shlomi-noach / openarkkit

Automatically exported from code.google.com/p/openarkkit
24 stars 16 forks source link

DELETE SQL in triggers of AFTER UPDATE/DELETE can't use index in composite keys case #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
DELETE FROM %s.%s WHERE (%s) = (%s);

The same WHERE clause works for SELECT case, hitting index, but not for DELETE.

http://bugs.mysql.com/bug.php?id=43187
According to the age of the issue, I don't think it would be fixed soon:)

Rewriting WHERE clause to "col1 = value1, col2 = value2, ..." does help.

Original issue reported on code.google.com by i...@h2l.name on 1 Nov 2011 at 3:43

GoogleCodeExporter commented 9 years ago
That's interesting.
I've handled a similar case with (%,%,%) > (%,%,%) not being able to properly 
use index; you can see in oak-online-alter-table an ugly code which translates 
this kind of equation to a multipart sub cases.
I wasn't aware that this can actually happen on plain equation!
Will have to fix it, then...

Original comment by shlomi.n...@gmail.com on 1 Nov 2011 at 6:31

GoogleCodeExporter commented 9 years ago
Here is a patch for this bug.  

Original comment by jah...@gmail.com on 7 Feb 2014 at 9:35

Attachments: