diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2008-06-24 21:03:17 +0500 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2008-06-24 21:03:17 +0500 |
commit | 2c77798c7439f7464f371932888f6ac54217f981 (patch) | |
tree | 2e492345dfd615a19cfdcc25861978ce1d2c1282 | |
parent | 6eb2e76abdbf903d6b3848961f942c7d41d640a0 (diff) | |
download | mariadb-git-2c77798c7439f7464f371932888f6ac54217f981.tar.gz |
back-port from 5.1.
Bug#33812: mysql client incorrectly parsing DELIMITER
Remove unnecessary and incorrect code that tried
to pull delimiter commands out of the middle of
statements.
-rw-r--r-- | client/mysql.cc | 31 | ||||
-rw-r--r-- | mysql-test/r/mysql.result | 2 | ||||
-rw-r--r-- | mysql-test/t/mysql_delimiter.sql | 6 |
3 files changed, 8 insertions, 31 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 5348941b92f..b373b9125a0 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2081,37 +2081,6 @@ 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 eded1a3fc3b..bc50c686ac6 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -38,6 +38,8 @@ 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 533ac2ce093..917401275a2 100644 --- a/mysql-test/t/mysql_delimiter.sql +++ b/mysql-test/t/mysql_delimiter.sql @@ -61,6 +61,12 @@ 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 # |