Done
Details
Assignee
patrick.birchpatrick.birchReporter
Brendan ByrdBrendan ByrdTime tracking
3h 50m loggedComponents
Fix versions
Affects versions
Priority
Medium
Details
Details
Assignee
patrick.birch
patrick.birchReporter
Brendan Byrd
Brendan ByrdTime tracking
3h 50m logged
Components
Fix versions
Affects versions
Priority
Smart Checklist
Smart Checklist
Smart Checklist
Created February 16, 2021 at 4:53 PM
Updated March 6, 2024 at 9:14 PM
Resolved July 7, 2021 at 2:06 PM
We are experiencing different behavior between two environments running
5.7.31-34-57-log
and5.7.32-35-57-log
.The environment running .32 cannot process this DDL:
Server version: 5.7.32-35-57-log Percona XtraDB Cluster (GPL), Release rel35, Revision 2055835, WSREP version 31.47, wsrep_31.47 [dbadmin@stage]> CREATE TABLE test_a ( -> a_id int(10) unsigned NOT NULL AUTO_INCREMENT, -> b_id varchar(60) COLLATE utf8_unicode_ci NOT NULL, -> c_id varchar(20) COLLATE utf8_unicode_ci NOT NULL, -> PRIMARY KEY (a_id), -> UNIQUE KEY uniq_b_c_id (b_id,c_id) -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; Query OK, 0 rows affected (0.02 sec) [dbadmin@stage]> ALTER TABLE test_a ADD state enum('new','active','closed') NOT NULL DEFAULT 'new' AFTER c_id, LOCK = NONE; ERROR 1845 (0A000): LOCK=NONE is not supported for this operation. Try LOCK=SHARED. [dbadmin@stage]> QUIT; Bye.
This is completely unexpected, based on the information in the Online DDL documentation. This bug does not exist in .31:
Server version: 5.7.31-34-57-log Percona XtraDB Cluster (GPL), Release rel34, Revision d76a6e8, WSREP version 31.45, wsrep_31.45 [dbadmin@test]> CREATE TABLE test_a ( -> a_id int(10) unsigned NOT NULL AUTO_INCREMENT, -> b_id varchar(60) COLLATE utf8_unicode_ci NOT NULL, -> c_id varchar(20) COLLATE utf8_unicode_ci NOT NULL, -> PRIMARY KEY (a_id), -> UNIQUE KEY uniq_b_c_id (b_id,c_id) -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; Query OK, 0 rows affected (0.01 sec) [dbadmin@test]> ALTER TABLE test_a ADD state enum('new','active','closed') NOT NULL DEFAULT 'new' AFTER c_id, LOCK = NONE; Query OK, 0 rows affected (0.01 sec) Records: 0 Duplicates: 0 Warnings: 0 [dbadmin@test]> QUIT; Bye
pt-config-diff
does not show any appreciable difference between the two environments besides the server version. These are Galera clusters, running 3 nodes each. Here are the charset/collation settings:[dbadmin@stage]> SHOW VARIABLES LIKE '%char%'; +---------------------------+---------------------------------------------+ | Variable_name | Value | +---------------------------+---------------------------------------------+ | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8mb4 | | character_set_server | utf8mb4 | | character_set_system | utf8 | | character_sets_dir | /usr/share/percona-xtradb-cluster/charsets/ | | ft_query_extra_word_chars | OFF | +---------------------------+---------------------------------------------+ 9 rows in set (0.00 sec) [dbadmin@stage]> SHOW VARIABLES LIKE '%collat%'; +----------------------+--------------------+ | Variable_name | Value | +----------------------+--------------------+ | collation_connection | utf8mb4_unicode_ci | | collation_database | utf8_unicode_ci | | collation_server | utf8mb4_unicode_ci | +----------------------+--------------------+ 3 rows in set (0.01 sec)
Reduction of the test case or switching to utf8mb4 on the table doesn't help, either:
[dbadmin@stage]> CREATE TABLE test_a ( -> a_id int(10) unsigned NOT NULL AUTO_INCREMENT, -> PRIMARY KEY (a_id) -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; Query OK, 0 rows affected (0.01 sec) [dbadmin@stage]> ALTER TABLE test_a ADD state enum('new','active','closed') NOT NULL DEFAULT 'new' AFTER a_id, LOCK = NONE; ERROR 1845 (0A000): LOCK=NONE is not supported for this operation. Try LOCK=SHARED. [dbadmin@stage]> ALTER TABLE test_a ADD state VARCHAR(10), LOCK=NONE; ERROR 1845 (0A000): LOCK=NONE is not supported for this operation. Try LOCK=SHARED. [dbadmin@stage-pex-m epay]> ALTER TABLE test_a ADD state BOOLEAN, LOCK=NONE; ERROR 1845 (0A000): LOCK=NONE is not supported for this operation. Try LOCK=SHARED. [dbadmin@stage]> DROP TABLE test_a; Query OK, 0 rows affected (0.01 sec) [dbadmin@stage]> CREATE TABLE test_a ( -> a_id int(10) unsigned NOT NULL AUTO_INCREMENT, -> PRIMARY KEY (a_id) -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; Query OK, 0 rows affected (0.01 sec) [dbadmin@stage]> ALTER TABLE test_a ADD state BOOLEAN, LOCK=NONE; ERROR 1845 (0A000): LOCK=NONE is not supported for this operation. Try LOCK=SHARED. [dbadmin@stage]>