Re: Multi table update

2004-12-30 Thread Kai Ruhnau
be. [snip] Just in case, I filled bug report number #7590. Feel free to add your comment. Greetings Kai -- Kai Ruhnau Software t a r g e t systemelectronic gmbh kölner str. 99 42651 Solingen germany Tel: +49 (0)212 22 20 9 - 710 Fax: +49 (0)212 20 10 45 -- MySQL General Mailing List For list

Re: Multi table update

2004-12-30 Thread Kai Ruhnau
-- Kai Ruhnau Software t a r g e t systemelectronic gmbh kölner str. 99 42651 Solingen germany Tel: +49 (0)212 22 20 9 - 710 Fax: +49 (0)212 20 10 45 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: Multi table update

2004-12-29 Thread Kai Ruhnau
Zitat von Jay Blanchard [EMAIL PROTECTED]: [snip] Although my question goes in that direction, it is more about why this statement does not act atomically from my applications point of view. update table2, table1 SET table2.value=table2.value-IF(table1.condition=7,1,0),

Re: importing data

2004-12-28 Thread Kai Ruhnau
Hi, An SQL-statement that is conceptually equal to the following caused some astonishment. UPDATE table1 LEFT JOIN table2 ON table2.ID=table2.ID_table1 SET table2.value=table2.value-IF(table1.condition=7,1,0), table1.condition=8 WHERE table1.ID=$id My problem is the IF condition, which alway

Multi table update

2004-12-28 Thread Kai Ruhnau
Sorry for duplicating this message. But I sent the other one with the wrong subject. Hi, An SQL-statement that is conceptually equal to the following caused some astonishment. UPDATE table1 LEFT JOIN table2 ON table2.ID=table2.ID_table1 SET table2.value=table2.value-IF(table1.condition=7,1,0),

Re: Multi table update

2004-12-28 Thread Kai Ruhnau
Zitat von [EMAIL PROTECTED]: One reason may be due to your ON condition. ON table2.ID=table2.ID_table1 You reference table 2 twice and I doubt that on the table2 table id equals id_table1 very often. Because table2 is LEFT JOINed to table1, you will only be able to update the rows that

Re: Multi table update

2004-12-28 Thread Kai Ruhnau
Zitat von [EMAIL PROTECTED]: Can you provide us a test case (sample table definitions and sample data) ? Sure. -- CREATE TABLE table1 ( ID int(10) unsigned NOT NULL default '0', condition int(10) unsigned NOT NULL default '0' ) TYPE=InnoDB; INSERT INTO table1 VALUES (1,7); INSERT INTO

Re: Multi table update

2004-12-28 Thread Kai Ruhnau
Zitat von Jay Blanchard [snip] And the query: UPDATE table1 INNER JOIN table2 ON table2.ID_table1=table1.ID SET table2.value=table2.value-IF(table1.condition=7,1,0), table1.condition=8 WHERE table1.ID IN (1,2) After that the value's in table2 are still 5 and 2. But I would expect

Row level locking with InnoDB

2004-08-24 Thread Kai Ruhnau
). No rows, because no row is actually returned / selected. Thanks and greetings, Kai Ruhnau -- This signature is left as an exercise for the reader. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]