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
4c1db018
Commit
4c1db018
authored
Sep 04, 2006
by
gkodinov/kgeorge@macbook.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge macbook.gmz:/Users/kgeorge/mysql/work/B21392-4.1-opt
into macbook.gmz:/Users/kgeorge/mysql/work/B21392-5.0-opt
parents
55163a36
3758b975
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
3 deletions
+23
-3
mysql-test/r/delete.result
mysql-test/r/delete.result
+4
-0
mysql-test/t/delete.test
mysql-test/t/delete.test
+10
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_parse.cc
sql/sql_parse.cc
+3
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+5
-2
No files found.
mysql-test/r/delete.result
View file @
4c1db018
...
@@ -172,6 +172,10 @@ a
...
@@ -172,6 +172,10 @@ a
0
0
2
2
DROP TABLE t1;
DROP TABLE t1;
create table t1 (a int);
delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5;
delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5;
drop table t1;
CREATE TABLE t1 (a int not null,b int not null);
CREATE TABLE t1 (a int not null,b int not null);
CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
CREATE TABLE t3 (a int not null, b int not null, primary key (a,b));
CREATE TABLE t3 (a int not null, b int not null, primary key (a,b));
...
...
mysql-test/t/delete.test
View file @
4c1db018
...
@@ -153,6 +153,16 @@ DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1;
...
@@ -153,6 +153,16 @@ DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1;
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug #21392: multi-table delete with alias table name fails with
# 1003: Incorrect table name
#
create
table
t1
(
a
int
);
delete
`4.t1`
from
t1
as
`4.t1`
where
`4.t1`
.
a
=
5
;
delete
FROM
`4.t1`
USING
t1
as
`4.t1`
where
`4.t1`
.
a
=
5
;
drop
table
t1
;
# End of 4.1 tests
# End of 4.1 tests
#
#
...
...
sql/mysql_priv.h
View file @
4c1db018
...
@@ -425,6 +425,7 @@ void view_store_options(THD *thd, st_table_list *table, String *buff);
...
@@ -425,6 +425,7 @@ void view_store_options(THD *thd, st_table_list *table, String *buff);
#define TL_OPTION_UPDATING 1
#define TL_OPTION_UPDATING 1
#define TL_OPTION_FORCE_INDEX 2
#define TL_OPTION_FORCE_INDEX 2
#define TL_OPTION_IGNORE_LEAVES 4
#define TL_OPTION_IGNORE_LEAVES 4
#define TL_OPTION_ALIAS 8
/* Some portable defines */
/* Some portable defines */
...
...
sql/sql_parse.cc
View file @
4c1db018
...
@@ -6085,6 +6085,7 @@ bool add_to_list(THD *thd, SQL_LIST &list,Item *item,bool asc)
...
@@ -6085,6 +6085,7 @@ bool add_to_list(THD *thd, SQL_LIST &list,Item *item,bool asc)
table_options A set of the following bits:
table_options A set of the following bits:
TL_OPTION_UPDATING Table will be updated
TL_OPTION_UPDATING Table will be updated
TL_OPTION_FORCE_INDEX Force usage of index
TL_OPTION_FORCE_INDEX Force usage of index
TL_OPTION_ALIAS an alias in multi table DELETE
lock_type How table should be locked
lock_type How table should be locked
use_index List of indexed used in USE INDEX
use_index List of indexed used in USE INDEX
ignore_index List of indexed used in IGNORE INDEX
ignore_index List of indexed used in IGNORE INDEX
...
@@ -6113,7 +6114,8 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
...
@@ -6113,7 +6114,8 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
if
(
!
table
)
if
(
!
table
)
DBUG_RETURN
(
0
);
// End of memory
DBUG_RETURN
(
0
);
// End of memory
alias_str
=
alias
?
alias
->
str
:
table
->
table
.
str
;
alias_str
=
alias
?
alias
->
str
:
table
->
table
.
str
;
if
(
check_table_name
(
table
->
table
.
str
,
table
->
table
.
length
))
if
(
!
test
(
table_options
&
TL_OPTION_ALIAS
)
&&
check_table_name
(
table
->
table
.
str
,
table
->
table
.
length
))
{
{
my_error
(
ER_WRONG_TABLE_NAME
,
MYF
(
0
),
table
->
table
.
str
);
my_error
(
ER_WRONG_TABLE_NAME
,
MYF
(
0
),
table
->
table
.
str
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
...
sql/sql_yacc.yy
View file @
4c1db018
...
@@ -6319,14 +6319,17 @@ table_wild_one:
...
@@ -6319,14 +6319,17 @@ table_wild_one:
ident opt_wild opt_table_alias
ident opt_wild opt_table_alias
{
{
if (!Select->add_table_to_list(YYTHD, new Table_ident($1), $3,
if (!Select->add_table_to_list(YYTHD, new Table_ident($1), $3,
TL_OPTION_UPDATING, Lex->lock_option))
TL_OPTION_UPDATING |
TL_OPTION_ALIAS, Lex->lock_option))
YYABORT;
YYABORT;
}
}
| ident '.' ident opt_wild opt_table_alias
| ident '.' ident opt_wild opt_table_alias
{
{
if (!Select->add_table_to_list(YYTHD,
if (!Select->add_table_to_list(YYTHD,
new Table_ident(YYTHD, $1, $3, 0),
new Table_ident(YYTHD, $1, $3, 0),
$5, TL_OPTION_UPDATING,
$5,
TL_OPTION_UPDATING |
TL_OPTION_ALIAS,
Lex->lock_option))
Lex->lock_option))
YYABORT;
YYABORT;
}
}
...
...
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