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

Added support for numeric parameters in Client#prepare() #189

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

krizalys
Copy link

@krizalys krizalys commented Sep 2, 2017

Client#prepare() currently quotes numeric values and therefore forces the SQL engine to interpret them as strings.

However, some values, such as the one given to LIMIT or OFFSET, accept only numeric values.

For example, using MySQL 5.5:

SELECT * FROM city LIMIT '2';

ERROR 1064 (42000): 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 ''2'' at line 1

SELECT * FROM city LIMIT 2;

[...]
2 rows in set (0.00 sec)

This pull request modifies Client#prepare() so that it leaves Number values alone.

@krizalys
Copy link
Author

krizalys commented Sep 2, 2017

Fixes #94 but noticed that #153 already attempted to fix it.

Merge whichever you want, as long as this is resolved :)

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.

1 participant