Bug #111866 executing a rename table statement could cause a transaction to be committed
Submitted: 24 Jul 2023 18:53 Modified: 25 Jul 2023 1:45
Reporter: remriver remriver Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Windows Severity:S2 (Serious)
Version:8.0.33 OS:Windows (windows 10)
Assigned to: CPU Architecture:Any

[24 Jul 2023 18:53] remriver remriver
Description:
Run a series of statements in a single transaction starting with "start transaction" statement and ending with "commit" statement.Wherein a "rename table" statement lies and no matter whether it succeeds, this transaction will be commited at its position.

How to repeat:
1. create a table in any database using statement below:
create table t1 (n int);

2. insert a row into t1:
insert into t1 values(1);

3. run statements below:
start transaction;
update t1 set n=n+1;
rename table t2 to t3; (t2 doesn't exists)
commit;

Since t2 doesn't exists, the third statement should fail and cause transaction to rollback. However, the fact is that the transaction will be committed normally.

Suggested fix:
"rename table " statement should not cause transaction to be committed.
[25 Jul 2023 1:45] remriver remriver
Since mysql does not support transactional DDL, this is not a bug.
[25 Jul 2023 12:03] MySQL Verification Team
Hi Mr. remriver,

You are quite correct. 

Any DDL will make an implicit COMMIT during the transaction ....

Not a bug.