mirror of
https://github.com/MariaDB/server.git
synced 2025-04-29 21:37:04 +03:00
This imports and adapts a number of MySQL 5.7 test cases that are applicable to MariaDB. Some tests for old bug fixes are not that relevant because the code has been refactored since then (especially starting with MariaDB Server 10.6), and the tests would not reproduce the original bug if the fix was reverted. In the test innodb_fts.opt, there are many duplicate MATCH ranks, which would make the results nondeterministic. The test was stabilized by changing some LIMIT clauses or by adding sorted_result in those cases where the purpose of a test was to show that no sorting took place in the server. In the test innodb_fts.phrase, MySQL 5.7 would generate FTS_DOC_ID that are 1 larger than in MariaDB. In innodb_fts.index_table the difference is 2. This is because in MariaDB, fts_get_next_doc_id() post-increments cache->next_doc_id, while MySQL 5.7 pre-increments it. Reviewed by: Thirunarayanan Balathandayuthapani
144 lines
5.3 KiB
Plaintext
144 lines
5.3 KiB
Plaintext
SET @save_timeout=@@GLOBAL.innodb_lock_wait_timeout;
|
||
SET GLOBAL innodb_lock_wait_timeout=100000000;
|
||
CREATE TABLE t_min (
|
||
c01 TINYINT,
|
||
c02 TINYINT UNSIGNED,
|
||
c03 SMALLINT,
|
||
c04 SMALLINT UNSIGNED,
|
||
c05 MEDIUMINT,
|
||
c06 MEDIUMINT UNSIGNED,
|
||
c07 INT,
|
||
c08 INT UNSIGNED,
|
||
c09 BIGINT,
|
||
c10 BIGINT UNSIGNED,
|
||
PRIMARY KEY(c01, c02, c03, c04, c05, c06, c07, c08, c09, c10)
|
||
) ENGINE=INNODB;;
|
||
INSERT INTO t_min VALUES
|
||
(-128, 0,
|
||
-32768, 0,
|
||
-8388608, 0,
|
||
-2147483648, 0,
|
||
-9223372036854775808, 0);
|
||
CREATE TABLE t_max (
|
||
c01 TINYINT,
|
||
c02 TINYINT UNSIGNED,
|
||
c03 SMALLINT,
|
||
c04 SMALLINT UNSIGNED,
|
||
c05 MEDIUMINT,
|
||
c06 MEDIUMINT UNSIGNED,
|
||
c07 INT,
|
||
c08 INT UNSIGNED,
|
||
c09 BIGINT,
|
||
c10 BIGINT UNSIGNED,
|
||
PRIMARY KEY(c01, c02, c03, c04, c05, c06, c07, c08, c09, c10)
|
||
) ENGINE=INNODB;;
|
||
INSERT INTO t_max VALUES
|
||
(127, 255,
|
||
32767, 65535,
|
||
8388607, 16777215,
|
||
2147483647, 4294967295,
|
||
9223372036854775807, 18446744073709551615);
|
||
CREATE TABLE ```t'\"_str` (
|
||
c1 VARCHAR(32),
|
||
c2 VARCHAR(32),
|
||
c3 VARCHAR(32),
|
||
c4 VARCHAR(32),
|
||
c5 VARCHAR(32),
|
||
c6 VARCHAR(32),
|
||
c7 VARCHAR(32),
|
||
PRIMARY KEY(c1, c2, c3, c4, c5, c6, c7)
|
||
) ENGINE=INNODB;
|
||
INSERT INTO ```t'\"_str` VALUES
|
||
('1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc''''');
|
||
INSERT INTO ```t'\"_str` VALUES
|
||
('2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""');
|
||
INSERT INTO ```t'\"_str` VALUES
|
||
('3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\');
|
||
INSERT INTO ```t'\"_str` VALUES
|
||
('4', 'abc', 0x00616263, 0x61626300, 0x61006263, 0x6100626300, 0x610062630000);
|
||
connect con_lock,localhost,root,,;
|
||
connect con_min_trylock,localhost,root,,;
|
||
connect con_max_trylock,localhost,root,,;
|
||
connect con_str_insert_supremum,localhost,root,,;
|
||
connect con_str_lock_row1,localhost,root,,;
|
||
connect con_str_lock_row2,localhost,root,,;
|
||
connect con_str_lock_row3,localhost,root,,;
|
||
connect con_str_lock_row4,localhost,root,,;
|
||
connect con_verify_innodb_locks,localhost,root,,;
|
||
connection con_lock;
|
||
SET autocommit=0;
|
||
SELECT * FROM t_min FOR UPDATE;
|
||
c01 c02 c03 c04 c05 c06 c07 c08 c09 c10
|
||
-128 0 -32768 0 -8388608 0 -2147483648 0 -9223372036854775808 0
|
||
SELECT * FROM t_max FOR UPDATE;
|
||
c01 c02 c03 c04 c05 c06 c07 c08 c09 c10
|
||
127 255 32767 65535 8388607 16777215 2147483647 4294967295 9223372036854775807 18446744073709551615
|
||
SELECT * FROM ```t'\"_str` FOR UPDATE;
|
||
c1 c2 c3 c4 c5 c6 c7
|
||
1 abc 'abc abc' a'bc a'bc' 'abc''
|
||
2 abc "abc abc" a"bc a"bc" "abc""
|
||
3 abc \abc abc\ a\bc a\bc\ \abc\\
|
||
4 abc |