diff options
Diffstat (limited to 'sql/sql_truncate.cc')
-rw-r--r-- | sql/sql_truncate.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index d4859efc7af..1d6edbc5fc9 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -14,6 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "mariadb.h" #include "debug_sync.h" // DEBUG_SYNC #include "table.h" // TABLE, FOREIGN_KEY_INFO #include "sql_class.h" // THD @@ -150,18 +151,18 @@ 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, - table->s->db.str) || - my_strcasecmp(system_charset_info, fk_info->foreign_table->str, - table->s->table_name.str)) + DBUG_ASSERT(!lex_string_cmp(system_charset_info, + fk_info->referenced_db, + &table->s->db)); + + DBUG_ASSERT(!lex_string_cmp(system_charset_info, + fk_info->referenced_table, + &table->s->table_name)); + + if (lex_string_cmp(system_charset_info, fk_info->foreign_db, + &table->s->db) || + lex_string_cmp(system_charset_info, fk_info->foreign_table, + &table->s->table_name)) break; } |