From: Date: June 20 2008 6:58pm Subject: bzr commit into mysql-5.1 branch (azundris:2661) Bug#33812 List-Archive: http://lists.mysql.com/commits/48263 X-Bug: 33812 Message-Id: <20080620165822.28C6F42E73AF@noir.koehntopp.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///misc/mysql/forest/mysql-5.1-3/ 2661 Tatiana A. Nurnberg 2008-06-20 Bug#33812: mysql client incorrectly parsing DELIMITER Remove unnecessary and incorrect code that tried to pull delimiter commands out of the middle of statements. modified: client/mysql.cc mysql-test/r/mysql.result mysql-test/t/mysql_delimiter.sql per-file messages: client/mysql.cc Remove unnecessary and incorrect code that tried to pull delimiter commands out of the middle of statements. mysql-test/r/mysql.result show we no longer parse DELIMITER when we shouldn't. mysql-test/t/mysql_delimiter.sql show we no longer parse DELIMITER when we shouldn't. === modified file 'client/mysql.cc' --- a/client/mysql.cc 2008-06-19 03:12:28 +0000 +++ b/client/mysql.cc 2008-06-20 16:58:14 +0000 @@ -2101,37 +2101,6 @@ static bool add_line(String &buffer,char 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 === modified file 'mysql-test/r/mysql.result' --- a/mysql-test/r/mysql.result 2007-11-26 18:50:43 +0000 +++ b/mysql-test/r/mysql.result 2008-06-20 16:58:14 +0000 @@ -38,6 +38,8 @@ t2 t3 Tables_in_test t1 +delimiter +1 _ Test delimiter : from command line a === modified file 'mysql-test/t/mysql_delimiter.sql' --- a/mysql-test/t/mysql_delimiter.sql 2006-11-22 06:27:06 +0000 +++ b/mysql-test/t/mysql_delimiter.sql 2008-06-20 16:58:14 +0000 @@ -59,3 +59,9 @@ source t/mysql_delimiter_19799.sql use test// show tables// delimiter ; # Reset delimiter + +# +# Bug #33812: mysql client incorrectly parsing DELIMITER +# +select a as delimiter from t1 +delimiter ; # Reset delimiter