| 1 |
######## suite/innodb/t/innodb_prefix_iindex_restart_server.test ##### |
| 2 |
# # |
| 3 |
# Testcase for worklog WL#5743: Lift the limit of index key prefixes # |
| 4 |
# Test scenario : Stop the server in between when prefix index are # |
| 5 |
# created and see if state is preserved after restart # |
| 6 |
# # |
| 7 |
# Creation: # |
| 8 |
# 2011-06-02 Implemented this test as part of WL#5743 # |
| 9 |
# # |
| 10 |
###################################################################### |
| 11 |
|
| 12 |
|
| 13 |
#------------------------------------------------------------------------------ |
| 14 |
# Stop the server in between when prefix index are created and see if state is |
| 15 |
# correct when server is restarted. |
| 16 |
# Server is restarted at differnt points. |
| 17 |
|
| 18 |
CREATE TABLE worklog5743 ( |
| 19 |
col_1_text TEXT(4000) , col_2_text TEXT(4000) , |
| 20 |
PRIMARY KEY (col_1_text(3072)) |
| 21 |
) charset latin1 ROW_FORMAT=DYNAMIC, engine = innodb; |
| 22 |
INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500)); |
| 23 |
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM |
| 24 |
worklog5743; |
| 25 |
|
| 26 |
--echo "In connection 1" |
| 27 |
--connect (con1,localhost,root,,) |
| 28 |
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM |
| 29 |
worklog5743; |
| 30 |
SELECT COUNT(*) FROM worklog5743; |
| 31 |
|
| 32 |
|
| 33 |
--echo "In connection 2" |
| 34 |
--connect (con2,localhost,root,,) |
| 35 |
START TRANSACTION; |
| 36 |
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500)); |
| 37 |
|
| 38 |
|
| 39 |
--echo "In connection 1" |
| 40 |
--connection con1 |
| 41 |
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM |
| 42 |
worklog5743; |
| 43 |
SELECT COUNT(*) FROM worklog5743; |
| 44 |
START TRANSACTION; |
| 45 |
|
| 46 |
|
| 47 |
--echo "In connection default ....restarting the server" |
| 48 |
--connection default |
| 49 |
# Restart the server |
| 50 |
-- source include/restart_mysqld.inc |
| 51 |
SELECT COUNT(*) FROM worklog5743; |
| 52 |
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM |
| 53 |
worklog5743; |
| 54 |
|
| 55 |
--disconnect con1 |
| 56 |
--disconnect con2 |
| 57 |
|
| 58 |
--echo "In connection 1" |
| 59 |
--connect (con1,localhost,root,,) |
| 60 |
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM |
| 61 |
worklog5743; |
| 62 |
SELECT COUNT(*) FROM worklog5743; |
| 63 |
START TRANSACTION; |
| 64 |
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500)); |
| 65 |
DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 3500); |
| 66 |
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM |
| 67 |
worklog5743; |
| 68 |
|
| 69 |
--echo "In connection default ....restarting the server" |
| 70 |
--connection default |
| 71 |
# Restart the server |
| 72 |
-- source include/restart_mysqld.inc |
| 73 |
SELECT COUNT(*) FROM worklog5743; |
| 74 |
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM |
| 75 |
worklog5743; |
| 76 |
|
| 77 |
--disconnect con1 |
| 78 |
|
| 79 |
--echo "In connection 1" |
| 80 |
--connect (con2,localhost,root,,) |
| 81 |
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM |
| 82 |
worklog5743; |
| 83 |
SELECT COUNT(*) FROM worklog5743; |
| 84 |
START TRANSACTION; |
| 85 |
UPDATE worklog5743 SET col_1_text = REPEAT("b", 3500) WHERE col_1_text = REPEAT("a", 3500); |
| 86 |
SELECT col_1_text = REPEAT("b", 3500) , col_2_text = REPEAT("o", 3500) FROM |
| 87 |
worklog5743; |
| 88 |
|
| 89 |
--echo "In connection default ....restarting the server" |
| 90 |
--connection default |
| 91 |
# Restart the server |
| 92 |
-- source include/restart_mysqld.inc |
| 93 |
SELECT COUNT(*) FROM worklog5743; |
| 94 |
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM |
| 95 |
worklog5743; |
| 96 |
|
| 97 |
DROP TABLE worklog5743; |
| 98 |
|
| 99 |
# |
| 100 |
# Bug#17530: Incorrect key truncation on table creation caused server crash. |
| 101 |
# |
| 102 |
|
| 103 |
# Legacy queries below need to turn off ONLY_FULL_GROUP_BY and STRICT mode. |
| 104 |
SET sql_mode='NO_ENGINE_SUBSTITUTION'; |
| 105 |
create table t1(f1 varchar(3800) binary not null, key(f1)) |
| 106 |
character set utf8 collate utf8_general_ci row_format=dynamic; |
| 107 |
insert into t1 values('aaa'); |
| 108 |
drop table t1; |
| 109 |
SET sql_mode=default; |