summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2008-06-20 18:58:14 +0200
committerTatiana A. Nurnberg <azundris@mysql.com>2008-06-20 18:58:14 +0200
commit574c57ccecb9f3131f7c2b5d5b0400cdaaaae41b (patch)
tree6737b1f8dea3594b907b380ebebc50fa391d0a3b
parentb4a45a712179865d2415a9e7df6761aa126dab2a (diff)
downloadmariadb-git-574c57ccecb9f3131f7c2b5d5b0400cdaaaae41b.tar.gz
Bug#33812: mysql client incorrectly parsing DELIMITER
Remove unnecessary and incorrect code that tried to pull delimiter commands out of the middle of statements. 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.
-rw-r--r--client/mysql.cc31
-rw-r--r--mysql-test/r/mysql.result2
-rw-r--r--mysql-test/t/mysql_delimiter.sql6
3 files changed, 8 insertions, 31 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 2ef987492b7..20ad769e9b4 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2101,37 +2101,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 a4d96c1c243..6fe35d5c9f9 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 db679c3b06b..8caa7cebc2f 100644
--- a/mysql-test/t/mysql_delimiter.sql
+++ b/mysql-test/t/mysql_delimiter.sql
@@ -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