MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Gleb Shchepa Date:June 24 2008 4:27pm
Subject:bzr push into mysql-5.0 branch (gshchepa:2640 to 2643) Bug#36244, Bug#37164,
Bug#35480, Bug#33812, Bug#37167
View as plain text  
 2643 Gleb Shchepa	2008-06-24
      back-port from 5.1.
      
      Bug#35480: BOM detection code crashes mysql CLI with zero-sized input
            
      MySQL client crashed if no input was passed to it.
modified:
  client/mysql.cc

 2642 Gleb Shchepa	2008-06-24
      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.
modified:
  client/mysql.cc
  mysql-test/r/mysql.result
  mysql-test/t/mysql_delimiter.sql

 2641 Gleb Shchepa	2008-06-24
      Bug #36244: MySQL CLI doesn't recognize standalone -- 
                  as a commentary
      
      mysql client has been modified to interpret EOL after
      standalone -- commentary strings like whitespace
      character (according to
      http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html)
modified:
  client/mysql.cc
  mysql-test/t/mysql_delimiter.sql

 2640 Matthias Leich	2008-06-18 [merge]
      Fix for
           Bug#37167 funcs_1: Many tests fail if the embedded server is used.
           Bug#37164 funcs_1: Some tests fail if an optional character set is missing.
      + some cleanup within the testsuite related to the fixes above
      + some adjustments to open bugs on Mac OS X
added:
  mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
  mysql-test/suite/funcs_1/datadict/is_routines.inc
  mysql-test/suite/funcs_1/datadict/is_schemata.inc
  mysql-test/suite/funcs_1/datadict/is_tables.inc
  mysql-test/suite/funcs_1/datadict/is_triggers.inc
  mysql-test/suite/funcs_1/datadict/is_views.inc
  mysql-test/suite/funcs_1/datadict/tables.inc
  mysql-test/suite/funcs_1/include/bug28309_skip.inc
  mysql-test/suite/funcs_1/r/is_cml_innodb.result
  mysql-test/suite/funcs_1/r/is_cml_memory.result
  mysql-test/suite/funcs_1/r/is_cml_myisam.result
  mysql-test/suite/funcs_1/r/is_cml_ndb.result
  mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
  mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
  mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
  mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result
  mysql-test/suite/funcs_1/r/is_routines_embedded.result
  mysql-test/suite/funcs_1/r/is_schemata_embedded.result
  mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
  mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
  mysql-test/suite/funcs_1/r/is_tables_embedded.result
  mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
  mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
  mysql-test/suite/funcs_1/r/is_triggers_embedded.result
  mysql-test/suite/funcs_1/r/is_views_embedded.result
  mysql-test/suite/funcs_1/t/is_cml_innodb.test
  mysql-test/suite/funcs_1/t/is_cml_memory.test
  mysql-test/suite/funcs_1/t/is_cml_myisam.test
  mysql-test/suite/funcs_1/t/is_cml_ndb.test
  mysql-test/suite/funcs_1/t/is_columns_is_embedded.test
  mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test
  mysql-test/suite/funcs_1/t/is_columns_mysql_embedded.test
  mysql-test/suite/funcs_1/t/is_key_column_usage_embedded.test
  mysql-test/suite/funcs_1/t/is_routines_embedded.test
  mysql-test/suite/funcs_1/t/is_schemata_embedded.test
  mysql-test/suite/funcs_1/t/is_statistics_mysql_embedded.test
  mysql-test/suite/funcs_1/t/is_table_constraints_mysql_embedded.test
  mysql-test/suite/funcs_1/t/is_tables_embedded.test
  mysql-test/suite/funcs_1/t/is_tables_myisam_embedded.test
  mysql-test/suite/funcs_1/t/is_tables_mysql_embedded.test
  mysql-test/suite/funcs_1/t/is_triggers_embedded.test
  mysql-test/suite/funcs_1/t/is_views_embedded.test
modified:
  mysql-test/suite/funcs_1/datadict/columns.inc
  mysql-test/suite/funcs_1/datadict/tables1.inc
  mysql-test/suite/funcs_1/datadict/tables2.inc
  mysql-test/suite/funcs_1/include/innodb_tb1.inc
  mysql-test/suite/funcs_1/include/innodb_tb3.inc
  mysql-test/suite/funcs_1/include/innodb_tb4.inc
  mysql-test/suite/funcs_1/include/memory_tb4.inc
  mysql-test/suite/funcs_1/include/myisam_tb1.inc
  mysql-test/suite/funcs_1/include/myisam_tb3.inc
  mysql-test/suite/funcs_1/include/myisam_tb4.inc
  mysql-test/suite/funcs_1/r/innodb_trig_frkey.result
  mysql-test/suite/funcs_1/r/is_columns_innodb.result
  mysql-test/suite/funcs_1/r/is_columns_memory.result
  mysql-test/suite/funcs_1/r/is_columns_myisam.result
  mysql-test/suite/funcs_1/r/is_tables_innodb.result
  mysql-test/suite/funcs_1/r/is_tables_is.result
  mysql-test/suite/funcs_1/r/is_tables_memory.result
  mysql-test/suite/funcs_1/r/is_tables_myisam.result
  mysql-test/suite/funcs_1/r/is_tables_mysql.result
  mysql-test/suite/funcs_1/r/is_tables_ndb.result
  mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
  mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
  mysql-test/suite/funcs_1/t/disabled.def
  mysql-test/suite/funcs_1/t/innodb_trig_frkey.test
  mysql-test/suite/funcs_1/t/is_basics_mixed.test
  mysql-test/suite/funcs_1/t/is_column_privileges.test
  mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test
  mysql-test/suite/funcs_1/t/is_columns.test
  mysql-test/suite/funcs_1/t/is_columns_innodb.test
  mysql-test/suite/funcs_1/t/is_columns_is.test
  mysql-test/suite/funcs_1/t/is_columns_memory.test
  mysql-test/suite/funcs_1/t/is_columns_myisam.test
  mysql-test/suite/funcs_1/t/is_columns_mysql.test
  mysql-test/suite/funcs_1/t/is_columns_ndb.test
  mysql-test/suite/funcs_1/t/is_key_column_usage.test
  mysql-test/suite/funcs_1/t/is_routines.test
  mysql-test/suite/funcs_1/t/is_schema_privileges.test
  mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test
  mysql-test/suite/funcs_1/t/is_schemata.test
  mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test
  mysql-test/suite/funcs_1/t/is_statistics.test
  mysql-test/suite/funcs_1/t/is_statistics_mysql.test
  mysql-test/suite/funcs_1/t/is_table_constraints.test
  mysql-test/suite/funcs_1/t/is_table_constraints_mysql.test
  mysql-test/suite/funcs_1/t/is_table_privileges.test
  mysql-test/suite/funcs_1/t/is_tables.test
  mysql-test/suite/funcs_1/t/is_tables_innodb.test
  mysql-test/suite/funcs_1/t/is_tables_memory.test
  mysql-test/suite/funcs_1/t/is_tables_myisam.test
  mysql-test/suite/funcs_1/t/is_tables_mysql.test
  mysql-test/suite/funcs_1/t/is_tables_ndb.test
  mysql-test/suite/funcs_1/t/is_triggers.test
  mysql-test/suite/funcs_1/t/is_user_privileges.test
  mysql-test/suite/funcs_1/t/is_views.test
  mysql-test/suite/funcs_1/t/memory_trig_0102.test
  mysql-test/suite/funcs_1/t/memory_trig_0407.test
  mysql-test/suite/funcs_1/t/memory_trig_1011ext.test
  mysql-test/suite/funcs_1/t/memory_views.test
  mysql-test/suite/funcs_1/triggers/trig_frkey.inc
  mysql-test/suite/funcs_1/triggers/triggers_03.inc
  mysql-test/suite/funcs_1/views/func_view.inc
  mysql-test/suite/funcs_1/views/views_master.inc

=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2008-03-28 18:02:27 +0000
+++ b/client/mysql.cc	2008-06-24 16:05:56 +0000
@@ -1779,7 +1779,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)
@@ -2081,37 +2081,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
@@ -2156,7 +2125,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-10-04 08:06:01 +0000
+++ b/mysql-test/r/mysql.result	2008-06-24 16:03:17 +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 push into mysql-5.0 branch (gshchepa:2640 to 2643) Bug#36244, Bug#37164,Bug#35480, Bug#33812, Bug#37167Gleb Shchepa24 Jun