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
33518801
Commit
33518801
authored
Jul 23, 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/B29644-5.0-opt
parents
5ae1392c
174dcb07
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
18 deletions
+77
-18
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+23
-0
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+54
-0
sql/ha_innodb.cc
sql/ha_innodb.cc
+0
-11
sql/sql_base.cc
sql/sql_base.cc
+0
-7
No files found.
mysql-test/r/innodb_mysql.result
View file @
33518801
...
...
@@ -984,4 +984,27 @@ a b c
15 1 1
16 1 1
DROP TABLE t1,t2;
CREATE TABLE t1 (a INT, PRIMARY KEY (a)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
INSERT INTO t1 SELECT a + 8 FROM t1;
INSERT INTO t1 SELECT a + 16 FROM t1;
CREATE PROCEDURE p1 ()
BEGIN
DECLARE i INT DEFAULT 50;
DECLARE cnt INT;
START TRANSACTION;
ALTER TABLE t1 ENGINE=InnoDB;
COMMIT;
START TRANSACTION;
WHILE (i > 0) DO
SET i = i - 1;
SELECT COUNT(*) INTO cnt FROM t1 LOCK IN SHARE MODE;
END WHILE;
COMMIT;
END;|
CALL p1();
CALL p1();
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
End of 5.0 tests
mysql-test/t/innodb_mysql.test
View file @
33518801
...
...
@@ -740,6 +740,8 @@ SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
set
@@
sort_buffer_size
=
default
;
DROP
TABLE
t1
,
t2
;
# Bug#27296 Assertion in ALTER TABLE SET DEFAULT in Linux Debug build
# (possible deadlock).
#
...
...
@@ -787,4 +789,56 @@ SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY c,a;
DROP
TABLE
t1
,
t2
;
#
# Bug #29644: alter table hangs if records locked in share mode by long
# running transaction
#
CREATE
TABLE
t1
(
a
INT
,
PRIMARY
KEY
(
a
))
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
);
INSERT
INTO
t1
SELECT
a
+
8
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
16
FROM
t1
;
DELIMITER
|
;
CREATE
PROCEDURE
p1
()
BEGIN
DECLARE
i
INT
DEFAULT
50
;
DECLARE
cnt
INT
;
START
TRANSACTION
;
ALTER
TABLE
t1
ENGINE
=
InnoDB
;
COMMIT
;
START
TRANSACTION
;
WHILE
(
i
>
0
)
DO
SET
i
=
i
-
1
;
SELECT
COUNT
(
*
)
INTO
cnt
FROM
t1
LOCK
IN
SHARE
MODE
;
END
WHILE
;
COMMIT
;
END
;
|
DELIMITER
;
|
CONNECT
(
con1
,
localhost
,
root
,,);
CONNECT
(
con2
,
localhost
,
root
,,);
CONNECTION
con1
;
SEND
CALL
p1
();
CONNECTION
con2
;
SEND
CALL
p1
();
CONNECTION
default
;
CALL
p1
();
CONNECTION
con1
;
REAP
;
CONNECTION
con2
;
REAP
;
CONNECTION
default
;
DISCONNECT
con1
;
DISCONNECT
con2
;
DROP
PROCEDURE
p1
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
sql/ha_innodb.cc
View file @
33518801
...
...
@@ -6721,17 +6721,6 @@ ha_innobase::store_lock(
&&
!
thd
->
tablespace_op
&&
thd
->
lex
->
sql_command
!=
SQLCOM_TRUNCATE
&&
thd
->
lex
->
sql_command
!=
SQLCOM_OPTIMIZE
#ifdef __WIN__
/* For alter table on win32 for succesful operation
completion it is used TL_WRITE(=10) lock instead of
TL_WRITE_ALLOW_READ(=6), however here in innodb handler
TL_WRITE is lifted to TL_WRITE_ALLOW_WRITE, which causes
race condition when several clients do alter table
simultaneously (bug #17264). This fix avoids the problem. */
&&
thd
->
lex
->
sql_command
!=
SQLCOM_ALTER_TABLE
#endif
&&
thd
->
lex
->
sql_command
!=
SQLCOM_CREATE_TABLE
)
{
lock_type
=
TL_WRITE_ALLOW_WRITE
;
...
...
sql/sql_base.cc
View file @
33518801
...
...
@@ -2938,13 +2938,6 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type)
if
(
table
)
{
#if defined( __WIN__) || defined(OS2)
/* Win32 can't drop a file that is open */
if
(
lock_type
==
TL_WRITE_ALLOW_READ
)
{
lock_type
=
TL_WRITE
;
}
#endif
/* __WIN__ || OS2 */
table_list
->
lock_type
=
lock_type
;
table_list
->
table
=
table
;
table
->
grant
=
table_list
->
grant
;
...
...
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