List:Commits« Previous MessageNext Message »
From:Gleb Shchepa Date:June 24 2008 4:15pm
Subject:bzr commit into mysql-5.1 branch (gshchepa:2673)
View as plain text  
#At file:///work/bzr/mysql-5.1-bugteam/

 2673 Gleb Shchepa	2008-06-24 [merge]
      auto merge 5.0-bugteam --> 5.1-bugteam
modified:
  client/mysql.cc
  mysql-test/r/mysql.result
  mysql-test/t/mysql_delimiter.sql

=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2008-03-28 18:20:21 +0000
+++ b/client/mysql.cc	2008-06-24 16:15:00 +0000
@@ -1821,7 +1821,7 @@ static int read_and_execute(bool interac
         the very beginning of a text file when
         you save the file using "Unicode UTF-8" format.
       */
-      if (!line_number &&
+      if (line && !line_number &&
            (uchar) line[0] == 0xEF &&
            (uchar) line[1] == 0xBB &&
            (uchar) line[2] == 0xBF)
@@ -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
@@ -2176,7 +2145,14 @@ static bool add_line(String &buffer,char
     }
     else if (!*ml_comment && (!*in_string && (inchar == '#' ||
 			      inchar == '-' && pos[1] == '-' &&
-			      my_isspace(charset_info,pos[2]))))
+                              /*
+                                The third byte is either whitespace or is the
+                                end of the line -- which would occur only
+                                because of the user sending newline -- which is
+                                itself whitespace and should also match.
+                              */
+			      (my_isspace(charset_info,pos[2]) ||
+                               !pos[2]))))
     {
       // Flush previously accepted characters
       if (out != line)

=== 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-24 16:15:00 +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-24 16:03:17 +0000
@@ -59,3 +59,16 @@ 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
+
+#
+# Bug #36244: MySQL CLI doesn't recognize standalone -- as comment
+#             before DELIMITER statement
+#
+--
+DELIMITER ;

Thread
bzr commit into mysql-5.1 branch (gshchepa:2673) Gleb Shchepa24 Jun