Bug #118055 | A potential bugs in Mysql Connector/J | ||
---|---|---|---|
Submitted: | 25 Apr 9:08 | Modified: | 28 Apr 17:25 |
Reporter: | 策 吕 | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | mysql-connector-j-9.2.0 && mysql Ver 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[25 Apr 9:08]
策 吕
[25 Apr 9:44]
MySQL Verification Team
Hello 策 吕, Thank you for the report and feedback. Verified as described. regards, Umesh
[28 Apr 17:25]
Axyoan Marcelo
Posted by developer: Hello 策 吕, Thank you for your report. The error message you are seeing is due to the following line in your code: stmt.addBatch("DROP TABLE t0;"); Notice the semicolon you added at the end. Because you are using rewriteBatchedStatements, your query is being rewritten into a single one before being sent to the server. This means the actual query being sent is: INSERT INTO t0 VALUES (1);DROP TABLE t0;;INSERT INTO t0 VALUES (2);INSERT INTO t0 VALUES (3);INSERT INTO t0 VALUES (4); This query will fail, but not because it's trying to insert into a non existent table. Rather, it's due to the extra semicolon in the middle of the statement. If you remove this semicolon, then the error message is exactly what you'd expect: "java.sql.BatchUpdateException: Table 'testcj.t0' doesn't exist" Let me know if this clears up the confusion. This report will be closed as not a bug. Regards, Axyoan