List:Internals« Previous MessageNext Message »
From:antony Date:May 31 2005 5:12pm
Subject:bk commit into 4.1 tree (acurtis:1.2303) BUG#10413
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of antony. When antony does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2303 05/05/31 18:06:54 acurtis@stripped +3 -0
  Bug#10413 - Invalid column name is not rejected
    Stop ignoring name parts and check for validity

  sql/sql_yacc.yy
    1.385 05/05/31 18:06:44 acurtis@stripped +25 -1
    Bug#10413
      Stop ignoring parts of fully qualified names.

  mysql-test/t/create.test
    1.50 05/05/31 18:06:44 acurtis@stripped +13 -0
    Test for bug#10413

  mysql-test/r/create.result
    1.78 05/05/31 18:06:44 acurtis@stripped +9 -0
    Test for bug#10413

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	acurtis
# Host:	ltantony
# Root:	/usr/home/antony/work2/p4-bug10413.2

--- 1.384/sql/sql_yacc.yy	2005-05-18 13:16:58 +01:00
+++ 1.385/sql/sql_yacc.yy	2005-05-31 18:06:44 +01:00
@@ -5016,7 +5016,31 @@
 
 field_ident:
 	ident			{ $$=$1;}
-	| ident '.' ident	{ $$=$3;}	/* Skip schema name in create*/
+	| ident '.' ident '.' ident
+          {
+            TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first;
+            if (my_strcasecmp(table_alias_charset, $1.str, table->db))
+            {
+              net_printf(YYTHD, ER_WRONG_DB_NAME, $1.str);
+              YYABORT;
+            }
+            if (my_strcasecmp(table_alias_charset, $3.str, table->real_name))
+            {
+              net_printf(YYTHD, ER_WRONG_TABLE_NAME, $3.str);
+              YYABORT;
+            }
+            $$=$5;
+          }
+	| ident '.' ident
+          {
+            TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first;
+            if (my_strcasecmp(table_alias_charset, $1.str, table->alias))
+            {
+              net_printf(YYTHD, ER_WRONG_TABLE_NAME, $1.str);
+              YYABORT;
+            }
+            $$=$3;
+          }
 	| '.' ident		{ $$=$2;}	/* For Delphi */;
 
 table_ident:

--- 1.77/mysql-test/r/create.result	2005-05-07 14:46:50 +01:00
+++ 1.78/mysql-test/r/create.result	2005-05-31 18:06:44 +01:00
@@ -563,3 +563,12 @@
 b
 1
 drop table t1,t2;
+create table t1(column.name int);
+ERROR 42000: Incorrect table name 'column'
+create table t1(test.column.name int);
+ERROR 42000: Incorrect table name 'column'
+create table t1(xyz.t1.name int);
+ERROR 42000: Incorrect database name 'xyz'
+create table t1(t1.name int);
+create table t2(test.t2.name int);
+drop table t1,t2;

--- 1.49/mysql-test/t/create.test	2005-05-07 13:50:20 +01:00
+++ 1.50/mysql-test/t/create.test	2005-05-31 18:06:44 +01:00
@@ -460,3 +460,16 @@
 select * from t1;
 select * from t2;
 drop table t1,t2;
+
+#
+# Bug#10413: Invalid column name is not rejected
+#
+--error 1103
+create table t1(column.name int);
+--error 1103
+create table t1(test.column.name int);
+--error 1102
+create table t1(xyz.t1.name int);
+create table t1(t1.name int);
+create table t2(test.t2.name int);
+drop table t1,t2;
Thread
bk commit into 4.1 tree (acurtis:1.2303) BUG#10413antony1 Jun