Bug #260 Parsing the key columns while generating cursor based updates/deletes query
Submitted: 9 Apr 2003 10:57 Modified: 19 Jun 2003 6:54
Reporter: Indrek Siitan Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51 OS:
Assigned to: Bugs System CPU Architecture:Any

[9 Apr 2003 10:57] Indrek Siitan
Description:
Table definition:

CREATE TABLE IF NOT EXISTS ModellVariable (
	ID              INTEGER         AUTO_INCREMENT,
	ModellId		INTEGER			DEFAULT 0   NOT NULL,
	VariableId      INTEGER			DEFAULT 0   NOT NULL,
	Fahrzeug		INTEGER			DEFAULT 0   NOT NULL,
	PRIMARY KEY (ID),
	INDEX INDEX_ModellVariable_1 (ModellId),
	INDEX INDEX_ModellVariable_2 (VariableId),
	FOREIGN KEY (ModellId) REFERENCES ModellIndex (ID),
	FOREIGN KEY (VariableId) REFERENCES VariablenIndex (ID),
	UNIQUE INDEX UNIQUE_ModellVariable (ModellId,VariableId,Fahrzeug), ) 
TYPE=INNODB;

SQL statements of a record update using MFC classes of VisualC++ via ODBC 
driver:

select * from ModellVariable where ID=9;;
show keys from `ModellVariable`;
SELECT `ModellId`,`VariableId` FROM `ModellVariable`;
UPDATE `ModellVariable` SET `Fahrzeug`=3 WHERE `ID`=9 AND `ModellId`=3 AND 
`VariableId`=1 AND `Fahrzeug`=2 AND `ModellId`=1 AND `VariableId`=1 LIMIT 
1;

The Update statement is incorrect. I am expecting this following statement:

UPDATE `ModellVariable` SET `Fahrzeug`=3 WHERE `ID`=9;

I assume that the other parts of the original statements are added by the 
ODBC driver.

How to repeat:
[28 May 2003 20:05] Venu Anuganti
Fixed in the current 3.51 tree.
[19 Jun 2003 6:54] Lenz Grimmer
Thank you for your bug report. This issue has been fixed in the latest
development tree for that product. You can find more information about
accessing our development trees at 
    http://www.mysql.com/doc/en/Installing_source_tree.html