[CONJ-126] PreparedStatement.setObject() returns IllegalParameterException: No '?' on that position Created: 2014-12-09 Updated: 2014-12-22 Resolved: 2014-12-22 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | None |
| Affects Version/s: | 1.1.7 |
| Fix Version/s: | 1.1.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Ivan | Assignee: | Massimo Siani (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Java 8, MariaDB connector 1.1.7 remotely connected to MariaDB server 10.0.11-MariaDB |
||
| Description |
|
The query below works fine with MySQL Connector/J driver. But it produces IllegalParameterException with mariaDB Java driver. The server is MariaDB in both cases. The query: The relevant part of stack trace: Removing columns with '#' or '?' in names solves the problem. But this is the fail of the driver as MariaDB server legally supports such characters in column names. After some debugging I figured out that PS parser does not distinguish back-ticks enclosing column names. So it interprets '#' in the column name `SLIndex#orBV#` as a start of the comment. When I remove this column the parser detects parameter placeholder '?' inside the column name `Seems:LikeParam?` etc. So the parser needs to be improved to respect back-ticks around object names. The problematic method is org.mariadb.jdbc.internal.common.Utils::createQueryParts The test table: ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Thank you, |