diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-04-03 10:57:45 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-04-24 11:15:38 +0200 |
commit | 81a8d8be76b1cc22d8567ed66cf8c6b93591112c (patch) | |
tree | 5bce62fbe10cc2e05276dc175600233e458adb1c /sql/sql_truncate.cc | |
parent | d5da8ae04d57556f517c0f03afeafe73c6cc75d1 (diff) | |
download | mariadb-git-81a8d8be76b1cc22d8567ed66cf8c6b93591112c.tar.gz |
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`
Diffstat (limited to 'sql/sql_truncate.cc')
-rw-r--r-- | sql/sql_truncate.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index ed36ab428a2..b225d5f04df 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -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)) |