From 7cd32aa3ec05bf6bfcb219719f16af69186fdb16 Mon Sep 17 00:00:00 2001 From: "kent/mysqldev@mysql.com/production.mysql.com" <> Date: Mon, 31 Mar 2008 19:01:56 +0200 Subject: [PATCH 01/11] disabled.def: Disabled 'rpl_redirect', failure is sporadic and and the test is superfluous rpl_packet.test, rpl_packet.result: Removing race conditions from rpl_packet causing test to fail --- mysql-test/suite/rpl/r/rpl_packet.result | 4 ++++ mysql-test/suite/rpl/t/disabled.def | 1 + mysql-test/suite/rpl/t/rpl_packet.test | 16 +++++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index dd56eb0471c..f89d6b3459a 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -6,6 +6,10 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; +SET @@global.max_allowed_packet=1024; +SET @@global.net_buffer_length=1024; +STOP SLAVE; +START SLAVE; select @@net_buffer_length, @@max_allowed_packet; @@net_buffer_length @@max_allowed_packet 1024 1024 diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 4375a2a8aa5..968817d253f 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -15,3 +15,4 @@ rpl_innodb_bug28430 : Bug #32247 2007-11-27 mats Test reports wrong value o rpl_view : Bug#32654: rpl_view.test fails randomly rpl_ndb_multi : Bug#30751: rpl_ndb_multi missing row in output rpl_log_pos : Bug#8693 Test 'rpl_log_pos' fails sometimes +rpl_redirect : Failure is sporadic and and the test is superfluous (mats) diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index 0e17ae3144c..1bde61aef78 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -13,13 +13,25 @@ enable_warnings; eval create database $db; connection master; -select @@net_buffer_length, @@max_allowed_packet; +SET @@global.max_allowed_packet=1024; +SET @@global.net_buffer_length=1024; + +# Restart slave for setting to take effect +connection slave; +STOP SLAVE; +source include/wait_for_slave_to_stop.inc; +START SLAVE; +source include/wait_for_slave_to_start.inc; + +# Reconnect to master for new setting to take effect disconnect master; # alas, can't use eval here; if db name changed apply the change here connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________); connection master; +select @@net_buffer_length, @@max_allowed_packet; + create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM; INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023'); @@ -54,7 +66,9 @@ SET @@global.net_buffer_length=4096; # Restart slave for new setting to take effect connection slave; STOP SLAVE; +source include/wait_for_slave_to_stop.inc; START SLAVE; +source include/wait_for_slave_to_start.inc; # Reconnect to master for new setting to take effect disconnect master; From bf92d91e1e434d40b995aa8192927c365ff3259e Mon Sep 17 00:00:00 2001 From: "kent/mysqldev@mysql.com/production.mysql.com" <> Date: Mon, 31 Mar 2008 19:48:54 +0200 Subject: [PATCH 02/11] mysql.spec.sh: Made Federated and Cluster optional --- support-files/mysql.spec.sh | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 9a417d5f02d..f26a922dbc3 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -27,6 +27,16 @@ %{?_with_yassl:%define YASSL_BUILD 1} %{!?_with_yassl:%define YASSL_BUILD 0} +# use "rpmbuild --with cluster" or "rpm --define '_with_cluster 1'" (for RPM 3.x) +# to build with cluster support (off by default) +%{?_with_cluster:%define CLUSTER_BUILD 1} +%{!?_with_cluster:%define CLUSTER_BUILD 0} + +# use "rpmbuild --with federated" or "rpm --define '_with_federated 1'" (for RPM 3.x) +# to build with federated support (off by default) +%{?_with_federated:%define FEDERATED_BUILD 1} +%{!?_with_federated:%define FEDERATED_BUILD 0} + %if %{STATIC_BUILD} %define release 0 %else @@ -134,6 +144,7 @@ This package contains the standard MySQL clients and administration tools. %{see_base} +%if %{CLUSTER_BUILD} %package ndb-storage Summary: MySQL - ndbcluster storage engine Group: Applications/Databases @@ -174,6 +185,7 @@ This package contains some extra ndbcluster storage engine tools for the advance They should be used with caution. %{see_base} +%endif %package test Requires: %{name}-client perl-DBI perl @@ -322,12 +334,16 @@ CXXFLAGS=`echo "${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno BuildMySQL "--enable-shared \ --with-debug \ --with-innodb \ +%if %{CLUSTER_BUILD} --with-ndbcluster \ +%endif --with-archive-storage-engine \ --with-csv-storage-engine \ --with-example-storage-engine \ --with-blackhole-storage-engine \ +%if %{FEDERATED_BUILD} --with-federated-storage-engine \ +%endif --with-partition \ --with-big-tables \ --with-comment=\"MySQL Community Server - Debug (GPL)\"") @@ -351,12 +367,16 @@ CFLAGS="${MYSQL_BUILD_CFLAGS:-$RPM_OPT_FLAGS} -g" \ CXXFLAGS="${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti} -g" \ BuildMySQL "--enable-shared \ --with-innodb \ +%if %{CLUSTER_BUILD} --with-ndbcluster \ +%endif --with-archive-storage-engine \ --with-csv-storage-engine \ --with-example-storage-engine \ --with-blackhole-storage-engine \ +%if %{FEDERATED_BUILD} --with-federated-storage-engine \ +%endif --with-partition \ --with-embedded-server \ --with-big-tables \ @@ -563,12 +583,13 @@ sleep 2 #scheduled service packs and more. Visit www.mysql.com/enterprise for more #information." +%if %{CLUSTER_BUILD} %post ndb-storage mysql_clusterdir=/var/lib/mysql-cluster # Create cluster directory if needed if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi - +%endif %preun server if test $1 = 0 @@ -603,7 +624,9 @@ fi %doc mysql-release-%{mysql_version}/COPYING mysql-release-%{mysql_version}/README %doc mysql-release-%{mysql_version}/support-files/my-*.cnf +%if %{CLUSTER_BUILD} %doc mysql-release-%{mysql_version}/support-files/ndb-*.ini +%endif %doc %attr(644, root, root) %{_infodir}/mysql.info* @@ -698,6 +721,7 @@ fi %postun shared /sbin/ldconfig +%if %{CLUSTER_BUILD} %files ndb-storage %defattr(-,root,root,0755) %attr(755, root, root) %{_sbindir}/ndbd @@ -745,6 +769,7 @@ fi %doc %attr(644, root, man) %{_mandir}/man1/ndb_delete_all.1* %doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_index.1* %doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_table.1* +%endif %files devel %defattr(-, root, root, 0755) @@ -767,8 +792,10 @@ fi %{_libdir}/mysql/libmysqlclient_r.la %{_libdir}/mysql/libmystrings.a %{_libdir}/mysql/libmysys.a +%if %{CLUSTER_BUILD} %{_libdir}/mysql/libndbclient.a %{_libdir}/mysql/libndbclient.la +%endif %{_libdir}/mysql/libvio.a %{_libdir}/mysql/libz.a %{_libdir}/mysql/libz.la @@ -777,7 +804,9 @@ fi %defattr(-, root, root, 0755) # Shared libraries (omit for architectures that don't support them) %{_libdir}/libmysql*.so* +%if %{CLUSTER_BUILD} %{_libdir}/libndb*.so* +%endif %files test %defattr(-, root, root, 0755) @@ -799,6 +828,11 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Mon Mar 31 2008 Kent Boortz + +- Made the "Federated" storage engine an option +- Made the "Cluster" storage engine and sub packages an option + * Wed Mar 19 2008 Joerg Bruehe - Add the man pages for "ndbd" and "ndb_mgmd". From 49d1eeaeb997d13351832b4e4181b4a8f053b2dc Mon Sep 17 00:00:00 2001 From: "df@pippilotta.erinye.com" <> Date: Tue, 1 Apr 2008 11:03:12 +0200 Subject: [PATCH 03/11] Portability fix --- sql/set_var.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/set_var.cc b/sql/set_var.cc index 99931d7bafc..b4b81ba2fbe 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -713,7 +713,7 @@ static uchar *slave_get_report_port(THD *thd) return (uchar*) &thd->sys_var_tmp.long_value; } -static sys_var_readonly sys_repl_report_port(&vars, "report_port", OPT_GLOBAL, SHOW_INT, slave_get_report_port); +static sys_var_readonly sys_repl_report_port(&vars, "report_port", OPT_GLOBAL, SHOW_LONG, slave_get_report_port); #endif From 984ea1a3cb7f8636aa8128d88543a4c49064beb6 Mon Sep 17 00:00:00 2001 From: "mats@mats-laptop.(none)" <> Date: Tue, 1 Apr 2008 14:40:23 +0200 Subject: [PATCH 04/11] Fixes to eliminate some race conditions in tests. --- mysql-test/include/master-slave-reset.inc | 3 ++- mysql-test/suite/rpl/t/rpl_insert.test | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mysql-test/include/master-slave-reset.inc b/mysql-test/include/master-slave-reset.inc index 204c6c5f5f6..1363fab236a 100644 --- a/mysql-test/include/master-slave-reset.inc +++ b/mysql-test/include/master-slave-reset.inc @@ -3,7 +3,7 @@ connection slave; #(the server was started with skip-slave-start) --disable_warnings stop slave; ---wait_for_slave_to_stop +source include/wait_for_slave_to_stop.inc; --enable_warnings connection master; --disable_warnings @@ -20,3 +20,4 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; --enable_warnings start slave; +source include/wait_for_slave_to_start.inc; diff --git a/mysql-test/suite/rpl/t/rpl_insert.test b/mysql-test/suite/rpl/t/rpl_insert.test index 504ca1809ad..00e814951d5 100644 --- a/mysql-test/suite/rpl/t/rpl_insert.test +++ b/mysql-test/suite/rpl/t/rpl_insert.test @@ -18,10 +18,13 @@ let $query = "INSERT DELAYED INTO t1 VALUES (1, 'Dr. No'), (2, 'From Russia With # Wait until all the 5000 inserts has been inserted into the table let $wait_condition= SELECT COUNT(*) = 5000 FROM mysqlslap.t1; ---source include/wait_condition.inc - +source include/wait_condition.inc; SELECT COUNT(*) FROM mysqlslap.t1; -sync_slave_with_master; + +connection slave; +# Wait until all the 5000 inserts has been inserted into the table +let $wait_condition= SELECT COUNT(*) = 5000 FROM mysqlslap.t1; +source include/wait_condition.inc; SELECT COUNT(*) FROM mysqlslap.t1; --echo # From 1f26fe081542d199a7c20c4c4972c9c6d7a017a4 Mon Sep 17 00:00:00 2001 From: "mleich@five.local.lan" <> Date: Tue, 1 Apr 2008 19:22:37 +0200 Subject: [PATCH 05/11] Fixes for failing funcs_1 tests in mysql-5.1.24-rc Problems were caused by modifications of - the server - HANDLER FOR SQLSTATE '00000' is now rejected (bug fix) affects several ..._storedproc* tests - improved error message affects the ..._trig_03e - improved content of information_schema.COLUMNS about information_schema.REFERENTIAL_CONSTRAINTS affects is_columns_is - the content of the community build (collations) affects charset_collation_3 --- .../funcs_1/r/charset_collation_3.result | 99 ++++++++++--------- .../suite/funcs_1/r/innodb_storedproc.result | 15 +-- .../funcs_1/r/innodb_storedproc_02.result | 7 +- .../suite/funcs_1/r/innodb_trig_03e.result | 2 +- .../suite/funcs_1/r/is_columns_is.result | 2 +- .../suite/funcs_1/r/memory_storedproc.result | 15 +-- .../funcs_1/r/memory_storedproc_02.result | 7 +- .../suite/funcs_1/r/memory_trig_03e.result | 2 +- .../suite/funcs_1/r/myisam_storedproc.result | 15 +-- .../funcs_1/r/myisam_storedproc_02.result | 7 +- .../suite/funcs_1/r/myisam_trig_03e.result | 2 +- .../suite/funcs_1/r/ndb_storedproc.result | 15 +-- .../suite/funcs_1/r/ndb_storedproc_02.result | 7 +- .../suite/funcs_1/r/ndb_trig_03e.result | 2 +- .../funcs_1/storedproc/storedproc_02.inc | 4 +- .../funcs_1/storedproc/storedproc_master.inc | 15 +-- 16 files changed, 85 insertions(+), 131 deletions(-) diff --git a/mysql-test/suite/funcs_1/r/charset_collation_3.result b/mysql-test/suite/funcs_1/r/charset_collation_3.result index b9a2dbe8a98..55ed4b4704c 100644 --- a/mysql-test/suite/funcs_1/r/charset_collation_3.result +++ b/mysql-test/suite/funcs_1/r/charset_collation_3.result @@ -47,10 +47,10 @@ SELECT * FROM information_schema.collations ORDER BY collation_name; COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN -armscii8_bin armscii8 64 Yes 1 -armscii8_general_ci armscii8 32 Yes Yes 1 -ascii_bin ascii 65 Yes 1 -ascii_general_ci ascii 11 Yes Yes 1 +armscii8_bin armscii8 64 0 +armscii8_general_ci armscii8 32 Yes 0 +ascii_bin ascii 65 0 +ascii_general_ci ascii 11 Yes 0 big5_bin big5 84 Yes 1 big5_chinese_ci big5 1 Yes Yes 1 binary binary 63 Yes Yes 1 @@ -58,26 +58,27 @@ cp1250_bin cp1250 66 Yes 1 cp1250_croatian_ci cp1250 44 Yes 1 cp1250_czech_cs cp1250 34 Yes 2 cp1250_general_ci cp1250 26 Yes Yes 1 -cp1251_bin cp1251 50 Yes 1 -cp1251_bulgarian_ci cp1251 14 Yes 1 -cp1251_general_ci cp1251 51 Yes Yes 1 -cp1251_general_cs cp1251 52 Yes 1 -cp1251_ukrainian_ci cp1251 23 Yes 1 -cp1256_bin cp1256 67 Yes 1 -cp1256_general_ci cp1256 57 Yes Yes 1 -cp1257_bin cp1257 58 Yes 1 -cp1257_general_ci cp1257 59 Yes Yes 1 -cp1257_lithuanian_ci cp1257 29 Yes 1 -cp850_bin cp850 80 Yes 1 -cp850_general_ci cp850 4 Yes Yes 1 -cp852_bin cp852 81 Yes 1 -cp852_general_ci cp852 40 Yes Yes 1 -cp866_bin cp866 68 Yes 1 -cp866_general_ci cp866 36 Yes Yes 1 +cp1250_polish_ci cp1250 99 Yes 1 +cp1251_bin cp1251 50 0 +cp1251_bulgarian_ci cp1251 14 0 +cp1251_general_ci cp1251 51 Yes 0 +cp1251_general_cs cp1251 52 0 +cp1251_ukrainian_ci cp1251 23 0 +cp1256_bin cp1256 67 0 +cp1256_general_ci cp1256 57 Yes 0 +cp1257_bin cp1257 58 0 +cp1257_general_ci cp1257 59 Yes 0 +cp1257_lithuanian_ci cp1257 29 0 +cp850_bin cp850 80 0 +cp850_general_ci cp850 4 Yes 0 +cp852_bin cp852 81 0 +cp852_general_ci cp852 40 Yes 0 +cp866_bin cp866 68 0 +cp866_general_ci cp866 36 Yes 0 cp932_bin cp932 96 Yes 1 cp932_japanese_ci cp932 95 Yes Yes 1 -dec8_bin dec8 69 Yes 1 -dec8_swedish_ci dec8 3 Yes Yes 1 +dec8_bin dec8 69 0 +dec8_swedish_ci dec8 3 Yes 0 eucjpms_bin eucjpms 98 Yes 1 eucjpms_japanese_ci eucjpms 97 Yes Yes 1 euckr_bin euckr 85 Yes 1 @@ -86,20 +87,20 @@ gb2312_bin gb2312 86 Yes 1 gb2312_chinese_ci gb2312 24 Yes Yes 1 gbk_bin gbk 87 Yes 1 gbk_chinese_ci gbk 28 Yes Yes 1 -geostd8_bin geostd8 93 Yes 1 -geostd8_general_ci geostd8 92 Yes Yes 1 -greek_bin greek 70 Yes 1 -greek_general_ci greek 25 Yes Yes 1 -hebrew_bin hebrew 71 Yes 1 -hebrew_general_ci hebrew 16 Yes Yes 1 -hp8_bin hp8 72 Yes 1 -hp8_english_ci hp8 6 Yes Yes 1 -keybcs2_bin keybcs2 73 Yes 1 -keybcs2_general_ci keybcs2 37 Yes Yes 1 -koi8r_bin koi8r 74 Yes 1 -koi8r_general_ci koi8r 7 Yes Yes 1 -koi8u_bin koi8u 75 Yes 1 -koi8u_general_ci koi8u 22 Yes Yes 1 +geostd8_bin geostd8 93 0 +geostd8_general_ci geostd8 92 Yes 0 +greek_bin greek 70 0 +greek_general_ci greek 25 Yes 0 +hebrew_bin hebrew 71 0 +hebrew_general_ci hebrew 16 Yes 0 +hp8_bin hp8 72 0 +hp8_english_ci hp8 6 Yes 0 +keybcs2_bin keybcs2 73 0 +keybcs2_general_ci keybcs2 37 Yes 0 +koi8r_bin koi8r 74 0 +koi8r_general_ci koi8r 7 Yes 0 +koi8u_bin koi8u 75 0 +koi8u_general_ci koi8u 22 Yes 0 latin1_bin latin1 47 Yes 1 latin1_danish_ci latin1 15 Yes 1 latin1_general_ci latin1 48 Yes 1 @@ -113,20 +114,20 @@ latin2_croatian_ci latin2 27 Yes 1 latin2_czech_cs latin2 2 Yes 4 latin2_general_ci latin2 9 Yes Yes 1 latin2_hungarian_ci latin2 21 Yes 1 -latin5_bin latin5 78 Yes 1 -latin5_turkish_ci latin5 30 Yes Yes 1 -latin7_bin latin7 79 Yes 1 -latin7_estonian_cs latin7 20 Yes 1 -latin7_general_ci latin7 41 Yes Yes 1 -latin7_general_cs latin7 42 Yes 1 -macce_bin macce 43 Yes 1 -macce_general_ci macce 38 Yes Yes 1 -macroman_bin macroman 53 Yes 1 -macroman_general_ci macroman 39 Yes Yes 1 +latin5_bin latin5 78 0 +latin5_turkish_ci latin5 30 Yes 0 +latin7_bin latin7 79 0 +latin7_estonian_cs latin7 20 0 +latin7_general_ci latin7 41 Yes 0 +latin7_general_cs latin7 42 0 +macce_bin macce 43 0 +macce_general_ci macce 38 Yes 0 +macroman_bin macroman 53 0 +macroman_general_ci macroman 39 Yes 0 sjis_bin sjis 88 Yes 1 sjis_japanese_ci sjis 13 Yes Yes 1 -swe7_bin swe7 82 Yes 1 -swe7_swedish_ci swe7 10 Yes Yes 1 +swe7_bin swe7 82 0 +swe7_swedish_ci swe7 10 Yes 0 tis620_bin tis620 89 Yes 1 tis620_thai_ci tis620 18 Yes Yes 4 ucs2_bin ucs2 90 Yes 1 @@ -190,6 +191,7 @@ cp1250_bin cp1250 cp1250_croatian_ci cp1250 cp1250_czech_cs cp1250 cp1250_general_ci cp1250 +cp1250_polish_ci cp1250 cp1251_bin cp1251 cp1251_bulgarian_ci cp1251 cp1251_general_ci cp1251 @@ -214,6 +216,7 @@ eucjpms_bin eucjpms eucjpms_japanese_ci eucjpms euckr_bin euckr euckr_korean_ci euckr +filename filename gb2312_bin gb2312 gb2312_chinese_ci gb2312 gbk_bin gbk diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc.result b/mysql-test/suite/funcs_1/r/innodb_storedproc.result index c20276b1937..18579f3c275 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc.result @@ -14309,10 +14309,7 @@ declare continue handler for cond1 set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.45: -------------------------------------------------------------------------------- @@ -14387,10 +14384,7 @@ declare continue handler for sqlstate '00000' set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.52: -------------------------------------------------------------------------------- @@ -23493,6 +23487,7 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE IF EXISTS h1; Testcase 4.11.40: @@ -23530,9 +23525,9 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' CALL h1(); -@x x1 -0 2 +ERROR 42000: PROCEDURE db_storedproc.h1 does not exist DROP PROCEDURE IF EXISTS h1; * Testcase 3.1.2.53 (4.11.42): diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result index 49f70d55676..50fa295e94f 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_02.result @@ -586,14 +586,9 @@ SELECT @var3, @var4; END begin2_label; SELECT @var1, @var2; END begin1_label// -CALL sp1(); -@var3 @var4 -NULL 8 -@var1 @var2 -NULL 6 +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE p1; DROP PROCEDURE h1; -DROP PROCEDURE sp1; DROP TABLE res_t1; Testcase 3.1.2.50: diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result index 048c070ea96..26546138ea2 100644 --- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result @@ -1214,7 +1214,7 @@ create definer=not_ex_user@localhost trigger trg1_0 before INSERT on t1 for each row set new.f1 = 'trig 1_0-yes'; Warnings: -Note 1449 There is no 'not_ex_user'@'localhost' registered +Note 1449 The user specified as a definer ('not_ex_user'@'localhost') does not exist drop trigger trg1_0; create definer=test_yesprivs@localhost trigger trg1_0 before INSERT on t1 for each row diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index e2081af7e00..c1813a1add2 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -176,7 +176,7 @@ NULL information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NO varchar 64 19 NULL information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select -NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select +NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema ROUTINES CHARACTER_SET_CLIENT 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc.result b/mysql-test/suite/funcs_1/r/memory_storedproc.result index a8294aa3e27..3e22ef2593f 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc.result @@ -14309,10 +14309,7 @@ declare continue handler for cond1 set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.45: -------------------------------------------------------------------------------- @@ -14387,10 +14384,7 @@ declare continue handler for sqlstate '00000' set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.52: -------------------------------------------------------------------------------- @@ -23471,6 +23465,7 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE IF EXISTS h1; Testcase 4.11.40: @@ -23508,9 +23503,9 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' CALL h1(); -@x x1 -0 2 +ERROR 42000: PROCEDURE db_storedproc.h1 does not exist DROP PROCEDURE IF EXISTS h1; * Testcase 3.1.2.53 (4.11.42): diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_02.result b/mysql-test/suite/funcs_1/r/memory_storedproc_02.result index a76301ffa18..3476719c530 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc_02.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc_02.result @@ -586,14 +586,9 @@ SELECT @var3, @var4; END begin2_label; SELECT @var1, @var2; END begin1_label// -CALL sp1(); -@var3 @var4 -NULL 8 -@var1 @var2 -NULL 6 +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE p1; DROP PROCEDURE h1; -DROP PROCEDURE sp1; DROP TABLE res_t1; Testcase 3.1.2.50: diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03e.result b/mysql-test/suite/funcs_1/r/memory_trig_03e.result index fad778ce7c0..251079f8638 100644 --- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result @@ -1214,7 +1214,7 @@ create definer=not_ex_user@localhost trigger trg1_0 before INSERT on t1 for each row set new.f1 = 'trig 1_0-yes'; Warnings: -Note 1449 There is no 'not_ex_user'@'localhost' registered +Note 1449 The user specified as a definer ('not_ex_user'@'localhost') does not exist drop trigger trg1_0; create definer=test_yesprivs@localhost trigger trg1_0 before INSERT on t1 for each row diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc.result b/mysql-test/suite/funcs_1/r/myisam_storedproc.result index 2584807bcc6..8391a36e62e 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc.result @@ -14309,10 +14309,7 @@ declare continue handler for cond1 set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.45: -------------------------------------------------------------------------------- @@ -14387,10 +14384,7 @@ declare continue handler for sqlstate '00000' set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.52: -------------------------------------------------------------------------------- @@ -23493,6 +23487,7 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE IF EXISTS h1; Testcase 4.11.40: @@ -23530,9 +23525,9 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' CALL h1(); -@x x1 -0 2 +ERROR 42000: PROCEDURE db_storedproc.h1 does not exist DROP PROCEDURE IF EXISTS h1; * Testcase 3.1.2.53 (4.11.42): diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result index e20b3ed22ba..5d7549b8b5a 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_02.result @@ -586,14 +586,9 @@ SELECT @var3, @var4; END begin2_label; SELECT @var1, @var2; END begin1_label// -CALL sp1(); -@var3 @var4 -NULL 8 -@var1 @var2 -NULL 6 +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE p1; DROP PROCEDURE h1; -DROP PROCEDURE sp1; DROP TABLE res_t1; Testcase 3.1.2.50: diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result index bcd50198fca..68f8b2a0ef6 100644 --- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result @@ -1214,7 +1214,7 @@ create definer=not_ex_user@localhost trigger trg1_0 before INSERT on t1 for each row set new.f1 = 'trig 1_0-yes'; Warnings: -Note 1449 There is no 'not_ex_user'@'localhost' registered +Note 1449 The user specified as a definer ('not_ex_user'@'localhost') does not exist drop trigger trg1_0; create definer=test_yesprivs@localhost trigger trg1_0 before INSERT on t1 for each row diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc.result b/mysql-test/suite/funcs_1/r/ndb_storedproc.result index 92cc86120d5..42886c69412 100644 --- a/mysql-test/suite/funcs_1/r/ndb_storedproc.result +++ b/mysql-test/suite/funcs_1/r/ndb_storedproc.result @@ -14309,10 +14309,7 @@ declare continue handler for cond1 set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.45: -------------------------------------------------------------------------------- @@ -14387,10 +14384,7 @@ declare continue handler for sqlstate '00000' set @var2 = 1; set @x=1; SELECT @var2; END// -CALL sp1(); -@var2 -NULL -DROP PROCEDURE sp1; +ERROR 42000: Bad SQLSTATE: '00000' Testcase 4.2.52: -------------------------------------------------------------------------------- @@ -23495,6 +23489,7 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE IF EXISTS h1; Testcase 4.11.40: @@ -23532,9 +23527,9 @@ set x1 = 2; END; SELECT @x, x1; END// +ERROR 42000: Bad SQLSTATE: '00000' CALL h1(); -@x x1 -0 2 +ERROR 42000: PROCEDURE db_storedproc.h1 does not exist DROP PROCEDURE IF EXISTS h1; * Testcase 3.1.2.53 (4.11.42): diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result index 419ade39c4f..032aef1d7e0 100644 --- a/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result +++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result @@ -586,14 +586,9 @@ SELECT @var3, @var4; END begin2_label; SELECT @var1, @var2; END begin1_label// -CALL sp1(); -@var3 @var4 -NULL 8 -@var1 @var2 -NULL 6 +ERROR 42000: Bad SQLSTATE: '00000' DROP PROCEDURE p1; DROP PROCEDURE h1; -DROP PROCEDURE sp1; DROP TABLE res_t1; Testcase 3.1.2.50: diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_03e.result b/mysql-test/suite/funcs_1/r/ndb_trig_03e.result index 0d097d6cd7c..2416732a129 100644 --- a/mysql-test/suite/funcs_1/r/ndb_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/ndb_trig_03e.result @@ -1214,7 +1214,7 @@ create definer=not_ex_user@localhost trigger trg1_0 before INSERT on t1 for each row set new.f1 = 'trig 1_0-yes'; Warnings: -Note 1449 There is no 'not_ex_user'@'localhost' registered +Note 1449 The user specified as a definer ('not_ex_user'@'localhost') does not exist drop trigger trg1_0; create definer=test_yesprivs@localhost trigger trg1_0 before INSERT on t1 for each row diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc index 2efc5a83663..756732b0e80 100644 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc @@ -696,6 +696,7 @@ delimiter ;// CALL h1(); +--error ER_SP_BAD_SQLSTATE delimiter //; CREATE PROCEDURE sp1() begin1_label:BEGIN @@ -710,12 +711,9 @@ CREATE PROCEDURE sp1() END begin1_label// delimiter ;// -CALL sp1(); - # cleanup 3.1.2.45+50 DROP PROCEDURE p1; DROP PROCEDURE h1; -DROP PROCEDURE sp1; DROP TABLE res_t1; diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc index 972e6e207a5..e48008316c1 100644 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc @@ -17235,6 +17235,7 @@ DROP PROCEDURE IF EXISTS sp1; --enable_warnings delimiter //; +--error ER_SP_BAD_SQLSTATE CREATE PROCEDURE sp1() BEGIN declare cond1 condition for sqlstate '00000'; @@ -17244,11 +17245,6 @@ BEGIN END// delimiter ;// -CALL sp1(); - -# cleanup -DROP PROCEDURE sp1; - # ------------------------------------------------------------------------------ let $message= Testcase 4.2.45:; @@ -17388,6 +17384,7 @@ DROP PROCEDURE IF EXISTS sp1; --enable_warnings delimiter //; +--error ER_SP_BAD_SQLSTATE CREATE PROCEDURE sp1() BEGIN declare continue handler for sqlstate '00000' set @var2 = 1; @@ -17396,12 +17393,6 @@ BEGIN END// delimiter ;// -CALL sp1(); - -# cleanup -DROP PROCEDURE sp1; - - # ------------------------------------------------------------------------------ let $message= Testcase 4.2.52:; @@ -29245,6 +29236,7 @@ DROP PROCEDURE IF EXISTS h1; --enable_warnings delimiter //; +--error ER_SP_BAD_SQLSTATE CREATE PROCEDURE h1 () BEGIN declare x1 int default 0; @@ -29320,6 +29312,7 @@ DROP PROCEDURE IF EXISTS h1; --enable_warnings delimiter //; +--error ER_SP_BAD_SQLSTATE CREATE PROCEDURE h1 () BEGIN declare x1 int default 0; From fd1bd7547a60d9f1c4ba8ddd997572a77d166345 Mon Sep 17 00:00:00 2001 From: "kent/mysqldev@mysql.com/production.mysql.com" <> Date: Wed, 2 Apr 2008 00:43:17 +0200 Subject: [PATCH 06/11] mysqld.cc: Corrects build problems embedded on Windows Makefile.am: Install .sym or mysqld-debug if exists query_cache_debug.test, query_cache_debug.result: Set more resonable query cache size (bug#35749) CMakeLists.txt: Added missing stacktrace.c --- libmysqld/CMakeLists.txt | 2 +- mysql-test/r/query_cache_debug.result | 2 +- mysql-test/t/query_cache_debug.test | 2 +- sql/Makefile.am | 8 +++++++- sql/mysqld.cc | 2 ++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index b1895e98014..fb7b214bf60 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -187,7 +187,7 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc ../sql/partition_info.cc ../sql/sql_connect.cc - ../sql/scheduler.cc + ../sql/scheduler.cc ../sql/stacktrace.c ${GEN_SOURCES} ${LIB_SOURCES}) diff --git a/mysql-test/r/query_cache_debug.result b/mysql-test/r/query_cache_debug.result index f177bfac836..c90165368e3 100644 --- a/mysql-test/r/query_cache_debug.result +++ b/mysql-test/r/query_cache_debug.result @@ -1,6 +1,6 @@ flush status; set query_cache_type=DEMAND; -set global query_cache_size= 1024*1024*512; +set global query_cache_size= 1024*768; drop table if exists t1; create table t1 (a varchar(100)); insert into t1 values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'); diff --git a/mysql-test/t/query_cache_debug.test b/mysql-test/t/query_cache_debug.test index b741eea0b29..18dfe487ac3 100644 --- a/mysql-test/t/query_cache_debug.test +++ b/mysql-test/t/query_cache_debug.test @@ -7,7 +7,7 @@ # flush status; set query_cache_type=DEMAND; -set global query_cache_size= 1024*1024*512; +set global query_cache_size= 1024*768; --disable_warnings drop table if exists t1; --enable_warnings diff --git a/sql/Makefile.am b/sql/Makefile.am index 3a6f4bcb7a2..33664b77957 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -54,7 +54,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ procedure.h sql_class.h sql_lex.h sql_list.h \ sql_map.h sql_string.h unireg.h \ sql_error.h field.h handler.h mysqld_suffix.h \ - sql_profile.h \ + sql_profile.h \ ha_ndbcluster.h ha_ndbcluster_cond.h \ ha_ndbcluster_binlog.h ha_ndbcluster_tables.h \ ha_partition.h rpl_constants.h \ @@ -178,6 +178,12 @@ lex_hash.h: gen_lex_hash.cc lex.h udf_example_la_SOURCES= udf_example.c udf_example_la_LDFLAGS= -module -rpath $(pkglibdir) +# We might have some stuff not built in this build, but that we want to install +install-exec-hook: + $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(pkglibdir) + test ! -x mysqld-debug$(EXEEXT) || $(INSTALL_PROGRAM) mysqld-debug$(EXEEXT) $(DESTDIR)$(libexecdir) + test ! -f mysqld-debug.sym.gz || $(INSTALL_DATA) mysqld-debug.sym.gz $(DESTDIR)$(pkglibdir) + test ! -f mysqld.sym.gz || $(INSTALL_DATA) mysqld.sym.gz $(DESTDIR)$(pkglibdir) # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8bafb15eeaa..f619899f3b1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1948,6 +1948,7 @@ extern "C" sig_handler abort_thread(int sig __attribute__((unused))) static BOOL WINAPI console_event_handler( DWORD type ) { DBUG_ENTER("console_event_handler"); +#ifndef EMBEDDED_LIBRARY if(type == CTRL_C_EVENT) { /* @@ -1962,6 +1963,7 @@ static BOOL WINAPI console_event_handler( DWORD type ) sql_print_warning("CTRL-C ignored during startup"); DBUG_RETURN(TRUE); } +#endif DBUG_RETURN(FALSE); } From c41a4e13f82461b4b0944998556748e3fb59ef45 Mon Sep 17 00:00:00 2001 From: "kent/mysqldev@mysql.com/production.mysql.com" <> Date: Wed, 2 Apr 2008 22:24:53 +0200 Subject: [PATCH 07/11] mysql.spec.sh: If excluding Federated, make sure dynamic plugin is not built Makefile.am: Only run cluster test when compiled with cluster lib_sql.cc: Work around for Visual Studio 2003, that lacks vsnprintf() but has _vsnprintf() --- Makefile.am | 17 +++++++++++------ libmysqld/lib_sql.cc | 3 +++ support-files/mysql.spec.sh | 4 ++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index ad94c9ea325..f999df86acf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -135,12 +135,17 @@ test-bt: -cd mysql-test ; MTR_BUILD_THREAD=auto \ @PERL@ ./mysql-test-run.pl --comment=normal+rowrepl --force --timer \ --skip-ndbcluster --mysqld=--binlog-format=row - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=ps+rowrepl+NDB --force --timer \ - --ps-protocol --mysqld=--binlog-format=row - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=NDB --force --timer \ - --with-ndbcluster-only + -if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \ + cd mysql-test ; \ + MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=ps+rowrepl+NDB --force --timer \ + --ps-protocol --mysqld=--binlog-format=row ; \ + MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=NDB --force --timer \ + --with-ndbcluster-only ; \ + else \ + echo "no program found for 'ndbcluster' tests - skipped testing" ; \ + fi -if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \ cd mysql-test ; MTR_BUILD_THREAD=auto \ @PERL@ ./mysql-test-run.pl --comment=embedded --force --timer \ diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index ec9356ce98d..0f0fb2c1bda 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -1124,6 +1124,9 @@ bool Protocol::net_store_data(const uchar *from, size_t length) return FALSE; } +#if defined(_MSC_VER) && _MSC_VER < 1400 +#define vsnprintf _vsnprintf +#endif int vprint_msg_to_log(enum loglevel level __attribute__((unused)), const char *format, va_list argsi) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index f26a922dbc3..7f7674eefc9 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -336,6 +336,8 @@ BuildMySQL "--enable-shared \ --with-innodb \ %if %{CLUSTER_BUILD} --with-ndbcluster \ +%else + --without-ndbcluster \ %endif --with-archive-storage-engine \ --with-csv-storage-engine \ @@ -343,6 +345,8 @@ BuildMySQL "--enable-shared \ --with-blackhole-storage-engine \ %if %{FEDERATED_BUILD} --with-federated-storage-engine \ +%else + --without-federated-storage-engine \ %endif --with-partition \ --with-big-tables \ From 5d725bfdf8b90dd0fe65d68e8c2991850d283ce7 Mon Sep 17 00:00:00 2001 From: "davi@mysql.com/endora.local" <> Date: Fri, 4 Apr 2008 13:46:05 -0300 Subject: [PATCH 08/11] Bug#35824: mysql_upgrade does not fix scheduler tables when upgrading from 5.1.23 to 5.1.24 The problem is that when upgrading the event table, the sql_mode column was always being added instead of being updated to list new sql_mode values, causing upgrades of the event which already have a sql_mode column to not be updated to the new sql_mode values. The solution is to always add first a stub sql_mode column and subsequently update the column to the new sql_mode values. --- scripts/mysql_system_tables_fix.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index e2bdd668c0f..a33c4fcb9fa 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -433,7 +433,10 @@ ALTER TABLE db MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NO # ALTER TABLE event DROP PRIMARY KEY; ALTER TABLE event ADD PRIMARY KEY(db, name); -ALTER TABLE event ADD sql_mode +# Add sql_mode column just in case. +ALTER TABLE event ADD sql_mode set ('NOT_USED') AFTER on_completion; +# Update list of sql_mode values. +ALTER TABLE event MODIFY sql_mode set('REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', From 5397f8c90d6a9fdc38278384bb1d3c695d99d5d3 Mon Sep 17 00:00:00 2001 From: "ramil/ram@mysql.com/ramil.myoffice.izhnet.ru" <> Date: Tue, 8 Apr 2008 10:20:58 +0500 Subject: [PATCH 09/11] Fix for bug #35732: read-only blocks SELECT statements in InnoDB Problem: SELECTs prohibited for a transactional SE in autocommit mode if read_only is set. Fix: allow them. --- mysql-test/r/read_only_innodb.result | 30 +++++++++++++ mysql-test/t/read_only_innodb.test | 42 ++++++++++++++++++ sql/handler.cc | 66 ++++++++++++++++------------ sql/lock.cc | 1 + 4 files changed, 110 insertions(+), 29 deletions(-) diff --git a/mysql-test/r/read_only_innodb.result b/mysql-test/r/read_only_innodb.result index d028e3cc207..690de085bf9 100644 --- a/mysql-test/r/read_only_innodb.result +++ b/mysql-test/r/read_only_innodb.result @@ -16,3 +16,33 @@ ERROR HY000: The MySQL server is running with the --read-only option so it canno set global read_only=0; drop table table_11733 ; drop user test@localhost; +GRANT CREATE, SELECT, DROP ON *.* TO test@localhost; +CREATE TABLE t1(a INT) ENGINE=INNODB; +INSERT INTO t1 VALUES (0), (1); +SET GLOBAL read_only=1; +SELECT * FROM t1; +a +0 +1 +BEGIN; +SELECT * FROM t1; +a +0 +1 +COMMIT; +SET GLOBAL read_only=0; +FLUSH TABLES WITH READ LOCK; +SELECT * FROM t1; +a +0 +1 +BEGIN; +SELECT * FROM t1; +a +0 +1 +COMMIT; +UNLOCK TABLES; +DROP TABLE t1; +DROP USER test@localhost; +echo End of 5.1 tests diff --git a/mysql-test/t/read_only_innodb.test b/mysql-test/t/read_only_innodb.test index 76d9748aa60..f8c25fdee1d 100644 --- a/mysql-test/t/read_only_innodb.test +++ b/mysql-test/t/read_only_innodb.test @@ -41,3 +41,45 @@ set global read_only=0; drop table table_11733 ; drop user test@localhost; +disconnect con1; + +# +# Bug #35732: read-only blocks SELECT statements in InnoDB +# +# Test 1: read only mode +GRANT CREATE, SELECT, DROP ON *.* TO test@localhost; +connect(con1, localhost, test, , test); + +connection default; +CREATE TABLE t1(a INT) ENGINE=INNODB; +INSERT INTO t1 VALUES (0), (1); +SET GLOBAL read_only=1; + +connection con1; +SELECT * FROM t1; +BEGIN; +SELECT * FROM t1; +COMMIT; + +connection default; +SET GLOBAL read_only=0; + +# +# Test 2: global read lock +# +FLUSH TABLES WITH READ LOCK; + +connection con1; +SELECT * FROM t1; +BEGIN; +SELECT * FROM t1; +COMMIT; + +connection default; +UNLOCK TABLES; +DROP TABLE t1; +DROP USER test@localhost; + +disconnect con1; + +--echo echo End of 5.1 tests diff --git a/sql/handler.cc b/sql/handler.cc index b334e003851..6099faa929f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -952,16 +952,21 @@ int ha_prepare(THD *thd) A helper function to evaluate if two-phase commit is mandatory. As a side effect, propagates the read-only/read-write flags of the statement transaction to its enclosing normal transaction. + + If we have at least two engines with read-write changes we must + run a two-phase commit. Otherwise we can run several independent + commits as the only transactional engine has read-write changes + and others are read-only. - @retval TRUE we must run a two-phase commit. Returned - if we have at least two engines with read-write changes. - @retval FALSE Don't need two-phase commit. Even if we have two - transactional engines, we can run two independent - commits if changes in one of the engines are read-only. + @retval 0 All engines are read-only. + @retval 1 We have the only engine with read-write changes. + @retval >1 More than one engine have read-write changes. + Note: return value might NOT be the exact number of + engines with read-write changes. */ static -bool +uint ha_check_and_coalesce_trx_read_only(THD *thd, Ha_trx_info *ha_list, bool all) { @@ -998,7 +1003,7 @@ ha_check_and_coalesce_trx_read_only(THD *thd, Ha_trx_info *ha_list, break; } } - return rw_ha_count > 1; + return rw_ha_count; } @@ -1061,25 +1066,8 @@ int ha_commit_trans(THD *thd, bool all) #ifdef USING_TRANSACTIONS if (ha_info) { - bool must_2pc; - - if (is_real_trans && wait_if_global_read_lock(thd, 0, 0)) - { - ha_rollback_trans(thd, all); - DBUG_RETURN(1); - } - - if ( is_real_trans - && opt_readonly - && ! (thd->security_ctx->master_access & SUPER_ACL) - && ! thd->slave_thread - ) - { - my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only"); - ha_rollback_trans(thd, all); - error= 1; - goto end; - } + uint rw_ha_count; + bool rw_trans; DBUG_EXECUTE_IF("crash_commit_before", abort();); @@ -1087,9 +1075,29 @@ int ha_commit_trans(THD *thd, bool all) if (is_real_trans) /* not a statement commit */ thd->stmt_map.close_transient_cursors(); - must_2pc= ha_check_and_coalesce_trx_read_only(thd, ha_info, all); + rw_ha_count= ha_check_and_coalesce_trx_read_only(thd, ha_info, all); + /* rw_trans is TRUE when we in a transaction changing data */ + rw_trans= is_real_trans && (rw_ha_count > 0); - if (!trans->no_2pc && must_2pc) + if (rw_trans && + wait_if_global_read_lock(thd, 0, 0)) + { + ha_rollback_trans(thd, all); + DBUG_RETURN(1); + } + + if (rw_trans && + opt_readonly && + !(thd->security_ctx->master_access & SUPER_ACL) && + !thd->slave_thread) + { + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only"); + ha_rollback_trans(thd, all); + error= 1; + goto end; + } + + if (!trans->no_2pc && (rw_ha_count > 1)) { for (; ha_info && !error; ha_info= ha_info->next()) { @@ -1129,7 +1137,7 @@ int ha_commit_trans(THD *thd, bool all) tc_log->unlog(cookie, xid); DBUG_EXECUTE_IF("crash_commit_after", abort();); end: - if (is_real_trans) + if (rw_trans) start_waiting_global_read_lock(thd); } #endif /* USING_TRANSACTIONS */ diff --git a/sql/lock.cc b/sql/lock.cc index a0d6faa6604..675b94c2175 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -1533,6 +1533,7 @@ void start_waiting_global_read_lock(THD *thd) if (unlikely(thd->global_read_lock)) DBUG_VOID_RETURN; (void) pthread_mutex_lock(&LOCK_global_read_lock); + DBUG_ASSERT(protect_against_global_read_lock); tmp= (!--protect_against_global_read_lock && (waiting_for_read_lock || global_read_lock_blocks_commit)); (void) pthread_mutex_unlock(&LOCK_global_read_lock); From 725d07d559d4f0922dabd450f32ec0a4415fb8ee Mon Sep 17 00:00:00 2001 From: "aelkin/andrei@mysql1000.(none)" <> Date: Tue, 8 Apr 2008 10:43:00 +0300 Subject: [PATCH 10/11] Bug #35762 Failing CREATE-SELECT steels Table map of the following query Among two claimed artifacts the critical one is in that the Table map of a query following the failing with a duplicate key error CREATE-SELECT is skipped from instantionating (and thus binlogging). That leads to sending a "chopped" group of the data row-events without the table map head to the slave. The slave can not apply the only data row events. It's not easy to force the slave to react with an error in such a case (the second complaint on the bug report), because the lack of a table Rows_log_event::do_apply_event the data row event handler is a common situation which normally designates the event has to be filtered out basing on the repliation do/ingore rules decision. Fixed: table map creating and binlogging is restored via deploying the standard cleanup call in select_create::abort(). No error is reported if by chance the table map was not been binlogged. Leaving this out to resolve with considering how to combine the do/ingore rules with the situation when erronoulsy the Table_map is not written to binlog. --- .../suite/rpl/r/rpl_row_create_table.result | 14 ++++++++++ .../suite/rpl/t/rpl_row_create_table.test | 27 +++++++++++++++++++ sql/sql_insert.cc | 2 +- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result index ebfb576c42d..c4cf8353bca 100644 --- a/mysql-test/suite/rpl/r/rpl_row_create_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result @@ -417,3 +417,17 @@ Log_name Pos Event_type Server_id End_log_pos Info SELECT * FROM t2 ORDER BY a; a DROP TABLE t1,t2; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(1); +CREATE TABLE t2 (a INT UNIQUE) ENGINE=INNODB SELECT * FROM t1; +ERROR 23000: Duplicate entry '1' for key 'a' +INSERT INTO t1 VALUES (2); +*** the proof of the fix: +select must show that the last insert performed on the slave *** +SELECT * FROM t1; +a +1 +1 +2 +DROP TABLE t1; +end of the tests diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test index bfeb939f30f..e5cdfa4341a 100644 --- a/mysql-test/suite/rpl/t/rpl_row_create_table.test +++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test @@ -234,3 +234,30 @@ SELECT * FROM t2 ORDER BY a; connection master; DROP TABLE t1,t2; sync_slave_with_master; + +# +# bug#35762 Failing CREATE-SELECT produces bad binlog in row mode +# + +connection master; + +CREATE TABLE t1 (a INT); + +INSERT INTO t1 VALUES (1),(1); +--error ER_DUP_ENTRY +CREATE TABLE t2 (a INT UNIQUE) ENGINE=INNODB SELECT * FROM t1; +INSERT INTO t1 VALUES (2); + +sync_slave_with_master; +# connection slave; + +--echo *** the proof of the fix: +--echo select must show that the last insert performed on the slave *** +SELECT * FROM t1; + +connection master; +DROP TABLE t1; +sync_slave_with_master; + + +--echo end of the tests diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 89038bacda3..d1e5c26912d 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -3720,7 +3720,7 @@ void select_create::abort() select_insert::abort(); thd->transaction.stmt.modified_non_trans_table= FALSE; reenable_binlog(thd); - + thd->binlog_flush_pending_rows_event(TRUE); if (m_plock) { From 9b6ac078f68061175cdfea7c43385c989e164697 Mon Sep 17 00:00:00 2001 From: "kent/mysqldev@mysql.com/production.mysql.com" <> Date: Tue, 8 Apr 2008 11:44:18 +0200 Subject: [PATCH 11/11] Makefile.am: Add ChangeLog if it exists - Removed separate 'normal+rowrepl' test run, not needed any longer - Removed separate 'rpl' test run, included in main test run already - Renamed some test "comments", to use similar naming style - Limited one of the Cluster test runs to 'ndb' and 'rpl_ndb' suites - Reordered test runs, to be aligned with Windows test runs mysql.spec.sh: - No longer including the "Example" storage engine - Added to configure "--without-ENGINE" if not to compile engine as plugin --- Docs/Makefile.am | 19 +++++++++++++--- Makefile.am | 43 ++++++++++++++++--------------------- support-files/mysql.spec.sh | 6 ++++-- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/Docs/Makefile.am b/Docs/Makefile.am index 629618609a3..24f921a4877 100644 --- a/Docs/Makefile.am +++ b/Docs/Makefile.am @@ -19,11 +19,24 @@ EXTRA_DIST = mysql.info INSTALL-BINARY @extra_docs@ # automake only seems to take care of this automatically, # if we're building the info page from texi directly. install-data-hook: $(srcdir)/mysql.info - $(mkinstalldirs) $(DESTDIR)$(infodir) - $(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir) + if test `basename $(prefix)` = "mysql" ; then \ + $(mkinstalldirs) $(DESTDIR)$(prefix)/docs ; \ + $(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(prefix)/docs ; \ + test ! -f $(top_srcdir)/ChangeLog || $(INSTALL_DATA) $(top_srcdir)/ChangeLog $(DESTDIR)$(prefix)/docs ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(pkgdatadir) ; \ + $(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir) ; \ + test ! -f $(top_srcdir)/ChangeLog || $(INSTALL_DATA) $(top_srcdir)/ChangeLog $(DESTDIR)$(pkgdatadir) ; \ + fi uninstall-local: - @RM@ -f $(DESTDIR)$(infodir)/mysql.info + if test `basename $(prefix)` = "mysql" ; then \ + @RM@ -f $(DESTDIR)$(prefix)/docs/mysql.info ; \ + @RM@ -f $(DESTDIR)$(prefix)/docs/ChangeLog ; \ + else \ + @RM@ -f $(DESTDIR)$(infodir)/mysql.info ; \ + @RM@ -f $(DESTDIR)$(pkgdatadir)/ChangeLog ; \ + fi # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/Makefile.am b/Makefile.am index f999df86acf..60b4f9bd07c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -132,20 +132,33 @@ test-bt: -cd mysql-test ; MTR_BUILD_THREAD=auto \ @PERL@ ./mysql-test-run.pl --comment=ps --force --timer \ --skip-ndbcluster --ps-protocol - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=normal+rowrepl --force --timer \ - --skip-ndbcluster --mysqld=--binlog-format=row -if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \ cd mysql-test ; \ MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=ps+rowrepl+NDB --force --timer \ - --ps-protocol --mysqld=--binlog-format=row ; \ + @PERL@ ./mysql-test-run.pl --comment=ndb+rpl_ndb+ps --force --timer \ + --ps-protocol --mysqld=--binlog-format=row --suite=ndb,rpl_ndb ; \ MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=NDB --force --timer \ + @PERL@ ./mysql-test-run.pl --comment=ndb --force --timer \ --with-ndbcluster-only ; \ else \ echo "no program found for 'ndbcluster' tests - skipped testing" ; \ fi + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --force --comment=funcs1+ps --ps-protocol --suite=funcs_1 + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2 + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress + -if [ -d mysql-test/suite/nist ] ; then \ + cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=nist --force --suite=nist ; \ + fi + -if [ -d mysql-test/suite/nist ] ; then \ + cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=nist+ps --force --suite=nist --ps-protocol ; \ + fi -if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \ cd mysql-test ; MTR_BUILD_THREAD=auto \ @PERL@ ./mysql-test-run.pl --comment=embedded --force --timer \ @@ -153,24 +166,6 @@ test-bt: else \ echo "no program found for 'embedded' tests - skipped testing" ; \ fi - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --suite=funcs_1 - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2 - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=rpl --suite=rpl - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts - -if [ -d mysql-test/suite/nist ] ; then \ - cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=NIST+normal --force --suite=nist ; \ - fi - -if [ -d mysql-test/suite/nist ] ; then \ - cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=NIST+ps --force --suite=nist --ps-protocol ; \ - fi - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress # Re-enable the "jp" suite when bug#28563 is fixed # -cd mysql-test ; MTR_BUILD_THREAD=auto \ diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 7f7674eefc9..5cbd85c62b4 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -341,7 +341,6 @@ BuildMySQL "--enable-shared \ %endif --with-archive-storage-engine \ --with-csv-storage-engine \ - --with-example-storage-engine \ --with-blackhole-storage-engine \ %if %{FEDERATED_BUILD} --with-federated-storage-engine \ @@ -373,13 +372,16 @@ BuildMySQL "--enable-shared \ --with-innodb \ %if %{CLUSTER_BUILD} --with-ndbcluster \ +%else + --without-ndbcluster \ %endif --with-archive-storage-engine \ --with-csv-storage-engine \ - --with-example-storage-engine \ --with-blackhole-storage-engine \ %if %{FEDERATED_BUILD} --with-federated-storage-engine \ +%else + --without-federated-storage-engine \ %endif --with-partition \ --with-embedded-server \