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

Multiple operators in one query #546

Closed
nuclon opened this issue Apr 24, 2016 · 4 comments
Closed

Multiple operators in one query #546

nuclon opened this issue Apr 24, 2016 · 4 comments

Comments

@nuclon
Copy link

nuclon commented Apr 24, 2016

Probably it's not really an issue, but I haven't found the solution.

Software I'm trying to make work with proxysql sends two operators in one query, like
"INSERT INTO table_name (...) VALUES (...); SELECT LAST_INSERT_ID()"
and I get

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT LAST_INSERT_ID()' at line 5

The same query which is made directly to mysql works well. Any ideas?
Unfortunately I can't change the software.

Thanks

@renecannao
Copy link
Contributor

There is a limitation in ProxySQL that doesn't support CLIENT_MULTI_STATEMENTS (see https://dev.mysql.com/doc/internals/en/capability-flags.html).
When a client connects to ProxySQL , this one communicates to the client the list of capabilities and CLIENT_MULTI_STATEMENTS is not among them. As the server (ProxySQL in this case) doesn't specify CLIENT_MULTI_STATEMENTS, the client shouldn't send multiple queries in the same COM_QUERY .
Unfortunately, it seems there are certain applications (like in your case) that ignore server capabilities.
Although I would consider it a bug in the application, I will fix this in ProxySQL as there are cases in which the application cannot be fixed, like in your case.

@renecannao
Copy link
Contributor

Implementation for the functionality required to solve this issue will be tracked in #547 .

@renecannao
Copy link
Contributor

This is now fixed in v1.2.0f
Thank you for the report.
Please do not hesitate to let me know if you hit any other issue. Thanks!

Note: issue #547 will stay open because support for multi statements needs to be enhanced further.

@hhyo
Copy link

hhyo commented Aug 22, 2019

I have the same problems in v2.0.6, and trying test to reproduce it

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

3 participants