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

Prepared statements fail to execute if a back-quoted column name contains a '?' #45

Open
StephG38 opened this issue Apr 13, 2018 · 0 comments

Comments

@StephG38
Copy link
Contributor

With a table defined as :
CREATE TABLE question ( a? int(11) NOT NULL AUTO_INCREMENT, b? char(80) DEFAULT NULL, PRIMARY KEY (a?));

Inserting data with a prepared statement ( INSERT INTO question ( a? , b? ) VALUES ( ? , ?) ) would fail with :

org.drizzle.jdbc.internal.common.QueryException: You need to set exactly 4 parameters on the prepared statement
at org.drizzle.jdbc.internal.common.query.DrizzleParameterizedQuery.length(DrizzleParameterizedQuery.java:88)
at org.drizzle.jdbc.internal.common.packet.commands.StreamedQueryPacket.send(StreamedQueryPacket.java:67)
at org.drizzle.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:439)
at org.drizzle.jdbc.DrizzlePreparedStatement.executeUpdate(DrizzlePreparedStatement.java:126)

This is due to the fact that the parameterized query does not handle '`', but only single and double quote

StephG38 pushed a commit to gilius38/DrizzleJDBC that referenced this issue Apr 13, 2018
Now handling backquotes the same way single and double quotes are handled
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

No branches or pull requests

1 participant