[CONJ-1093] Check the manual that corresponds to your MariaDB server version for the right syntax to use near '?"%" Created: 2023-07-23 Updated: 2023-11-22 Resolved: 2023-11-22 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | MySQL compatibility |
| Affects Version/s: | 3.1.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Duckie | Assignee: | Diego Dupin |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Java |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
After upgrading the Database server from 10.11.4 and in java change the connector to MariaDB Connector i get the following error in my application:
The code in Java:
This works fine with: This fails with: MariaDB 11.1.1 + MariaDB Connector/J 4.3.1, this results: If i run the Select in HeidiSQL then i get the result, so that looks fine |
| Comments |
| Comment by Diego Dupin [ 2023-07-26 ] | |||||||||||||||||||||||||||
|
I need to check why mysql connector is not compatible with MariaDB server 11.1.1, but to the main point : It would seem the command executed cannot be prepared.
mariadb implementation for MariaDB server implementation:
The permit to gain 40-50% performance (execution time). As indicate before, the problem is that it would seems the command cannot be prepared. Could you share the executed command ? code and image doesn't show executed command.
This will probably result in this '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 '?"%") AND rooms.state NOT LIKE '' ORDER BY rooms.users, rooms.id DESC LIMIT 035' at line 1' error | |||||||||||||||||||||||||||
| Comment by Duckie [ 2023-07-27 ] | |||||||||||||||||||||||||||
|
If i run : | |||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2023-07-31 ] | |||||||||||||||||||||||||||
|
Could it be just some wrong escaping ?
is allright. same using :
Could you share more details ? | |||||||||||||||||||||||||||
| Comment by Duckie [ 2023-08-04 ] | |||||||||||||||||||||||||||
|
This is the complete call in Java
| |||||||||||||||||||||||||||
| Comment by Duckie [ 2023-08-04 ] | |||||||||||||||||||||||||||
|
And i look like it goes wrong here : value : "%" + value + "%" But the stange thing is that with the MySQL connector it just runs fine | |||||||||||||||||||||||||||
| Comment by Duckie [ 2023-08-04 ] | |||||||||||||||||||||||||||
|
I finaly found it It is using the following query :
I had to change this to :
|