diff options
| author | Michael Widenius <monty@mariadb.org> | 2017-06-18 14:00:28 +0300 |
|---|---|---|
| committer | Sergei Golubchik <serg@mariadb.org> | 2017-08-24 01:05:53 +0200 |
| commit | 25c06f5282513e15c25c54364ef886310126e870 (patch) | |
| tree | 4a695cd4d445e7af0739dc4485e8fb14b3d6451f /sql/sql_truncate.cc | |
| parent | cc77f9882dcaa4e02196bb3847cd66f2943eb4c6 (diff) | |
| download | mariadb-git-25c06f5282513e15c25c54364ef886310126e870.tar.gz | |
Optimize LEX_STRING comparisons
- Added inline lex_string_cmp() to replace my_strcase_cmp().
- Added inline lex_string_eq to first compares lengths before comparing strings
Diffstat (limited to 'sql/sql_truncate.cc')
| -rw-r--r-- | sql/sql_truncate.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index 13b553f8b71..1d6edbc5fc9 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -151,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; } |
