From 9a864bb70a6611e9f513b6df2fe4240f2433f2bf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Dec 2006 12:13:43 +0100 Subject: [PATCH 1/7] Fix problems with "make dist" and running from "binary dist" mysql-test/Makefile.am: Add missing ($DESTDIR) wich cause "make discheck" to fail scripts/make_binary_distribution.sh: Add std_data/*.MY* files to binary dist --- mysql-test/Makefile.am | 2 +- scripts/make_binary_distribution.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 72998d786b9..341afac1c9a 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -98,7 +98,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(DESTDIR)$(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(DESTDIR)$(testdir)/lib $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index a6a2f1e3b49..ec1c6b70bb6 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -245,7 +245,7 @@ $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ - mysql-test/std_data/*.cnf \ + mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ $BASE/mysql-test/std_data $CP mysql-test/t/*.test mysql-test/t/*.imtest \ mysql-test/t/*.disabled mysql-test/t/*.opt \ From ca1aebbd57a67381b1016d63f614e21af80a1d0c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Dec 2006 13:37:40 +0100 Subject: [PATCH 2/7] Backport fix for mysqladmin on windows test failure --- mysql-test/t/mysqladmin.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test index 7c016fd7416..850abc1ee69 100644 --- a/mysql-test/t/mysqladmin.test +++ b/mysql-test/t/mysqladmin.test @@ -15,7 +15,7 @@ database=db1 EOF ---replace_regex /\/.*mysqladmin/mysqladmin/ +--replace_regex /.*mysqladmin.*: unknown/mysqladmin: unknown/ --error 7 --exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 @@ -27,6 +27,6 @@ EOF loose-database=db2 EOF ---replace_regex /Warning: .*mysqladmin/Warning: mysqladmin/ +--replace_regex /Warning: .*mysqladmin.*: unknown/Warning: mysqladmin: unknown/ --exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 From 33a098bf7607db19f513d80e2391b757e9ce6536 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Dec 2006 16:08:54 +0100 Subject: [PATCH 3/7] Bug#24498 Stack overflow in mysqltest - Thanks to Vasil Dimov for the patch! client/mysqltest.c: Use my_snprintf to protect against exceeding size of buff Since variable name and valu might not be null terminated it's necessary to provide the length of the format specifiers. --- client/mysqltest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index c6cbf6aabe0..ac186a7361e 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1240,7 +1240,9 @@ void var_set(const char *var_name, const char *var_name_end, v->int_dirty= 0; v->str_val_len= strlen(v->str_val); } - strxmov(buf, v->name, "=", v->str_val, NullS); + my_snprintf(buf, sizeof(buf), "%.*s=%.*s", + v->name_len, v->name, + v->str_val_len, v->str_val); if (!(v->env_s= my_strdup(buf, MYF(MY_WME)))) die("Out of memory"); putenv(v->env_s); From e8d82549afbb8ba46d3a65e027fbbe2c401ec17b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Dec 2006 16:43:50 +0100 Subject: [PATCH 4/7] Bug#19410 Test 'kill' fails on Windows + SCO - Use "mysql_field_count" to determine if there is a need to call "mysql_store_result" client/mysqltest.c: Only call 'mysql_store_result' if 'mysql_field_count' is greater than 0 indicating that this query has a result set. This change is mainly since if mysql_store_result fails the value returned by mysql_field_count will be reset. --- client/mysqltest.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index ac186a7361e..3d9344fb098 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4680,10 +4680,9 @@ void run_query_normal(struct st_connection *cn, struct st_command *command, } /* - Store the result. If res is NULL, use mysql_field_count to - determine if that was expected + Store the result of the query if it will return any fields */ - if (!(res= mysql_store_result(mysql)) && mysql_field_count(mysql)) + if (mysql_field_count(mysql) && ((res= mysql_store_result(mysql)) == 0)) { handle_error(command, mysql_errno(mysql), mysql_error(mysql), mysql_sqlstate(mysql), ds); @@ -4735,7 +4734,10 @@ void run_query_normal(struct st_connection *cn, struct st_command *command, } if (res) + { mysql_free_result(res); + res= 0; + } counter++; } while (!(err= mysql_next_result(mysql))); if (err > 0) From 8fc4864ed76247b20258d5234e2d42ed34ae35c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Dec 2006 16:48:49 +0100 Subject: [PATCH 5/7] Add missing space --- client/mysqltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 3d9344fb098..ad7124601ab 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4804,7 +4804,7 @@ void handle_error(struct st_command *command, err_errno, err_error); /* Abort the run of this test, pass the failed query as reason */ - abort_not_supported_test("Query '%s' failed, required functionality" \ + abort_not_supported_test("Query '%s' failed, required functionality " \ "not supported", command->query); } From 0abeff727d7033ae653cd192d48ab302f069993e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Dec 2006 17:09:07 +0100 Subject: [PATCH 6/7] Bug#19410 Test 'kill' fails on Windows + SCO mysql-test/t/kill.test: Move the connect of second connection to just before the query to be killed are sent. This introduces less variance since the connect time is not included in the delay we want between send of query and kill. --- mysql-test/t/kill.test | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index 50c4239b45e..1cf871d5f9f 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -70,11 +70,14 @@ insert into t2 select id from t1; create table t3 (kill_id int); insert into t3 values(connection_id()); +connect (conn2, localhost, root,,); +connection conn2; + +connection conn1; -- disable_result_log send select id from t1 where id in (select distinct id from t2); -- enable_result_log -connect (conn2, localhost, root,,); connection conn2; select ((@id := kill_id) - kill_id) from t3; -- sleep 1 From 29ff97f8cce5b5857070982f9ee9ef46c8577488 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 11 Dec 2006 11:25:45 +0100 Subject: [PATCH 7/7] Bug#23735 mysqlbinlog client fails when reading binlog from stdin - Windows opens stdin in text mode by default. Certain characters such as CTRL-Z are interpeted as events and the read() method will stop. CTRL-Z is the EOF marker in Windows. to get past this you have to open stdin in binary mode. Setmode() is used to set stdin in binary mode. Errors on setting this mode result in halting the function and printing an error message to stderr. client/mysqlbinlog.cc: Apply fix to 5.0 as well --- client/mysqlbinlog.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index ff4e0b5a5cf..102c665031d 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1310,6 +1310,25 @@ static int dump_local_log_entries(const char* logname) } else // reading from stdin; { + /* + Bug fix: #23735 + Author: Chuck Bell + Description: + Windows opens stdin in text mode by default. Certain characters + such as CTRL-Z are interpeted as events and the read() method + will stop. CTRL-Z is the EOF marker in Windows. to get past this + you have to open stdin in binary mode. Setmode() is used to set + stdin in binary mode. Errors on setting this mode result in + halting the function and printing an error message to stderr. + */ +#if defined (__WIN__) || (_WIN64) + if (_setmode(fileno(stdin), O_BINARY) == -1) + { + fprintf(stderr, "Could not set binary mode on stdin.\n"); + return 1; + } +#endif + if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0, 0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE))) return 1;