Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Now all commands will be supported using binary protocol (MDEV-16708), but this fallback support is only partial, not permitting question mark for newly supported command.
An example is that some command without question mark works, but same one with parameter won't.
an example is :
// without parameter |
try (PreparedStatement prep = con.prepareStatement("CREATE OR REPLACE USER 'testUser1' IDENTIFIED BY 'myPwd'")) { |
prep.execute();
|
}
|
 |
// same with question mark will result in error |
// You have an error in your SQL syntax; check the manual that corresponds to your |
// MariaDB server version for the right syntax to use near '?' at line 1 |
try (PreparedStatement prep = con.prepareStatement("CREATE OR REPLACE USER ? IDENTIFIED BY ?")) { |
for (int i = 0; i < 100; i++) { |
prep.setString(1, "testUser" + i); |
prep.setString(2, "myPwd"); |
prep.execute();
|
}
|
}
|
Connectors normally doesn't have not to parse commands, to check that for example if this is an insert command, question mark are allowed, or for other they are not.
Solution would be for optimizer to support question mark on COM_STMT_PREPARE and execution to take given parameter of COM_STMT_EXECUTE