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

fix unquoted table name leading to sql errors #2836

Merged
merged 1 commit into from
May 29, 2020

Conversation

noother
Copy link
Contributor

@noother noother commented May 28, 2020

In lib/MySQL_Protocol.cpp MySQL_Protocol::generate_COM_QUERY_from_COM_FIELD_LIST line 2315 there is a query:
char *qt = (char *)"SELECT * FROM %s WHERE 1=0";

The table name here is unquoted, leading to SQL errors if the table name is a keyword or somewhat non-normalized, like:
2020-05-28 15:36:16 MySQL_Session.cpp:4333:handler(): [WARNING] Error during query on (1,sql1,3306): 1064, 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 'groups WHERE 1=0' at line 1

@pondix
Copy link
Contributor

pondix commented May 28, 2020

Automated message: PR pending admin approval for build testing

@renecannao
Copy link
Contributor

test this please

@renecannao
Copy link
Contributor

@noother : thank you for the PR. Automated testing started

@renecannao renecannao merged commit 2721003 into sysown:v2.0.13 May 29, 2020
@renecannao
Copy link
Contributor

Thank you

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

Successfully merging this pull request may close these issues.

3 participants