mariadb/mysql-test/suite/galera/t/galera_unicode_pk.test
Jan Lindström d7b37de936 Fix bad galera tests
* galera_kill_applier : we should make sure that node has
  correct number of wsrep appliers
* galera_bad_wsrep_new_cluster: This test restarts both nodes,
so it is bad on mtr. Make sure it is run alone
* galera_update_limit : Make sure we have PK when needed
galera_as_slave_replay : bf abort was not consistent
* galera_unicode_pk : Add wait_conditions so that all nodes
are part of cluster and DDL and INSERT has replicated before
any further operations are done.
* galera_bf_abort_at_after_statement : Add wait_conditions
to make sure all nodes are part of cluster and that DDL
and INSERT has replicated. Make sure we reset DEBUG_SYNC.
2021-12-01 08:27:08 +02:00

75 lines
1.6 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#
# Test non-ascii data in table where the PK is unicode
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_1
# Mare sure both nodes are in the cluster
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
CREATE TABLE t1 (
f1 VARCHAR(255) PRIMARY KEY
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES ('текст');
--connection node_2
# Mare sure that DLL has replicated and insert has replicated
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1
--source include/wait_condition.inc
SELECT f1 = 'текст' FROM t1;
#
# Provoke a conflict
#
--connection node_1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'текст2';
--connection node_2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'текст3';
--connection node_1
COMMIT;
--connection node_2
--error ER_LOCK_DEADLOCK
COMMIT;
SELECT f1 = 'текст2' FROM t1;
SELECT f1 = 'текст2' FROM t1 WHERE f1 = 'текст2';
#
# Provoke a duplicate key error
#
--connection node_2
START TRANSACTION;
INSERT INTO t1 VALUES ('текст4');
--connection node_1
START TRANSACTION;
INSERT INTO t1 VALUES ('текст4');
--connection node_2
COMMIT;
--connection node_1
--error ER_LOCK_DEADLOCK
COMMIT;
# Work around for mysql-wsrep#29 'Spurious deadlock error on a DROP TABLE'
--error 0,ER_LOCK_DEADLOCK
COMMIT;
DROP TABLE t1;