Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 1 Nov 2011 at 3:43

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 1 Nov 2011 at 6:31

@GoogleCodeExporter
Copy link
Author

Here is a patch for this bug.  

Original comment by [email protected] on 7 Feb 2014 at 9:35

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant