From 430aaacdaf7405946c3b447e58316a9871113c14 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 17 Jul 2008 17:33:41 +0300 Subject: [PATCH 1/3] Folow-up on Bug#37069: fix a valgrind warning Don't initalize federated if it's disabled by a command line option. sql/ha_federated.cc: Folow-up on Bug#37069: Don't initalize federated if it's disabled by a command line option. --- sql/ha_federated.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 2ccfeba74cb..9ce5d44534e 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -405,6 +405,9 @@ static byte *federated_get_key(FEDERATED_SHARE *share, uint *length, bool federated_db_init() { DBUG_ENTER("federated_db_init"); + /* the federated engine can be disabled by a command line option */ + if (have_federated_db == SHOW_OPTION_DISABLED) + DBUG_RETURN(TRUE); if (pthread_mutex_init(&federated_mutex, MY_MUTEX_INIT_FAST)) goto error; if (hash_init(&federated_open_tables, &my_charset_bin, 32, 0, 0, From 6a42c35fa74103c8706ffd223a22dd25df7faa63 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 18 Jul 2008 14:07:16 +0500 Subject: [PATCH 2/3] Bug#27934 test client_xml misssing initialization Problem: missing initialization, if the previous test fails leaving table t1, client_xml fails as well. Fix: adding initialization. --- mysql-test/r/client_xml.result | 1 + mysql-test/t/client_xml.test | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/mysql-test/r/client_xml.result b/mysql-test/r/client_xml.result index ed5e8f2c1b8..b7bca426e65 100644 --- a/mysql-test/r/client_xml.result +++ b/mysql-test/r/client_xml.result @@ -1,3 +1,4 @@ +drop table if exists t1; create table t1 ( `a&b` int, `a Date: Fri, 18 Jul 2008 13:24:59 +0300 Subject: [PATCH 3/3] Bug 38158: mysql client regression, can't read dump files - Revert the fix for bug 33812 - fixed a win32 warning client/mysql.cc: revert the fix for bug 33812 mysql-test/r/mysql.result: revert the fix for bug 33812 mysql-test/t/mysql_delimiter.sql: revert the fix for bug 33812 mysys/default.c: fixed a win32 warning --- client/mysql.cc | 31 +++++++++++++++++++++++++++++++ mysql-test/r/mysql.result | 2 -- mysql-test/t/mysql_delimiter.sql | 6 ------ mysys/default.c | 2 +- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index c8d5522628d..9b14f9fb3ef 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2081,6 +2081,37 @@ static bool add_line(String &buffer,char *line,char *in_string, continue; } } + else if (!*ml_comment && !*in_string && + (end_of_line - pos) >= 10 && + !my_strnncoll(charset_info, (uchar*) pos, 10, + (const uchar*) "delimiter ", 10)) + { + // Flush previously accepted characters + if (out != line) + { + buffer.append(line, (uint32) (out - line)); + out= line; + } + + // Flush possible comments in the buffer + if (!buffer.is_empty()) + { + if (com_go(&buffer, 0) > 0) // < 0 is not fatal + DBUG_RETURN(1); + buffer.length(0); + } + + /* + Delimiter wants the get rest of the given line as argument to + allow one to change ';' to ';;' and back + */ + buffer.append(pos); + if (com_delimiter(&buffer, pos) > 0) + DBUG_RETURN(1); + + buffer.length(0); + break; + } else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter)) { // Found a statement. Continue parsing after the delimiter diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index bc50c686ac6..eded1a3fc3b 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -38,8 +38,6 @@ t2 t3 Tables_in_test t1 -delimiter -1 _ Test delimiter : from command line a diff --git a/mysql-test/t/mysql_delimiter.sql b/mysql-test/t/mysql_delimiter.sql index 917401275a2..533ac2ce093 100644 --- a/mysql-test/t/mysql_delimiter.sql +++ b/mysql-test/t/mysql_delimiter.sql @@ -60,12 +60,6 @@ use test// show tables// delimiter ; # Reset delimiter -# -# Bug #33812: mysql client incorrectly parsing DELIMITER -# -select a as delimiter from t1 -delimiter ; # Reset delimiter - # # Bug #36244: MySQL CLI doesn't recognize standalone -- as comment # before DELIMITER statement diff --git a/mysys/default.c b/mysys/default.c index bf32261129b..b7eb963e395 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -1017,7 +1017,7 @@ static const char *my_get_module_parent(char *buf, size_t size) { char *last= NULL; char *end; - if (!GetModuleFileName(NULL, buf, size)) + if (!GetModuleFileName(NULL, buf, (DWORD) size)) return NULL; end= strend(buf);