1
0
mirror of https://github.com/MariaDB/server.git synced 2025-04-26 11:49:09 +03:00
mariadb/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
Alexander Barkov 36eba98817 MDEV-19123 Change default charset from latin1 to utf8mb4
Changing the default server character set from latin1 to utf8mb4.
2024-07-11 10:21:07 +04:00

113 lines
3.7 KiB
Plaintext

--source include/have_innodb.inc
######## suite/innodb/t/innodb_prefix_iindex_restart_server.test #####
# #
# Testcase for worklog WL#5743: Lift the limit of index key prefixes #
# Test scenario : Stop the server in between when prefix index are #
# created and see if state is preserved after restart #
# #
# Creation: #
# 2011-06-02 Implemented this test as part of WL#5743 #
# #
######################################################################
# Embedded server tests do not support restarting
--source include/not_embedded.inc
--source include/test_db_charset_latin1.inc
#------------------------------------------------------------------------------
# Stop the server in between when prefix index are created and see if state is
# correct when server is restarted.
# Server is restarted at differnt points.
CREATE TABLE worklog5743 (
col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
PRIMARY KEY (col_1_text(3072))
) ROW_FORMAT=DYNAMIC, engine = innodb;
INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500));
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
--connect (con1,localhost,root,,)
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
SELECT COUNT(*) FROM worklog5743;
--connect (con2,localhost,root,,)
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
--connection con1
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
SELECT COUNT(*) FROM worklog5743;
START TRANSACTION;
--connection default
# Restart the server
SET GLOBAL innodb_fast_shutdown=3;
-- source include/restart_mysqld.inc
SELECT COUNT(*) FROM worklog5743;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
--disconnect con1
--disconnect con2
--connect (con1,localhost,root,,)
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
SELECT COUNT(*) FROM worklog5743;
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 3500);
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
--connection default
# Restart the server
SET GLOBAL innodb_fast_shutdown=3;
-- source include/restart_mysqld.inc
SELECT COUNT(*) FROM worklog5743;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
--disconnect con1
--connect (con2,localhost,root,,)
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
SELECT COUNT(*) FROM worklog5743;
START TRANSACTION;
UPDATE worklog5743 SET col_1_text = REPEAT("b", 3500) WHERE col_1_text = REPEAT("a", 3500);
SELECT col_1_text = REPEAT("b", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
--connection default
# Restart the server
SET GLOBAL innodb_fast_shutdown=3;
-- source include/restart_mysqld.inc
SELECT COUNT(*) FROM worklog5743;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
DROP TABLE worklog5743;
--echo #
--echo # MDEV-21245 InnoDB: Using a partial-field key prefix in search
--echo #
CREATE TABLE t1 (a VARCHAR(255), KEY k(a)) DEFAULT CHARSET=utf8mb3
ENGINE=InnoDB;
INSERT INTO t1 set a='';
--enable_info
alter table t1 change a a varchar(3000);
--disable_info
SELECT * FROM t1 WHERE a IN ('');
DROP TABLE t1;
--echo # End of 10.4 tests
--source include/test_db_charset_restore.inc