summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2012-02-14 16:06:41 +0100
committerunknown <knielsen@knielsen-hq.org>2012-02-14 16:06:41 +0100
commit47a54a2e087a7c1fc861bcbc114c14987f492cfe (patch)
tree6fd2aa26626f3f8e7ae49333ca3fbb546a992972 /mysql-test
parentbbd20403c5f759fa3ce866703a5fba0d193a1734 (diff)
parent16036b5e61d8f48f352ac4e1f68a541f45f2ae34 (diff)
downloadmariadb-git-47a54a2e087a7c1fc861bcbc114c14987f492cfe.tar.gz
Merge MySQL 5.5.20 into MariaDB 5.5.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/key_cache.result16
-rw-r--r--mysql-test/r/mysqlcheck.result1
-rw-r--r--mysql-test/r/partition_key_cache.result27
-rw-r--r--mysql-test/t/key_cache.test16
-rw-r--r--mysql-test/t/mysqlcheck.test1
-rw-r--r--mysql-test/t/partition_key_cache.test28
6 files changed, 89 insertions, 0 deletions
diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result
index a1feb3ad40d..ab07b7b1f5d 100644
--- a/mysql-test/r/key_cache.result
+++ b/mysql-test/r/key_cache.result
@@ -817,3 +817,19 @@ set global keycache1.key_buffer_size=0;
set global keycache2.key_buffer_size=0;
set global key_buffer_size=@save_key_buffer_size;
set global key_cache_segments=@save_key_cache_segments;
+#
+# Bug#12361113: crash when load index into cache
+#
+# Note that this creates an empty disabled key cache!
+SET GLOBAL key_cache_none.key_cache_block_size = 1024;
+CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) ) ENGINE = MYISAM;
+INSERT INTO t1 VALUES (1, 1);
+CACHE INDEX t1 in key_cache_none;
+ERROR HY000: Unknown key cache 'key_cache_none'
+# The bug crashed the server at LOAD INDEX below. Now it will succeed
+# since the default cache is used due to CACHE INDEX failed for
+# key_cache_none.
+LOAD INDEX INTO CACHE t1;
+Table Op Msg_type Msg_text
+test.t1 preload_keys status OK
+DROP TABLE t1;
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index ca9d3a20404..ab707ceef80 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -191,6 +191,7 @@ CREATE TABLE `я` (a INT) engine=myisam;
SET NAMES DEFAULT;
call mtr.add_suppression("@003f.frm' \\(errno: 22\\)");
mysqlcheck --default-character-set="latin1" --databases test
+call mtr.add_suppression("Can't find file: '..test.@003f.frm'");
test.?
Error : Table doesn't exist
status : Operation failed
diff --git a/mysql-test/r/partition_key_cache.result b/mysql-test/r/partition_key_cache.result
index 653d2f29d54..f1b174ca249 100644
--- a/mysql-test/r/partition_key_cache.result
+++ b/mysql-test/r/partition_key_cache.result
@@ -397,6 +397,33 @@ test.t1 assign_to_keycache error Subpartition sp0 returned error
test.t1 assign_to_keycache Error Key 'inx_b' doesn't exist in table 't1'
test.t1 assign_to_keycache status Operation failed
DROP TABLE t1,t2;
+#
+# Bug#12361113: crash when load index into cache
+#
+# Note that this creates an empty disabled key cache!
+SET GLOBAL key_cache_none.key_cache_block_size = 1024;
+CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) )
+ENGINE = MYISAM
+PARTITION BY HASH(a) PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 1);
+CACHE INDEX t1 IN key_cache_none;
+ERROR HY000: Unknown key cache 'key_cache_none'
+CACHE INDEX t1 PARTITION (p0) IN key_cache_none;
+ERROR HY000: Unknown key cache 'key_cache_none'
+CACHE INDEX t1 PARTITION (p1) IN key_cache_none;
+ERROR HY000: Unknown key cache 'key_cache_none'
+CACHE INDEX t1 PARTITION (p0) KEY (`b`) IN key_cache_none;
+ERROR HY000: Unknown key cache 'key_cache_none'
+CACHE INDEX t1 PARTITION (p1) KEY (`b`) IN key_cache_none;
+ERROR HY000: Unknown key cache 'key_cache_none'
+# The bug crashed the server at LOAD INDEX below. Now it will succeed
+# since the default cache is used due to CACHE INDEX failed for
+# key_cache_none.
+LOAD INDEX INTO CACHE t1;
+Table Op Msg_type Msg_text
+test.t1 preload_keys status OK
+DROP TABLE t1;
+# Clean up
SET GLOBAL hot_cache.key_buffer_size = 0;
SET GLOBAL warm_cache.key_buffer_size = 0;
SET @@global.cold_cache.key_buffer_size = 0;
diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test
index 13367cbdcaa..83b4b0b1deb 100644
--- a/mysql-test/t/key_cache.test
+++ b/mysql-test/t/key_cache.test
@@ -522,3 +522,19 @@ set global key_buffer_size=@save_key_buffer_size;
set global key_cache_segments=@save_key_cache_segments;
# End of 5.2 tests
+
+--echo #
+--echo # Bug#12361113: crash when load index into cache
+--echo #
+
+--echo # Note that this creates an empty disabled key cache!
+SET GLOBAL key_cache_none.key_cache_block_size = 1024;
+CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) ) ENGINE = MYISAM;
+INSERT INTO t1 VALUES (1, 1);
+--error ER_UNKNOWN_KEY_CACHE
+CACHE INDEX t1 in key_cache_none;
+--echo # The bug crashed the server at LOAD INDEX below. Now it will succeed
+--echo # since the default cache is used due to CACHE INDEX failed for
+--echo # key_cache_none.
+LOAD INDEX INTO CACHE t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
index ef88b89e8d8..c0025f9e742 100644
--- a/mysql-test/t/mysqlcheck.test
+++ b/mysql-test/t/mysqlcheck.test
@@ -147,6 +147,7 @@ SET NAMES DEFAULT;
call mtr.add_suppression("@003f.frm' \\(errno: 22\\)");
--echo mysqlcheck --default-character-set="latin1" --databases test
# Error returned depends on platform, replace it with "Table doesn't exist"
+call mtr.add_suppression("Can't find file: '..test.@003f.frm'");
--replace_result "Can't find file: './test/@003f.frm' (errno: 22)" "Table doesn't exist" "Table 'test.?' doesn't exist" "Table doesn't exist"
--exec $MYSQL_CHECK --default-character-set="latin1" --databases test
--echo mysqlcheck --default-character-set="utf8" --databases test
diff --git a/mysql-test/t/partition_key_cache.test b/mysql-test/t/partition_key_cache.test
index 4beb9506b05..067eb7fae59 100644
--- a/mysql-test/t/partition_key_cache.test
+++ b/mysql-test/t/partition_key_cache.test
@@ -239,6 +239,34 @@ CACHE INDEX t2 INDEX (`inx_b`) IN hot_cache;
CACHE INDEX t1 PARTITION (p0) KEY (`inx_b`) IN hot_cache;
CACHE INDEX t1 INDEX (`inx_b`) IN hot_cache;
DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug#12361113: crash when load index into cache
+--echo #
+--echo # Note that this creates an empty disabled key cache!
+SET GLOBAL key_cache_none.key_cache_block_size = 1024;
+CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) )
+ENGINE = MYISAM
+PARTITION BY HASH(a) PARTITIONS 2;
+INSERT INTO t1 VALUES (1, 1);
+--error ER_UNKNOWN_KEY_CACHE
+CACHE INDEX t1 IN key_cache_none;
+--error ER_UNKNOWN_KEY_CACHE
+CACHE INDEX t1 PARTITION (p0) IN key_cache_none;
+--error ER_UNKNOWN_KEY_CACHE
+CACHE INDEX t1 PARTITION (p1) IN key_cache_none;
+--error ER_UNKNOWN_KEY_CACHE
+CACHE INDEX t1 PARTITION (p0) KEY (`b`) IN key_cache_none;
+--error ER_UNKNOWN_KEY_CACHE
+CACHE INDEX t1 PARTITION (p1) KEY (`b`) IN key_cache_none;
+--echo # The bug crashed the server at LOAD INDEX below. Now it will succeed
+--echo # since the default cache is used due to CACHE INDEX failed for
+--echo # key_cache_none.
+LOAD INDEX INTO CACHE t1;
+DROP TABLE t1;
+
+
+--echo # Clean up
SET GLOBAL hot_cache.key_buffer_size = 0;
SET GLOBAL warm_cache.key_buffer_size = 0;
SET @@global.cold_cache.key_buffer_size = 0;