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
3a23b675
Commit
3a23b675
authored
May 24, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge acurtis@bk-internal.mysql.com:/home/bk/mysql-4.1
into xiphis.org:/usr/home/antony/work2/p3-bug7241.5
parents
b36f9f2e
1a8f64d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
mysql-test/r/lock.result
mysql-test/r/lock.result
+10
-0
mysql-test/t/lock.test
mysql-test/t/lock.test
+14
-0
sql/sql_parse.cc
sql/sql_parse.cc
+13
-0
No files found.
mysql-test/r/lock.result
View file @
3a23b675
...
...
@@ -47,3 +47,13 @@ unlock tables;
lock tables t1 write, t1 as t1_alias read;
insert into t1 select index1,nr from t1 as t1_alias;
drop table t1,t2;
create table t1 ( a int(11) not null auto_increment, primary key(a));
create table t2 ( a int(11) not null auto_increment, primary key(a));
lock tables t1 write, t2 read;
delete from t1 using t1,t2 where t1.a=t2.a;
delete t1 from t1,t2 where t1.a=t2.a;
delete from t2 using t1,t2 where t1.a=t2.a;
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
delete t2 from t1,t2 where t1.a=t2.a;
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
drop table t1,t2;
mysql-test/t/lock.test
View file @
3a23b675
...
...
@@ -59,3 +59,17 @@ unlock tables;
lock
tables
t1
write
,
t1
as
t1_alias
read
;
insert
into
t1
select
index1
,
nr
from
t1
as
t1_alias
;
drop
table
t1
,
t2
;
#
# Bug7241 - Invalid response when DELETE .. USING and LOCK TABLES used.
#
create
table
t1
(
a
int
(
11
)
not
null
auto_increment
,
primary
key
(
a
));
create
table
t2
(
a
int
(
11
)
not
null
auto_increment
,
primary
key
(
a
));
lock
tables
t1
write
,
t2
read
;
delete
from
t1
using
t1
,
t2
where
t1
.
a
=
t2
.
a
;
delete
t1
from
t1
,
t2
where
t1
.
a
=
t2
.
a
;
--
error
1099
delete
from
t2
using
t1
,
t2
where
t1
.
a
=
t2
.
a
;
--
error
1099
delete
t2
from
t1
,
t2
where
t1
.
a
=
t2
.
a
;
drop
table
t1
,
t2
;
sql/sql_parse.cc
View file @
3a23b675
...
...
@@ -1992,6 +1992,10 @@ mysql_execute_command(THD *thd)
#endif
}
#endif
/* !HAVE_REPLICATION */
/* When subselects or time_zone info is used in a query
* we create a new TABLE_LIST containing all referenced tables
* and set local variable 'tables' to point to this list. */
if
((
&
lex
->
select_lex
!=
lex
->
all_selects_list
||
lex
->
time_zone_tables_used
)
&&
lex
->
unit
.
create_total_list
(
thd
,
lex
,
&
tables
))
...
...
@@ -4141,6 +4145,7 @@ void mysql_init_multi_delete(LEX *lex)
lex
->
select_lex
.
select_limit
=
lex
->
unit
.
select_limit_cnt
=
HA_POS_ERROR
;
lex
->
select_lex
.
table_list
.
save_and_clear
(
&
lex
->
auxilliary_table_list
);
lex
->
lock_option
=
using_update_log
?
TL_READ_NO_INSERT
:
TL_READ
;
}
...
...
@@ -5437,6 +5442,14 @@ int multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count)
}
walk
->
lock_type
=
target_tbl
->
lock_type
;
target_tbl
->
table_list
=
walk
;
// Remember corresponding table
/* in case of subselects, we need to set lock_type in
* corresponding table in list of all tables */
if
(
walk
->
table_list
)
{
target_tbl
->
table_list
=
walk
->
table_list
;
walk
->
table_list
->
lock_type
=
walk
->
lock_type
;
}
}
DBUG_RETURN
(
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