From cba07d5bfd547319fd5866d76170e18639827bdc Mon Sep 17 00:00:00 2001 From: Karen Langford Date: Wed, 26 Oct 2011 17:03:53 +0200 Subject: Raise version number after cloning 5.1.60 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 120717d6afa..080de523c1b 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,7 @@ dnl dnl When changing the major version number please also check the switch dnl statement in mysqlbinlog::check_master_version(). You may also need dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.1.60], [], [mysql]) +AC_INIT([MySQL Server], [5.1.61], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM -- cgit v1.2.1 From 9fe16c24087bf149c389c94162d0de686d06772f Mon Sep 17 00:00:00 2001 From: Hery Ramilison Date: Wed, 26 Oct 2011 20:37:36 +0200 Subject: cloning 5.5.18 off --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7bac52ecdfb..508f021f35d 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=18 +MYSQL_VERSION_PATCH=20 MYSQL_VERSION_EXTRA= -- cgit v1.2.1 From beedf6b261b243ec0a2332162bface6ec7d58dd0 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 12 Dec 2011 14:07:02 +0100 Subject: 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. --- .bzrignore | 9 +++++++++ myisam/mi_preload.c | 3 +++ mysql-test/r/key_cache.result | 16 ++++++++++++++++ mysql-test/t/key_cache.test | 16 ++++++++++++++++ sql/sql_table.cc | 5 +++++ 5 files changed, 49 insertions(+) diff --git a/.bzrignore b/.bzrignore index 2b5b42cb87f..184ed9fe235 100644 --- a/.bzrignore +++ b/.bzrignore @@ -8,6 +8,7 @@ *.core *.d *.da +*.dir *.exe *.gcda *.gcno @@ -25,6 +26,7 @@ *.pdb *.reject *.res +*.rule *.sbr *.so *.so.* @@ -32,13 +34,19 @@ *.user *.vcproj *.vcproj.cmake +*.vcxproj +*.vcxproj.filters */*.dir/* +Debug +MySql.sdf +Win32 */*_pure_*warnings */.deps */.libs/* */.pure */debug/* */release/* +RelWithDebInfo *~ .*.swp ./CMakeCache.txt @@ -83,6 +91,7 @@ BitKeeper/tmp/* BitKeeper/tmp/bkr3sAHD BitKeeper/tmp/gone CMakeFiles/* +CMakeFiles COPYING COPYING.LIB Docs/#manual.texi# diff --git a/myisam/mi_preload.c b/myisam/mi_preload.c index c73c70962ed..f53fcd2e1ee 100644 --- a/myisam/mi_preload.c +++ b/myisam/mi_preload.c @@ -54,6 +54,9 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) if (!keys || !mi_is_any_key_active(key_map) || key_file_length == pos) DBUG_RETURN(0); + /* Preload into a non initialized key cache should never happen. */ + DBUG_ASSERT(share->key_cache->key_cache_inited); + block_length= keyinfo[0].block_length; if (ignore_leaves) diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 9ada5dc0784..6513c4eb374 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -368,3 +368,19 @@ Variable_name Value key_cache_block_size 1536 SET GLOBAL key_cache_block_size= @bug28478_key_cache_block_size; DROP TABLE t1; +# +# 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/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; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 4320cef2c49..2bb758f8b86 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2680,6 +2680,11 @@ bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* tables, DBUG_RETURN(TRUE); } pthread_mutex_unlock(&LOCK_global_system_variables); + if (!key_cache->key_cache_inited) + { + my_error(ER_UNKNOWN_KEY_CACHE, MYF(0), key_cache_name->str); + DBUG_RETURN(TRUE); + } check_opt.key_cache= key_cache; DBUG_RETURN(mysql_admin_table(thd, tables, &check_opt, "assign_to_keycache", TL_READ_NO_INSERT, 0, 0, -- cgit v1.2.1 From e5cb28793385566e22d5a82efdf3f6cb8dbe5cbc Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Thu, 15 Dec 2011 16:59:18 +0100 Subject: Post push fix for merge.test and mysqlcheck.test on windows --- mysql-test/r/mysqlcheck.result | 1 + mysql-test/t/merge.test | 10 +++++++--- mysql-test/t/mysqlcheck.test | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 5f1a0565b10..ffba0d443e7 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -147,6 +147,7 @@ DROP TABLE `@`; CREATE TABLE `я` (a INT); SET NAMES DEFAULT; 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/t/merge.test b/mysql-test/t/merge.test index a6affbb0540..7954aed6a55 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -1817,9 +1817,13 @@ CREATE TABLE t1(a INT); --echo # Test reattach merge failure LOCK TABLES m1 READ; --echo # Replace 't1' with 't3' table using file operations. -remove_file $MYSQLD_DATADIR/test/t1.frm; -remove_file $MYSQLD_DATADIR/test/t1.MYI; -remove_file $MYSQLD_DATADIR/test/t1.MYD; +# move + remove is a work around for windows. +move_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/oldt1.frm; +move_file $MYSQLD_DATADIR/test/t1.MYI $MYSQLD_DATADIR/test/oldt1.MYI; +move_file $MYSQLD_DATADIR/test/t1.MYD $MYSQLD_DATADIR/test/oldt1.MYD; +remove_file $MYSQLD_DATADIR/test/oldt1.frm; +remove_file $MYSQLD_DATADIR/test/oldt1.MYI; +remove_file $MYSQLD_DATADIR/test/oldt1.MYD; copy_file $MYSQLD_DATADIR/test/t3.frm $MYSQLD_DATADIR/test/t1.frm; copy_file $MYSQLD_DATADIR/test/t3.MYI $MYSQLD_DATADIR/test/t1.MYI; copy_file $MYSQLD_DATADIR/test/t3.MYD $MYSQLD_DATADIR/test/t1.MYD; diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index 986b5aba385..bf99d48fd6a 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -138,6 +138,7 @@ CREATE TABLE `я` (a INT); SET NAMES DEFAULT; --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 -- cgit v1.2.1 From 16036b5e61d8f48f352ac4e1f68a541f45f2ae34 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 16 Dec 2011 12:17:13 +0400 Subject: Test case for BUG11763712 is intended for 5.1 only. --- mysql-test/r/merge.result | 5 ----- mysql-test/t/merge.test | 53 ----------------------------------------------- 2 files changed, 58 deletions(-) diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index cd56b5eca5c..6e4e6c5a443 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -2403,11 +2403,6 @@ REPAIR TABLE m1; Table Op Msg_type Msg_text test.m1 repair note The storage engine for the table doesn't support repair DROP TABLE m1, t1; -# -# BUG#11763712 - 56458: KILLING A FLUSH TABLE FOR A MERGE/CHILD -# CRASHES SERVER -# -# Disabled in 5.5 by Mattias. TODO: FIX THIS! End of 5.1 tests # # An additional test case for Bug#27430 Crash in subquery code diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 64327400a4f..74110962299 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -1812,59 +1812,6 @@ REPAIR TABLE m1; # DROP TABLE m1, t1; - ---echo # ---echo # BUG#11763712 - 56458: KILLING A FLUSH TABLE FOR A MERGE/CHILD ---echo # CRASHES SERVER ---echo # ---echo # Disabled in 5.5 by Mattias. TODO: FIX THIS! -if (0) -{ -CREATE TABLE t1(a INT); -CREATE TABLE t2(a INT); -CREATE TABLE t3(a INT, b INT); -CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2); - ---echo # Test reopen merge parent failure -LOCK TABLES m1 READ; ---echo # Remove 'm1' table using file operations. -remove_file $MYSQLD_DATADIR/test/m1.MRG; -remove_file $MYSQLD_DATADIR/test/m1.frm; ---error ER_NO_SUCH_TABLE -FLUSH TABLES; -UNLOCK TABLES; -CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2); - ---echo # Test reopen merge child failure -LOCK TABLES m1 READ; ---echo # Remove 't1' table using file operations. -remove_file $MYSQLD_DATADIR/test/t1.frm; -remove_file $MYSQLD_DATADIR/test/t1.MYI; -remove_file $MYSQLD_DATADIR/test/t1.MYD; ---error ER_NO_SUCH_TABLE -FLUSH TABLES; -UNLOCK TABLES; -CREATE TABLE t1(a INT); - ---echo # Test reattach merge failure -LOCK TABLES m1 READ; ---echo # Replace 't1' with 't3' table using file operations. -# move + remove is a work around for windows. -move_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/oldt1.frm; -move_file $MYSQLD_DATADIR/test/t1.MYI $MYSQLD_DATADIR/test/oldt1.MYI; -move_file $MYSQLD_DATADIR/test/t1.MYD $MYSQLD_DATADIR/test/oldt1.MYD; -remove_file $MYSQLD_DATADIR/test/oldt1.frm; -remove_file $MYSQLD_DATADIR/test/oldt1.MYI; -remove_file $MYSQLD_DATADIR/test/oldt1.MYD; -copy_file $MYSQLD_DATADIR/test/t3.frm $MYSQLD_DATADIR/test/t1.frm; -copy_file $MYSQLD_DATADIR/test/t3.MYI $MYSQLD_DATADIR/test/t1.MYI; -copy_file $MYSQLD_DATADIR/test/t3.MYD $MYSQLD_DATADIR/test/t1.MYD; ---error ER_CANT_REOPEN_TABLE -FLUSH TABLES; -UNLOCK TABLES; -DROP TABLE t1, t2, t3, m1; -} - --echo End of 5.1 tests --echo # -- cgit v1.2.1