From 44305ca26c343c99c7b548c0664d171264602d90 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 25 Sep 2005 11:35:32 +0200 Subject: [PATCH 1/5] disabled.def: Disable unstable test cases new file --- mysql-test/t/disabled.def | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 mysql-test/t/disabled.def diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def new file mode 100644 index 00000000000..ddb79205357 --- /dev/null +++ b/mysql-test/t/disabled.def @@ -0,0 +1,16 @@ +############################################################################## +# +# List the test cases that are to be disabled temporarely. +# +# Separate the test case name and the comment with ':'. +# +# : Comment test +# +# Don't use any TAB characters for whitespace. +# +############################################################################## + +rpl_relayrotate : Unstable test case, bug#12429 +rpl_until : Unstable test case, bug#12429 +rpl_deadlock : Unstable test case, bug#12429 +kill : Unstable test case, bug#9712 From ed1c0cbd07a1f8126711921ebe526cd0205cacd0 Mon Sep 17 00:00:00 2001 From: "dlenev@mysql.com" <> Date: Tue, 27 Sep 2005 23:36:02 +0400 Subject: [PATCH 2/5] Fix for bug #13501 "build problem: too many arguments to function my_bool acl_init". Updated calls to acl_init()/grant_init() in init_embedded_server() - their signatures were changed recently, now they don't need argument for passing pointer to THD object (this code was only compiled if one built embedded server library with --with-embedded-privilege-control switch). --- libmysqld/lib_sql.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 82e1c19d758..bf8c17a71af 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -427,9 +427,9 @@ int init_embedded_server(int argc, char **argv, char **groups) acl_error= 0; #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (!(acl_error= acl_init((THD *)0, opt_noacl)) && + if (!(acl_error= acl_init(opt_noacl)) && !opt_noacl) - (void) grant_init((THD *)0); + (void) grant_init(); #endif if (acl_error || my_tz_init((THD *)0, default_tz_name, opt_bootstrap)) { From 4f4711bd49c57c48cb58ab1132eb1259ad8f3e8d Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Wed, 28 Sep 2005 00:58:12 +0400 Subject: [PATCH 3/5] Fix bug#13356 resolve_const_item() wasn't able to handle Item_row items. resolve_const_item() assumed to be not called for Item_row items. For ensuring that DBUG_ASSERT(0) was set there. This patch adds section for Item_row items. If it can it recursively calls resolve_const_item() for each item the Item_row contains. If any of the contained items is null then whole Item_row substitued by Item_null. Otherwise it just returns. --- mysql-test/r/select.result | 9 +++++++++ mysql-test/t/select.test | 10 ++++++++++ sql/item.cc | 29 +++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 993fe7d22f1..64cbaf4fa67 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2617,3 +2617,12 @@ select found_rows(); found_rows() 1 DROP TABLE t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +drop table t1,t2; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index b51ea89c7dd..bdadd5c536b 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2164,4 +2164,14 @@ select found_rows(); DROP TABLE t1; +# +# Bug #13356 assertion failed in resolve_const_item() +# +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +drop table t1,t2; + # End of 4.1 tests diff --git a/sql/item.cc b/sql/item.cc index 010189c321c..03ab38fc970 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2870,6 +2870,35 @@ void resolve_const_item(THD *thd, Item **ref, Item *comp_item) new_item= (null_value ? (Item*) new Item_null(name) : (Item*) new Item_int(name, result, length)); } + else if (res_type == ROW_RESULT) + { + new_item= 0; + /* + If item and comp_item are both Item_rows and have same number of cols + then process items in Item_row one by one. If Item_row contain nulls + substitute it by Item_null. Otherwise just return. + */ + if (item->result_type() == comp_item->result_type() && + ((Item_row*)item)->cols() == ((Item_row*)comp_item)->cols()) + { + Item_row *item_row= (Item_row*)item,*comp_item_row= (Item_row*)comp_item; + if (item_row->null_inside()) + new_item= (Item*) new Item_null(name); + else + { + int i= item_row->cols() - 1; + for (; i >= 0; i--) + { + if (item_row->maybe_null && item_row->el(i)->is_null()) + { + new_item= (Item*) new Item_null(name); + break; + } + resolve_const_item(thd, item_row->addr(i), comp_item_row->el(i)); + } + } + } + } else { // It must REAL_RESULT double result=item->val(); From dc80450410c45ea1f851fe959f61aff1ddd35aee Mon Sep 17 00:00:00 2001 From: "jan@hundin.mysql.fi" <> Date: Wed, 28 Sep 2005 14:14:49 +0300 Subject: [PATCH 4/5] Fixed a bug checksum table locks the InnoDB table and does not use a consistent read (Bug #12669). --- mysql-test/r/innodb.result | 28 ++++++++++++++++++++++++++ mysql-test/t/innodb.test | 41 ++++++++++++++++++++++++++++++++++++++ sql/ha_innodb.cc | 7 +++++++ 3 files changed, 76 insertions(+) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index c7aef8ed792..ca78d23e6dc 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1694,3 +1694,31 @@ select min(b) from t1 where a='8'; min(b) 6 drop table t1; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=0; +checksum table test_checksum; +Table Checksum +test.test_checksum 1531596814 +insert into test_checksum values(3); +checksum table test_checksum; +Table Checksum +test.test_checksum 1531596814 +commit; +checksum table test_checksum; +Table Checksum +test.test_checksum 2050879373 +commit; +drop table test_checksum; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=1; +checksum table test_checksum; +Table Checksum +test.test_checksum 1531596814 +set autocommit=1; +insert into test_checksum values(3); +checksum table test_checksum; +Table Checksum +test.test_checksum 2050879373 +drop table test_checksum; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index b966ea5b281..3a693968769 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1239,4 +1239,45 @@ insert into t1 values ('8', '6'), ('4', '7'); select min(a) from t1; select min(b) from t1 where a='8'; drop table t1; + +# +# Test that checksum table uses a consistent read Bug #12669 +# +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=0; +checksum table test_checksum; +connection b; +insert into test_checksum values(3); +connection a; +# +# Here checksum should not see insert +# +checksum table test_checksum; +connection a; +commit; +checksum table test_checksum; +commit; +drop table test_checksum; +# +# autocommit = 1 +# +connection a; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=1; +checksum table test_checksum; +connection b; +set autocommit=1; +insert into test_checksum values(3); +connection a; +# +# Here checksum sees insert +# +checksum table test_checksum; +drop table test_checksum; + # End of 4.1 tests diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index b30ddfe8227..1312b645017 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5421,6 +5421,13 @@ ha_innobase::store_lock( prebuilt->select_lock_type = LOCK_NONE; prebuilt->stored_select_lock_type = LOCK_NONE; + } else if (thd->lex->sql_command == SQLCOM_CHECKSUM) { + /* Use consistent read for checksum table and + convert lock type to the TL_READ */ + + prebuilt->select_lock_type = LOCK_NONE; + prebuilt->stored_select_lock_type = LOCK_NONE; + lock.type = TL_READ; } else { prebuilt->select_lock_type = LOCK_S; prebuilt->stored_select_lock_type = LOCK_S; From 5b79dbb2eb7caa07eed2cadd370bf5544501f8c8 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 28 Sep 2005 13:39:28 +0200 Subject: [PATCH 5/5] mysql_config.sh: Added -lz to link using libmysqld --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 15b45391ef8..5b35c0190a5 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -101,7 +101,7 @@ libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" -embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@ $client_libs" +embedded_libs="$ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@" embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` # Remove some options that a client doesn't have to care about