Skip to content
Permalink
Browse files
main.alter_table_lock could fail with query "'LOCK TABLE t1 WRITE' fa…
…iled"

Backported fix from MariaDB 10.5
  • Loading branch information
montywi committed May 24, 2022
1 parent ddb1f7c commit 915afdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
@@ -11,8 +11,6 @@ ERROR 42S02: Table 'test.x' doesn't exist
SET SESSION max_session_mem_used= 8192;
LOCK TABLE t1 WRITE;
ALTER TABLE t1 CHANGE COLUMN IF EXISTS b c INT;
Warnings:
Note 1054 Unknown column 'b' in 't1'
SET SESSION max_session_mem_used = @max_session_mem_used_save;
UNLOCK TABLES;
DROP TABLE t1;
@@ -14,9 +14,13 @@ SELECT * FROM t1;
ALTER TABLE x MODIFY xx INT;

SET SESSION max_session_mem_used= 8192;
--error 0,ER_OPTION_PREVENTS_STATEMENT
LOCK TABLE t1 WRITE;

--disable_warnings
--error 0,ER_OPTION_PREVENTS_STATEMENT
ALTER TABLE t1 CHANGE COLUMN IF EXISTS b c INT;
--enable_warnings

SET SESSION max_session_mem_used = @max_session_mem_used_save;
UNLOCK TABLES;

0 comments on commit 915afdd

Please sign in to comment.