List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:October 2 2008 2:17pm
Subject:bzr push into mysql-6.0 branch (Sergey.Glukhov:2839 to 2840)
View as plain text  
 2840 Sergey Glukhov	2008-10-02 [merge]
      5.1->6.0 bugteam merge
modified:
  mysql-test/r/create.result
  mysql-test/t/create.test
  sql/mysql_priv.h
  sql/sql_parse.cc
  sql/sql_yacc.yy

 2839 Sergey Glukhov	2008-10-02 [merge]
      automerge

=== modified file 'mysql-test/r/create.result'
--- a/mysql-test/r/create.result	2008-09-08 10:03:52 +0000
+++ b/mysql-test/r/create.result	2008-10-02 14:03:57 +0000
@@ -1564,6 +1564,8 @@ SHOW INDEX FROM t1;
 Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment	Index_Comment
 t1	1	c1	1	c1	A	NULL	NULL	NULL	YES	BTREE		
 DROP TABLE t1;
+create user mysqltest_1@'test@test';
+ERROR HY000: Malformed hostname (illegal symbol: '@')
 CREATE TABLE t1 (a INTEGER AUTO_INCREMENT PRIMARY KEY, b INTEGER NOT NULL);
 INSERT IGNORE INTO t1 (b) VALUES (5);
 CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)

=== modified file 'mysql-test/t/create.test'
--- a/mysql-test/t/create.test	2008-09-08 10:03:52 +0000
+++ b/mysql-test/t/create.test	2008-10-02 14:03:57 +0000
@@ -1179,6 +1179,11 @@ CREATE TABLE t1(c1 VARCHAR(33), KEY USIN
 SHOW INDEX FROM t1;
 DROP TABLE t1;
 
+#
+# Bug#35924 DEFINER should be stored 'quoted' in I_S
+#
+--error ER_UNKNOWN_ERROR
+create user mysqltest_1@'test@test';
 
 #
 # Bug#38821: Assert table->auto_increment_field_not_null failed in open_table()

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2008-10-01 12:02:28 +0000
+++ b/sql/mysql_priv.h	2008-10-02 14:03:57 +0000
@@ -873,6 +873,7 @@ bool check_string_byte_length(LEX_STRING
 bool check_string_char_length(LEX_STRING *str, const char *err_msg,
                               uint max_char_length, CHARSET_INFO *cs,
                               bool no_error);
+bool check_host_name(LEX_STRING *str);
 bool check_identifier_name(LEX_STRING *str, uint max_char_length,
                            uint err_code, const char *param_for_err_msg);
 inline bool check_identifier_name(LEX_STRING *str, uint err_code)

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2008-10-01 12:02:28 +0000
+++ b/sql/sql_parse.cc	2008-10-02 14:03:57 +0000
@@ -7457,6 +7457,39 @@ int test_if_data_home_dir(const char *di
 C_MODE_END
 
 
+/**
+  Check that host name string is valid.
+
+  @param[in] str string to be checked
+
+  @return             Operation status
+    @retval  FALSE    host name is ok
+    @retval  TRUE     host name string is longer than max_length or
+                      has invalid symbols
+*/
+
+bool check_host_name(LEX_STRING *str)
+{
+  const char *name= str->str;
+  const char *end= str->str + str->length;
+  if (check_string_byte_length(str, ER(ER_HOSTNAME), HOSTNAME_LENGTH))
+    return TRUE;
+
+  while (name != end)
+  {
+    if (*name == '@')
+    {
+      my_printf_error(ER_UNKNOWN_ERROR, 
+                      "Malformed hostname (illegal symbol: '%c')", MYF(0),
+                      *name);
+      return TRUE;
+    }
+    name++;
+  }
+  return FALSE;
+}
+
+
 extern int MYSQLparse(void *thd); // from sql_yacc.cc
 
 

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2008-10-01 12:02:28 +0000
+++ b/sql/sql_yacc.yy	2008-10-02 14:03:57 +0000
@@ -11768,8 +11768,7 @@ user:
             if (check_identifier_name(&$$->user, USERNAME_CHAR_LENGTH,
                                       ER_WRONG_STRING_LENGTH,
                                       ER(ER_USERNAME)) ||
-                check_string_byte_length(&$$->host, ER(ER_HOSTNAME),
-                                         HOSTNAME_LENGTH))
+                check_host_name(&$$->host))
               MYSQL_YYABORT;
           }
         | CURRENT_USER optional_braces

Thread
bzr push into mysql-6.0 branch (Sergey.Glukhov:2839 to 2840)Sergey Glukhov2 Oct