From a85bebb3c4608b4133d5b78f3eef895f839f10d6 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Fri, 13 Nov 2009 21:32:29 +0100 Subject: [PATCH 01/27] Solve a "make" rule issue in the context of dtarce and shared objects: Replace a correct dependency in "storage/Makefile.am" (which "make" cannot handle correctly, because it is to a "libtool" convenience module) by a hack which it should. --- storage/archive/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/archive/Makefile.am b/storage/archive/Makefile.am index 143d684025e..871acd673d1 100644 --- a/storage/archive/Makefile.am +++ b/storage/archive/Makefile.am @@ -80,6 +80,9 @@ ha_archive_la_DEPENDENCIES = probes_sh_mysql.o dtrace_shared_files dtrace_provid CLEANFILES = $(DTRACEPROVIDER) dtrace_files dtrace_providers dtrace_shared_files DTRACEFILES = libarchive_a-ha_archive.o DTRACESHAREDFILES = .libs/ha_archive_la-ha_archive.o +# Hack: We "depend" on ".libs/" but have no rule for it, +# but it is created as a byproduct of the ".lo" +DTRACESHAREDDEPEND = ha_archive_la-ha_archive.lo DTRACEPROVIDER = probes_mysql.d dtrace_files: @@ -93,7 +96,7 @@ probes_mysql.d: $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d echo timestamp > dtrace_sources -probes_sh_mysql.o: $(DTRACEPROVIDER) $(DTRACESHAREDFILES) +probes_sh_mysql.o: $(DTRACEPROVIDER) $(DTRACESHAREDDEPEND) $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACESHAREDFILES) -o $@ probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES) From 3ae5a3034a4444ae43128be9ad976909dcc3e5a5 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Fri, 13 Nov 2009 23:07:41 +0100 Subject: [PATCH 02/27] Add missing cleanup, needed for "make distcheck" to succeed. --- storage/archive/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/archive/Makefile.am b/storage/archive/Makefile.am index 871acd673d1..bb88ff2e8d1 100644 --- a/storage/archive/Makefile.am +++ b/storage/archive/Makefile.am @@ -77,7 +77,7 @@ libarchive_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers ha_archive_la_LIBADD = probes_sh_mysql.o ha_archive_la_DEPENDENCIES = probes_sh_mysql.o dtrace_shared_files dtrace_providers -CLEANFILES = $(DTRACEPROVIDER) dtrace_files dtrace_providers dtrace_shared_files +CLEANFILES = $(DTRACEPROVIDER) dtrace_files dtrace_providers dtrace_shared_files dtrace_sources DTRACEFILES = libarchive_a-ha_archive.o DTRACESHAREDFILES = .libs/ha_archive_la-ha_archive.o # Hack: We "depend" on ".libs/" but have no rule for it, From b0c7053192de1c7b2183814b4d2077b8441369c8 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 16 Nov 2009 19:36:55 +0100 Subject: [PATCH 03/27] In a C file, use C style comments and not C++ style. --- mysys/typelib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/typelib.c b/mysys/typelib.c index a0fe8a96a89..cb72c91e20d 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -184,7 +184,7 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err) i= x; while (*x && *x != field_separator) x++; - if (x[0] && x[1]) // skip separator if found + if (x[0] && x[1]) /* skip separator if found */ x++; if ((find= find_type(i, lib, 2 | 8) - 1) < 0) DBUG_RETURN(0); From 4bf94dec9b4e523106961f561f13c3b4ad37b38d Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 17 Nov 2009 13:55:42 +0100 Subject: [PATCH 04/27] The "hash_*" functions have got a prefix "my_" in 2008. Recently, the "#define" directives mapping the old names to the new ones have been removed, so now all callers must use the new names. This change was missing in the DB2 storage handler modules. --- storage/ibmdb2i/db2i_charsetSupport.cc | 12 ++++++------ storage/ibmdb2i/ha_ibmdb2i.cc | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/storage/ibmdb2i/db2i_charsetSupport.cc b/storage/ibmdb2i/db2i_charsetSupport.cc index 83bf1b9448b..f5a3a74025e 100644 --- a/storage/ibmdb2i/db2i_charsetSupport.cc +++ b/storage/ibmdb2i/db2i_charsetSupport.cc @@ -164,10 +164,10 @@ int32 initCharsetSupport() } VOID(pthread_mutex_init(&textDescMapHashMutex,MY_MUTEX_INIT_FAST)); - hash_init(&textDescMapHash, &my_charset_bin, 10, offsetof(TextDescMap, hashKey), sizeof(TextDescMap::hashKey), 0, 0, HASH_UNIQUE); + my_hash_init(&textDescMapHash, &my_charset_bin, 10, offsetof(TextDescMap, hashKey), sizeof(TextDescMap::hashKey), 0, 0, HASH_UNIQUE); VOID(pthread_mutex_init(&iconvMapHashMutex,MY_MUTEX_INIT_FAST)); - hash_init(&iconvMapHash, &my_charset_bin, 10, offsetof(IconvMap, hashKey), sizeof(IconvMap::hashKey), 0, 0, HASH_UNIQUE); + my_hash_init(&iconvMapHash, &my_charset_bin, 10, offsetof(IconvMap, hashKey), sizeof(IconvMap::hashKey), 0, 0, HASH_UNIQUE); init_alloc_root(&textDescMapMemroot, 2048, 0); init_alloc_root(&iconvMapMemroot, 256, 0); @@ -191,9 +191,9 @@ void doneCharsetSupport() free_root(&iconvMapMemroot, 0); pthread_mutex_destroy(&textDescMapHashMutex); - hash_free(&textDescMapHash); + my_hash_free(&textDescMapHash); pthread_mutex_destroy(&iconvMapHashMutex); - hash_free(&iconvMapHash); + my_hash_free(&iconvMapHash); free_aligned(QlgCvtTextDescToDesc_sym); } @@ -415,7 +415,7 @@ static int32 convertTextDesc(const int32 inType, const int32 outType, const char memcpy(hashKey.inDesc, inDescOverride, len); memset(hashKey.inDesc+len, 0, sizeof(hashKey.inDesc) - len); - if (!(mapping=(TextDescMap *) hash_search(&textDescMapHash, + if (!(mapping=(TextDescMap *) my_hash_search(&textDescMapHash, (const uchar*)&hashKey, sizeof(hashKey)))) { @@ -748,7 +748,7 @@ int32 getConversion(enum_conversionDirection direction, const CHARSET_INFO* cs, /* Look for the conversion in the cache and add it if it is not there. */ IconvMap *mapping; - if (!(mapping= (IconvMap *) hash_search(&iconvMapHash, + if (!(mapping= (IconvMap *) my_hash_search(&iconvMapHash, (const uchar*)&hashKey, sizeof(hashKey)))) { diff --git a/storage/ibmdb2i/ha_ibmdb2i.cc b/storage/ibmdb2i/ha_ibmdb2i.cc index 0fc2d1e83dc..759562e3217 100644 --- a/storage/ibmdb2i/ha_ibmdb2i.cc +++ b/storage/ibmdb2i/ha_ibmdb2i.cc @@ -284,8 +284,8 @@ static int ibmdb2i_init_func(void *p) was_ILE_inited = false; ibmdb2i_hton= (handlerton *)p; VOID(pthread_mutex_init(&ibmdb2i_mutex,MY_MUTEX_INIT_FAST)); - (void) hash_init(&ibmdb2i_open_tables,system_charset_info,32,0,0, - (hash_get_key) ibmdb2i_get_key,0,0); + (void) my_hash_init(&ibmdb2i_open_tables,system_charset_info,32,0,0, + (my_hash_get_key) ibmdb2i_get_key,0,0); ibmdb2i_hton->state= SHOW_OPTION_YES; ibmdb2i_hton->create= ibmdb2i_create_handler; @@ -340,7 +340,7 @@ static int ibmdb2i_done_func(void *p) doneCharsetSupport(); - hash_free(&ibmdb2i_open_tables); + my_hash_free(&ibmdb2i_open_tables); pthread_mutex_destroy(&ibmdb2i_mutex); DBUG_RETURN(0); @@ -356,7 +356,7 @@ IBMDB2I_SHARE *ha_ibmdb2i::get_share(const char *table_name, TABLE *table) pthread_mutex_lock(&ibmdb2i_mutex); length=(uint) strlen(table_name); - if (!(share=(IBMDB2I_SHARE*) hash_search(&ibmdb2i_open_tables, + if (!(share=(IBMDB2I_SHARE*) my_hash_search(&ibmdb2i_open_tables, (uchar*)table_name, length))) { @@ -387,7 +387,7 @@ IBMDB2I_SHARE *ha_ibmdb2i::get_share(const char *table_name, TABLE *table) if (rc) { delete share->db2Table; - hash_delete(&ibmdb2i_open_tables, (uchar*) share); + my_hash_delete(&ibmdb2i_open_tables, (uchar*) share); thr_lock_delete(&share->lock); my_errno = rc; goto error; @@ -420,7 +420,7 @@ int ha_ibmdb2i::free_share(IBMDB2I_SHARE *share) delete share->db2Table; db2Table = NULL; - hash_delete(&ibmdb2i_open_tables, (uchar*) share); + my_hash_delete(&ibmdb2i_open_tables, (uchar*) share); thr_lock_delete(&share->lock); pthread_mutex_destroy(&share->mutex); my_free(share, MYF(0)); From ac0654166f48d834afb8011457e575c557ec3a0f Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 17 Nov 2009 14:35:05 +0100 Subject: [PATCH 05/27] Type change: "fk->name" is no "const char *" any more, rather a "LEX_STRING". To access its string part, the ".str" element must be accessed. This change was missing in "storage/ibmdb2i/db2i_constraints.cc", add it now. --- storage/ibmdb2i/db2i_constraints.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/ibmdb2i/db2i_constraints.cc b/storage/ibmdb2i/db2i_constraints.cc index 9a96eda1173..50af6c27898 100644 --- a/storage/ibmdb2i/db2i_constraints.cc +++ b/storage/ibmdb2i/db2i_constraints.cc @@ -102,7 +102,7 @@ int ha_ibmdb2i::buildDB2ConstraintString(LEX* lex, Foreign_key* fk = (Foreign_key*)curKey; char db2LibName[MAX_DB2_SCHEMANAME_LENGTH+1]; - if (fk->name) + if (fk->name.str) { char db2FKName[MAX_DB2_FILENAME_LENGTH+1]; appendHere.append(STRING_WITH_LEN("CONSTRAINT ")); @@ -120,7 +120,7 @@ int ha_ibmdb2i::buildDB2ConstraintString(LEX* lex, appendHere.append('.'); - convertMySQLNameToDB2Name(fk->name, db2FKName, sizeof(db2FKName)); + convertMySQLNameToDB2Name(fk->name.str, db2FKName, sizeof(db2FKName)); appendHere.append(db2FKName); } @@ -139,7 +139,7 @@ int ha_ibmdb2i::buildDB2ConstraintString(LEX* lex, } firstTime = false; - convertMySQLNameToDB2Name(curColumn->field_name, colName, sizeof(colName)); + convertMySQLNameToDB2Name(curColumn->field_name.str, colName, sizeof(colName)); appendHere.append(colName); // DB2 requires that the sort sequence on the child table match the parent table's @@ -148,7 +148,7 @@ int ha_ibmdb2i::buildDB2ConstraintString(LEX* lex, Field** field = fields; do { - if (strcmp((*field)->field_name, curColumn->field_name) == 0) + if (strcmp((*field)->field_name, curColumn->field_name.str) == 0) { int rc = updateAssociatedSortSequence((*field)->charset(), fileSortSequenceType, @@ -199,7 +199,7 @@ int ha_ibmdb2i::buildDB2ConstraintString(LEX* lex, } firstTime = false; - convertMySQLNameToDB2Name(curRef->field_name, colName, sizeof(colName)); + convertMySQLNameToDB2Name(curRef->field_name.str, colName, sizeof(colName)); appendHere.append(colName); } From 41f7c2be26117ac8b6c88386cb12e9d6831511b4 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 17 Nov 2009 17:05:36 +0100 Subject: [PATCH 06/27] Disable WL#4435. Patch done by Alik, received for the 5.5.0-beta release build in mail. --- libmysql/client_settings.h | 3 +-- tests/mysql_client_test.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h index aaec08d1b1e..fa92dfb2687 100644 --- a/libmysql/client_settings.h +++ b/libmysql/client_settings.h @@ -27,8 +27,7 @@ extern char * mysql_unix_port; CLIENT_TRANSACTIONS | \ CLIENT_PROTOCOL_41 | \ CLIENT_SECURE_CONNECTION | \ - CLIENT_MULTI_RESULTS | \ - CLIENT_PS_MULTI_RESULTS) + CLIENT_MULTI_RESULTS) sig_handler my_pipe_sig_handler(int sig); void read_user_name(char *name); diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index cfe401c75f3..aea0f1f6b11 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -19154,7 +19154,7 @@ static struct my_tests_st my_tests[]= { { "test_wl4166_2", test_wl4166_2 }, { "test_wl4166_3", test_wl4166_3 }, { "test_wl4166_4", test_wl4166_4 }, - { "test_wl4435", test_wl4435 }, +/* { "test_wl4435", test_wl4435 }, */ { "test_wl4435_2", test_wl4435_2 }, { "test_bug38486", test_bug38486 }, { "test_bug33831", test_bug33831 }, From 8ff142999d009f7602ae58b6559f05e648bd83f3 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 17 Nov 2009 17:08:37 +0100 Subject: [PATCH 07/27] Fix not_partition.test. Patch done by Alik and received for the 5.5.0-beta build by mail. --- mysql-test/r/not_partition.result | 8 ++++---- mysql-test/t/not_partition.test | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/not_partition.result b/mysql-test/r/not_partition.result index f516f8634ce..4ec37ab9fc7 100644 --- a/mysql-test/r/not_partition.result +++ b/mysql-test/r/not_partition.result @@ -52,9 +52,9 @@ joined DATE NOT NULL ) PARTITION BY KEY(joined) PARTITIONS 6; -ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working +Got one of the listed errors ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2; -ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working +Got one of the listed errors drop table t1; ERROR 42S02: Unknown table 't1' CREATE TABLE t1 ( @@ -71,7 +71,7 @@ PARTITION p2 VALUES LESS THAN (1980), PARTITION p3 VALUES LESS THAN (1990), PARTITION p4 VALUES LESS THAN MAXVALUE ); -ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working +Got one of the listed errors drop table t1; ERROR 42S02: Unknown table 't1' CREATE TABLE t1 (id INT, purchased DATE) @@ -82,7 +82,7 @@ PARTITION p0 VALUES LESS THAN (1990), PARTITION p1 VALUES LESS THAN (2000), PARTITION p2 VALUES LESS THAN MAXVALUE ); -ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working +Got one of the listed errors drop table t1; ERROR 42S02: Unknown table 't1' create table t1 (a varchar(10) charset latin1 collate latin1_bin); diff --git a/mysql-test/t/not_partition.test b/mysql-test/t/not_partition.test index 78ca44acf18..63892845de8 100644 --- a/mysql-test/t/not_partition.test +++ b/mysql-test/t/not_partition.test @@ -31,7 +31,7 @@ ALTER TABLE t1 ENGINE Memory; ALTER TABLE t1 ADD (new INT); DROP TABLE t1; ---error ER_FEATURE_DISABLED +--error ER_FEATURE_DISABLED,ER_OPTION_PREVENTS_STATEMENT CREATE TABLE t1 ( firstname VARCHAR(25) NOT NULL, lastname VARCHAR(25) NOT NULL, @@ -42,13 +42,13 @@ CREATE TABLE t1 ( PARTITION BY KEY(joined) PARTITIONS 6; ---error ER_FEATURE_DISABLED +--error ER_FEATURE_DISABLED,ER_OPTION_PREVENTS_STATEMENT ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2; --error ER_BAD_TABLE_ERROR drop table t1; ---error ER_FEATURE_DISABLED +--error ER_FEATURE_DISABLED,ER_OPTION_PREVENTS_STATEMENT CREATE TABLE t1 ( firstname VARCHAR(25) NOT NULL, lastname VARCHAR(25) NOT NULL, @@ -66,7 +66,7 @@ PARTITION BY RANGE( YEAR(joined) ) ( --error ER_BAD_TABLE_ERROR drop table t1; ---error ER_FEATURE_DISABLED +--error ER_FEATURE_DISABLED,ER_OPTION_PREVENTS_STATEMENT CREATE TABLE t1 (id INT, purchased DATE) PARTITION BY RANGE( YEAR(purchased) ) SUBPARTITION BY HASH( TO_DAYS(purchased) ) From 1da38990cb81e693c24bc8d06a8bf95abb482bcf Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Tue, 17 Nov 2009 17:19:00 +0100 Subject: [PATCH 08/27] Change the control structures which the RPM spec file uses to govern the inclusion of a separate malloc library (used for Google's "tcmalloc") to follow the pattern used for other optional parts. This is still experimental, there are some "rpmbuild" issues around this. --- support-files/mysql.spec.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 239611c0b53..6e68e5ee702 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -43,6 +43,12 @@ %{?_with_cluster:%define CLUSTER_BUILD 1} %{!?_with_cluster:%define CLUSTER_BUILD 0} +# ---------------------------------------------------------------------- +# support optional "tcmalloc" stuff (experimental) +# ---------------------------------------------------------------------- +%{?malloc_lib_target:%define WITH_TCMALLOC 1} +%{!?malloc_lib_target:%define WITH_TCMALLOC 0} + %if %{STATIC_BUILD} %define release 0 %else @@ -448,7 +454,7 @@ $MBD/libtool --mode=execute install -m 755 \ $RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-debug-%{mysql_version}/sql/mysqld \ $RBR%{_sbindir}/mysqld-debug -%if %{?malloc_lib_target:1}%{!?malloc_lib_target:0} +%if %{WITH_TCMALLOC} # Even though this is a shared library, put it under /usr/lib/mysql, so it # doesn't conflict with possible shared lib by the same name in /usr/lib. See # `mysql_config --variable=pkglibdir` and mysqld_safe for how this is used. @@ -714,7 +720,7 @@ fi %attr(755, root, root) %{_libdir}/mysql/plugin/ha_innodb_plugin.so* %endif -%if %{?malloc_lib_target:1}%{!?malloc_lib_target:0} +%if %{WITH_TCMALLOC} %attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target} %endif @@ -878,6 +884,10 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Mon Nov 16 2009 Joerg Bruehe + +- Fix some problems with the directives around "tcmalloc" (experimental). + * Fri Oct 02 2009 Alexander Nozdrin - "mysqlmanager" got removed from version 5.4, all references deleted. From 63a044f31f0eaef2ef654761006c548ddc44e159 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Wed, 18 Nov 2009 11:42:20 +0100 Subject: [PATCH 09/27] Remove erroneous traces of the InnoDB plugin (that is 5.1 only) from the "spec" file for generic RPMs. --- support-files/mysql.spec.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 6e68e5ee702..7813b35b32a 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -715,10 +715,6 @@ fi %attr(755, root, root) %{_bindir}/resolveip %attr(755, root, root) %{_libdir}/mysql/plugin/ha_example.so* -%if %{WITHOUT_INNODB_PLUGIN} -%else -%attr(755, root, root) %{_libdir}/mysql/plugin/ha_innodb_plugin.so* -%endif %if %{WITH_TCMALLOC} %attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target} @@ -850,11 +846,6 @@ fi %{_libdir}/mysql/libz.la %{_libdir}/mysql/plugin/ha_example.a %{_libdir}/mysql/plugin/ha_example.la -%if %{WITHOUT_INNODB_PLUGIN} -%else -%{_libdir}/mysql/plugin/ha_innodb_plugin.a -%{_libdir}/mysql/plugin/ha_innodb_plugin.la -%endif %files shared %defattr(-, root, root, 0755) @@ -886,7 +877,8 @@ fi %changelog * Mon Nov 16 2009 Joerg Bruehe -- Fix some problems with the directives around "tcmalloc" (experimental). +- Fix some problems with the directives around "tcmalloc" (experimental), + remove erroneous traces of the InnoDB plugin (that is 5.1 only). * Fri Oct 02 2009 Alexander Nozdrin From 4746239b371b058535078e55970280c4bd8320a2 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 26 Nov 2009 19:55:33 +0100 Subject: [PATCH 10/27] Handle the "semisync" plugin in - binary distributions for Windows, - "generic" RPM packages. --- scripts/make_win_bin_dist | 19 +++++++++++++++++++ support-files/mysql.spec.sh | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index bf148c45150..34d9c560006 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -290,6 +290,11 @@ if [ -d storage/innodb_plugin ]; then cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.dll \ $DESTDIR/lib/plugin/ fi +if [ -d plugin/semisync ]; then + cp plugin/semisync/$TARGET/semisync_master.dll \ + plugin/semisync/$TARGET/semisync_slave.dll \ + $DESTDIR/lib/plugin/ +fi if [ x"$TARGET" != x"release" ] ; then cp libmysql/$TARGET/libmysql.pdb \ @@ -302,6 +307,11 @@ if [ x"$TARGET" != x"release" ] ; then cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.pdb \ $DESTDIR/lib/plugin/ fi + if [ -d plugin/semisync ]; then + cp plugin/semisync/$TARGET/semisync_master.pdb \ + plugin/semisync/$TARGET/semisync_slave.pdb \ + $DESTDIR/lib/plugin/ + fi fi @@ -328,6 +338,15 @@ if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \ storage/innodb_plugin/debug/ha_innodb_plugin.pdb \ $DESTDIR/lib/plugin/debug/ fi + if [ -d plugin/semisync ]; then + cp plugin/semisync/debug/semisync_master.dll \ + plugin/semisync/debug/semisync_master.lib \ + plugin/semisync/debug/semisync_master.pdb \ + plugin/semisync/debug/semisync_slave.dll \ + plugin/semisync/debug/semisync_slave.lib \ + plugin/semisync/debug/semisync_slave.pdb \ + $DESTDIR/lib/plugin/debug/ + fi fi # ---------------------------------------------------------------------- diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 7813b35b32a..83d4550466b 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -715,6 +715,8 @@ fi %attr(755, root, root) %{_bindir}/resolveip %attr(755, root, root) %{_libdir}/mysql/plugin/ha_example.so* +%attr(755, root, root) %{_libdir}/mysql/plugin/libsemisync_master.so* +%attr(755, root, root) %{_libdir}/mysql/plugin/libsemisync_slave.so* %if %{WITH_TCMALLOC} %attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target} @@ -835,6 +837,7 @@ fi %{_libdir}/mysql/libmysqlclient.la %{_libdir}/mysql/libmysqlclient_r.a %{_libdir}/mysql/libmysqlclient_r.la +%{_libdir}/mysql/libmysqlservices.a %{_libdir}/mysql/libmystrings.a %{_libdir}/mysql/libmysys.a %if %{CLUSTER_BUILD} @@ -846,6 +849,10 @@ fi %{_libdir}/mysql/libz.la %{_libdir}/mysql/plugin/ha_example.a %{_libdir}/mysql/plugin/ha_example.la +%{_libdir}/mysql/plugin/libsemisync_master.a +%{_libdir}/mysql/plugin/libsemisync_master.la +%{_libdir}/mysql/plugin/libsemisync_slave.a +%{_libdir}/mysql/plugin/libsemisync_slave.la %files shared %defattr(-, root, root, 0755) From 886a489bc3ad882ebf52bce1e496f2b28d427133 Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Fri, 27 Nov 2009 16:49:45 +0800 Subject: [PATCH 11/27] Bug#48351 Inconsistent library names for semisync plugin The semisync plugin library names on Unix like systems were prefixed with 'lib', which did not follow the conventions. Fix the problem by removing the 'lib' prefix on Unix systems. mysql-test/mysql-test-run.pl: Remove 'lib' prefix for semisync plugin library names plugin/semisync/Makefile.am: Remove 'lib' prefix for semisync plugin library names plugin/semisync/plug.in: Remove 'lib' prefix for semisync plugin library names --- mysql-test/mysql-test-run.pl | 4 ++-- plugin/semisync/Makefile.am | 18 +++++++++--------- plugin/semisync/plug.in | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 6f3822cfd85..ddee67c124e 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1828,8 +1828,8 @@ sub environment_setup { } else { - $semisync_master_filename = "libsemisync_master.so"; - $semisync_slave_filename = "libsemisync_slave.so"; + $semisync_master_filename = "semisync_master.so"; + $semisync_slave_filename = "semisync_slave.so"; } my $lib_semisync_master_plugin= mtr_file_exists(vs_config_dirs('plugin/semisync',$semisync_master_filename), diff --git a/plugin/semisync/Makefile.am b/plugin/semisync/Makefile.am index 25949485987..27ff89aae88 100644 --- a/plugin/semisync/Makefile.am +++ b/plugin/semisync/Makefile.am @@ -23,16 +23,16 @@ INCLUDES = -I$(top_srcdir)/include \ noinst_HEADERS = semisync.h semisync_master.h semisync_slave.h -pkgplugin_LTLIBRARIES = libsemisync_master.la libsemisync_slave.la +pkgplugin_LTLIBRARIES = semisync_master.la semisync_slave.la -libsemisync_master_la_LDFLAGS = -module -libsemisync_master_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN -libsemisync_master_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN -libsemisync_master_la_SOURCES = semisync.cc semisync_master.cc semisync_master_plugin.cc +semisync_master_la_LDFLAGS = -module +semisync_master_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +semisync_master_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +semisync_master_la_SOURCES = semisync.cc semisync_master.cc semisync_master_plugin.cc -libsemisync_slave_la_LDFLAGS = -module -libsemisync_slave_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN -libsemisync_slave_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN -libsemisync_slave_la_SOURCES = semisync.cc semisync_slave.cc semisync_slave_plugin.cc +semisync_slave_la_LDFLAGS = -module +semisync_slave_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +semisync_slave_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +semisync_slave_la_SOURCES = semisync.cc semisync_slave.cc semisync_slave_plugin.cc EXTRA_DIST= CMakeLists.txt plug.in diff --git a/plugin/semisync/plug.in b/plugin/semisync/plug.in index 917c8950f02..82bd9772644 100644 --- a/plugin/semisync/plug.in +++ b/plugin/semisync/plug.in @@ -1,3 +1,3 @@ MYSQL_PLUGIN(semisync,[Semi-synchronous Replication Plugin], [Semi-synchronous replication plugin.]) -MYSQL_PLUGIN_DYNAMIC(semisync, [libsemisync_master.la libsemisync_slave.la]) +MYSQL_PLUGIN_DYNAMIC(semisync, [semisync_master.la semisync_slave.la]) From e8bea38238d7240571dbdbcd5aee25b9141b7c28 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Thu, 3 Dec 2009 13:31:56 +0100 Subject: [PATCH 12/27] Bug#49369: No testcase for key caches on partitions The original test case was lost when merging WL#4571. Added the testcase. mysql-test/include/check_key_reads.inc: Bug#49369: No testcase for key caches on partitions New include file for testing key caches on partitions WL#4571 mysql-test/include/check_key_req.inc: Bug#49369: No testcase for key caches on partitions New include file for testing key caches on partitions WL#4571 mysql-test/r/partition_key_cache.result: Bug#49369: No testcase for key caches on partitions New test case for testing key caches on partitions WL#4571 mysql-test/t/partition_key_cache.test: Bug#49369: No testcase for key caches on partitions New test case for testing key caches on partitions WL#4571 --- mysql-test/include/check_key_reads.inc | 6 + mysql-test/include/check_key_req.inc | 9 + mysql-test/r/partition_key_cache.result | 420 ++++++++++++++++++++++++ mysql-test/t/partition_key_cache.test | 252 ++++++++++++++ 4 files changed, 687 insertions(+) create mode 100644 mysql-test/include/check_key_reads.inc create mode 100644 mysql-test/include/check_key_req.inc create mode 100644 mysql-test/r/partition_key_cache.result create mode 100644 mysql-test/t/partition_key_cache.test diff --git a/mysql-test/include/check_key_reads.inc b/mysql-test/include/check_key_reads.inc new file mode 100644 index 00000000000..cfb754bccd4 --- /dev/null +++ b/mysql-test/include/check_key_reads.inc @@ -0,0 +1,6 @@ +# include file for checking if variable key_reads is zero +let $key_reads= query_get_value(SHOW STATUS LIKE 'key_reads',Value,1); +--disable_query_log +eval SELECT IF($key_reads = 0, "Yes!", "No!") as 'Zero key reads?'; +FLUSH STATUS; +--enable_query_log diff --git a/mysql-test/include/check_key_req.inc b/mysql-test/include/check_key_req.inc new file mode 100644 index 00000000000..92a81f09d91 --- /dev/null +++ b/mysql-test/include/check_key_req.inc @@ -0,0 +1,9 @@ +# include file for checking if variable key_reads = key_read_requests +let $key_reads= query_get_value(SHOW STATUS LIKE 'key_reads',Value,1); +let $key_r_req= query_get_value(SHOW STATUS LIKE 'key_read_requests',Value,1); +let $key_writes= query_get_value(SHOW STATUS LIKE 'key_writes',Value,1); +let $key_w_req= query_get_value(SHOW STATUS LIKE 'key_write_requests',Value,1); +--disable_query_log +eval SELECT IF($key_reads = $key_r_req, "reads == requests", "reads != requests") as 'reads vs requests'; +eval SELECT IF($key_writes = $key_w_req, "writes == requests", "writes != requests") as 'writes vs requests'; +--enable_query_log diff --git a/mysql-test/r/partition_key_cache.result b/mysql-test/r/partition_key_cache.result new file mode 100644 index 00000000000..c09f277840b --- /dev/null +++ b/mysql-test/r/partition_key_cache.result @@ -0,0 +1,420 @@ +DROP TABLE IF EXISTS t1, t2, v, x; +# Actual test of key caches +# Verifing that reads/writes use the key cache correctly +SELECT @org_key_cache_buffer_size:= @@global.default.key_buffer_size; +@org_key_cache_buffer_size:= @@global.default.key_buffer_size +1048576 +# Minimize default key cache (almost disabled). +SET @@global.default.key_buffer_size = 1; +Warnings: +Warning 1292 Truncated incorrect key_buffer_size value: '1' +SELECT @@global.default.key_buffer_size; +@@global.default.key_buffer_size +36 +CREATE TABLE t1 ( +a INT, +b INT, +c INT NOT NULL, +PRIMARY KEY (a), +KEY `inx_b` (b)) +PARTITION BY RANGE (a) +SUBPARTITION BY HASH (a) +(PARTITION p0 VALUES LESS THAN (1167602410) +(SUBPARTITION sp0, +SUBPARTITION sp1), +PARTITION p1 VALUES LESS THAN MAXVALUE +(SUBPARTITION sp2, +SUBPARTITION sp3)); +CREATE TABLE t2 ( +a INT, +b INT, +c INT NOT NULL, +PRIMARY KEY (a), +KEY `inx_b` (b)); +FLUSH TABLES; +FLUSH STATUS; +SET @a:=1167602400; +CREATE VIEW v AS SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4; +CREATE VIEW x AS SELECT 1 FROM v,v a,v b; +FLUSH STATUS; +INSERT t1 SELECT @a, @a * (1 - ((@a % 2) * 2)) , 1167612400 - (@a:=@a+1) FROM x, x y; +reads vs requests +reads == requests +writes vs requests +writes == requests +# row distribution: +SELECT PARTITION_NAME, SUBPARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA='test' and TABLE_NAME='t1'; +PARTITION_NAME SUBPARTITION_NAME TABLE_ROWS +p0 sp0 5 +p0 sp1 5 +p1 sp2 2043 +p1 sp3 2043 +DROP VIEW x; +DROP VIEW v; +FLUSH TABLES; +FLUSH STATUS; +SELECT COUNT(b) FROM t1 WHERE b >= 0; +COUNT(b) +2048 +Zero key reads? +No! +INSERT t2 SELECT a,b,c FROM t1; +reads vs requests +reads == requests +writes vs requests +writes == requests +FLUSH STATUS; +SELECT COUNT(b) FROM t2 WHERE b >= 0; +COUNT(b) +2048 +Zero key reads? +No! +FLUSH TABLES; +# Setting the default key cache to 1M +SET GLOBAL key_buffer_size = 1024*1024; +FLUSH STATUS; +# All these have to read the indexes +LOAD INDEX INTO CACHE t1 PARTITION (p1); +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +Zero key reads? +No! +SELECT COUNT(b) FROM t1 WHERE b >= 0; +COUNT(b) +2048 +Zero key reads? +No! +SELECT COUNT(b) FROM t2 WHERE b >= 0; +COUNT(b) +2048 +Zero key reads? +No! +# All these should be able to use the key cache +SELECT COUNT(b) FROM t1 WHERE b >= 0; +COUNT(b) +2048 +Zero key reads? +Yes! +SELECT COUNT(b) FROM t2 WHERE b >= 0; +COUNT(b) +2048 +Zero key reads? +Yes! +FLUSH TABLES; +LOAD INDEX INTO CACHE t1 PARTITION (p1,p0); +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +Zero key reads? +No! +# should not be zero +SELECT COUNT(b) FROM t1 WHERE b >= 0; +COUNT(b) +2048 +Zero key reads? +Yes! +LOAD INDEX INTO CACHE t2; +Table Op Msg_type Msg_text +test.t2 preload_keys status OK +Zero key reads? +No! +# should not be zero +SELECT COUNT(b) FROM t2 WHERE b >= 0; +COUNT(b) +2048 +Zero key reads? +Yes! +FLUSH TABLES; +LOAD INDEX INTO CACHE t1 PARTITION (p1,p0) IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +Zero key reads? +No! +# should not be zero +SELECT COUNT(b) FROM t1 WHERE b >= 0; +COUNT(b) +2048 +Zero key reads? +No! +LOAD INDEX INTO CACHE t2 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t2 preload_keys status OK +Zero key reads? +No! +# should not be zero +SELECT COUNT(b) FROM t2 WHERE b >= 0; +COUNT(b) +2048 +Zero key reads? +No! +TRUNCATE TABLE t2; +INSERT t2 SELECT a,b,c FROM t1; +reads vs requests +reads != requests +writes vs requests +writes != requests +DROP TABLE t1,t2; +SET GLOBAL hot_cache.key_buffer_size = 1024*1024; +SET GLOBAL warm_cache.key_buffer_size = 1024*1024; +SET @@global.cold_cache.key_buffer_size = 1024*1024; +SELECT @@global.default.key_buffer_size a, @@global.default.key_cache_block_size b, @@global.default.key_cache_age_threshold c, @@global.default.key_cache_division_limit d; +a b c d +1048576 1024 300 100 +SELECT @@global.hot_cache.key_buffer_size a, @@global.hot_cache.key_cache_block_size b, @@global.hot_cache.key_cache_age_threshold c, @@global.hot_cache.key_cache_division_limit d; +a b c d +1048576 1024 300 100 +SELECT @@global.warm_cache.key_buffer_size a, @@global.warm_cache.key_cache_block_size b, @@global.warm_cache.key_cache_age_threshold c, @@global.warm_cache.key_cache_division_limit d; +a b c d +1048576 1024 300 100 +SELECT @@global.cold_cache.key_buffer_size a, @@global.cold_cache.key_cache_block_size b, @@global.cold_cache.key_cache_age_threshold c, @@global.cold_cache.key_cache_division_limit d; +a b c d +1048576 1024 300 100 +CREATE TABLE t1 ( +a INT, +b VARCHAR(257), +c INT NOT NULL, +PRIMARY KEY (a), +KEY `inx_b` (b), +KEY `inx_c`(c)) +PARTITION BY RANGE (a) +SUBPARTITION BY HASH (a) +(PARTITION p0 VALUES LESS THAN (10) +(SUBPARTITION sp0, +SUBPARTITION sp1), +PARTITION p1 VALUES LESS THAN MAXVALUE +(SUBPARTITION sp2, +SUBPARTITION sp3)); +CREATE TABLE t2 ( +a INT, +b VARCHAR(257), +c INT NOT NULL, +PRIMARY KEY (a), +KEY `inx_b` (b), +KEY `inx_c`(c)); +SET @a:=1167602400; +CREATE VIEW v AS SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4; +CREATE VIEW x AS SELECT 1 FROM v,v a,v b; +INSERT t1 SELECT @a, CONCAT('X_', @a, ' MySQL'), 1167612400 - (@a:=@a+1) FROM x, x a; +DROP VIEW x; +DROP VIEW v; +INSERT t2 SELECT a, b, c FROM t1; +SELECT COUNT(*) FROM t1; +COUNT(*) +4096 +SELECT COUNT(*) FROM t2; +COUNT(*) +4096 +FLUSH TABLES; +# Restrict partitioned commands to partitioned tables only +CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache; +ERROR HY000: Partition management on a not partitioned table is not possible +CACHE INDEX t2 PARTITION (p0,`p1`) INDEX (`PRIMARY`) IN hot_cache; +ERROR HY000: Partition management on a not partitioned table is not possible +CACHE INDEX t2 PARTITION (`p1`) INDEX (`PRIMARY`,`inx_b`) IN hot_cache; +ERROR HY000: Partition management on a not partitioned table is not possible +CACHE INDEX t2 PARTITION (ALL) KEY (`inx_b`,`PRIMARY`) IN hot_cache; +ERROR HY000: Partition management on a not partitioned table is not possible +# Basic key cache testing +# The manual correctly says: "The syntax of CACHE INDEX enables you to +# specify that only particular indexes from a table should be assigned +# to the cache. The current implementation assigns all the table's +# indexes to the cache, so there is no reason to specify anything +# other than the table name." +# So the most of the test only tests the syntax +CACHE INDEX t2 INDEX (`inx_b`) IN hot_cache; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +CACHE INDEX t2 KEY (`PRIMARY`) IN warm_cache; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +CACHE INDEX t2 KEY (`PRIMARY`,`inx_b`) IN cold_cache; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +CACHE INDEX t2 INDEX (inx_b,`PRIMARY`) IN default; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +CACHE INDEX t1 PARTITION (p0) KEY (`inx_b`) IN cold_cache; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +CACHE INDEX t1 PARTITIONS (p0) KEY (`inx_b`) IN cold_cache; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PARTITIONS (p0) KEY (`inx_b`) IN cold_cache' at line 1 +# only one table at a time if specifying partitions +CACHE INDEX t1,t2 PARTITION (p0) KEY (`inx_b`) IN cold_cache; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PARTITION (p0) KEY (`inx_b`) IN cold_cache' at line 1 +CACHE INDEX t1 PARTITION (`p0`,p1) INDEX (`PRIMARY`) IN warm_cache; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +CACHE INDEX t1 PARTITION (`p1`) INDEX (`PRIMARY`,inx_b) IN hot_cache; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +CACHE INDEX t1 PARTITION (ALL) KEY (`inx_b`,`PRIMARY`) IN default; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +CACHE INDEX t1 PARTITION (ALL) IN hot_cache; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +CACHE INDEX t1 INDEX (`inx_b`) IN default; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +CACHE INDEX t1 KEY (`PRIMARY`) IN hot_cache; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +CACHE INDEX t1 KEY (`PRIMARY`,`inx_b`) IN warm_cache; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +CACHE INDEX t1 INDEX (`inx_b`,`PRIMARY`) IN cold_cache; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +CACHE INDEX t1 IN hot_cache; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +# Test of non existent key cache: +CACHE INDEX t1 IN non_existent_key_cache; +ERROR HY000: Unknown key cache 'non_existent_key_cache' +# Basic testing of LOAD INDEX +LOAD INDEX INTO CACHE t2; +Table Op Msg_type Msg_text +test.t2 preload_keys status OK +# PRIMARY and secondary keys have different block sizes +LOAD INDEX INTO CACHE t2 ignore leaves; +Table Op Msg_type Msg_text +test.t2 preload_keys error Indexes use different block sizes +test.t2 preload_keys status Operation failed +# Must have INDEX or KEY before the index list +LOAD INDEX INTO CACHE t2 (`PRIMARY`); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(`PRIMARY`)' at line 1 +# Test of IGNORE LEAVES +LOAD INDEX INTO CACHE t2 INDEX (`PRIMARY`); +Table Op Msg_type Msg_text +test.t2 preload_keys status OK +LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_b`) IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t2 preload_keys error Indexes use different block sizes +test.t2 preload_keys status Operation failed +CACHE INDEX t2 IN warm_cache; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +CACHE INDEX t1 IN cold_cache; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`) IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t2 preload_keys error Indexes use different block sizes +test.t2 preload_keys status Operation failed +CACHE INDEX t2 INDEX (`inx_b`, `inx_c`) IN hot_cache; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +LOAD INDEX INTO CACHE t2 KEY (`inx_b`, `inx_c`) IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t2 preload_keys error Indexes use different block sizes +test.t2 preload_keys status Operation failed +CACHE INDEX t2 IN warm_cache; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +CACHE INDEX t2 INDEX (`PRIMARY`, `inx_c`) IN hot_cache; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_c`) IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t2 preload_keys error Indexes use different block sizes +test.t2 preload_keys status Operation failed +CACHE INDEX t2 INDEX (`inx_b`,`PRIMARY`) IN default; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_b`); +Table Op Msg_type Msg_text +test.t2 preload_keys status OK +CACHE INDEX t2 IN default; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache status OK +LOAD INDEX INTO CACHE t2 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t2 preload_keys error Indexes use different block sizes +test.t2 preload_keys status Operation failed +LOAD INDEX INTO CACHE t2 PARTITION (p1) INDEX (`PRIMARY`); +ERROR HY000: Partition management on a not partitioned table is not possible +LOAD INDEX INTO CACHE t1, t2; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +test.t2 preload_keys status OK +# only one table at a time if specifying partitions +LOAD INDEX INTO CACHE t1 PARTITION (p0), t2; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' t2' at line 1 +LOAD INDEX INTO CACHE t1 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys error Indexes use different block sizes +test.t1 preload_keys error Subpartition sp2 returned error +test.t1 preload_keys status Operation failed +LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`); +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`,`inx_b`) IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys error Indexes use different block sizes +test.t1 preload_keys error Subpartition sp2 returned error +test.t1 preload_keys status Operation failed +LOAD INDEX INTO CACHE t1 INDEX (`inx_b`) IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys error Indexes use different block sizes +test.t1 preload_keys error Subpartition sp2 returned error +test.t1 preload_keys status Operation failed +LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`) IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys error Indexes use different block sizes +test.t1 preload_keys error Subpartition sp2 returned error +test.t1 preload_keys status Operation failed +LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`,`inx_b`); +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +LOAD INDEX INTO CACHE t1 PARTITION (p1) INDEX (`PRIMARY`); +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +LOAD INDEX INTO CACHE t1 PARTITION (`p1`,p0) KEY (`PRIMARY`) IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys error Indexes use different block sizes +test.t1 preload_keys error Subpartition sp2 returned error +test.t1 preload_keys status Operation failed +LOAD INDEX INTO CACHE t1 PARTITION (ALL); +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +LOAD INDEX INTO CACHE t1 PARTITIONS ALL; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PARTITIONS ALL' at line 1 +LOAD INDEX INTO CACHE t1 PARTITION (p1,`p0`) IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys error Indexes use different block sizes +test.t1 preload_keys error Subpartition sp2 returned error +test.t1 preload_keys status Operation failed +DROP INDEX `inx_b` on t1; +DROP INDEX `inx_b` on t2; +CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache; +ERROR HY000: Partition management on a not partitioned table is not possible +CACHE INDEX t2 INDEX (`inx_b`) IN hot_cache; +Table Op Msg_type Msg_text +test.t2 assign_to_keycache Error Key 'inx_b' doesn't exist in table 't2' +test.t2 assign_to_keycache status Operation failed +CACHE INDEX t1 PARTITION (p0) KEY (`inx_b`) IN hot_cache; +Table Op Msg_type Msg_text +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 +CACHE INDEX t1 INDEX (`inx_b`) IN hot_cache; +Table Op Msg_type Msg_text +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; +SET GLOBAL hot_cache.key_buffer_size = 0; +SET GLOBAL warm_cache.key_buffer_size = 0; +SET @@global.cold_cache.key_buffer_size = 0; +SELECT @@global.default.key_buffer_size a, @@global.default.key_cache_block_size b, @@global.default.key_cache_age_threshold c, @@global.default.key_cache_division_limit d; +a b c d +1048576 1024 300 100 +SELECT @@global.hot_cache.key_buffer_size a, @@global.hot_cache.key_cache_block_size b, @@global.hot_cache.key_cache_age_threshold c, @@global.hot_cache.key_cache_division_limit d; +a b c d +0 1024 300 100 +SELECT @@global.warm_cache.key_buffer_size a, @@global.warm_cache.key_cache_block_size b, @@global.warm_cache.key_cache_age_threshold c, @@global.warm_cache.key_cache_division_limit d; +a b c d +0 1024 300 100 +SELECT @@global.cold_cache.key_buffer_size a, @@global.cold_cache.key_cache_block_size b, @@global.cold_cache.key_cache_age_threshold c, @@global.cold_cache.key_cache_division_limit d; +a b c d +0 1024 300 100 +SET @@global.default.key_buffer_size = @org_key_cache_buffer_size; diff --git a/mysql-test/t/partition_key_cache.test b/mysql-test/t/partition_key_cache.test new file mode 100644 index 00000000000..34f3d4de19c --- /dev/null +++ b/mysql-test/t/partition_key_cache.test @@ -0,0 +1,252 @@ +# Test of key cache with partitions +--source include/have_partition.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2, v, x; +--enable_warnings + +--echo # Actual test of key caches +--echo # Verifing that reads/writes use the key cache correctly +SELECT @org_key_cache_buffer_size:= @@global.default.key_buffer_size; +--echo # Minimize default key cache (almost disabled). +SET @@global.default.key_buffer_size = 1; +SELECT @@global.default.key_buffer_size; +CREATE TABLE t1 ( + a INT, + b INT, + c INT NOT NULL, + PRIMARY KEY (a), + KEY `inx_b` (b)) +PARTITION BY RANGE (a) +SUBPARTITION BY HASH (a) +(PARTITION p0 VALUES LESS THAN (1167602410) + (SUBPARTITION sp0, + SUBPARTITION sp1), + PARTITION p1 VALUES LESS THAN MAXVALUE + (SUBPARTITION sp2, + SUBPARTITION sp3)); +CREATE TABLE t2 ( + a INT, + b INT, + c INT NOT NULL, + PRIMARY KEY (a), + KEY `inx_b` (b)); +FLUSH TABLES; +FLUSH STATUS; + +# Genereate 4096 rows. Idea from: +# http://datacharmer.blogspot.com/2007/12/data-from-nothing-solution-to-pop-quiz.html +SET @a:=1167602400; +CREATE VIEW v AS SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4; +CREATE VIEW x AS SELECT 1 FROM v,v a,v b; +# due to I_S performance, this was substituted with include files which +# uses SHOW STATUS +#DELIMITER |; +#CREATE PROCEDURE was_zero_reads() +#BEGIN +# SELECT IF(VARIABLE_VALUE = 0,"Yes!","No!") as 'Was zero reads?' +# FROM INFORMATION_SCHEMA.SESSION_STATUS +# WHERE VARIABLE_NAME = 'KEY_READS'; +# FLUSH STATUS; +#END| +#DELIMITER ;| + +FLUSH STATUS; +INSERT t1 SELECT @a, @a * (1 - ((@a % 2) * 2)) , 1167612400 - (@a:=@a+1) FROM x, x y; +--source include/check_key_req.inc +--echo # row distribution: +SELECT PARTITION_NAME, SUBPARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA='test' and TABLE_NAME='t1'; +DROP VIEW x; +DROP VIEW v; +FLUSH TABLES; +FLUSH STATUS; +SELECT COUNT(b) FROM t1 WHERE b >= 0; +--source include/check_key_reads.inc +INSERT t2 SELECT a,b,c FROM t1; +--source include/check_key_req.inc +FLUSH STATUS; +SELECT COUNT(b) FROM t2 WHERE b >= 0; +--source include/check_key_reads.inc +FLUSH TABLES; +--echo # Setting the default key cache to 1M +SET GLOBAL key_buffer_size = 1024*1024; +FLUSH STATUS; +--echo # All these have to read the indexes +LOAD INDEX INTO CACHE t1 PARTITION (p1); +--source include/check_key_reads.inc +SELECT COUNT(b) FROM t1 WHERE b >= 0; +--source include/check_key_reads.inc +SELECT COUNT(b) FROM t2 WHERE b >= 0; +--source include/check_key_reads.inc +--echo # All these should be able to use the key cache +SELECT COUNT(b) FROM t1 WHERE b >= 0; +--source include/check_key_reads.inc +SELECT COUNT(b) FROM t2 WHERE b >= 0; +--source include/check_key_reads.inc +FLUSH TABLES; +LOAD INDEX INTO CACHE t1 PARTITION (p1,p0); +--source include/check_key_reads.inc +--echo # should not be zero +SELECT COUNT(b) FROM t1 WHERE b >= 0; +--source include/check_key_reads.inc +LOAD INDEX INTO CACHE t2; +--source include/check_key_reads.inc +--echo # should not be zero +SELECT COUNT(b) FROM t2 WHERE b >= 0; +--source include/check_key_reads.inc +FLUSH TABLES; +LOAD INDEX INTO CACHE t1 PARTITION (p1,p0) IGNORE LEAVES; +--source include/check_key_reads.inc +--echo # should not be zero +SELECT COUNT(b) FROM t1 WHERE b >= 0; +--source include/check_key_reads.inc +LOAD INDEX INTO CACHE t2 IGNORE LEAVES; +--source include/check_key_reads.inc +--echo # should not be zero +SELECT COUNT(b) FROM t2 WHERE b >= 0; +--source include/check_key_reads.inc +TRUNCATE TABLE t2; +INSERT t2 SELECT a,b,c FROM t1; +--source include/check_key_req.inc +DROP TABLE t1,t2; + +SET GLOBAL hot_cache.key_buffer_size = 1024*1024; +SET GLOBAL warm_cache.key_buffer_size = 1024*1024; +SET @@global.cold_cache.key_buffer_size = 1024*1024; +SELECT @@global.default.key_buffer_size a, @@global.default.key_cache_block_size b, @@global.default.key_cache_age_threshold c, @@global.default.key_cache_division_limit d; +SELECT @@global.hot_cache.key_buffer_size a, @@global.hot_cache.key_cache_block_size b, @@global.hot_cache.key_cache_age_threshold c, @@global.hot_cache.key_cache_division_limit d; +SELECT @@global.warm_cache.key_buffer_size a, @@global.warm_cache.key_cache_block_size b, @@global.warm_cache.key_cache_age_threshold c, @@global.warm_cache.key_cache_division_limit d; +SELECT @@global.cold_cache.key_buffer_size a, @@global.cold_cache.key_cache_block_size b, @@global.cold_cache.key_cache_age_threshold c, @@global.cold_cache.key_cache_division_limit d; +CREATE TABLE t1 ( + a INT, + b VARCHAR(257), + c INT NOT NULL, + PRIMARY KEY (a), + KEY `inx_b` (b), + KEY `inx_c`(c)) +PARTITION BY RANGE (a) +SUBPARTITION BY HASH (a) +(PARTITION p0 VALUES LESS THAN (10) + (SUBPARTITION sp0, + SUBPARTITION sp1), + PARTITION p1 VALUES LESS THAN MAXVALUE + (SUBPARTITION sp2, + SUBPARTITION sp3)); +CREATE TABLE t2 ( + a INT, + b VARCHAR(257), + c INT NOT NULL, + PRIMARY KEY (a), + KEY `inx_b` (b), + KEY `inx_c`(c)); +SET @a:=1167602400; +# Genereate 4096 rows. Idea from: +# http://datacharmer.blogspot.com/2007/12/data-from-nothing-solution-to-pop-quiz.html +CREATE VIEW v AS SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4; +CREATE VIEW x AS SELECT 1 FROM v,v a,v b; +INSERT t1 SELECT @a, CONCAT('X_', @a, ' MySQL'), 1167612400 - (@a:=@a+1) FROM x, x a; +DROP VIEW x; +DROP VIEW v; +INSERT t2 SELECT a, b, c FROM t1; +SELECT COUNT(*) FROM t1; +SELECT COUNT(*) FROM t2; +FLUSH TABLES; + +--echo # Restrict partitioned commands to partitioned tables only +--error ER_PARTITION_MGMT_ON_NONPARTITIONED +CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache; +--error ER_PARTITION_MGMT_ON_NONPARTITIONED +CACHE INDEX t2 PARTITION (p0,`p1`) INDEX (`PRIMARY`) IN hot_cache; +--error ER_PARTITION_MGMT_ON_NONPARTITIONED +CACHE INDEX t2 PARTITION (`p1`) INDEX (`PRIMARY`,`inx_b`) IN hot_cache; +--error ER_PARTITION_MGMT_ON_NONPARTITIONED +CACHE INDEX t2 PARTITION (ALL) KEY (`inx_b`,`PRIMARY`) IN hot_cache; +--echo # Basic key cache testing +--echo # The manual correctly says: "The syntax of CACHE INDEX enables you to +--echo # specify that only particular indexes from a table should be assigned +--echo # to the cache. The current implementation assigns all the table's +--echo # indexes to the cache, so there is no reason to specify anything +--echo # other than the table name." +--echo # So the most of the test only tests the syntax +CACHE INDEX t2 INDEX (`inx_b`) IN hot_cache; +CACHE INDEX t2 KEY (`PRIMARY`) IN warm_cache; +CACHE INDEX t2 KEY (`PRIMARY`,`inx_b`) IN cold_cache; +CACHE INDEX t2 INDEX (inx_b,`PRIMARY`) IN default; +CACHE INDEX t1 PARTITION (p0) KEY (`inx_b`) IN cold_cache; +--error ER_PARSE_ERROR +CACHE INDEX t1 PARTITIONS (p0) KEY (`inx_b`) IN cold_cache; +--echo # only one table at a time if specifying partitions +--error ER_PARSE_ERROR +CACHE INDEX t1,t2 PARTITION (p0) KEY (`inx_b`) IN cold_cache; +CACHE INDEX t1 PARTITION (`p0`,p1) INDEX (`PRIMARY`) IN warm_cache; +CACHE INDEX t1 PARTITION (`p1`) INDEX (`PRIMARY`,inx_b) IN hot_cache; +CACHE INDEX t1 PARTITION (ALL) KEY (`inx_b`,`PRIMARY`) IN default; +CACHE INDEX t1 PARTITION (ALL) IN hot_cache; +CACHE INDEX t1 INDEX (`inx_b`) IN default; +CACHE INDEX t1 KEY (`PRIMARY`) IN hot_cache; +CACHE INDEX t1 KEY (`PRIMARY`,`inx_b`) IN warm_cache; +CACHE INDEX t1 INDEX (`inx_b`,`PRIMARY`) IN cold_cache; +CACHE INDEX t1 IN hot_cache; +--echo # Test of non existent key cache: +--error ER_UNKNOWN_KEY_CACHE +CACHE INDEX t1 IN non_existent_key_cache; +--echo # Basic testing of LOAD INDEX +LOAD INDEX INTO CACHE t2; +--echo # PRIMARY and secondary keys have different block sizes +LOAD INDEX INTO CACHE t2 ignore leaves; +--echo # Must have INDEX or KEY before the index list +--error ER_PARSE_ERROR +LOAD INDEX INTO CACHE t2 (`PRIMARY`); + +--echo # Test of IGNORE LEAVES +LOAD INDEX INTO CACHE t2 INDEX (`PRIMARY`); +LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_b`) IGNORE LEAVES; +CACHE INDEX t2 IN warm_cache; +CACHE INDEX t1 IN cold_cache; +LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`) IGNORE LEAVES; +CACHE INDEX t2 INDEX (`inx_b`, `inx_c`) IN hot_cache; +LOAD INDEX INTO CACHE t2 KEY (`inx_b`, `inx_c`) IGNORE LEAVES; +CACHE INDEX t2 IN warm_cache; +CACHE INDEX t2 INDEX (`PRIMARY`, `inx_c`) IN hot_cache; +LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_c`) IGNORE LEAVES; +CACHE INDEX t2 INDEX (`inx_b`,`PRIMARY`) IN default; +LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_b`); +CACHE INDEX t2 IN default; +LOAD INDEX INTO CACHE t2 IGNORE LEAVES; + +--error ER_PARTITION_MGMT_ON_NONPARTITIONED +LOAD INDEX INTO CACHE t2 PARTITION (p1) INDEX (`PRIMARY`); +LOAD INDEX INTO CACHE t1, t2; +--echo # only one table at a time if specifying partitions +--error ER_PARSE_ERROR +LOAD INDEX INTO CACHE t1 PARTITION (p0), t2; +LOAD INDEX INTO CACHE t1 IGNORE LEAVES; +LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`); +LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`,`inx_b`) IGNORE LEAVES; +LOAD INDEX INTO CACHE t1 INDEX (`inx_b`) IGNORE LEAVES; +LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`) IGNORE LEAVES; +LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`,`inx_b`); +LOAD INDEX INTO CACHE t1 PARTITION (p1) INDEX (`PRIMARY`); +LOAD INDEX INTO CACHE t1 PARTITION (`p1`,p0) KEY (`PRIMARY`) IGNORE LEAVES; +LOAD INDEX INTO CACHE t1 PARTITION (ALL); +--error ER_PARSE_ERROR +LOAD INDEX INTO CACHE t1 PARTITIONS ALL; +LOAD INDEX INTO CACHE t1 PARTITION (p1,`p0`) IGNORE LEAVES; +DROP INDEX `inx_b` on t1; +DROP INDEX `inx_b` on t2; +--error ER_PARTITION_MGMT_ON_NONPARTITIONED +CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache; +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; +SET GLOBAL hot_cache.key_buffer_size = 0; +SET GLOBAL warm_cache.key_buffer_size = 0; +SET @@global.cold_cache.key_buffer_size = 0; +SELECT @@global.default.key_buffer_size a, @@global.default.key_cache_block_size b, @@global.default.key_cache_age_threshold c, @@global.default.key_cache_division_limit d; +SELECT @@global.hot_cache.key_buffer_size a, @@global.hot_cache.key_cache_block_size b, @@global.hot_cache.key_cache_age_threshold c, @@global.hot_cache.key_cache_division_limit d; +SELECT @@global.warm_cache.key_buffer_size a, @@global.warm_cache.key_cache_block_size b, @@global.warm_cache.key_cache_age_threshold c, @@global.warm_cache.key_cache_division_limit d; +SELECT @@global.cold_cache.key_buffer_size a, @@global.cold_cache.key_cache_block_size b, @@global.cold_cache.key_cache_age_threshold c, @@global.cold_cache.key_cache_division_limit d; +--disable_warnings +SET @@global.default.key_buffer_size = @org_key_cache_buffer_size; +--enable_warnings From 81d9615de8781c278635acb4e7980966b1963f85 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 7 Dec 2009 19:00:02 +0100 Subject: [PATCH 13/27] The version is renamed: This is no tree that will progress through "beta" and "rc" to "GA", rather it is a series of "milestones", so the version is 5.5.0-m2 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9fe5c741a03..fe5f9953645 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM # # When changing major version number please also check switch statement # in client/mysqlbinlog.cc:check_master_version(). -AM_INIT_AUTOMAKE(mysql, 5.5.0-beta) +AM_INIT_AUTOMAKE(mysql, 5.5.0-m2) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 From d12a2c32e9a1aeb962f03368c4915872b3243344 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Tue, 15 Dec 2009 23:20:53 +0300 Subject: [PATCH 14/27] Backporting patch for Bug#47756 from mysql-next-mr-bugfixing into mysql-trunk-bugfixing. NOTE: the "utf8_phone_ci" collation does not exist in mysql-trunk yet, so another collation with 2-byte collation ID is used: "utf8_test_ci". This patch will be null-merged to mysql-next-mr-bugfixing. Original revision: ------------------------------------------------------------ revision-id: bar@mysql.com-20091207121153-hs3bqbmr0719ws21 committer: Alexander Barkov branch nick: mysql-next-mr.b47756 timestamp: Mon 2009-12-07 16:11:53 +0400 message: Bug#47756 Setting 2byte collation ID with 'set names' crashes the server The problem is not actually related to 2byte collation IDs. The same crash happens if you change the collation ID in mysql-test/str_data/Index.xml to a value smaller than 256. Crash happened in SQL parser, because the "ident_map" and "state_map" arrays were not initialized in loadable utf8 collations. Fix: adding proper initialization of the "ident_map" and "state_map" members for loadable utf8 collations. ------------------------------------------------------------ --- mysql-test/r/ctype_ldml.result | 5 +++++ mysql-test/t/ctype_ldml.test | 8 ++++++++ mysys/charset.c | 3 +++ 3 files changed, 16 insertions(+) diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result index 00da0db1735..a63dc91f305 100644 --- a/mysql-test/r/ctype_ldml.result +++ b/mysql-test/r/ctype_ldml.result @@ -369,3 +369,8 @@ s1 a b DROP TABLE t1; +SET NAMES utf8 COLLATE utf8_test_ci; +SHOW COLLATION LIKE 'utf8_test_ci'; +Collation Charset Id Default Compiled Sortlen +utf8_test_ci utf8 353 8 +SET NAMES utf8; diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test index 0fcfd603aad..d134861cd46 100644 --- a/mysql-test/t/ctype_ldml.test +++ b/mysql-test/t/ctype_ldml.test @@ -125,3 +125,11 @@ CREATE TABLE t1 (s1 char(10) character set utf8 collate utf8_maxuserid_ci); INSERT INTO t1 VALUES ('a'),('b'); SELECT * FROM t1 WHERE s1='a' ORDER BY BINARY s1; DROP TABLE t1; + + +# +# Bug#47756 Setting 2byte collation ID with 'set names' crashes the server +# +SET NAMES utf8 COLLATE utf8_test_ci; +SHOW COLLATION LIKE 'utf8_test_ci'; +SET NAMES utf8; diff --git a/mysys/charset.c b/mysys/charset.c index 280b2ad6091..e216f665092 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -255,6 +255,9 @@ static int add_collation(CHARSET_INFO *cs) { #if defined (HAVE_CHARSET_utf8) && defined(HAVE_UCA_COLLATIONS) copy_uca_collation(newcs, &my_charset_utf8_unicode_ci); + newcs->ctype= my_charset_utf8_unicode_ci.ctype; + if (init_state_maps(newcs)) + return MY_XML_ERROR; #endif } else From af3aad2448e416e84fcad4096e2beb5c2614bbaf Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Tue, 15 Dec 2009 23:23:01 +0300 Subject: [PATCH 15/27] Backporting a patch for Bug#49170 (Inconsistent placement of semisync plugin prevents it from getting tested) from mysql-next-mr-bugfixing to mysql-trunk-bugfixing. Original revision: ------------------------------------------------------------ revision-id: zhenxing.he@sun.com-20091204014339-2m06r42vajhm9vke committer: He Zhenxing branch nick: 5.1-rep-semisync timestamp: Fri 2009-12-04 09:43:39 +0800 message: Bug#49170 Inconsistent placement of semisync plugin prevents it from getting tested Add $basedir/lib/plugin to the search paths for semisync plugins. ------------------------------------------------------------ --- mysql-test/mysql-test-run.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f76cb008c3c..95095586bec 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1849,11 +1849,13 @@ sub environment_setup { my $lib_semisync_master_plugin= mtr_file_exists(vs_config_dirs('plugin/semisync',$semisync_master_filename), "$basedir/plugin/semisync/.libs/" . $semisync_master_filename, - "$basedir/lib/mysql/plugin/" . $semisync_master_filename); + "$basedir/lib/mysql/plugin/" . $semisync_master_filename, + "$basedir/lib/plugin/" . $semisync_master_filename); my $lib_semisync_slave_plugin= mtr_file_exists(vs_config_dirs('plugin/semisync',$semisync_slave_filename), "$basedir/plugin/semisync/.libs/" . $semisync_slave_filename, - "$basedir/lib/mysql/plugin/" . $semisync_slave_filename); + "$basedir/lib/mysql/plugin/" . $semisync_slave_filename, + "$basedir/lib/plugin/" . $semisync_slave_filename); if ($lib_semisync_master_plugin && $lib_semisync_slave_plugin) { $ENV{'SEMISYNC_MASTER_PLUGIN'}= basename($lib_semisync_master_plugin); From f9015023dddd4a575d3584ba3884b4c53262695d Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Wed, 16 Dec 2009 08:45:25 +0100 Subject: [PATCH 16/27] post push patch of bug#49369 updating test by removing select of platform dependend variable. --- mysql-test/r/partition_key_cache.result | 3 --- mysql-test/t/partition_key_cache.test | 1 - 2 files changed, 4 deletions(-) diff --git a/mysql-test/r/partition_key_cache.result b/mysql-test/r/partition_key_cache.result index c09f277840b..7fbab34fa41 100644 --- a/mysql-test/r/partition_key_cache.result +++ b/mysql-test/r/partition_key_cache.result @@ -8,9 +8,6 @@ SELECT @org_key_cache_buffer_size:= @@global.default.key_buffer_size; SET @@global.default.key_buffer_size = 1; Warnings: Warning 1292 Truncated incorrect key_buffer_size value: '1' -SELECT @@global.default.key_buffer_size; -@@global.default.key_buffer_size -36 CREATE TABLE t1 ( a INT, b INT, diff --git a/mysql-test/t/partition_key_cache.test b/mysql-test/t/partition_key_cache.test index 34f3d4de19c..f6ea974ba96 100644 --- a/mysql-test/t/partition_key_cache.test +++ b/mysql-test/t/partition_key_cache.test @@ -10,7 +10,6 @@ DROP TABLE IF EXISTS t1, t2, v, x; SELECT @org_key_cache_buffer_size:= @@global.default.key_buffer_size; --echo # Minimize default key cache (almost disabled). SET @@global.default.key_buffer_size = 1; -SELECT @@global.default.key_buffer_size; CREATE TABLE t1 ( a INT, b INT, From ed02cca13ab2446140b47e8756bccc404a66fe6b Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 16 Dec 2009 10:27:56 +0000 Subject: [PATCH 17/27] Fix previous merge: 'kill -0' (check PID exists) was changed to 'kill -9', meaning a '/etc/init.d/mysql stop' would actually cause mysqld_safe to relaunch mysqld rather than shut it down. --- support-files/mysql.server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index ccf4d8ff51d..b5115a5c05e 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -303,7 +303,7 @@ case "$mode" in then mysqld_pid=`cat "$mysqld_pid_file_path"` - if (kill -9 $mysqld_pid 2>/dev/null) + if (kill -0 $mysqld_pid 2>/dev/null) then echo $echo_n "Shutting down MySQL" kill $mysqld_pid From 7548f142c39d6f7d9a995bd4478c62ef6baa5e19 Mon Sep 17 00:00:00 2001 From: Mikael Ronstrom Date: Thu, 17 Dec 2009 18:39:10 +0100 Subject: [PATCH 18/27] BUG#49591, Fixed version string in SHOW CREATE TABLE to accomodate for column list partitioning and new function to_seconds --- mysql-test/r/partition_column.result | 16 ++++++------ mysql-test/r/partition_range.result | 37 ++++++++++++++++++++++++++++ mysql-test/r/partition_utf8.result | 6 ++--- mysql-test/t/partition_range.test | 13 ++++++++++ sql/item.h | 9 +++++++ sql/item_timefunc.h | 9 +++++++ sql/partition_info.cc | 36 +++++++++++++++++++++++++++ sql/partition_info.h | 1 + sql/sql_show.cc | 2 +- 9 files changed, 117 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/partition_column.result b/mysql-test/r/partition_column.result index 784df3045f0..a64ca8e405d 100644 --- a/mysql-test/r/partition_column.result +++ b/mysql-test/r/partition_column.result @@ -69,7 +69,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST COLUMNS(a) +/*!50500 PARTITION BY LIST COLUMNS(a) (PARTITION p0 VALUES IN ('''') ENGINE = MyISAM, PARTITION p1 VALUES IN ('\\') ENGINE = MyISAM, PARTITION p2 VALUES IN ('\0') ENGINE = MyISAM) */ @@ -128,7 +128,7 @@ t1 CREATE TABLE `t1` ( `c` varchar(25) DEFAULT NULL, `d` datetime DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE COLUMNS(a,b,c,d) +/*!50500 PARTITION BY RANGE COLUMNS(a,b,c,d) SUBPARTITION BY HASH (to_seconds(d)) SUBPARTITIONS 4 (PARTITION p0 VALUES LESS THAN (1,'0',MAXVALUE,'1900-01-01') ENGINE = MyISAM, @@ -211,7 +211,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST COLUMNS(a,b) +/*!50500 PARTITION BY LIST COLUMNS(a,b) (PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM, PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM, PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */ @@ -245,7 +245,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST COLUMNS(a,b) +/*!50500 PARTITION BY LIST COLUMNS(a,b) (PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM, PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM, PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */ @@ -299,7 +299,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST COLUMNS(a) +/*!50500 PARTITION BY LIST COLUMNS(a) (PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM, PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */ insert into t1 values (1); @@ -314,7 +314,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST COLUMNS(a) +/*!50500 PARTITION BY LIST COLUMNS(a) (PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM, PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */ drop table t1; @@ -349,7 +349,7 @@ t1 CREATE TABLE `t1` ( `c` varchar(5) DEFAULT NULL, `d` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE COLUMNS(a,b,c) +/*!50500 PARTITION BY RANGE COLUMNS(a,b,c) SUBPARTITION BY KEY (c,d) SUBPARTITIONS 3 (PARTITION p0 VALUES LESS THAN (1,'abc','abc') ENGINE = MyISAM, @@ -382,7 +382,7 @@ t1 CREATE TABLE `t1` ( `b` varchar(2) DEFAULT NULL, `c` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY RANGE COLUMNS(a,b,c) +/*!50500 PARTITION BY RANGE COLUMNS(a,b,c) (PARTITION p0 VALUES LESS THAN (1,'A',1) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1,'B',1) ENGINE = MyISAM) */ insert into t1 values (1, 'A', 1); diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index 87cb4fba306..0bd7605a5c8 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -1,6 +1,19 @@ drop table if exists t1, t2; create table t1 (a int) partition by range (a) +subpartition by hash(to_seconds(a)) +(partition p0 values less than (1)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50500 PARTITION BY RANGE (a) +SUBPARTITION BY HASH (to_seconds(a)) +(PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM) */ +drop table t1; +create table t1 (a int) +partition by range (a) ( partition p0 values less than (NULL), partition p1 values less than (MAXVALUE)); ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN @@ -30,6 +43,14 @@ id select_type table partitions type possible_keys key key_len ref rows Extra explain partitions select * from t1 where a < '2007-03-07 23:59:59'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50500 PARTITION BY RANGE (TO_SECONDS(a)) +(PARTITION p0 VALUES LESS THAN (63340531200) ENGINE = MyISAM, + PARTITION p1 VALUES LESS THAN (63342604800) ENGINE = MyISAM) */ drop table t1; create table t1 (a date) partition by range(to_seconds(a)) @@ -53,6 +74,14 @@ select * from t1 where a <= '2005-01-01'; a 2003-12-30 2004-12-31 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50500 PARTITION BY RANGE (to_seconds(a)) +(PARTITION p0 VALUES LESS THAN (63240134400) ENGINE = MyISAM, + PARTITION p1 VALUES LESS THAN (63271756800) ENGINE = MyISAM) */ drop table t1; create table t1 (a datetime) partition by range(to_seconds(a)) @@ -75,6 +104,14 @@ id select_type table partitions type possible_keys key key_len ref rows Extra select * from t1 where a <= '2005-01-01'; a 2004-01-01 11:59:29 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` datetime DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50500 PARTITION BY RANGE (to_seconds(a)) +(PARTITION p0 VALUES LESS THAN (63240177600) ENGINE = MyISAM, + PARTITION p1 VALUES LESS THAN (63271800000) ENGINE = MyISAM) */ drop table t1; create table t1 (a int, b char(20)) partition by range columns(a,b) diff --git a/mysql-test/r/partition_utf8.result b/mysql-test/r/partition_utf8.result index 0fae7bb16b6..339871f1f4a 100644 --- a/mysql-test/r/partition_utf8.result +++ b/mysql-test/r/partition_utf8.result @@ -7,7 +7,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST COLUMNS(a) +/*!50500 PARTITION BY LIST COLUMNS(a) (PARTITION p0 VALUES IN (_cp1250 0x81) ENGINE = MyISAM) */ drop table t1; create table t1 (a varchar(2) character set cp1250) @@ -18,7 +18,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST COLUMNS(a) +/*!50500 PARTITION BY LIST COLUMNS(a) (PARTITION p0 VALUES IN ('€') ENGINE = MyISAM) */ drop table t1; create table t1 (a varchar(1500), b varchar(1570)) @@ -45,7 +45,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(2) CHARACTER SET ucs2 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY LIST COLUMNS(a) +/*!50500 PARTITION BY LIST COLUMNS(a) (PARTITION p0 VALUES IN ('†') ENGINE = MyISAM, PARTITION p1 VALUES IN ('') ENGINE = MyISAM) */ insert into t1 values (''); diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 07c345faed5..6c0b5ca77d6 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -9,6 +9,16 @@ drop table if exists t1, t2; --enable_warnings +# +#BUG#49591, Add proper version number to SHOW CREATE TABLE +# +create table t1 (a int) +partition by range (a) +subpartition by hash(to_seconds(a)) +(partition p0 values less than (1)); +show create table t1; +drop table t1; + --error ER_NULL_IN_VALUES_LESS_THAN create table t1 (a int) partition by range (a) @@ -30,6 +40,7 @@ explain partitions select * from t1 where a < '2007-03-08 00:00:01'; explain partitions select * from t1 where a <= '2007-03-08 00:00:00'; explain partitions select * from t1 where a <= '2007-03-07 23:59:59'; explain partitions select * from t1 where a < '2007-03-07 23:59:59'; +show create table t1; drop table t1; # # New test cases for new function to_seconds @@ -44,6 +55,7 @@ explain partitions select * from t1 where a <= '2003-12-31'; select * from t1 where a <= '2003-12-31'; explain partitions select * from t1 where a <= '2005-01-01'; select * from t1 where a <= '2005-01-01'; +show create table t1; drop table t1; create table t1 (a datetime) @@ -56,6 +68,7 @@ explain partitions select * from t1 where a <= '2004-01-01 11:59.59'; select * from t1 where a <= '2004-01-01 11:59:59'; explain partitions select * from t1 where a <= '2005-01-01'; select * from t1 where a <= '2005-01-01'; +show create table t1; drop table t1; # diff --git a/sql/item.h b/sql/item.h index 24d800300e7..2c798123852 100644 --- a/sql/item.h +++ b/sql/item.h @@ -894,6 +894,15 @@ public: (*traverser)(this, arg); } + /* + This is used to get the most recent version of any function in + an item tree. The version is the version where a MySQL function + was introduced in. So any function which is added should use + this function and set the int_arg to maximum of the input data + and their own version info. + */ + virtual bool intro_version(uchar *int_arg) { return 0; } + virtual bool remove_dependence_processor(uchar * arg) { return 0; } virtual bool remove_fixed(uchar * arg) { fixed= 0; return 0; } virtual bool cleanup_processor(uchar *arg); diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index cdd74c8c601..31726585e88 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -91,6 +91,15 @@ public: enum_monotonicity_info get_monotonicity_info() const; longlong val_int_endpoint(bool left_endp, bool *incl_endp); bool check_partition_func_processor(uchar *bool_arg) { return FALSE;} + + bool intro_version(uchar *int_arg) + { + int *input_version= (int*)int_arg; + /* This function was introduced in 5.5 */ + int output_version= (*input_version, 50500); + *input_version= output_version; + return 0; + } }; diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 56d79ac0d45..65029a817de 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -115,6 +115,42 @@ char *partition_info::create_default_partition_names(uint part_no, } +/* + Generate a version string for partition expression + This function must be updated every time there is a possibility for + a new function of a higher version number than 5.5.0. + + SYNOPSIS + set_show_version_string() + RETURN VALUES + None +*/ +void partition_info::set_show_version_string(String *packet) +{ + int version= 0; + if (column_list) + packet->append(STRING_WITH_LEN("\n/*!50500")); + else + { + if (part_expr) + part_expr->walk(&Item::intro_version, 0, (uchar*)&version); + if (subpart_expr) + subpart_expr->walk(&Item::intro_version, 0, (uchar*)&version); + if (version == 0) + { + /* No new functions in partition function */ + packet->append(STRING_WITH_LEN("\n/*!50100")); + } + else + { + char buf[65]; + char *buf_ptr= longlong10_to_str((longlong)version, buf, 10); + packet->append(STRING_WITH_LEN("\n/*!")); + packet->append(buf, (size_t)(buf_ptr - buf)); + } + } +} + /* Create a unique name for the subpartition as part_name'sp''subpart_no' SYNOPSIS diff --git a/sql/partition_info.h b/sql/partition_info.h index 0ac8dec4945..479714a3928 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -302,6 +302,7 @@ public: bool check_partition_field_length(); bool init_column_part(); bool add_column_list_value(THD *thd, Item *item); + void set_show_version_string(String *packet); private: static int list_part_cmp(const void* a, const void* b); bool set_up_default_partitions(handler *file, HA_CREATE_INFO *info, diff --git a/sql/sql_show.cc b/sql/sql_show.cc index b9f5015f8f0..1b1545f538c 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1497,7 +1497,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, show_table_options, NULL, NULL)))) { - packet->append(STRING_WITH_LEN("\n/*!50100")); + table->part_info->set_show_version_string(packet); packet->append(part_syntax, part_syntax_len); packet->append(STRING_WITH_LEN(" */")); my_free(part_syntax, MYF(0)); From fef794a800b839b78283898a99c1747ba5f6cbdc Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 18 Dec 2009 21:39:24 +0100 Subject: [PATCH 19/27] Bug #49811: inconsistent usage of SAFEMALLOC in debug compilation on windows Remove per-project SAFEMALLOCs definitions, as they result in malloc/free mismatches. --- plugin/semisync/CMakeLists.txt | 3 --- storage/innobase/CMakeLists.txt | 7 ------- 2 files changed, 10 deletions(-) diff --git a/plugin/semisync/CMakeLists.txt b/plugin/semisync/CMakeLists.txt index ad26298b0b7..cf8863e970f 100644 --- a/plugin/semisync/CMakeLists.txt +++ b/plugin/semisync/CMakeLists.txt @@ -15,9 +15,6 @@ # This is CMakeLists.txt for semi-sync replication plugins -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") - # Add common include directories INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/sql diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index d67b518642c..b63ed840f3c 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -15,13 +15,6 @@ # This is the CMakeLists for InnoDB Plugin - -# TODO: remove the two FLAGS_DEBUG settings when merging into -# 6.0-based trees, like is already the case for other engines in -# those trees. -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") - # Starting at 5.1.38, MySQL CMake files are simplified. But the plugin # CMakeLists.txt still needs to work with previous versions of MySQL. IF (MYSQL_VERSION_ID GREATER "50137") From 6bcd9edc8a998f2e79ac762000e9fee93b647949 Mon Sep 17 00:00:00 2001 From: Mikael Ronstrom Date: Sat, 19 Dec 2009 13:26:00 +0100 Subject: [PATCH 20/27] Post-merge fix: wait for statement result before disconnecting. Otherwise the statement might affect unrelated tests. mysql-test/t/lock_multi.test, Reap statement status --- mysql-test/t/lock_multi.test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test index 47b5aa0292b..4df1a0f3478 100644 --- a/mysql-test/t/lock_multi.test +++ b/mysql-test/t/lock_multi.test @@ -626,9 +626,11 @@ let $wait_condition= --source include/wait_condition.inc let $tlwb= `show status like 'Table_locks_waited'`; unlock tables; +connection waiter; +--reap +connection default; drop table t1; disconnect waiter; -connection default; --disable_query_log eval SET @tlwa= SUBSTRING_INDEX('$tlwa', ' ', -1); eval SET @tlwb= SUBSTRING_INDEX('$tlwb', ' ', -1); From c736665e43995327cae3ea417c8abc815ea925fc Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Mon, 21 Dec 2009 13:20:43 +0300 Subject: [PATCH 21/27] Disable plugin_load.test due to Bug#42144. --- mysql-test/collections/default.experimental | 1 - mysql-test/t/disabled.def | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 7f5faa23c1b..52422f5d140 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -12,7 +12,6 @@ main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_m main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_multi_bug38691 times out sporadically on Solaris 10 main.log_tables # Bug#47924 2009-10-08 alik main.log_tables times out sporadically main.plugin # Bug#47146 Linking problem with example plugin when dtrace enabled -main.plugin_load # Bug#47146 rpl.rpl_get_master_version_and_clock* # Bug#49191 2009-12-01 Daogang rpl_get_master_version_and_clock failed on PB2: COM_REGISTER_SLAVE failed rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 3d9dc72ee45..97237d5da73 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -13,3 +13,4 @@ kill : Bug#37780 2008-12-03 HHunger need some changes to be query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadicallyr innodb-autoinc : Bug#49267 2009-12-02 test fails on windows because of different case mode innodb : Bug#49396 2009-12-03 test fails in embedded mode +plugin_load : Bug#42144 2009-12-21 alik plugin_load fails From 287dfc146949af0bd28e202b0086e93ceeb1d77a Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 21 Dec 2009 11:38:31 +0100 Subject: [PATCH 22/27] Bug#48737: Partitions: search fails with ucs2 Recommit of patch: http://lists.mysql.com/commits/91400 Test case only (code part was pushes as bug-49028) mysql-test/r/partition_column.result: Bug#48737: Partitions: search fails with ucs2 added test case mysql-test/t/partition_column.test: Bug#48737: Partitions: search fails with ucs2 Added result --- mysql-test/r/partition_column.result | 24 ++++++++++++++++++++++++ mysql-test/t/partition_column.test | 17 +++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/mysql-test/r/partition_column.result b/mysql-test/r/partition_column.result index a64ca8e405d..ddc48b635cf 100644 --- a/mysql-test/r/partition_column.result +++ b/mysql-test/r/partition_column.result @@ -9,6 +9,30 @@ partition by range columns (a,b,c) ( partition p0 values less than (1, maxvalue, 10), partition p1 values less than (1, maxvalue, maxvalue)); ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition +create table t1 (a varchar(5) character set ucs2 collate ucs2_bin) +partition by range columns (a) +(partition p0 values less than (0x0041)); +insert into t1 values (0x00410000); +select hex(a) from t1 where a like 'A_'; +hex(a) +00410000 +explain partitions select hex(a) from t1 where a like 'A_'; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 system NULL NULL NULL NULL 1 +alter table t1 remove partitioning; +select hex(a) from t1 where a like 'A_'; +hex(a) +00410000 +create index a on t1 (a); +select hex(a) from t1 where a like 'A_'; +hex(a) +00410000 +insert into t1 values ('A_'); +select hex(a) from t1; +hex(a) +00410000 +0041005F +drop table t1; create table t1 (a varchar(1) character set latin1 collate latin1_general_ci) partition by range columns(a) ( partition p0 values less than ('a'), diff --git a/mysql-test/t/partition_column.test b/mysql-test/t/partition_column.test index 9e47b94b036..a0e944ceb09 100644 --- a/mysql-test/t/partition_column.test +++ b/mysql-test/t/partition_column.test @@ -23,6 +23,23 @@ partition by range columns (a,b,c) ( partition p0 values less than (1, maxvalue, 10), partition p1 values less than (1, maxvalue, maxvalue)); +# +# BUG#48737, Search fails with ucs2 +# +create table t1 (a varchar(5) character set ucs2 collate ucs2_bin) +partition by range columns (a) +(partition p0 values less than (0x0041)); +insert into t1 values (0x00410000); +select hex(a) from t1 where a like 'A_'; +explain partitions select hex(a) from t1 where a like 'A_'; +alter table t1 remove partitioning; +select hex(a) from t1 where a like 'A_'; +create index a on t1 (a); +select hex(a) from t1 where a like 'A_'; +insert into t1 values ('A_'); +select hex(a) from t1; +drop table t1; + # # BUG#48161, Delivering too few records using collate syntax with partitions # From 23e70189ab6412aa7af04dd81fe1b446b5f674c7 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Mon, 21 Dec 2009 18:35:38 +0300 Subject: [PATCH 23/27] Fix default.conf. --- .bzr-mysql/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index 08ca040642e..f33ccdf6753 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] post_commit_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.5-trunk-bugfixing" +tree_name = "mysql-5.5-trunk" From dcdaa8f4fcd381c01e030e6d80bc3c2810fd3691 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 22 Dec 2009 21:49:37 +0100 Subject: [PATCH 24/27] Fix build error with CMake 2.8 (mysql_stmt_next_result not exported by shared embedded library) --- libmysqld/libmysqld.def | 1 + 1 file changed, 1 insertion(+) diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def index d7f98f8b32b..ecfad75b12f 100644 --- a/libmysqld/libmysqld.def +++ b/libmysqld/libmysqld.def @@ -104,3 +104,4 @@ EXPORTS mysql_stmt_attr_get mysql_stmt_attr_set mysql_stmt_field_count + mysql_stmt_next_result From ba60b39ca3678a2ec53d773144662b2ed2f11f64 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 23 Dec 2009 15:03:51 +0300 Subject: [PATCH 25/27] Backporting fix for Bug#49834 from mysql-next-mr-bugfixing into mysql-trunk-bugfixing. Original revision: ------------------------------------------------------------ revision-id: vvaintroub@mysql.com-20091222115311-bam0xorumd8gvjyo parent: mattias.jonsson@sun.com-20091221104426-x2e6c93x8iik4fo0 committer: Vladislav Vaintroub branch nick: mysql-next-mr-bugfixing timestamp: Tue 2009-12-22 12:53:11 +0100 message: Bug#49834 - fixed a bug introduced by mismerge. restore original innobase version ------------------------------------------------------------ --- storage/innobase/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 3f9808a2022..b63ed840f3c 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -86,5 +86,10 @@ IF (MYSQL_VERSION_ID GREATER "50137") SET_TARGET_PROPERTIES(ha_innobase PROPERTIES OUTPUT_NAME ha_innodb) ENDIF(LIB_LOCATION) ELSE (MYSQL_VERSION_ID GREATER "50137") - MYSQL_STORAGE_ENGINE(INNODB_PLUGIN) + IF (NOT SOURCE_SUBLIBS) + ADD_DEFINITIONS(-D_WIN32 -DMYSQL_SERVER) + ADD_LIBRARY(innobase STATIC ${INNOBASE_SOURCES}) + # Require mysqld_error.h, which is built as part of the GenError + ADD_DEPENDENCIES(innobase GenError) + ENDIF (NOT SOURCE_SUBLIBS) ENDIF (MYSQL_VERSION_ID GREATER "50137") From 5be5b55ff4ce2c9fce0563e1a729d13e92a7d423 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 23 Dec 2009 15:09:31 +0300 Subject: [PATCH 26/27] Fix default.conf. --- .bzr-mysql/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index 08ca040642e..f33ccdf6753 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] post_commit_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.5-trunk-bugfixing" +tree_name = "mysql-5.5-trunk" From 0b74a911263c563b457e29ed4faf42bcf62e6efc Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Thu, 24 Dec 2009 10:10:05 +0300 Subject: [PATCH 27/27] Postfix for Bug#37408 (fix for Bug#49898). --- storage/myisam/mi_static.c | 1 - 1 file changed, 1 deletion(-) diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c index a43a099663b..27485e101ff 100644 --- a/storage/myisam/mi_static.c +++ b/storage/myisam/mi_static.c @@ -41,7 +41,6 @@ my_off_t myisam_max_temp_length= MAX_FILE_SIZE; ulong myisam_bulk_insert_tree_size=8192*1024; ulong myisam_data_pointer_size=4; ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0; -pthread_mutex_t THR_LOCK_myisam_mmap; static int always_valid(const char *filename __attribute__((unused))) {