summaryrefslogtreecommitdiff
path: root/mysql-test/t/key_cache.test
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2011-12-12 14:07:02 +0100
committerMattias Jonsson <mattias.jonsson@oracle.com>2011-12-12 14:07:02 +0100
commitbeedf6b261b243ec0a2332162bface6ec7d58dd0 (patch)
tree86868d0d8268b65cd2a903f192c0044e3f8221d1 /mysql-test/t/key_cache.test
parent138df47b4988aa59ddf3be74710c1537240b1ccc (diff)
downloadmariadb-git-beedf6b261b243ec0a2332162bface6ec7d58dd0.tar.gz
Bug#12361113: CRASH WHEN "LOAD INDEX INTO CACHE" WITH TOO
SMALL KEY CACHE The server crashed on division by zero because the key cache was not initialized and the block length was 0 which was used in a division. The fix was to not allow CACHE INDEX if the key cache was not initiallized. Thus never try LOAD INDEX INTO CACHE for an uninitialized key cache. Also added some windows files/directories to .bzrignore.
Diffstat (limited to 'mysql-test/t/key_cache.test')
-rw-r--r--mysql-test/t/key_cache.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test
index 4c14dc96aaa..9d865b9b5fe 100644
--- a/mysql-test/t/key_cache.test
+++ b/mysql-test/t/key_cache.test
@@ -247,3 +247,19 @@ SET GLOBAL key_cache_block_size= @bug28478_key_cache_block_size;
DROP TABLE t1;
# End of 4.1 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;