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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b9512a55
Commit
b9512a55
authored
Jul 26, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#4717 - check for valid table names in ALTER TABLE ... RENAME
parent
a0bae8eb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
mysql-test/r/alter_table.result
mysql-test/r/alter_table.result
+6
-0
mysql-test/t/alter_table.test
mysql-test/t/alter_table.test
+11
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+7
-1
No files found.
mysql-test/r/alter_table.result
View file @
b9512a55
...
...
@@ -380,3 +380,9 @@ t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE
t1 0 PRIMARY 2 User A 0 NULL NULL BTREE
t1 1 Host 1 Host A NULL NULL NULL BTREE disabled
DROP TABLE t1;
create table t1 (a int);
alter table t1 rename to `t1\\`;
Incorrect table name 't1\\'
rename table t1 to `t1\\`;
Incorrect table name 't1\\'
drop table t1;
mysql-test/t/alter_table.test
View file @
b9512a55
...
...
@@ -243,3 +243,14 @@ LOCK TABLES t1 WRITE;
ALTER
TABLE
t1
DISABLE
KEYS
;
SHOW
INDEX
FROM
t1
;
DROP
TABLE
t1
;
#
# BUG#4717 - check for valid table names
#
create
table
t1
(
a
int
);
--
error
1103
alter
table
t1
rename
to
`t1\\`
;
--
error
1103
rename
table
t1
to
`t1\\`
;
drop
table
t1
;
sql/sql_yacc.yy
View file @
b9512a55
...
...
@@ -1320,6 +1320,12 @@ alter_list_item:
LEX *lex=Lex;
lex->select->db=$3->db.str;
lex->name= $3->table.str;
if (check_table_name($3->table.str,$3->table.length) ||
$3->db.str && check_db_name($3->db.str))
{
net_printf(&lex->thd->net,ER_WRONG_TABLE_NAME,$3->table.str);
YYABORT;
}
}
| create_table_options { Lex->simple_alter=0; }
| order_clause { Lex->simple_alter=0; };
...
...
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