1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-18923 Assertion `!lex_string_cmp(system_charset_info, fk_info->referenced_table, &table->s->table_name)' failed in fk_truncate_illegal_if_parent

don't assert the correctness of FK constraints, as it can be
broken under `SET FOREIGN_KEY_CHECKS= OFF`
This commit is contained in:
Sergei Golubchik
2019-04-03 10:57:45 +02:00
parent d5da8ae04d
commit 81a8d8be76
3 changed files with 34 additions and 9 deletions

View File

@ -150,15 +150,11 @@ fk_truncate_illegal_if_parent(THD *thd, TABLE *table)
/* Loop over the set of foreign keys for which this table is a parent. */
while ((fk_info= it++))
{
DBUG_ASSERT(!my_strcasecmp(system_charset_info,
fk_info->referenced_db->str,
table->s->db.str));
DBUG_ASSERT(!my_strcasecmp(system_charset_info,
fk_info->referenced_table->str,
table->s->table_name.str));
if (my_strcasecmp(system_charset_info, fk_info->foreign_db->str,
if (my_strcasecmp(system_charset_info, fk_info->referenced_db->str,
table->s->db.str) ||
my_strcasecmp(system_charset_info, fk_info->referenced_table->str,
table->s->table_name.str) ||
my_strcasecmp(system_charset_info, fk_info->foreign_db->str,
table->s->db.str) ||
my_strcasecmp(system_charset_info, fk_info->foreign_table->str,
table->s->table_name.str))