From c34e5a9152723c4b8c92c538ee4cc3082b24ea00 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 4 May 2011 15:45:39 +0200 Subject: [PATCH 1/4] Avoid mtr warning on Windows during startup The reason for mtr warning is that collect_mysqld_features() starts mysqld with --datadir=/tmp and this directory does not exist on Windows. Fix : instead of passing --datadir=$opt_vardir/tmp in collect_mysqld_features() just use --datadir=. mysqld does not need a correct directory, just an existing one, as it is started with --help ---verbose -skip-grant-tables. --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 0bf0245325a..f10f5e4fcba 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1697,7 +1697,7 @@ sub collect_mysqld_features { my $args; mtr_init_args(\$args); mtr_add_arg($args, "--no-defaults"); - mtr_add_arg($args, "--datadir=%s/tmp", $opt_vardir); + mtr_add_arg($args, "--datadir=."); mtr_add_arg($args, "--basedir=%s", $basedir); mtr_add_arg($args, "--language=%s", $path_language); mtr_add_arg($args, "--skip-grant-tables"); From aff371f662796e6313f39a163de858aaeb139d06 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 4 May 2011 16:03:52 +0200 Subject: [PATCH 2/4] Cherrypick fix for maria recovery bug LPBUG#686006 from 5.2 into 5.1 --- mysql-test/include/maria_make_snapshot_for_comparison.inc | 1 + mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/include/maria_make_snapshot_for_comparison.inc b/mysql-test/include/maria_make_snapshot_for_comparison.inc index cb756f60527..0c71bd10408 100644 --- a/mysql-test/include/maria_make_snapshot_for_comparison.inc +++ b/mysql-test/include/maria_make_snapshot_for_comparison.inc @@ -8,6 +8,7 @@ # cover tables mysqltest.$mms_tname1,...$mms_tnameN connection admin; +--source include/wait_until_connected_again.inc let $mms_table_to_use=$mms_tables; let $mms_purpose=comparison; diff --git a/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc b/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc index c204409de4d..8a2a99c28eb 100644 --- a/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc +++ b/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc @@ -11,6 +11,7 @@ connection admin; +--source include/wait_until_connected_again.inc let $mms_table_to_use=$mms_tables; let $mms_purpose=feeding_recovery; From 3c9ae014ca93480ab7f4868d5c69db59bc1a9fd1 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Wed, 4 May 2011 21:28:02 +0300 Subject: [PATCH 3/4] Fixed build errors on centos5-amd64-minimal, where we compile with very few character sets Fixed compiler warnings client/readline.cc: Fixed compiler warning mysql-test/t/mysqldump.test: Only run test if utf8 is used sql/log.cc: Fixed compiler warning sql/mysql_priv.h: Fixed compiler warnings tests/mysql_client_test.c: Don't abort test if ucs2 is not in use. --- client/readline.cc | 1 + mysql-test/t/mysqldump.test | 4 ++++ sql/log.cc | 1 + sql/mysql_priv.h | 16 ++++++++-------- tests/mysql_client_test.c | 3 ++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/client/readline.cc b/client/readline.cc index 946cb582977..4edccebef39 100644 --- a/client/readline.cc +++ b/client/readline.cc @@ -56,6 +56,7 @@ char *batch_readline(LINE_BUFFER *line_buff) { char *pos; ulong out_length; + LINT_INIT(out_length); if (!(pos=intern_read_line(line_buff, &out_length))) return 0; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 00d9339fcf4..99537618011 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -6,6 +6,10 @@ call mtr.add_suppression("@003f.frm' \\(errno: 22\\)"); # Binlog is required --source include/have_log_bin.inc +# utf8 is required +let collation=utf8_unicode_ci; +--source include/have_collation.inc + # Save the initial number of concurrent sessions --source include/count_sessions.inc diff --git a/sql/log.cc b/sql/log.cc index c0feb753bef..ad546cc3642 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1877,6 +1877,7 @@ static int find_uniq_filename(char *name) size_t buf_length, length; char *start, *end; DBUG_ENTER("find_uniq_filename"); + LINT_INIT(number); length= dirname_part(buff, name, &buf_length); start= name + length; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 0a62c17e2fc..24c8ba0b257 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -909,14 +909,14 @@ struct Query_cache_query_flags (((L)->sql_command == SQLCOM_SELECT) && (L)->safe_to_cache_query) #else #define QUERY_CACHE_FLAGS_SIZE 0 -#define query_cache_store_query(A, B) -#define query_cache_destroy() -#define query_cache_result_size_limit(A) -#define query_cache_init() -#define query_cache_resize(A) -#define query_cache_set_min_res_unit(A) -#define query_cache_invalidate3(A, B, C) -#define query_cache_invalidate1(A) +#define query_cache_store_query(A, B) do { } while(0) +#define query_cache_destroy() do { } while(0) +#define query_cache_result_size_limit(A) do { } while(0) +#define query_cache_init() do { } while(0) +#define query_cache_resize(A) do { } while(0) +#define query_cache_set_min_res_unit(A) do { } while(0) +#define query_cache_invalidate3(A, B, C) do { } while(0) +#define query_cache_invalidate1(A) do { } while(0) #define query_cache_send_result_to_client(A, B, C) 0 #define query_cache_invalidate_by_MyISAM_filename_ref NULL diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 22d62d9a661..bbb98229222 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -18466,7 +18466,8 @@ static void test_bug58036() if (!opt_silent) printf("Got mysql_real_connect() error (expected): %s (%d)\n", mysql_error(conn), mysql_errno(conn)); - DIE_UNLESS(mysql_errno(conn) == ER_WRONG_VALUE_FOR_VAR); + DIE_UNLESS(mysql_errno(conn) == ER_WRONG_VALUE_FOR_VAR || + mysql_errno(conn)== CR_CANT_READ_CHARSET); mysql_close(conn); From a3af6f0f3d023bcbba7be013343b46a400cf0648 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Wed, 4 May 2011 21:51:44 +0300 Subject: [PATCH 4/4] Fixed build errors on centos5-amd64-minimal, where we compile with very few character sets Fixed compiler warnings client/readline.cc: Fixed compiler warning mysql-test/suite/innodb/t/innodb_bug60049.test: This test failed when running with --mysqld=--loose-innodb-fast-shutdown=2 which we do on some machines mysql-test/t/mysqldump.test: Only run test if utf8 is used sql/log.cc: Fixed compiler warning sql/mysql_priv.h: Fixed compiler warnings tests/mysql_client_test.c: Don't abort test if ucs2 is not in use. --- client/readline.cc | 1 + mysql-test/suite/innodb/t/innodb_bug60049.test | 6 ++++++ mysql-test/t/mysqldump.test | 4 ++++ sql/log.cc | 1 + sql/mysql_priv.h | 16 ++++++++-------- tests/mysql_client_test.c | 3 ++- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/client/readline.cc b/client/readline.cc index 946cb582977..4edccebef39 100644 --- a/client/readline.cc +++ b/client/readline.cc @@ -56,6 +56,7 @@ char *batch_readline(LINE_BUFFER *line_buff) { char *pos; ulong out_length; + LINT_INIT(out_length); if (!(pos=intern_read_line(line_buff, &out_length))) return 0; diff --git a/mysql-test/suite/innodb/t/innodb_bug60049.test b/mysql-test/suite/innodb/t/innodb_bug60049.test index ec4e3b8de7e..1110f619862 100644 --- a/mysql-test/suite/innodb/t/innodb_bug60049.test +++ b/mysql-test/suite/innodb/t/innodb_bug60049.test @@ -5,6 +5,12 @@ -- source include/not_embedded.inc -- source include/have_innodb.inc +if (`SELECT @@innodb_fast_shutdown != 0`) + +{ + skip Need innodb_fast_shutdown=0; +} + CREATE TABLE t(a INT)ENGINE=InnoDB; RENAME TABLE t TO u; DROP TABLE u; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 00d9339fcf4..99537618011 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -6,6 +6,10 @@ call mtr.add_suppression("@003f.frm' \\(errno: 22\\)"); # Binlog is required --source include/have_log_bin.inc +# utf8 is required +let collation=utf8_unicode_ci; +--source include/have_collation.inc + # Save the initial number of concurrent sessions --source include/count_sessions.inc diff --git a/sql/log.cc b/sql/log.cc index c0feb753bef..ad546cc3642 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1877,6 +1877,7 @@ static int find_uniq_filename(char *name) size_t buf_length, length; char *start, *end; DBUG_ENTER("find_uniq_filename"); + LINT_INIT(number); length= dirname_part(buff, name, &buf_length); start= name + length; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 0a62c17e2fc..24c8ba0b257 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -909,14 +909,14 @@ struct Query_cache_query_flags (((L)->sql_command == SQLCOM_SELECT) && (L)->safe_to_cache_query) #else #define QUERY_CACHE_FLAGS_SIZE 0 -#define query_cache_store_query(A, B) -#define query_cache_destroy() -#define query_cache_result_size_limit(A) -#define query_cache_init() -#define query_cache_resize(A) -#define query_cache_set_min_res_unit(A) -#define query_cache_invalidate3(A, B, C) -#define query_cache_invalidate1(A) +#define query_cache_store_query(A, B) do { } while(0) +#define query_cache_destroy() do { } while(0) +#define query_cache_result_size_limit(A) do { } while(0) +#define query_cache_init() do { } while(0) +#define query_cache_resize(A) do { } while(0) +#define query_cache_set_min_res_unit(A) do { } while(0) +#define query_cache_invalidate3(A, B, C) do { } while(0) +#define query_cache_invalidate1(A) do { } while(0) #define query_cache_send_result_to_client(A, B, C) 0 #define query_cache_invalidate_by_MyISAM_filename_ref NULL diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 22d62d9a661..bbb98229222 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -18466,7 +18466,8 @@ static void test_bug58036() if (!opt_silent) printf("Got mysql_real_connect() error (expected): %s (%d)\n", mysql_error(conn), mysql_errno(conn)); - DIE_UNLESS(mysql_errno(conn) == ER_WRONG_VALUE_FOR_VAR); + DIE_UNLESS(mysql_errno(conn) == ER_WRONG_VALUE_FOR_VAR || + mysql_errno(conn)== CR_CANT_READ_CHARSET); mysql_close(conn);