Skip to content

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

Description

@StephG38

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions