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
7d14564d
Commit
7d14564d
authored
Jun 25, 2007
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B29154-5.0-opt
parents
da416060
f93607d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
1 deletion
+62
-1
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+15
-0
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+35
-0
sql/sql_parse.cc
sql/sql_parse.cc
+12
-1
No files found.
mysql-test/r/innodb_mysql.result
View file @
7d14564d
...
...
@@ -661,4 +661,19 @@ UPDATE t3 SET a = 'us' WHERE a = 'uk';
SELECT * FROM t3 WHERE a = 'uk';
a
DROP TABLE t1,t2,t3;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
switch to connection c1
SET AUTOCOMMIT=0;
INSERT INTO t2 VALUES (1);
switch to connection c2
SET AUTOCOMMIT=0;
LOCK TABLES t1 READ, t2 READ;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
switch to connection c1
COMMIT;
INSERT INTO t1 VALUES (1);
switch to connection default
SET AUTOCOMMIT=default;
DROP TABLE t1,t2;
End of 5.0 tests
mysql-test/t/innodb_mysql.test
View file @
7d14564d
...
...
@@ -636,4 +636,39 @@ SELECT * FROM t3 WHERE a = 'uk';
DROP
TABLE
t1
,
t2
,
t3
;
#
# Bug #29154: LOCK TABLES is not atomic when >1 InnoDB tables are locked
#
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
InnoDB
;
CREATE
TABLE
t2
(
a
INT
)
ENGINE
=
InnoDB
;
CONNECT
(
c1
,
localhost
,
root
,,);
CONNECT
(
c2
,
localhost
,
root
,,);
--
echo
switch
to
connection
c1
CONNECTION
c1
;
SET
AUTOCOMMIT
=
0
;
INSERT
INTO
t2
VALUES
(
1
);
--
echo
switch
to
connection
c2
CONNECTION
c2
;
SET
AUTOCOMMIT
=
0
;
--
error
ER_LOCK_WAIT_TIMEOUT
LOCK
TABLES
t1
READ
,
t2
READ
;
--
echo
switch
to
connection
c1
CONNECTION
c1
;
COMMIT
;
INSERT
INTO
t1
VALUES
(
1
);
--
echo
switch
to
connection
default
CONNECTION
default
;
SET
AUTOCOMMIT
=
default
;
DISCONNECT
c1
;
DISCONNECT
c2
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.0
tests
sql/sql_parse.cc
View file @
7d14564d
...
...
@@ -3837,7 +3837,10 @@ mysql_execute_command(THD *thd)
break
;
case
SQLCOM_LOCK_TABLES
:
unlock_locked_tables
(
thd
);
if
(
check_db_used
(
thd
,
all_tables
)
||
end_active_trans
(
thd
))
/* we must end the trasaction first, regardless of anything */
if
(
end_active_trans
(
thd
))
goto
error
;
if
(
check_db_used
(
thd
,
all_tables
))
goto
error
;
if
(
check_table_access
(
thd
,
LOCK_TABLES_ACL
|
SELECT_ACL
,
all_tables
,
0
))
goto
error
;
...
...
@@ -3855,7 +3858,15 @@ mysql_execute_command(THD *thd)
send_ok
(
thd
);
}
else
{
/*
Need to end the current transaction, so the storage engine (InnoDB)
can free its locks if LOCK TABLES locked some tables before finding
that it can't lock a table in its list
*/
end_active_trans
(
thd
);
thd
->
options
&=
~
(
ulong
)
(
OPTION_TABLE_LOCK
);
}
thd
->
in_lock_tables
=
0
;
break
;
case
SQLCOM_CREATE_DB
:
...
...
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