Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
effd338f
Commit
effd338f
authored
May 31, 2005
by
ingo@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
40b53eab
fb10cfd0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
mysql-test/r/create.result
mysql-test/r/create.result
+9
-0
mysql-test/t/create.test
mysql-test/t/create.test
+13
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+25
-1
No files found.
mysql-test/r/create.result
View file @
effd338f
...
@@ -572,3 +572,12 @@ ERROR HY000: You can't specify target table 't1' for update in FROM clause
...
@@ -572,3 +572,12 @@ ERROR HY000: You can't specify target table 't1' for update in FROM clause
flush tables with read lock;
flush tables with read lock;
unlock tables;
unlock tables;
drop table t1;
drop table t1;
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;
mysql-test/t/create.test
View file @
effd338f
...
@@ -477,3 +477,16 @@ create table t2 union = (t1) select * from t1;
...
@@ -477,3 +477,16 @@ create table t2 union = (t1) select * from t1;
flush
tables
with
read
lock
;
flush
tables
with
read
lock
;
unlock
tables
;
unlock
tables
;
drop
table
t1
;
drop
table
t1
;
#
# 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
;
sql/sql_yacc.yy
View file @
effd338f
...
@@ -5016,7 +5016,31 @@ simple_ident:
...
@@ -5016,7 +5016,31 @@ simple_ident:
field_ident:
field_ident:
ident { $$=$1;}
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 */;
| '.' ident { $$=$2;} /* For Delphi */;
table_ident:
table_ident:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment