mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Bug #20442523 CRASH WHEN CREATE TABLE VIOLATES FOREIGN KEY CONSTRAINT
Problem: This is a coding mistake during error handling. When the specified foreign key constraint is wrong because of data type mismatch, the resulting foreign key object will not have valid foreign->id (it will be NULL.) Solution: While removing the foreign key object from dictionary cache during error handling, ensure that foreign->id is not null before using it. rb#8204 approved by Sunny.
This commit is contained in:
parent
ffa7ae1c6e
commit
98b18c5971
1 changed files with 3 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
|
@ -2530,7 +2530,7 @@ dict_foreign_remove_from_cache(
|
|||
|
||||
rbt = foreign->referenced_table->referenced_rbt;
|
||||
|
||||
if (rbt != NULL) {
|
||||
if (rbt != NULL && foreign->id != NULL) {
|
||||
const ib_rbt_node_t* node
|
||||
= rbt_lookup(rbt, foreign->id);
|
||||
dict_foreign_t* val = *(dict_foreign_t**) node->value;
|
||||
|
|
@ -2549,7 +2549,7 @@ dict_foreign_remove_from_cache(
|
|||
foreign);
|
||||
rbt = foreign->foreign_table->foreign_rbt;
|
||||
|
||||
if (rbt != NULL) {
|
||||
if (rbt != NULL && foreign->id != NULL) {
|
||||
const ib_rbt_node_t* node
|
||||
= rbt_lookup(rbt, foreign->id);
|
||||
dict_foreign_t* val = *(dict_foreign_t**) node->value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue