mariadb/mysql-test/suite/galera/t/galera_unicode_pk.test
2015-07-14 16:05:29 -04:00

64 lines
1.1 KiB
Text
Raw 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
CREATE TABLE t1 (
f1 VARCHAR(255) PRIMARY KEY
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES ('текст');
--connection node_2
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;