List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:July 17 2008 11:19pm
Subject:bzr commit into mysql-5.0 branch (davi:2581) Bug#38158, Bug#33812
View as plain text  
# At a local mysql-5.0 repository of davi

 2581 Davi Arnaut	2008-07-17
      Bug#33812: mysql client incorrectly parsing DELIMITER
      
      Revert fix for this bug as it introduced a regression
      reported in Bug#38158.
modified:
  client/mysql.cc
  mysql-test/r/mysql.result
  mysql-test/t/mysql_delimiter.sql

per-file messages:
  client/mysql.cc
    Revert fix for Bug#33812
  mysql-test/r/mysql.result
    Revert fix for Bug#33812
  mysql-test/t/mysql_delimiter.sql
    Revert fix for Bug#33812
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2008-06-24 16:05:56 +0000
+++ b/client/mysql.cc	2008-07-17 23:19:13 +0000
@@ -2081,6 +2081,37 @@ 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	2008-06-24 16:03:17 +0000
+++ b/mysql-test/r/mysql.result	2008-07-17 23:19:13 +0000
@@ -38,8 +38,6 @@ 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	2008-06-24 16:03:17 +0000
+++ b/mysql-test/t/mysql_delimiter.sql	2008-07-17 23:19:13 +0000
@@ -61,12 +61,6 @@ 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
 #

Thread
bzr commit into mysql-5.0 branch (davi:2581) Bug#38158, Bug#33812Davi Arnaut18 Jul