Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-11379, MDEV-11388 - [WAIT n|NOWAIT]
Extended syntax so that it is now possible to set lock_wait_timeout for the following statements: SELECT ... FOR UPDATE [WAIT n|NOWAIT] SELECT ... LOCK IN SHARED MODE [WAIT n|NOWAIT] LOCK TABLE ... [WAIT n|NOWAIT] CREATE ... INDEX ON tbl_name (index_col_name, ...) [WAIT n|NOWAIT] ... ALTER TABLE tbl_name [WAIT n|NOWAIT] ... OPTIMIZE TABLE tbl_name [WAIT n|NOWAIT] DROP INDEX ... [WAIT n|NOWAIT] TRUNCATE TABLE tbl_name [WAIT n|NOWAIT] RENAME TABLE tbl_name [WAIT n|NOWAIT] ... DROP TABLE tbl_name [WAIT n|NOWAIT] ... Valid range of lock_wait_timeout and innodb_lock_wait_timeout was extended so that 0 is acceptable value (means no wait). This is amended AliSQL patch. We prefer Oracle syntax for [WAIT n|NOWAIT] instead of original [WAIT [n]|NO_WAIT].
- Loading branch information
Sergey Vojtovich
committed
Mar 22, 2017
1 parent
4c6ae99
commit 8026cd6
Showing
22 changed files
with
369 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# | ||
# MDEV-11379 - AliSQL: [Feature] Issue#8: SELECT FOR UPDATE WAIT | ||
# MDEV-11388 - AliSQL: [Feature] Issue#15 DDL FAST FAIL | ||
# | ||
CREATE TABLE t1(a INT, b TEXT, c MULTIPOLYGON NOT NULL); | ||
CREATE INDEX i1 ON t1(a) WAIT 1; | ||
CREATE FULLTEXT INDEX i2 ON t1(b) WAIT 1; | ||
CREATE SPATIAL INDEX i3 ON t1(c) WAIT 1; | ||
ALTER TABLE t1 WAIT 1 COMMENT='test'; | ||
OPTIMIZE TABLE t1 WAIT 1; | ||
Table Op Msg_type Msg_text | ||
test.t1 optimize status OK | ||
DROP INDEX i1 ON t1 WAIT 1; | ||
TRUNCATE TABLE t1 WAIT 1; | ||
RENAME TABLE t1 WAIT 1 TO t2; | ||
RENAME TABLE t2 NOWAIT TO t1; | ||
connect con1, localhost, root,,; | ||
LOCK TABLE t1 WRITE WAIT 31536001; | ||
Warnings: | ||
Warning 1292 Truncated incorrect lock_wait_timeout value: '31536001' | ||
connection default; | ||
CREATE INDEX i1 ON t1(a) WAIT 0; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
CREATE INDEX i1 ON t1(a) NOWAIT; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
CREATE FULLTEXT INDEX i2 ON t1(b) WAIT 0; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
CREATE FULLTEXT INDEX i2 ON t1(b) NOWAIT; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
CREATE SPATIAL INDEX i3 ON t1(c) WAIT 0; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
CREATE SPATIAL INDEX i3 ON t1(c) NOWAIT; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
ALTER TABLE t1 WAIT 0 COMMENT='test'; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
ALTER TABLE t1 NOWAIT COMMENT='test'; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
OPTIMIZE TABLE t1 WAIT 0; | ||
Table Op Msg_type Msg_text | ||
test.t1 optimize Error Lock wait timeout exceeded; try restarting transaction | ||
test.t1 optimize status Operation failed | ||
OPTIMIZE TABLE t1 NOWAIT; | ||
Table Op Msg_type Msg_text | ||
test.t1 optimize Error Lock wait timeout exceeded; try restarting transaction | ||
test.t1 optimize status Operation failed | ||
DROP INDEX i1 ON t1 WAIT 0; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
DROP INDEX i1 ON t1 NOWAIT; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
TRUNCATE TABLE t1 WAIT 0; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
TRUNCATE TABLE t1 NOWAIT; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
RENAME TABLE t1 WAIT 0 TO t2; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
RENAME TABLE t1 NOWAIT TO t2; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
DROP TABLE t1 WAIT 0; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
DROP TABLE t1 NOWAIT; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
LOCK TABLE t1 WRITE WAIT 0; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
LOCK TABLE t1 WRITE NOWAIT; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
disconnect con1; | ||
DROP TABLE t1 WAIT 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--echo # | ||
--echo # MDEV-11379 - AliSQL: [Feature] Issue#8: SELECT FOR UPDATE WAIT | ||
--echo # MDEV-11388 - AliSQL: [Feature] Issue#15 DDL FAST FAIL | ||
--echo # | ||
CREATE TABLE t1(a INT, b TEXT, c MULTIPOLYGON NOT NULL); | ||
CREATE INDEX i1 ON t1(a) WAIT 1; | ||
CREATE FULLTEXT INDEX i2 ON t1(b) WAIT 1; | ||
CREATE SPATIAL INDEX i3 ON t1(c) WAIT 1; | ||
ALTER TABLE t1 WAIT 1 COMMENT='test'; | ||
OPTIMIZE TABLE t1 WAIT 1; | ||
DROP INDEX i1 ON t1 WAIT 1; | ||
TRUNCATE TABLE t1 WAIT 1; | ||
RENAME TABLE t1 WAIT 1 TO t2; | ||
RENAME TABLE t2 NOWAIT TO t1; | ||
|
||
connect(con1, localhost, root,,); | ||
LOCK TABLE t1 WRITE WAIT 31536001; | ||
|
||
connection default; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
CREATE INDEX i1 ON t1(a) WAIT 0; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
CREATE INDEX i1 ON t1(a) NOWAIT; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
CREATE FULLTEXT INDEX i2 ON t1(b) WAIT 0; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
CREATE FULLTEXT INDEX i2 ON t1(b) NOWAIT; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
CREATE SPATIAL INDEX i3 ON t1(c) WAIT 0; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
CREATE SPATIAL INDEX i3 ON t1(c) NOWAIT; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
ALTER TABLE t1 WAIT 0 COMMENT='test'; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
ALTER TABLE t1 NOWAIT COMMENT='test'; | ||
OPTIMIZE TABLE t1 WAIT 0; | ||
OPTIMIZE TABLE t1 NOWAIT; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
DROP INDEX i1 ON t1 WAIT 0; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
DROP INDEX i1 ON t1 NOWAIT; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
TRUNCATE TABLE t1 WAIT 0; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
TRUNCATE TABLE t1 NOWAIT; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
RENAME TABLE t1 WAIT 0 TO t2; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
RENAME TABLE t1 NOWAIT TO t2; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
DROP TABLE t1 WAIT 0; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
DROP TABLE t1 NOWAIT; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
LOCK TABLE t1 WRITE WAIT 0; | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
LOCK TABLE t1 WRITE NOWAIT; | ||
|
||
disconnect con1; | ||
DROP TABLE t1 WAIT 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.