From 1f7be881414291d91a4cb134b75ed029f90f707d Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Wed, 25 Mar 2020 17:10:01 +0530 Subject: MDEV-19092 Server crash when renaming the column when FOREIGN_KEY_CHECKS is disabled - dict_foreign_find_index() can return NULL if InnoDB already dropped the foreign index when FOREIGN_KEY_CHECKS is disabled. --- storage/xtradb/dict/dict0mem.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'storage/xtradb') diff --git a/storage/xtradb/dict/dict0mem.cc b/storage/xtradb/dict/dict0mem.cc index f4bbc5c8f06..51ca6de8cd2 100644 --- a/storage/xtradb/dict/dict0mem.cc +++ b/storage/xtradb/dict/dict0mem.cc @@ -2,7 +2,7 @@ Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2019, MariaDB Corporation. +Copyright (c) 2013, 2020, MariaDB Corporation. 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 @@ -421,9 +421,10 @@ dict_mem_table_col_rename_low( foreign->foreign_col_names, foreign->n_fields, NULL, true, false, NULL, NULL, NULL); - /* There must be an equivalent index in this case. */ - ut_ad(new_index != NULL); + /* New index can be null if XtraDB already dropped + the foreign index when FOREIGN_KEY_CHECKS is + disabled */ foreign->foreign_index = new_index; } else { -- cgit v1.2.1