From 0c0e1f2e351923c2fecdf38641734ec796ec9c15 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Oct 2009 09:57:22 +0300 Subject: [PATCH 01/29] BUG#39249 Maria:query cache returns out of date results BUG#41098 Query Cache returns wrong result with concurent insert BUILD/SETUP.sh: test build without query cache setup BUILD/compile-pentium-debug-max-no-qc: test build without query cache sql/mysql_priv.h: removed double declaration storage/maria/ha_maria.cc: query cache invalidation fixed storage/maria/ma_state.c: query cache invalidation fixed storage/maria/maria_def.h: last transaction ID added invalidation fixed storage/myisam/ha_myisam.cc: invalidation fixed storage/myisam/mi_locking.c: invalidation fixed storage/myisam/myisamdef.h: invalidation fixed --- BUILD/SETUP.sh | 1 + BUILD/compile-pentium-debug-max-no-qc | 9 +++++++++ sql/mysql_priv.h | 1 - storage/maria/ha_maria.cc | 6 ++++++ storage/maria/ma_state.c | 9 +++++++++ storage/maria/maria_def.h | 6 +++++- storage/myisam/ha_myisam.cc | 3 +++ storage/myisam/mi_locking.c | 6 ++++++ storage/myisam/myisamdef.h | 5 ++++- 9 files changed, 43 insertions(+), 3 deletions(-) create mode 100755 BUILD/compile-pentium-debug-max-no-qc diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 7677119843c..21108ccdf13 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -172,6 +172,7 @@ local_infile_configs="--enable-local-infile" max_no_embedded_configs="$SSL_LIBRARY --with-plugins=max" +max_no_qc_configs="$SSL_LIBRARY --with-plugins=max --without-query-cache" max_no_ndb_configs="$SSL_LIBRARY --with-plugins=max-no-ndb --with-embedded-server --with-libevent" max_configs="$SSL_LIBRARY --with-plugins=max --with-embedded-server -with-libevent" # Disable NDB in maria max builds diff --git a/BUILD/compile-pentium-debug-max-no-qc b/BUILD/compile-pentium-debug-max-no-qc new file mode 100755 index 00000000000..4d8b568a3cf --- /dev/null +++ b/BUILD/compile-pentium-debug-max-no-qc @@ -0,0 +1,9 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $debug_cflags" +extra_configs="$pentium_configs $debug_configs $max_no_qc_configs" + +. "$path/FINISH.sh" diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index d3a4b2d3686..06554589f6c 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -933,7 +933,6 @@ struct Query_cache_query_flags #define query_cache_abort(A) #define query_cache_end_of_result(A) -#define query_cache_invalidate_by_MyISAM_filename_ref NULL #define query_cache_maybe_disabled(T) 1 #define query_cache_is_cacheable_query(L) 0 #endif /*HAVE_QUERY_CACHE*/ diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 558a9b92234..6dd2783e76f 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -28,6 +28,7 @@ #include #include "ha_maria.h" #include "trnman_public.h" +#include "trnman.h" C_MODE_START #include "maria_def.h" @@ -907,6 +908,8 @@ int ha_maria::open(const char *name, int mode, uint test_if_locked) if (!(file= maria_open(name, mode, test_if_locked | HA_OPEN_FROM_SQL_LAYER))) return (my_errno ? my_errno : -1); + file->s->chst_invalidator= query_cache_invalidate_by_MyISAM_filename_ref; + if (test_if_locked & (HA_OPEN_IGNORE_IF_LOCKED | HA_OPEN_TMP_TABLE)) VOID(maria_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0)); @@ -3227,6 +3230,9 @@ my_bool ha_maria::register_query_cache_table(THD *thd, char *table_name, */ *engine_data= 0; + if (file->s->now_transactional && file->s->have_versioning) + return (file->trn->trid >= file->s->state.last_change_trn); + /* If a concurrent INSERT has happened just before the currently processed SELECT statement, the total size of the table is unknown. diff --git a/storage/maria/ma_state.c b/storage/maria/ma_state.c index a7e3b49e284..0b7fba9f55a 100644 --- a/storage/maria/ma_state.c +++ b/storage/maria/ma_state.c @@ -318,6 +318,13 @@ void _ma_update_status(void* param) DBUG_ASSERT(!info->s->base.born_transactional); share->state.state= *info->state; info->state= &share->state.state; +#ifdef HAVE_QUERY_CACHE + DBUG_PRINT("info", ("invalidator... '%s' (status update)", + info->s->data_file_name.str)); + DBUG_ASSERT(info->s->chst_invalidator != NULL); + (*info->s->chst_invalidator)((const char *)info->s->data_file_name.str); +#endif + } info->append_insert_at_end= 0; } @@ -469,6 +476,8 @@ my_bool _ma_trnman_end_trans_hook(TRN *trn, my_bool commit, tables->state_start.checksum); history->trid= trn->commit_trid; + share->state.last_change_trn= trn->commit_trid; + if (history->next) { /* Remove not visible states */ diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h index 9385c8602b0..ada4ae3f426 100644 --- a/storage/maria/maria_def.h +++ b/storage/maria/maria_def.h @@ -83,6 +83,7 @@ typedef struct st_maria_state_info pgcache_page_no_t first_bitmap_with_space; ulonglong auto_increment; TrID create_trid; /* Minum trid for file */ + TrID last_change_trn; /* selfdescriptive */ ulong update_count; /* Updated for each write lock */ ulong status; double *rec_per_key_part; @@ -337,7 +338,10 @@ typedef struct st_maria_share /* Mapings to read/write the data file */ size_t (*file_read)(MARIA_HA *, uchar *, size_t, my_off_t, myf); size_t (*file_write)(MARIA_HA *, const uchar *, size_t, my_off_t, myf); - invalidator_by_filename invalidator; /* query cache invalidator */ + /* query cache invalidator for merged tables */ + invalidator_by_filename invalidator; + /* query cache invalidator for changing state */ + invalidator_by_filename chst_invalidator; my_off_t key_del_current; /* delete links for index pages */ ulong this_process; /* processid */ ulong last_process; /* For table-change-check */ diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 160e6dfed6c..39c157f2e64 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -660,6 +660,9 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) if (!(file=mi_open(name, mode, test_if_locked | HA_OPEN_FROM_SQL_LAYER))) return (my_errno ? my_errno : -1); + + file->s->chst_invalidator= query_cache_invalidate_by_MyISAM_filename_ref; + if (!table->s->tmp_table) /* No need to perform a check for tmp table */ { if ((my_errno= table2myisam(table, &keyinfo, &recinfo, &recs))) diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index ebee8826c3b..b935d517c81 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -329,6 +329,12 @@ void mi_update_status(void* param) #endif info->s->state.state= *info->state; info->state= &info->s->state.state; +#ifdef HAVE_QUERY_CACHE + DBUG_PRINT("info", ("invalidator... '%s' (status update)", + info->filename)); + DBUG_ASSERT(info->s->chst_invalidator != NULL); + (*info->s->chst_invalidator)((const char *)info->filename); +#endif } info->append_insert_at_end= 0; diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index f311202e47a..c2841c49199 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -190,7 +190,10 @@ typedef struct st_mi_isam_share const uchar *record, my_off_t pos); size_t (*file_read) (MI_INFO *, uchar *, size_t, my_off_t, myf); size_t (*file_write) (MI_INFO *, const uchar *, size_t, my_off_t, myf); - invalidator_by_filename invalidator; /* query cache invalidator */ + /* query cache invalidator for merged tables */ + invalidator_by_filename invalidator; + /* query cache invalidator for changing state */ + invalidator_by_filename chst_invalidator; ulong this_process; /* processid */ ulong last_process; /* For table-change-check */ ulong last_version; /* Version on start */ From eebb0da3334937b311242ea93fa5bb8fce38ae4c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Oct 2009 09:40:56 +0200 Subject: [PATCH 02/29] Add missing PBXT windows file to `make dist`. --- storage/pbxt/src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/pbxt/src/Makefile.am b/storage/pbxt/src/Makefile.am index 94cf6517329..a09d8f0a57b 100644 --- a/storage/pbxt/src/Makefile.am +++ b/storage/pbxt/src/Makefile.am @@ -49,4 +49,4 @@ libpbxt_a_SOURCES = $(libpbxt_la_SOURCES) libpbxt_a_CXXFLAGS = $(AM_CXXFLAGS) libpbxt_a_CFLAGS = $(AM_CFLAGS) -std=c99 -EXTRA_DIST = pbms_enabled.cc +EXTRA_DIST = pbms_enabled.cc win_inttypes.h From ed40801d9d95a549491cc20fb9e3a7edd3a45d33 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Oct 2009 09:57:48 +0200 Subject: [PATCH 03/29] Fix test case partition_recover_myisam for --embedded-server. --- mysql-test/suite/parts/t/partition_recover_myisam.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysql-test/suite/parts/t/partition_recover_myisam.test b/mysql-test/suite/parts/t/partition_recover_myisam.test index 14604bfeb15..d6f30878482 100644 --- a/mysql-test/suite/parts/t/partition_recover_myisam.test +++ b/mysql-test/suite/parts/t/partition_recover_myisam.test @@ -16,6 +16,8 @@ FLUSH TABLES; let $MYSQLD_DATADIR= `select @@datadir`; --remove_file $MYSQLD_DATADIR/test/t1_will_crash.MYI --copy_file std_data/corrupt_t1.MYI $MYSQLD_DATADIR/test/t1_will_crash.MYI +# Embedded server doesn't chdir to data directory +--replace_regex /Table '.*\/data\/test\/t1_will_crash/Table '.\/test\/t1_will_crash/ SELECT * FROM t1_will_crash; DROP TABLE t1_will_crash; CREATE TABLE t1_will_crash (a INT, KEY (a)) @@ -29,5 +31,7 @@ FLUSH TABLES; --echo # head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI --remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI --copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI +# Embedded server doesn't chdir to data directory +--replace_regex /Table '.*\/data\/test\/t1_will_crash/Table '.\/test\/t1_will_crash/ SELECT * FROM t1_will_crash; DROP TABLE t1_will_crash; From 99ff6ada7b2d0c7edebde49e47d39b74f290858f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Oct 2009 13:02:43 +0300 Subject: [PATCH 04/29] comment added --- BUILD/compile-pentium-debug-max-no-qc | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD/compile-pentium-debug-max-no-qc b/BUILD/compile-pentium-debug-max-no-qc index 4d8b568a3cf..6407b4b09ad 100755 --- a/BUILD/compile-pentium-debug-max-no-qc +++ b/BUILD/compile-pentium-debug-max-no-qc @@ -1,4 +1,5 @@ #! /bin/sh +# Builds server without query cache support path=`dirname $0` . "$path/SETUP.sh" From e244cdaf0cddb21aab04b870b883b2ad177f39a2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Oct 2009 13:48:58 +0200 Subject: [PATCH 05/29] Change naming of our package to mariadb rather than mysql. --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 5b11dbb331b..57061f44151 100644 --- a/configure.in +++ b/configure.in @@ -12,8 +12,8 @@ AC_CANONICAL_SYSTEM # in mysqlbinlog.cc / check_master_version(). # # When merging new MySQL releases, update the version number to match the -# MySQL version number, but reset the maria subrelease (-beta1). -AM_INIT_AUTOMAKE(mysql, 5.1.38-MariaDB-beta1) +# MySQL version number, but reset the maria subrelease (m1). +AM_INIT_AUTOMAKE(mariadb, 5.1.38m1-beta) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 From 49e212374ef67390f1a6597fb4140c2d85754d3d Mon Sep 17 00:00:00 2001 From: Arjen Lentz Date: Wed, 7 Oct 2009 23:07:10 +1000 Subject: [PATCH 06/29] Fix log_slow_filter/log_slow_verbosity code typos (Monty?) --- sql/mysqld.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f4c6ae4d56a..114c07b2ca2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -8429,7 +8429,7 @@ mysqld_get_one_option(int optid, break; case OPT_LOG_SLOW_FILTER: global_system_variables.log_slow_filter= - find_bit_type_or_exit(argument, &log_slow_verbosity_typelib, + find_bit_type_or_exit(argument, &log_slow_filter_typelib, opt->name, &error); /* If we are using filters, we set opt_slow_admin_statements to be always @@ -8441,7 +8441,7 @@ mysqld_get_one_option(int optid, break; case OPT_LOG_SLOW_VERBOSITY: global_system_variables.log_slow_verbosity= - find_bit_type_or_exit(argument, &log_slow_filter_typelib, + find_bit_type_or_exit(argument, &log_slow_verbosity_typelib, opt->name, &error); if (error) return 1; From 9d58141cdc995518eed0352b0aa7a1d488a1cc05 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Wed, 7 Oct 2009 20:56:11 +0400 Subject: [PATCH 07/29] Fix pbxt test suite failures: - Update EXPLAIN results after table elimination - mysqlslap now specifies 'Engine=' in CREATE TABLE instead of using SET storage_engine=... - For some reason, mysqltest logs "connect" command differently when PBXT is the default storage engine. This is probably a bug in mysqltest which we can't be bothered to investigate at the moment, so add --replace mysql-test/suite/pbxt/r/connect.result: Fix pbxt test suite failures: - For some reason, mysqltest logs "connect" command differently when PBXT is the default storage engine. This is probably a bug in mysqltest which we can't be bothered to investigate at the moment, so add --replace mysql-test/suite/pbxt/r/mysqlslap.result: Fix pbxt test suite failures: - mysqlslap now specifies 'Engine=' in CREATE TABLE instead of using SET storage_engine=... mysql-test/suite/pbxt/r/ps_11bugs.result: Fix pbxt test suite failures: - Update EXPLAIN results after table elimination mysql-test/suite/pbxt/r/select.result: Fix pbxt test suite failures: - Update EXPLAIN results after table elimination mysql-test/suite/pbxt/r/union.result: Fix pbxt test suite failures: - Update EXPLAIN results after table elimination mysql-test/suite/pbxt/t/connect.test: Fix pbxt test suite failures: - For some reason, mysqltest logs "connect" command differently when PBXT is the default storage engine. This is probably a bug in mysqltest which we can't be bothered to investigate at the moment, so add --replace --- mysql-test/suite/pbxt/r/connect.result | 4 ++-- mysql-test/suite/pbxt/r/mysqlslap.result | 18 ++++++------------ mysql-test/suite/pbxt/r/ps_11bugs.result | 4 ++-- mysql-test/suite/pbxt/r/select.result | 1 - mysql-test/suite/pbxt/r/union.result | 2 +- mysql-test/suite/pbxt/t/connect.test | 2 +- 6 files changed, 12 insertions(+), 19 deletions(-) diff --git a/mysql-test/suite/pbxt/r/connect.result b/mysql-test/suite/pbxt/r/connect.result index 25cf4f90e6d..c8d048f4d38 100644 --- a/mysql-test/suite/pbxt/r/connect.result +++ b/mysql-test/suite/pbxt/r/connect.result @@ -61,8 +61,8 @@ show tables; Tables_in_test connect(localhost,test,,test2,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) -connect(localhost,test,,"",MASTER_PORT,MASTER_SOCKET); -ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) +connect(localhost,,,,MASTER_PORT,MASTER_SOCKET); +ERROR 28000: Access denied for user ''@'localhost' (using password: NO) connect(localhost,test,zorro,test2,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET); diff --git a/mysql-test/suite/pbxt/r/mysqlslap.result b/mysql-test/suite/pbxt/r/mysqlslap.result index 7f2d4396c68..3a539a1761c 100644 --- a/mysql-test/suite/pbxt/r/mysqlslap.result +++ b/mysql-test/suite/pbxt/r/mysqlslap.result @@ -122,8 +122,7 @@ DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`; CREATE SCHEMA `mysqlslap`; use mysqlslap; -set storage_engine=`heap`; -CREATE TABLE t1 (id int, name varchar(64)); +CREATE TABLE t1 (id int, name varchar(64)) Engine = heap; create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2'); @@ -133,8 +132,7 @@ DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`; CREATE SCHEMA `mysqlslap`; use mysqlslap; -set storage_engine=`myisam`; -CREATE TABLE t1 (id int, name varchar(64)); +CREATE TABLE t1 (id int, name varchar(64)) Engine = myisam; create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2'); @@ -144,8 +142,7 @@ DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`; CREATE SCHEMA `mysqlslap`; use mysqlslap; -set storage_engine=`heap`; -CREATE TABLE t1 (id int, name varchar(64)); +CREATE TABLE t1 (id int, name varchar(64)) Engine = heap; create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2'); @@ -157,8 +154,7 @@ DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`; CREATE SCHEMA `mysqlslap`; use mysqlslap; -set storage_engine=`myisam`; -CREATE TABLE t1 (id int, name varchar(64)); +CREATE TABLE t1 (id int, name varchar(64)) Engine = myisam; create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2'); @@ -170,8 +166,7 @@ DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`; CREATE SCHEMA `mysqlslap`; use mysqlslap; -set storage_engine=`heap`; -CREATE TABLE t1 (id int, name varchar(64)); +CREATE TABLE t1 (id int, name varchar(64)) Engine = heap; create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2'); @@ -196,8 +191,7 @@ DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`; CREATE SCHEMA `mysqlslap`; use mysqlslap; -set storage_engine=`myisam`; -CREATE TABLE t1 (id int, name varchar(64)); +CREATE TABLE t1 (id int, name varchar(64)) Engine = myisam; create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2'); diff --git a/mysql-test/suite/pbxt/r/ps_11bugs.result b/mysql-test/suite/pbxt/r/ps_11bugs.result index ebe161f46b3..fad35b97b24 100644 --- a/mysql-test/suite/pbxt/r/ps_11bugs.result +++ b/mysql-test/suite/pbxt/r/ps_11bugs.result @@ -121,8 +121,8 @@ insert into t1 values (1); explain select * from t1 where 3 in (select (1+1) union select 1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL Impossible HAVING NULL UNION RESULT ALL NULL NULL NULL NULL NULL select * from t1 where 3 in (select (1+1) union select 1); a diff --git a/mysql-test/suite/pbxt/r/select.result b/mysql-test/suite/pbxt/r/select.result index 41137e9e8dd..11244cd3689 100644 --- a/mysql-test/suite/pbxt/r/select.result +++ b/mysql-test/suite/pbxt/r/select.result @@ -3585,7 +3585,6 @@ INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c'); EXPLAIN SELECT t1.a FROM t1 LEFT JOIN t2 ON t2.b=t1.b WHERE t1.a=3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 -1 SIMPLE t2 const b b 22 const 1 Using index DROP TABLE t1,t2; CREATE TABLE t1(id int PRIMARY KEY, b int, e int); CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); diff --git a/mysql-test/suite/pbxt/r/union.result b/mysql-test/suite/pbxt/r/union.result index 04e5aaf6298..cfcd17cf0d9 100644 --- a/mysql-test/suite/pbxt/r/union.result +++ b/mysql-test/suite/pbxt/r/union.result @@ -480,7 +480,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 UNION t2 const PRIMARY PRIMARY 4 const 1 100.00 NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 (select '1' AS `a`,'1' AS `b` from `test`.`t1` where ('1' = 1)) union (select '1' AS `a`,'10' AS `b` from `test`.`t2` where ('1' = 1)) +Note 1003 (select '1' AS `a`,'1' AS `b` from `test`.`t1` where 1) union (select '1' AS `a`,'10' AS `b` from `test`.`t2` where 1) (select * from t1 where a=5) union (select * from t2 where a=1); a b 1 10 diff --git a/mysql-test/suite/pbxt/t/connect.test b/mysql-test/suite/pbxt/t/connect.test index aa1c34068f5..0f1107d9556 100644 --- a/mysql-test/suite/pbxt/t/connect.test +++ b/mysql-test/suite/pbxt/t/connect.test @@ -42,7 +42,7 @@ show tables; --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --error 1045 connect (fail_con,localhost,test,,test2); ---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT test "" --error 1045 connect (fail_con,localhost,test,,""); --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT From 56841aced4dbfd888ecb9f38e704919fe4f459b8 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Wed, 7 Oct 2009 21:26:36 +0400 Subject: [PATCH 08/29] Fix win/configure.js: now configure.in has AM_INIT_AUTOMAKE(mariadb, ...) --- configure.in | 2 ++ win/configure.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/configure.in b/configure.in index 57061f44151..daf18ed3b3a 100644 --- a/configure.in +++ b/configure.in @@ -13,6 +13,8 @@ AC_CANONICAL_SYSTEM # # When merging new MySQL releases, update the version number to match the # MySQL version number, but reset the maria subrelease (m1). +# +# Note: the following line must be parseable by win/configure.js:GetVersion() AM_INIT_AUTOMAKE(mariadb, 5.1.38m1-beta) AM_CONFIG_HEADER([include/config.h:config.h.in]) diff --git a/win/configure.js b/win/configure.js index be30dc7f9d9..2f6ecbe3d0e 100644 --- a/win/configure.js +++ b/win/configure.js @@ -156,7 +156,10 @@ function GetValue(str, key) function GetVersion(str) { var key = "AM_INIT_AUTOMAKE(mysql, "; + var key2 = "AM_INIT_AUTOMAKE(mariadb, "; var pos = str.indexOf(key); //5.0.6-beta) + if (pos == -1) + pos = str.indexOf(key2); if (pos == -1) return null; pos += key.length; var end = str.indexOf(")", pos); From d1d978ddc401606ba3634c5440d17c5624d623d1 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Thu, 8 Oct 2009 01:00:29 +0400 Subject: [PATCH 09/29] Fix win/configure.js: now configure.in has AM_INIT_AUTOMAKE(mariadb, ...) - Part 2. make it really work. --- win/configure.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/win/configure.js b/win/configure.js index 2f6ecbe3d0e..4cb9b9aeeb4 100644 --- a/win/configure.js +++ b/win/configure.js @@ -157,11 +157,15 @@ function GetVersion(str) { var key = "AM_INIT_AUTOMAKE(mysql, "; var key2 = "AM_INIT_AUTOMAKE(mariadb, "; + var key_len = key.length; var pos = str.indexOf(key); //5.0.6-beta) if (pos == -1) + { pos = str.indexOf(key2); + key_len= key2.length; + } if (pos == -1) return null; - pos += key.length; + pos += key_len; var end = str.indexOf(")", pos); if (end == -1) return null; return str.substring(pos, end); From 538d689f114716c65c64c3957a71485c4001549c Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Thu, 8 Oct 2009 01:29:04 +0400 Subject: [PATCH 10/29] MBUG#442254: mysql-test-run --embedded fails on Windows with: ERROR: .opt file references 'EXAMPLE_PLUGIN_OPT' - Fix suggested by Kristian on review: ignore the test using mtr's facilities --- mysql-test/lib/mtr_cases.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index d2b454014c4..23a9586ff0b 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -1082,6 +1082,17 @@ sub collect_one_test_case { $tinfo->{template_path}= $config; } + if ( $tinfo->{'example_plugin_test'} ) + { + if ( !$ENV{'EXAMPLE_PLUGIN'} ) + { + $tinfo->{'skip'}= 1; + $tinfo->{'comment'}= "Test requires the 'example' plugin"; + return $tinfo; + } + } + + # Set extra config file to use if (defined $defaults_extra_file) { $tinfo->{extra_template_path}= $defaults_extra_file; @@ -1134,6 +1145,7 @@ my @tags= ["federated.inc", "federated_test", 1], ["include/not_embedded.inc", "not_embedded", 1], ["include/not_valgrind.inc", "not_valgrind", 1], + ["include/have_example_plugin.inc", "example_plugin_test", 1] ); From 68602b939bff04a6ff315a122f595523e3f226e9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Oct 2009 00:57:43 +0200 Subject: [PATCH 11/29] Fixes for package name change mysql -> mariadb. - Don't need any m1 prefix for the first release based on given MySQL version number. - Fix mysql-test-run to understand that some stuff is installed under share/mariadb rather than share/mysql. --- configure.in | 2 +- mysql-test/lib/My/ConfigFactory.pm | 2 +- mysql-test/lib/mtr_cases.pm | 2 ++ mysql-test/mysql-test-run.pl | 11 ++++++++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index daf18ed3b3a..bb30efc1ec9 100644 --- a/configure.in +++ b/configure.in @@ -15,7 +15,7 @@ AC_CANONICAL_SYSTEM # MySQL version number, but reset the maria subrelease (m1). # # Note: the following line must be parseable by win/configure.js:GetVersion() -AM_INIT_AUTOMAKE(mariadb, 5.1.38m1-beta) +AM_INIT_AUTOMAKE(mariadb, 5.1.38-beta) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm index 751c4815945..855918a1284 100644 --- a/mysql-test/lib/My/ConfigFactory.pm +++ b/mysql-test/lib/My/ConfigFactory.pm @@ -19,7 +19,7 @@ my @pre_rules= ); -my @share_locations= ("share/mysql", "sql/share", "share"); +my @share_locations= ("share/mariadb", "share/mysql", "sql/share", "share"); sub get_basedir { diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index d2b454014c4..5f8f49b943b 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -490,6 +490,8 @@ sub collect_one_suite($) my $lib_innodb_plugin= mtr_file_exists(::vs_config_dirs('storage/innodb_plugin', 'ha_innodb_plugin.dll'), "$::basedir/storage/innodb_plugin/.libs/ha_innodb_plugin.so", + "$::basedir/lib/mariadb/plugin/ha_innodb_plugin.so", + "$::basedir/lib/mariadb/plugin/ha_innodb_plugin.dll", "$::basedir/lib/mysql/plugin/ha_innodb_plugin.so", "$::basedir/lib/mysql/plugin/ha_innodb_plugin.dll"); if ($::mysql_version_id >= 50100 && !(IS_WINDOWS && $::opt_embedded_server) && diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index d8274192419..72e49ed01f8 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1018,7 +1018,8 @@ sub command_line_setup { } # Look for language files and charsetsdir, use same share - $path_language= mtr_path_exists("$basedir/share/mysql/english", + $path_language= mtr_path_exists("$basedir/share/mariadb/english", + "$basedir/share/mysql/english", "$basedir/sql/share/english", "$basedir/share/english"); @@ -1887,6 +1888,7 @@ sub environment_setup { my $lib_udf_example= mtr_file_exists(vs_config_dirs('sql', 'udf_example.dll'), "$basedir/sql/.libs/udf_example.so", + "$basedir/lib/mariadb/plugin/udf_example.so", "$basedir/lib/mysql/plugin/udf_example.so",); if ( $lib_udf_example ) @@ -1915,6 +1917,7 @@ sub environment_setup { my $lib_example_plugin= mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename), "$basedir/storage/example/.libs/".$plugin_filename, + "$basedir/lib/mariadb/plugin/".$plugin_filename, "$basedir/lib/mysql/plugin/".$plugin_filename); $ENV{'EXAMPLE_PLUGIN'}= ($lib_example_plugin ? basename($lib_example_plugin) : ""); @@ -1931,6 +1934,7 @@ sub environment_setup { my $lib_simple_parser= mtr_file_exists(vs_config_dirs('plugin/fulltext', 'mypluglib.dll'), "$basedir/plugin/fulltext/.libs/mypluglib.so", + "$basedir/lib/mariadb/plugin/mypluglib.so", "$basedir/lib/mysql/plugin/mypluglib.so",); $ENV{'SIMPLE_PARSER'}= @@ -2074,6 +2078,7 @@ sub environment_setup { my $file_mysql_fix_privilege_tables= mtr_file_exists("$basedir/scripts/mysql_fix_privilege_tables.sql", "$basedir/share/mysql_fix_privilege_tables.sql", + "$basedir/share/mariadb/mysql_fix_privilege_tables.sql", "$basedir/share/mysql/mysql_fix_privilege_tables.sql"); $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables; @@ -2870,8 +2875,8 @@ sub mysql_install_db { my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql"; my $path_sql= my_find_file($install_basedir, - ["mysql", "sql/share", "share/mysql", - "share", "scripts"], + ["mysql", "sql/share", "share/mariadb", + "share/mysql", "share", "scripts"], "mysql_system_tables.sql", NOT_REQUIRED); From 0d827917bed0eaa5b126bfe793e8569b37b74a1e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Oct 2009 11:43:31 +0200 Subject: [PATCH 12/29] Revert change of package name in configure.in, as it breaks too much stuff. --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index bb30efc1ec9..8ee4a3a47fc 100644 --- a/configure.in +++ b/configure.in @@ -12,10 +12,10 @@ AC_CANONICAL_SYSTEM # in mysqlbinlog.cc / check_master_version(). # # When merging new MySQL releases, update the version number to match the -# MySQL version number, but reset the maria subrelease (m1). +# MySQL version number. # # Note: the following line must be parseable by win/configure.js:GetVersion() -AM_INIT_AUTOMAKE(mariadb, 5.1.38-beta) +AM_INIT_AUTOMAKE(mysql, 5.1.38-maria-beta) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 From 2433da4718145e2dd7a0ca60678cab425eed2409 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Thu, 8 Oct 2009 23:04:12 +0400 Subject: [PATCH 13/29] Added win/configure-mariadb.sh - the standard way to configure on Windows. --- win/configure-mariadb.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 win/configure-mariadb.sh diff --git a/win/configure-mariadb.sh b/win/configure-mariadb.sh new file mode 100644 index 00000000000..294b1530788 --- /dev/null +++ b/win/configure-mariadb.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# +# This script is the "standard" way to configure MariaDB on Windows. To be +# used by buildbot slaves and release build script. +# + +set -e + +cscript win/configure.js \ + WITH_ARCHIVE_STORAGE_ENGINE \ + WITH_BLACKHOLE_STORAGE_ENGINE \ + WITH_CSV_STORAGE_ENGINE \ + WITH_EXAMPLE_STORAGE_ENGINE \ + WITH_FEDERATED_STORAGE_ENGINE \ + WITH_MERGE_STORAGE_ENGINE \ + WITH_PARTITION_STORAGE_ENGINE \ + WITH_MARIA_STORAGE_ENGINE \ + WITH_PBXT_STORAGE_ENGINE \ + WITH_XTRADB_STORAGE_ENGINE \ + WITH_EMBEDDED_SERVER + + From 87de323cb4e969882a3682c08978ae242239c8e1 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Thu, 8 Oct 2009 23:11:48 +0400 Subject: [PATCH 14/29] Include configure-mariadb.sh in source tarball --- win/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/Makefile.am b/win/Makefile.am index 3ade0f85bfc..ecab394e258 100644 --- a/win/Makefile.am +++ b/win/Makefile.am @@ -17,7 +17,7 @@ EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat build-vs9.bat \ build-vs9_x64.bat configure.js README mysql_manifest.cmake \ create_manifest.js create_def_file.js build-nmake.bat \ - build-nmake-x64.bat + build-nmake-x64.bat configure-mariadb.sh # Don't update the files from bitkeeper %::SCCS/s.% From fcb97aa7af91f55b5b6d310da10752997ea7da2e Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Fri, 9 Oct 2009 01:01:03 +0400 Subject: [PATCH 15/29] Fix make_win_bin_dist: - Include maria_chk and other maria binaries - Include sql/$TARGET/mysqld.lib, like mainline does (but what is that useful for?) - Don't include my_safe_{process,kill} garbage. - call '/bin/find', not just 'find' is that is some incompatible windows command. --- scripts/make_win_bin_dist | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 9c17c26b445..0380d7f8c32 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -140,12 +140,24 @@ fi # ---------------------------------------------------------------------- # Copy executables, and client DLL # ---------------------------------------------------------------------- - +MYISAM_BINARIES="myisamchk myisamlog myisampack myisam_ftdump" +MARIA_BINARIES="maria_chk maria_dump_log maria_ftdump maria_pack maria_read_log" mkdir $DESTDIR mkdir $DESTDIR/bin cp client/$TARGET/*.exe $DESTDIR/bin/ cp extra/$TARGET/*.exe $DESTDIR/bin/ -cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ + +# MyISAM +#cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ +for eng in $MYISAM_BINARIES ; do + cp storage/myisam/$TARGET/$eng.{exe,pdb} $DESTDIR/bin +done + +# Maria +for eng in $MARIA_BINARIES ; do + cp storage/maria/$TARGET/$eng.{exe,pdb} $DESTDIR/bin +done + cp server-tools/instance-manager/$TARGET/*.{exe,map} $DESTDIR/bin/ if [ x"$TARGET" != x"release" ] ; then cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ @@ -280,6 +292,7 @@ cp include/mysql/plugin.h $DESTDIR/include/mysql/ mkdir -p $DESTDIR/lib/opt mkdir -p $DESTDIR/lib/plugin +cp sql/$TARGET/mysqld.lib $DESTDIR/lib/ cp libmysql/$TARGET/libmysql.dll \ libmysql/$TARGET/libmysql.lib \ libmysql/$TARGET/mysqlclient.lib \ @@ -340,6 +353,11 @@ cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp -R mysql-test/{t,r,include,suite,std_data,lib} $DESTDIR/mysql-test/ +rm -rf $DESTDIR/mysql-test/lib/My/SafeProcess/my_safe_kill.{dir,vcproj} +rm -rf $DESTDIR/mysql-test/lib/My/SafeProcess/my_safe_process.{dir,vcproj} +rm -rf $DESTDIR/mysql-test/lib/My/SafeProcess/{Debug,RelWithDebInfo}/*.{ilk,idb,map} + + # Note that this will not copy "extra" if a soft link if [ -d mysql-test/extra ] ; then mkdir $DESTDIR/mysql-test/extra @@ -378,7 +396,7 @@ cp scripts/*.sql $DESTDIR/share/ # Clean up from possibly copied SCCS directories # ---------------------------------------------------------------------- -rm -rf `find $DISTDIR -type d -name SCCS -print` +rm -rf `/bin/find $DISTDIR -type d -name SCCS -print` # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE From e702b70d67b113686068a68b8143ce94be54716f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Oct 2009 10:09:24 +0200 Subject: [PATCH 16/29] Implement mysqltest --enable_prepare_warnings to properly fix some test failures. The --enable_prepare_warnings allows to not discard warnings from autorepair of crashed table in --ps-protocol mode. Use this to properly fix the parts.partition_recover_myisam and maria.maria-recover tests. Add a test case for the new feature. This also adds missing test coverage for the case where the same warning is thrown in both prepare and execute phase. client/mysqltest.cc: Implement new commands --enable-prepare_warnings and --disable_prepare_warnings. mysql-test/r/mysqltest_ps.result: Add test case for new --enable_prepare_warning mysqltest command. mysql-test/suite/maria/t/maria-recover.test: Better fix of test case using new --enable_prepare_warnings command. mysql-test/suite/parts/t/partition_recover_myisam.test: Fix test failure in --ps-protocol mode. mysql-test/t/mysqltest_ps.test: Add test case for new --enable_prepare_warning mysqltest command. --- client/mysqltest.cc | 20 ++++++++-- mysql-test/r/mysqltest_ps.result | 40 +++++++++++++++++++ mysql-test/suite/maria/t/maria-recover.test | 5 +-- .../parts/t/partition_recover_myisam.test | 4 ++ mysql-test/t/mysqltest_ps.test | 34 ++++++++++++++++ 5 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 mysql-test/r/mysqltest_ps.result create mode 100644 mysql-test/t/mysqltest_ps.test diff --git a/client/mysqltest.cc b/client/mysqltest.cc index f5c6c1ce377..c9dedde7476 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -100,6 +100,7 @@ static my_bool display_result_vertically= FALSE, display_metadata= FALSE, display_result_sorted= FALSE; static my_bool disable_query_log= 0, disable_result_log= 0; static my_bool disable_warnings= 0; +static my_bool prepare_warnings_enabled= 0; static my_bool disable_info= 1; static my_bool abort_on_error= 1; static my_bool server_initialized= 0; @@ -289,7 +290,7 @@ enum enum_commands { Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR, Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE, Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER, - Q_MOVE_FILE, + Q_MOVE_FILE, Q_ENABLE_PREPARE_WARNINGS, Q_DISABLE_PREPARE_WARNINGS, Q_UNKNOWN, /* Unknown command. */ Q_COMMENT, /* Comments, ignored. */ @@ -387,6 +388,8 @@ const char *command_names[]= "send_shutdown", "shutdown_server", "move_file", + "enable_prepare_warnings", + "disable_prepare_warnings", 0 }; @@ -6929,8 +6932,17 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command, mysql_free_result(res); /* Free normal result set with meta data */ - /* Clear prepare warnings */ - dynstr_set(&ds_prepare_warnings, NULL); + /* + Normally, if there is a result set, we do not show warnings from the + prepare phase. This is because some warnings are generated both during + prepare and execute; this would generate different warning output + between normal and ps-protocol test runs. + + The --enable_prepare_warnings command can be used to change this so + that warnings from both the prepare and execute phase are shown. + */ + if (!disable_warnings && !prepare_warnings_enabled) + dynstr_set(&ds_prepare_warnings, NULL); } else { @@ -7754,6 +7766,8 @@ int main(int argc, char **argv) case Q_DISABLE_RESULT_LOG: disable_result_log=1; break; case Q_ENABLE_WARNINGS: disable_warnings=0; break; case Q_DISABLE_WARNINGS: disable_warnings=1; break; + case Q_ENABLE_PREPARE_WARNINGS: prepare_warnings_enabled=1; break; + case Q_DISABLE_PREPARE_WARNINGS: prepare_warnings_enabled=0; break; case Q_ENABLE_INFO: disable_info=0; break; case Q_DISABLE_INFO: disable_info=1; break; case Q_ENABLE_METADATA: display_metadata=1; break; diff --git a/mysql-test/r/mysqltest_ps.result b/mysql-test/r/mysqltest_ps.result new file mode 100644 index 00000000000..dcf73455055 --- /dev/null +++ b/mysql-test/r/mysqltest_ps.result @@ -0,0 +1,40 @@ +select 1 + "2 a"; +1 + "2 a" +3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '2 a' +create table t (a int primary key, b blob default ''); +Warnings: +Warning 1101 BLOB/TEXT column 'b' can't have a default value +select a, (2*a) AS a from t group by a; +a a +Warnings: +Warning 1052 Column 'a' in group statement is ambiguous +drop table t; +select 1 + "2 a"; +1 + "2 a" +3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '2 a' +create table t (a int primary key, b blob default ''); +Warnings: +Warning 1101 BLOB/TEXT column 'b' can't have a default value +select a, (2*a) AS a from t group by a; +a a +Warnings: +Warning 1052 Column 'a' in group statement is ambiguous +Warning 1052 Column 'a' in group statement is ambiguous +drop table t; +select 1 + "2 a"; +1 + "2 a" +3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '2 a' +create table t (a int primary key, b blob default ''); +Warnings: +Warning 1101 BLOB/TEXT column 'b' can't have a default value +select a, (2*a) AS a from t group by a; +a a +Warnings: +Warning 1052 Column 'a' in group statement is ambiguous +drop table t; diff --git a/mysql-test/suite/maria/t/maria-recover.test b/mysql-test/suite/maria/t/maria-recover.test index b9cec2eadf1..e73cfa67bf0 100644 --- a/mysql-test/suite/maria/t/maria-recover.test +++ b/mysql-test/suite/maria/t/maria-recover.test @@ -54,11 +54,10 @@ perl; close FILE; EOF -# line below will be removed -disable_ps_protocol; replace_regex /Table.*t_corrupted2/t_corrupted2/ ; +--enable_prepare_warnings select * from t_corrupted2; # should show corruption and repair messages -enable_ps_protocol; +--disable_prepare_warnings select * from t_corrupted2; # should show just rows drop database mysqltest; diff --git a/mysql-test/suite/parts/t/partition_recover_myisam.test b/mysql-test/suite/parts/t/partition_recover_myisam.test index d6f30878482..dbab4e8f1a2 100644 --- a/mysql-test/suite/parts/t/partition_recover_myisam.test +++ b/mysql-test/suite/parts/t/partition_recover_myisam.test @@ -18,7 +18,9 @@ let $MYSQLD_DATADIR= `select @@datadir`; --copy_file std_data/corrupt_t1.MYI $MYSQLD_DATADIR/test/t1_will_crash.MYI # Embedded server doesn't chdir to data directory --replace_regex /Table '.*\/data\/test\/t1_will_crash/Table '.\/test\/t1_will_crash/ +--enable_prepare_warnings SELECT * FROM t1_will_crash; +--disable_prepare_warnings DROP TABLE t1_will_crash; CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM @@ -33,5 +35,7 @@ FLUSH TABLES; --copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI # Embedded server doesn't chdir to data directory --replace_regex /Table '.*\/data\/test\/t1_will_crash/Table '.\/test\/t1_will_crash/ +--enable_prepare_warnings SELECT * FROM t1_will_crash; +--disable_prepare_warnings DROP TABLE t1_will_crash; diff --git a/mysql-test/t/mysqltest_ps.test b/mysql-test/t/mysqltest_ps.test new file mode 100644 index 00000000000..c91f6dcb409 --- /dev/null +++ b/mysql-test/t/mysqltest_ps.test @@ -0,0 +1,34 @@ +# +# Test mysqltest in --ps-protocol mode. +# + +if (`SELECT $PS_PROTOCOL = 0`) +{ + --skip Need prepared statement protocol +} + +# +# Test the --enable_prepare_warnings command. +# Test default value (off), enabling, and disabling. +# + +--enable_warnings + +select 1 + "2 a"; +create table t (a int primary key, b blob default ''); +# This statement gives warning both during prepare and execute. +# So gives double warnings when --enable_prepare_warnings. +select a, (2*a) AS a from t group by a; +drop table t; + +--enable_prepare_warnings +select 1 + "2 a"; +create table t (a int primary key, b blob default ''); +select a, (2*a) AS a from t group by a; +drop table t; + +--disable_prepare_warnings +select 1 + "2 a"; +create table t (a int primary key, b blob default ''); +select a, (2*a) AS a from t group by a; +drop table t; From b27fdb26b26a13f06378a5148b37d6beb3faca84 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Oct 2009 15:08:09 +0200 Subject: [PATCH 17/29] Fix many test failures in parts test suite with --embedded-server. Fix some connect options to work with embedded. Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. Disable in --embedded tests that rely on the mysqltest --list_files command, which does not seem to work properly in --embedded. mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter1_1_2_myisam.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter1_1_innodb.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter1_1_myisam.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter1_2_innodb.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter1_2_myisam.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter2_1_innodb.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter2_1_maria.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter2_1_myisam.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter2_2_innodb.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter2_2_maria.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter2_2_myisam.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter3_innodb.test: Disable in --embedded tests that rely on the mysqltest --list_files command, which does not seem to work properly in --embedded. mysql-test/suite/parts/t/partition_alter3_myisam.test: Disable in --embedded tests that rely on the mysqltest --list_files command, which does not seem to work properly in --embedded. mysql-test/suite/parts/t/partition_alter4_innodb.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_alter4_myisam.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_basic_innodb.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_basic_myisam.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_basic_symlink_myisam.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_engine_innodb.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_engine_myisam.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_special_innodb.test: Fix some connect options to work with embedded. mysql-test/suite/parts/t/partition_syntax_innodb.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. mysql-test/suite/parts/t/partition_syntax_myisam.test: Disable in --embedded tests that rely on connecting to mysqld externally by spawning mysqltest. --- mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test | 3 +++ mysql-test/suite/parts/t/partition_alter1_1_2_myisam.test | 3 +++ mysql-test/suite/parts/t/partition_alter1_1_innodb.test | 3 +++ mysql-test/suite/parts/t/partition_alter1_1_myisam.test | 3 +++ mysql-test/suite/parts/t/partition_alter1_2_innodb.test | 3 +++ mysql-test/suite/parts/t/partition_alter1_2_myisam.test | 3 +++ mysql-test/suite/parts/t/partition_alter2_1_innodb.test | 3 +++ mysql-test/suite/parts/t/partition_alter2_1_maria.test | 3 +++ mysql-test/suite/parts/t/partition_alter2_1_myisam.test | 3 +++ mysql-test/suite/parts/t/partition_alter2_2_innodb.test | 3 +++ mysql-test/suite/parts/t/partition_alter2_2_maria.test | 3 +++ mysql-test/suite/parts/t/partition_alter2_2_myisam.test | 3 +++ mysql-test/suite/parts/t/partition_alter3_innodb.test | 2 ++ mysql-test/suite/parts/t/partition_alter3_myisam.test | 2 ++ mysql-test/suite/parts/t/partition_alter4_innodb.test | 3 +++ mysql-test/suite/parts/t/partition_alter4_myisam.test | 3 +++ mysql-test/suite/parts/t/partition_basic_innodb.test | 3 +++ mysql-test/suite/parts/t/partition_basic_myisam.test | 3 +++ mysql-test/suite/parts/t/partition_basic_symlink_myisam.test | 3 +++ mysql-test/suite/parts/t/partition_engine_innodb.test | 3 +++ mysql-test/suite/parts/t/partition_engine_myisam.test | 3 +++ mysql-test/suite/parts/t/partition_special_innodb.test | 4 ++-- mysql-test/suite/parts/t/partition_syntax_innodb.test | 3 +++ mysql-test/suite/parts/t/partition_syntax_myisam.test | 3 +++ 24 files changed, 69 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test b/mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test index 8e3dde286cf..f2e057fbbd1 100644 --- a/mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test +++ b/mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test @@ -43,6 +43,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter1_1_2_myisam.test b/mysql-test/suite/parts/t/partition_alter1_1_2_myisam.test index 55378e42ef4..12baa86105a 100644 --- a/mysql-test/suite/parts/t/partition_alter1_1_2_myisam.test +++ b/mysql-test/suite/parts/t/partition_alter1_1_2_myisam.test @@ -42,6 +42,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter1_1_innodb.test b/mysql-test/suite/parts/t/partition_alter1_1_innodb.test index 8dad5d0a335..e50a0cd7ed6 100644 --- a/mysql-test/suite/parts/t/partition_alter1_1_innodb.test +++ b/mysql-test/suite/parts/t/partition_alter1_1_innodb.test @@ -42,6 +42,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter1_1_myisam.test b/mysql-test/suite/parts/t/partition_alter1_1_myisam.test index 109c34b6663..43fa088529c 100644 --- a/mysql-test/suite/parts/t/partition_alter1_1_myisam.test +++ b/mysql-test/suite/parts/t/partition_alter1_1_myisam.test @@ -43,6 +43,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter1_2_innodb.test b/mysql-test/suite/parts/t/partition_alter1_2_innodb.test index 76fe7eb0223..f2d952375d5 100644 --- a/mysql-test/suite/parts/t/partition_alter1_2_innodb.test +++ b/mysql-test/suite/parts/t/partition_alter1_2_innodb.test @@ -43,6 +43,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter1_2_myisam.test b/mysql-test/suite/parts/t/partition_alter1_2_myisam.test index 69acecdbf7f..8df05fdc7a8 100644 --- a/mysql-test/suite/parts/t/partition_alter1_2_myisam.test +++ b/mysql-test/suite/parts/t/partition_alter1_2_myisam.test @@ -43,6 +43,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter2_1_innodb.test b/mysql-test/suite/parts/t/partition_alter2_1_innodb.test index b5f29e4ad72..602426c32c4 100644 --- a/mysql-test/suite/parts/t/partition_alter2_1_innodb.test +++ b/mysql-test/suite/parts/t/partition_alter2_1_innodb.test @@ -40,6 +40,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter2_1_maria.test b/mysql-test/suite/parts/t/partition_alter2_1_maria.test index d261c705459..88be2fb785f 100644 --- a/mysql-test/suite/parts/t/partition_alter2_1_maria.test +++ b/mysql-test/suite/parts/t/partition_alter2_1_maria.test @@ -40,6 +40,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter2_1_myisam.test b/mysql-test/suite/parts/t/partition_alter2_1_myisam.test index fa88b739f29..1c89a82b960 100644 --- a/mysql-test/suite/parts/t/partition_alter2_1_myisam.test +++ b/mysql-test/suite/parts/t/partition_alter2_1_myisam.test @@ -40,6 +40,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter2_2_innodb.test b/mysql-test/suite/parts/t/partition_alter2_2_innodb.test index 1d8ac251aca..14240483008 100644 --- a/mysql-test/suite/parts/t/partition_alter2_2_innodb.test +++ b/mysql-test/suite/parts/t/partition_alter2_2_innodb.test @@ -40,6 +40,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter2_2_maria.test b/mysql-test/suite/parts/t/partition_alter2_2_maria.test index a46e9a3924e..5e8b9b7d9f2 100644 --- a/mysql-test/suite/parts/t/partition_alter2_2_maria.test +++ b/mysql-test/suite/parts/t/partition_alter2_2_maria.test @@ -40,6 +40,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter2_2_myisam.test b/mysql-test/suite/parts/t/partition_alter2_2_myisam.test index 2edd6148e3e..c9b22ed8595 100644 --- a/mysql-test/suite/parts/t/partition_alter2_2_myisam.test +++ b/mysql-test/suite/parts/t/partition_alter2_2_myisam.test @@ -40,6 +40,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter3_innodb.test b/mysql-test/suite/parts/t/partition_alter3_innodb.test index 23c1a987aae..c63cf00bc53 100644 --- a/mysql-test/suite/parts/t/partition_alter3_innodb.test +++ b/mysql-test/suite/parts/t/partition_alter3_innodb.test @@ -39,6 +39,8 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on --list_files, which doesn't work correctly in embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter3_myisam.test b/mysql-test/suite/parts/t/partition_alter3_myisam.test index 2212065fcc1..372716982b5 100644 --- a/mysql-test/suite/parts/t/partition_alter3_myisam.test +++ b/mysql-test/suite/parts/t/partition_alter3_myisam.test @@ -39,6 +39,8 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on --list_files, which doesn't work correctly in embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter4_innodb.test b/mysql-test/suite/parts/t/partition_alter4_innodb.test index 3061e5c9e7f..09f0a402f9f 100644 --- a/mysql-test/suite/parts/t/partition_alter4_innodb.test +++ b/mysql-test/suite/parts/t/partition_alter4_innodb.test @@ -40,6 +40,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_alter4_myisam.test b/mysql-test/suite/parts/t/partition_alter4_myisam.test index 3b2117a3745..bd27e0f7cd3 100644 --- a/mysql-test/suite/parts/t/partition_alter4_myisam.test +++ b/mysql-test/suite/parts/t/partition_alter4_myisam.test @@ -40,6 +40,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_basic_innodb.test b/mysql-test/suite/parts/t/partition_basic_innodb.test index d3d5916886b..2fa94cbde21 100644 --- a/mysql-test/suite/parts/t/partition_basic_innodb.test +++ b/mysql-test/suite/parts/t/partition_basic_innodb.test @@ -40,6 +40,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_basic_myisam.test b/mysql-test/suite/parts/t/partition_basic_myisam.test index 8d84982335c..c1dffb3b616 100644 --- a/mysql-test/suite/parts/t/partition_basic_myisam.test +++ b/mysql-test/suite/parts/t/partition_basic_myisam.test @@ -40,6 +40,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_basic_symlink_myisam.test b/mysql-test/suite/parts/t/partition_basic_symlink_myisam.test index 8a12f8e8b39..0a25d1a11b8 100644 --- a/mysql-test/suite/parts/t/partition_basic_symlink_myisam.test +++ b/mysql-test/suite/parts/t/partition_basic_symlink_myisam.test @@ -40,6 +40,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc # The server must support symlink for DATA/INDEX DIRECTORY. diff --git a/mysql-test/suite/parts/t/partition_engine_innodb.test b/mysql-test/suite/parts/t/partition_engine_innodb.test index 13a7b133fa1..bd3e593b08f 100644 --- a/mysql-test/suite/parts/t/partition_engine_innodb.test +++ b/mysql-test/suite/parts/t/partition_engine_innodb.test @@ -39,6 +39,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_engine_myisam.test b/mysql-test/suite/parts/t/partition_engine_myisam.test index a7696d690db..17fb5926445 100644 --- a/mysql-test/suite/parts/t/partition_engine_myisam.test +++ b/mysql-test/suite/parts/t/partition_engine_myisam.test @@ -39,6 +39,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_special_innodb.test b/mysql-test/suite/parts/t/partition_special_innodb.test index eac19f6d588..347ec5119f9 100644 --- a/mysql-test/suite/parts/t/partition_special_innodb.test +++ b/mysql-test/suite/parts/t/partition_special_innodb.test @@ -58,8 +58,8 @@ ENGINE = InnoDB PARTITION BY HASH (a) PARTITIONS 2; -connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,); -connect (con2,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (con1,localhost,root,,test,$MASTER_MYPORT,); +connect (con2,localhost,root,,test,$MASTER_MYPORT,); --connection con1 SET autocommit=OFF; diff --git a/mysql-test/suite/parts/t/partition_syntax_innodb.test b/mysql-test/suite/parts/t/partition_syntax_innodb.test index 6e65337d267..db52c5dc471 100644 --- a/mysql-test/suite/parts/t/partition_syntax_innodb.test +++ b/mysql-test/suite/parts/t/partition_syntax_innodb.test @@ -39,6 +39,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc diff --git a/mysql-test/suite/parts/t/partition_syntax_myisam.test b/mysql-test/suite/parts/t/partition_syntax_myisam.test index 7777833f6d4..ba98062dfab 100644 --- a/mysql-test/suite/parts/t/partition_syntax_myisam.test +++ b/mysql-test/suite/parts/t/partition_syntax_myisam.test @@ -39,6 +39,9 @@ SET @max_row = 20; let $more_trigger_tests= 0; let $more_pk_ui_tests= 0; +# This test relies on connecting externally from mysqltest, doesn't +# work with embedded. +--source include/not_embedded.inc # The server must support partitioning. --source include/have_partition.inc From 314ac2a0ab1401062b75ab191dcd6fc62a66587c Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 10 Oct 2009 11:59:06 +0200 Subject: [PATCH 18/29] Fix failures in the funcs_1 test suite. Some result updates necessary due to extra tables and columns added in information_schema in MariaDB (XtraDB, PBXT, microsec_process). Also fix bad merge of two result files; apparently the test case was merged, but the result file was not. mysql-test/suite/funcs_1/datadict/processlist_priv.inc: Handle the new TIME_MS column in information_schema.processlist. mysql-test/suite/funcs_1/datadict/processlist_val.inc: Handle the new TIME_MS column in information_schema.processlist. mysql-test/suite/funcs_1/r/is_columns_is.result: Handle new tables in information_schema. mysql-test/suite/funcs_1/r/is_tables_is.result: Handle new tables in information_schema. mysql-test/suite/funcs_1/r/is_tables_myisam.result: Fix previous bad merge; apparently this file was not merged along with test changes. mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result: Handle the new TIME_MS column in information_schema.processlist. mysql-test/suite/funcs_1/r/processlist_val_no_prot.result: Fix previous bad merge; apparently this file was not merged along with test changes. Also handle the new TIME_MS column in INFORMATION_SCHEMA.PROCESSLIST. mysql-test/suite/funcs_1/t/is_columns_is.test: Since result file includes PBXT information_schema tables, we need PBXT to run this test. --- .../funcs_1/datadict/processlist_priv.inc | 58 +- .../funcs_1/datadict/processlist_val.inc | 18 +- .../suite/funcs_1/r/is_columns_is.result | 197 +++++ .../suite/funcs_1/r/is_tables_is.result | 690 ++++++++++++++++++ .../suite/funcs_1/r/is_tables_myisam.result | 545 +------------- .../funcs_1/r/processlist_priv_no_prot.result | 164 +++-- .../funcs_1/r/processlist_val_no_prot.result | 284 ++++--- mysql-test/suite/funcs_1/t/is_columns_is.test | 2 + 8 files changed, 1211 insertions(+), 747 deletions(-) diff --git a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc index 187ab730a2a..9bd8eaedd14 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc @@ -66,7 +66,7 @@ let $table= processlist; # # columns of the information_schema table e.g. to use in a select. -let $columns= ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO; +let $columns= ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS; # # Where clause for an update. let $update_where= WHERE id=1 ; @@ -137,11 +137,11 @@ WHERE DB = 'information_schema' AND COMMAND = 'Sleep' AND USER = 'ddicttestuser1 --source include/wait_condition.inc --replace_result ENGINE=MyISAM "" ENGINE=MARIA "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" "" eval SHOW CREATE TABLE $table; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS eval SHOW $table; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS eval SELECT * FROM $table $select_where ORDER BY id; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS eval SELECT $columns FROM $table $select_where ORDER BY id; --source suite/funcs_1/datadict/datadict_priv.inc --real_sleep 0.3 @@ -157,11 +157,11 @@ connection con100; # but "ddicttestuser1" must not see anything of the root session. --replace_result ENGINE=MyISAM "" ENGINE=MARIA "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" "" eval SHOW CREATE TABLE $table; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS eval SHOW $table; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS eval SELECT * FROM $table $select_where ORDER BY id; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS eval SELECT $columns FROM $table $select_where ORDER BY id; --source suite/funcs_1/datadict/datadict_priv.inc --real_sleep 0.3 @@ -183,9 +183,9 @@ GRANT PROCESS ON *.* TO ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass'; --echo #################################################################################### connection con100; SHOW GRANTS; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -195,9 +195,9 @@ SELECT * FROM information_schema.processlist; --echo #################################################################################### connect (con101,localhost,ddicttestuser1,ddictpass,information_schema); SHOW GRANTS; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -217,9 +217,9 @@ GRANT PROCESS ON *.* TO ''@'localhost'; --echo #################################################################################### connect (anonymous1,localhost,"''",,information_schema); SHOW GRANTS; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -239,9 +239,9 @@ connect (con102,localhost,ddicttestuser1,ddictpass,information_schema); --echo ddicttestuser1 are visible. --echo #################################################################################### SHOW GRANTS; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -264,10 +264,10 @@ SHOW GRANTS FOR ''@'localhost'; if ($fixed_bug_30395) { # Bug#30395 strange results after REVOKE PROCESS ON *.* FROM ... ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; } ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -286,9 +286,9 @@ connect (con103,localhost,ddicttestuser1,ddictpass,information_schema); --echo Only the processes of ddicttestuser1 user are visible. --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -308,9 +308,9 @@ connect (con104,localhost,ddicttestuser1,ddictpass,information_schema); --echo Only the processes of ddicttestuser1 are visible. --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -355,9 +355,9 @@ connect (con200,localhost,ddicttestuser2,ddictpass,information_schema); --echo ddicttestuser2 has now the PROCESS privilege and sees all connections --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser2'@'localhost'; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -376,9 +376,9 @@ connect (con201,localhost,ddicttestuser2,ddictpass,information_schema); --echo ddicttestuser2 has no more the PROCESS privilege and can only see own connects --echo #################################################################################### SHOW GRANTS; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -399,9 +399,9 @@ connect (con107,localhost,ddicttestuser1,ddictpass,information_schema); SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; --error ER_ACCESS_DENIED_ERROR GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost'; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -423,9 +423,9 @@ connect (con108,localhost,ddicttestuser1,ddictpass,information_schema); --echo Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST. --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SHOW processlist; ---replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS SELECT * FROM information_schema.processlist; --real_sleep 0.3 diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc index ee5347fa529..9936b7c580b 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc @@ -93,9 +93,9 @@ echo # - INFO must contain the corresponding SHOW/SELECT PROCESSLIST # # 1. Just dump what we get ---replace_column 1 3 6