[CONJ-960] Syntax error RENAME TABLE Created: 2022-04-12 Updated: 2022-06-02 Resolved: 2022-06-02 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | 2.7 compatibility |
| Affects Version/s: | 3.0.4, 3.0.5 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Patrick Neyer | Assignee: | Diego Dupin |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MariaDB 10.4.18 Docker Image |
||
| Description |
|
Using MariaDB Java Client version 3.0.4 (and latest Spring Data JPA/Hibernate), we get following exception:
Was working with MariaDB Java Client 2.7.5 (and all older 2.x versions). |
| Comments |
| Comment by Diego Dupin [ 2022-04-14 ] | |
|
This error 'RENAME TABLE x_partial TO x' error is just a message returned from server, it doesn't help much to identify the issue. Since it this was working with 2.7.5, either hibernate doesn't send the same kind of query, either server has changed too. | |
| Comment by Diego Dupin [ 2022-05-13 ] | |
|
any news ? | |
| Comment by Patrick Neyer [ 2022-05-31 ] | |
|
Sorry for the late reply.
This statement fails with the error message above. As a workaround, when we execute the these two commands as separate Queries, the code runs perfectly. So the real issue is: Regression-Bug: You cannot execute two sql queries in the same statement anymore using JdbcTemplate | |
| Comment by Diego Dupin [ 2022-06-02 ] | |
|
By default this is disable. But there is an option to permit that : `allowMultiQueries` (see options https://mariadb.com/kb/en/about-mariadb-connector-j/#infrequently-used-parameters). | |
| Comment by Patrick Neyer [ 2022-06-02 ] | |
|
We do not use the parameter "allowMultiQueries" anywhere. | |
| Comment by Diego Dupin [ 2022-06-02 ] | |
|
allright, found the problem: multiple queries in 2.7 are enabled either by enabling options `allowMultiQueries` or `rewriteBatchedStatements`. In order to still allow multiqueries in 3.0, the option `allowMultiQueries` must explicitly be enable. | |
| Comment by Patrick Neyer [ 2022-06-02 ] | |
|
Ok, we set "rewriteBatchedStatements=true" in jdbc connection string, that explains the behavior, you've nailed it |