diff options
author | unknown <acurtis@xiphis.org> | 2005-05-31 18:06:54 +0100 |
---|---|---|
committer | unknown <acurtis@xiphis.org> | 2005-05-31 18:06:54 +0100 |
commit | 2b548fe935b126fb4c0c9bfd109ed7dee778382b (patch) | |
tree | d1f6b58a051a3caa9b5379f40287853935d3c658 /sql | |
parent | 25841aa9addc20fc28c0392d5447b984b2bc230b (diff) | |
download | mariadb-git-2b548fe935b126fb4c0c9bfd109ed7dee778382b.tar.gz |
Bug#10413 - Invalid column name is not rejected
Stop ignoring name parts and check for validity
mysql-test/r/create.result:
Test for bug#10413
mysql-test/t/create.test:
Test for bug#10413
sql/sql_yacc.yy:
Bug#10413
Stop ignoring parts of fully qualified names.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_yacc.yy | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index d8a2c997bf8..7585f0b10a0 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -5016,7 +5016,31 @@ simple_ident: 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: |