diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-07-23 17:20:57 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-07-23 17:20:57 +0300 |
commit | 173e562dc2bd339de32d17de73b720e7ca863ff2 (patch) | |
tree | e295abdd444203d6a4c93c4449df0ce315441a31 /mysql-test/suite/gcol/r | |
parent | 4c4237e63fb9d766a99fb1d45049d6955fd7f8f2 (diff) | |
download | mariadb-git-173e562dc2bd339de32d17de73b720e7ca863ff2.tar.gz |
MDEV-26228 ASAN heap-use-after-free with ON UPDATE CASCADE
In commit 83d2e0841ee30727c609f23957cc592399a3aca4 (MDEV-24041)
we failed to notice that in addition to the bug with
DELETE and ON DELETE CASCADE, there is another bug with
UPDATE and ON UPDATE CASCADE.
row_ins_foreign_fill_virtual(): Use the correct memory heap
for everything that will be reachable from the cascade->update
that we return to the caller.
Note: It is correct to use the shorter-lived cascade->heap for
rec_get_offsets(), because that memory will be abandoned when
row_ins_foreign_fill_virtual() returns.
Diffstat (limited to 'mysql-test/suite/gcol/r')
-rw-r--r-- | mysql-test/suite/gcol/r/innodb_virtual_fk.result | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_fk.result b/mysql-test/suite/gcol/r/innodb_virtual_fk.result index 252274f3e0a..367ed1223f7 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_fk.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_fk.result @@ -809,15 +809,18 @@ generated_email_id int as (email_id), PRIMARY KEY (id), KEY mautic_generated_sent_date_email_id (generated_email_id), FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL +ON UPDATE CASCADE ) ENGINE=InnoDB; CREATE TABLE emails_metadata ( email_id int, PRIMARY KEY (email_id), CONSTRAINT FK FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE CASCADE +ON UPDATE CASCADE ) ENGINE=InnoDB; INSERT INTO emails VALUES (1); INSERT INTO email_stats (id, email_id, date_sent) VALUES (1,1,'Jan'); INSERT INTO emails_metadata VALUES (1); +UPDATE emails SET id=2; DELETE FROM emails; DROP TABLE email_stats; DROP TABLE emails_metadata; |