Skip to content

Commit fba1f0f

Browse files
Bug #30556595 FAILING ASSERTION: !CURSOR->INDEX->IS_COMMITTED() ON
TABLE WITH GCOLS Post-push test-case fix. RB: 26149 Reviewed by : Debarun Banerjee <debarun.banerjee@oracle.com>
1 parent f330518 commit fba1f0f

File tree

4 files changed

+215
-215
lines changed

4 files changed

+215
-215
lines changed

mysql-test/suite/innodb/r/virtual_debug.result

+98
Original file line numberDiff line numberDiff line change
@@ -445,3 +445,101 @@ gc
445445
-1
446446
COMMIT;
447447
DROP TABLE t2;
448+
#
449+
# Bug #30556595 FAILING ASSERTION: !CURSOR->INDEX->IS_COMMITTED()
450+
# ON TABLE WITH GCOLS
451+
#
452+
# Testcase-1
453+
CREATE TABLE t (pid int PRIMARY KEY,
454+
uid int,
455+
vid int AS (uid) VIRTUAL);
456+
# Create index on virtual column and stop before applying row logs.
457+
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
458+
ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace;
459+
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
460+
# Insert a record to generate an insert row log for the new index.
461+
# LOG-1 idx_vid : INSERT [10, 1]
462+
INSERT INTO t(pid, uid) VALUES (1,10);
463+
# Update the record changing PK. It should generate 2 row logs for the new index.
464+
# LOG-2 idx_vid : DELETE [10, 1]
465+
# LOG-3 idx_vid : INSERT [10, 2]
466+
UPDATE t SET pid = 2 WHERE pid = 1;
467+
SELECT * FROM t;
468+
pid uid vid
469+
2 10 10
470+
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
471+
# Insert a record to re-use the delete marked record in idx_vid [10, 1]
472+
INSERT INTO t(pid, uid) VALUES (1,10);
473+
SELECT * FROM t;
474+
pid uid vid
475+
1 10 10
476+
2 10 10
477+
DROP TABLE t;
478+
# Testcase-2
479+
CREATE TABLE t (pid int PRIMARY KEY,
480+
uid int,
481+
vid int AS (uid) VIRTUAL);
482+
# Create index on virtual column and stop before applying row logs.
483+
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
484+
ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace;
485+
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
486+
# Start transaction
487+
BEGIN;
488+
# Insert a record to generate an insert row log for the new index.
489+
# LOG-1 idx_vid : INSERT [10, 1]
490+
INSERT INTO t(pid, uid) VALUES (1,10);
491+
# Update the record changing PK. It should generate 2 row logs for the new index.
492+
# LOG-2 idx_vid : DELETE [10, 1]
493+
# LOG-3 idx_vid : INSERT [10, 2]
494+
UPDATE t SET pid = 2 WHERE pid = 1;
495+
SELECT * FROM t;
496+
pid uid vid
497+
2 10 10
498+
# Rollback transaction
499+
# LOG-4 idx_vid : DELETE [10, 2]
500+
# LOG-5 idx_vid : INSERT [10, 1]
501+
# LOG-6 idx_vid : DELETE [10, 1]
502+
ROLLBACK;
503+
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
504+
# Insert a record to check valid entry in idx_vid [NULL, 1]
505+
INSERT INTO t(pid) VALUES (1);
506+
SELECT * FROM t;
507+
pid uid vid
508+
1 NULL NULL
509+
DROP TABLE t;
510+
# Testcase-3
511+
CREATE TABLE t (pid int PRIMARY KEY,
512+
uid int,
513+
vid int AS (uid) VIRTUAL);
514+
INSERT INTO t(pid, uid) VALUES (1,10);
515+
# Create index on virtual column and stop before applying row logs.
516+
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
517+
ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace;
518+
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
519+
# Update the record changing PK. It should generate 2 row logs for the new index.
520+
# LOG-2 idx_vid : DELETE [10, 1]
521+
# LOG-3 idx_vid : INSERT [10, 2]
522+
UPDATE t SET pid = 2 WHERE pid = 1;
523+
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
524+
# Read [2, 10, 10] row using idx_vid index key.
525+
select * from t where VID=10;
526+
pid uid vid
527+
2 10 10
528+
DROP TABLE t;
529+
# Testcase-4
530+
CREATE TABLE t (pid int PRIMARY KEY,
531+
uid int,
532+
vid int AS (uid) VIRTUAL);
533+
INSERT INTO t(pid, uid) VALUES (1,10);
534+
# Create index on virtual column and stop before applying row logs.
535+
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
536+
ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace;
537+
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
538+
# Update the record changing PK. It should generate 2 row logs for the new index.
539+
# LOG-2 idx_vid : DELETE [10, 1]
540+
# LOG-3 idx_vid : INSERT [10, 2]
541+
UPDATE t SET pid = 2 WHERE pid = 1;
542+
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
543+
# Delete a record.
544+
delete from t limit 1;
545+
DROP TABLE t;

mysql-test/suite/innodb/r/virtual_index.result

-98
Original file line numberDiff line numberDiff line change
@@ -211,101 +211,3 @@ t1 CREATE TABLE `t1` (
211211
KEY `n` (`col2`)
212212
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
213213
DROP TABLE t1;
214-
#
215-
# Bug #30556595 FAILING ASSERTION: !CURSOR->INDEX->IS_COMMITTED()
216-
# ON TABLE WITH GCOLS
217-
#
218-
# Testcase-1
219-
CREATE TABLE t (pid int PRIMARY KEY,
220-
uid int,
221-
vid int AS (uid) VIRTUAL);
222-
# Create index on virtual column and stop before applying row logs.
223-
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
224-
ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace;
225-
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
226-
# Insert a record to generate an insert row log for the new index.
227-
# LOG-1 idx_vid : INSERT [10, 1]
228-
INSERT INTO t(pid, uid) VALUES (1,10);
229-
# Update the record changing PK. It should generate 2 row logs for the new index.
230-
# LOG-2 idx_vid : DELETE [10, 1]
231-
# LOG-3 idx_vid : INSERT [10, 2]
232-
UPDATE t SET pid = 2 WHERE pid = 1;
233-
SELECT * FROM t;
234-
pid uid vid
235-
2 10 10
236-
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
237-
# Insert a record to re-use the delete marked record in idx_vid [10, 1]
238-
INSERT INTO t(pid, uid) VALUES (1,10);
239-
SELECT * FROM t;
240-
pid uid vid
241-
1 10 10
242-
2 10 10
243-
DROP TABLE t;
244-
# Testcase-2
245-
CREATE TABLE t (pid int PRIMARY KEY,
246-
uid int,
247-
vid int AS (uid) VIRTUAL);
248-
# Create index on virtual column and stop before applying row logs.
249-
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
250-
ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace;
251-
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
252-
# Start transaction
253-
BEGIN;
254-
# Insert a record to generate an insert row log for the new index.
255-
# LOG-1 idx_vid : INSERT [10, 1]
256-
INSERT INTO t(pid, uid) VALUES (1,10);
257-
# Update the record changing PK. It should generate 2 row logs for the new index.
258-
# LOG-2 idx_vid : DELETE [10, 1]
259-
# LOG-3 idx_vid : INSERT [10, 2]
260-
UPDATE t SET pid = 2 WHERE pid = 1;
261-
SELECT * FROM t;
262-
pid uid vid
263-
2 10 10
264-
# Rollback transaction
265-
# LOG-4 idx_vid : DELETE [10, 2]
266-
# LOG-5 idx_vid : INSERT [10, 1]
267-
# LOG-6 idx_vid : DELETE [10, 1]
268-
ROLLBACK;
269-
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
270-
# Insert a record to check valid entry in idx_vid [NULL, 1]
271-
INSERT INTO t(pid) VALUES (1);
272-
SELECT * FROM t;
273-
pid uid vid
274-
1 NULL NULL
275-
DROP TABLE t;
276-
# Testcase-3
277-
CREATE TABLE t (pid int PRIMARY KEY,
278-
uid int,
279-
vid int AS (uid) VIRTUAL);
280-
INSERT INTO t(pid, uid) VALUES (1,10);
281-
# Create index on virtual column and stop before applying row logs.
282-
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
283-
ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace;
284-
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
285-
# Update the record changing PK. It should generate 2 row logs for the new index.
286-
# LOG-2 idx_vid : DELETE [10, 1]
287-
# LOG-3 idx_vid : INSERT [10, 2]
288-
UPDATE t SET pid = 2 WHERE pid = 1;
289-
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
290-
# Read [2, 10, 10] row using idx_vid index key.
291-
select * from t where VID=10;
292-
pid uid vid
293-
2 10 10
294-
DROP TABLE t;
295-
# Testcase-4
296-
CREATE TABLE t (pid int PRIMARY KEY,
297-
uid int,
298-
vid int AS (uid) VIRTUAL);
299-
INSERT INTO t(pid, uid) VALUES (1,10);
300-
# Create index on virtual column and stop before applying row logs.
301-
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
302-
ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace;
303-
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
304-
# Update the record changing PK. It should generate 2 row logs for the new index.
305-
# LOG-2 idx_vid : DELETE [10, 1]
306-
# LOG-3 idx_vid : INSERT [10, 2]
307-
UPDATE t SET pid = 2 WHERE pid = 1;
308-
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
309-
# Delete a record.
310-
delete from t limit 1;
311-
DROP TABLE t;

mysql-test/suite/innodb/t/virtual_debug.test

+117
Original file line numberDiff line numberDiff line change
@@ -542,3 +542,120 @@ CONNECTION default;
542542
COMMIT;
543543

544544
DROP TABLE t2;
545+
546+
--echo #
547+
--echo # Bug #30556595 FAILING ASSERTION: !CURSOR->INDEX->IS_COMMITTED()
548+
--echo # ON TABLE WITH GCOLS
549+
--echo #
550+
551+
--echo # Testcase-1
552+
CREATE TABLE t (pid int PRIMARY KEY,
553+
uid int,
554+
vid int AS (uid) VIRTUAL);
555+
connect(con1,localhost,root,,);
556+
--echo # Create index on virtual column and stop before applying row logs.
557+
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
558+
--send ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace
559+
connection default;
560+
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
561+
--echo # Insert a record to generate an insert row log for the new index.
562+
--echo # LOG-1 idx_vid : INSERT [10, 1]
563+
INSERT INTO t(pid, uid) VALUES (1,10);
564+
--echo # Update the record changing PK. It should generate 2 row logs for the new index.
565+
--echo # LOG-2 idx_vid : DELETE [10, 1]
566+
--echo # LOG-3 idx_vid : INSERT [10, 2]
567+
UPDATE t SET pid = 2 WHERE pid = 1;
568+
SELECT * FROM t;
569+
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
570+
connection con1;
571+
--reap
572+
connection default;
573+
--echo # Insert a record to re-use the delete marked record in idx_vid [10, 1]
574+
INSERT INTO t(pid, uid) VALUES (1,10);
575+
SELECT * FROM t;
576+
disconnect con1;
577+
DROP TABLE t;
578+
579+
--echo # Testcase-2
580+
CREATE TABLE t (pid int PRIMARY KEY,
581+
uid int,
582+
vid int AS (uid) VIRTUAL);
583+
connect(con1,localhost,root,,);
584+
--echo # Create index on virtual column and stop before applying row logs.
585+
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
586+
--send ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace
587+
connection default;
588+
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
589+
--echo # Start transaction
590+
BEGIN;
591+
--echo # Insert a record to generate an insert row log for the new index.
592+
--echo # LOG-1 idx_vid : INSERT [10, 1]
593+
INSERT INTO t(pid, uid) VALUES (1,10);
594+
--echo # Update the record changing PK. It should generate 2 row logs for the new index.
595+
--echo # LOG-2 idx_vid : DELETE [10, 1]
596+
--echo # LOG-3 idx_vid : INSERT [10, 2]
597+
UPDATE t SET pid = 2 WHERE pid = 1;
598+
SELECT * FROM t;
599+
--echo # Rollback transaction
600+
--echo # LOG-4 idx_vid : DELETE [10, 2]
601+
--echo # LOG-5 idx_vid : INSERT [10, 1]
602+
--echo # LOG-6 idx_vid : DELETE [10, 1]
603+
ROLLBACK;
604+
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
605+
connection con1;
606+
--reap
607+
connection default;
608+
--echo # Insert a record to check valid entry in idx_vid [NULL, 1]
609+
INSERT INTO t(pid) VALUES (1);
610+
SELECT * FROM t;
611+
disconnect con1;
612+
DROP TABLE t;
613+
614+
--echo # Testcase-3
615+
CREATE TABLE t (pid int PRIMARY KEY,
616+
uid int,
617+
vid int AS (uid) VIRTUAL);
618+
INSERT INTO t(pid, uid) VALUES (1,10);
619+
connect(con1,localhost,root,,);
620+
--echo # Create index on virtual column and stop before applying row logs.
621+
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
622+
--send ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace
623+
connection default;
624+
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
625+
--echo # Update the record changing PK. It should generate 2 row logs for the new index.
626+
--echo # LOG-2 idx_vid : DELETE [10, 1]
627+
--echo # LOG-3 idx_vid : INSERT [10, 2]
628+
UPDATE t SET pid = 2 WHERE pid = 1;
629+
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
630+
connection con1;
631+
--reap
632+
connection default;
633+
--echo # Read [2, 10, 10] row using idx_vid index key.
634+
--sleep 1
635+
select * from t where VID=10;
636+
disconnect con1;
637+
DROP TABLE t;
638+
639+
--echo # Testcase-4
640+
CREATE TABLE t (pid int PRIMARY KEY,
641+
uid int,
642+
vid int AS (uid) VIRTUAL);
643+
INSERT INTO t(pid, uid) VALUES (1,10);
644+
connect(con1,localhost,root,,);
645+
--echo # Create index on virtual column and stop before applying row logs.
646+
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL start_dml WAIT_FOR resume_ddl';
647+
--send ALTER TABLE t ADD INDEX idx_vid(vid), algorithm=inplace
648+
connection default;
649+
SET DEBUG_SYNC= 'now WAIT_FOR start_dml';
650+
--echo # Update the record changing PK. It should generate 2 row logs for the new index.
651+
--echo # LOG-2 idx_vid : DELETE [10, 1]
652+
--echo # LOG-3 idx_vid : INSERT [10, 2]
653+
UPDATE t SET pid = 2 WHERE pid = 1;
654+
SET DEBUG_SYNC= 'now SIGNAL resume_ddl';
655+
connection con1;
656+
--reap
657+
connection default;
658+
--echo # Delete a record.
659+
delete from t limit 1;
660+
disconnect con1;
661+
DROP TABLE t;

0 commit comments

Comments
 (0)