| 1 |
--source include/have_debug.inc |
| 2 |
--source include/have_debug_sync.inc |
| 3 |
|
| 4 |
# Save the initial number of concurrent sessions. |
| 5 |
--source include/count_sessions.inc |
| 6 |
|
| 7 |
CREATE TABLE t ( |
| 8 |
a INTEGER, |
| 9 |
b BLOB GENERATED ALWAYS AS (a) VIRTUAL, |
| 10 |
INDEX (b(57)) |
| 11 |
)ENGINE=INNODB; |
| 12 |
|
| 13 |
INSERT INTO t (a) VALUES (9); |
| 14 |
BEGIN; |
| 15 |
SAVEPOINT a; |
| 16 |
UPDATE t set a = 12; |
| 17 |
DELETE FROM t where a = 12; |
| 18 |
ROLLBACK TO SAVEPOINT a; |
| 19 |
COMMIT; |
| 20 |
|
| 21 |
CHECK TABLE t; |
| 22 |
|
| 23 |
SELECT * FROM t; |
| 24 |
|
| 25 |
BEGIN; |
| 26 |
INSERT INTO t (a) VALUES (10); |
| 27 |
--source include/kill_and_restart_mysqld.inc |
| 28 |
SELECT * FROM t; |
| 29 |
DROP TABLE t; |
| 30 |
|
| 31 |
CREATE TABLE t ( |
| 32 |
a INTEGER, |
| 33 |
b BLOB GENERATED ALWAYS AS (a) VIRTUAL, |
| 34 |
c INTEGER |
| 35 |
)ENGINE=INNODB; |
| 36 |
|
| 37 |
INSERT INTO t (a,c) VALUES (9, 10); |
| 38 |
SELECT * FROM t; |
| 39 |
|
| 40 |
connect (con1,localhost,root,,); |
| 41 |
connection con1; |
| 42 |
|
| 43 |
# This DEBUG_SYNC should not kick in yet, because the duplicate key will be |
| 44 |
# detected before we get a chance to apply the online log. |
| 45 |
|
| 46 |
SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done'; |
| 47 |
--send |
| 48 |
ALTER TABLE t ADD KEY(b(57)), ALGORITHM=INPLACE; |
| 49 |
|
| 50 |
connection default; |
| 51 |
SET DEBUG_SYNC = 'now WAIT_FOR created'; |
| 52 |
BEGIN; |
| 53 |
INSERT INTO t (a,c) VALUES (10, 12); |
| 54 |
SELECT * FROM t; |
| 55 |
ROLLBACK; |
| 56 |
SET DEBUG_SYNC = 'now SIGNAL dml_done'; |
| 57 |
|
| 58 |
connection con1; |
| 59 |
reap; |
| 60 |
disconnect con1; |
| 61 |
connection default; |
| 62 |
|
| 63 |
SELECT * FROM t; |
| 64 |
DROP TABLE t; |
| 65 |
|
| 66 |
# drop virtual column and alter index |
| 67 |
CREATE TABLE t ( |
| 68 |
a INT, |
| 69 |
b INT, |
| 70 |
c INT GENERATED ALWAYS AS(a+b), |
| 71 |
d INT GENERATED ALWAYS AS(a+b+b), |
| 72 |
KEY(c, d) |
| 73 |
)ENGINE=INNODB; |
| 74 |
|
| 75 |
INSERT INTO t (a,b) VALUES (9, 10); |
| 76 |
SELECT * FROM t; |
| 77 |
|
| 78 |
connect (con1,localhost,root,,); |
| 79 |
connection con1; |
| 80 |
|
| 81 |
# This DEBUG_SYNC should not kick in yet, because the duplicate key will be |
| 82 |
# detected before we get a chance to apply the online log. |
| 83 |
|
| 84 |
SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done'; |
| 85 |
--send |
| 86 |
ALTER TABLE t DROP COLUMN c, ALGORITHM=INPLACE; |
| 87 |
|
| 88 |
connection default; |
| 89 |
SET DEBUG_SYNC = 'now WAIT_FOR created'; |
| 90 |
BEGIN; |
| 91 |
INSERT INTO t (a,b) VALUES (10, 12); |
| 92 |
SELECT * FROM t; |
| 93 |
ROLLBACK; |
| 94 |
SET DEBUG_SYNC = 'now SIGNAL dml_done'; |
| 95 |
|
| 96 |
connection con1; |
| 97 |
reap; |
| 98 |
disconnect con1; |
| 99 |
connection default; |
| 100 |
|
| 101 |
SELECT * FROM t; |
| 102 |
|
| 103 |
DROP TABLE t; |
| 104 |
|
| 105 |
# Wait till all disconnects are completed |
| 106 |
--source include/wait_until_count_sessions.inc |