Skip to content

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