Commit b9ddb9da authored by Aleksey Midenkov's avatar Aleksey Midenkov

alter_copy_bulk fix

Related to FIXME here. Now check_bulk_buffer() returns false.

3389                    if (auto t= trx->check_bulk_buffer(index->table)) {
3390                            /* MDEV-25036 FIXME:
3391                            row_ins_check_foreign_constraint() check
3392                            should be done before buffering the insert
3393                            operation. */
3394                            ut_ad(index->table->skip_alter_undo
3395                                  || !trx->check_foreigns);
3396                            return t->bulk_insert_buffered(*entry, *index, trx);
3397                    }
parent 1213918f
......@@ -45,6 +45,5 @@ ALTER TABLE t1 ALGORITHM=COPY, FORCE;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
ALTER TABLE t2 ALGORITHM=COPY, FORCE;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`#sql-alter`, CONSTRAINT `)
DROP TABLE t2, t1;
......@@ -63,6 +63,8 @@ INSERT INTO t1 VALUES(3, 1);
SET STATEMENT foreign_key_checks=0 FOR
ALTER TABLE t2 ALGORITHM=COPY, ADD CONSTRAINT FOREIGN KEY(f2) REFERENCES t1(f1);
ALTER TABLE t1 ALGORITHM=COPY, FORCE;
--replace_regex /#sql-alter-[0-9a-f-]*/#sql-alter/
--error ER_NO_REFERENCED_ROW_2
ALTER TABLE t2 ALGORITHM=COPY, FORCE;
--disable_info
DROP TABLE t2, t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment