1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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
This commit is contained in:
Michael Widenius
2017-06-18 14:00:28 +03:00
committed by Sergei Golubchik
parent cc77f9882d
commit 25c06f5282
14 changed files with 137 additions and 137 deletions

View File

@ -750,8 +750,8 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
DBUG_RETURN(true);
/* Trigger must be in the same schema as target table. */
if (my_strcasecmp(table_alias_charset, table->s->db.str,
lex->spname->m_db.str))
if (lex_string_cmp(table_alias_charset, &table->s->db,
&lex->spname->m_db))
{
my_error(ER_TRG_IN_WRONG_SCHEMA, MYF(0));
DBUG_RETURN(true);
@ -1084,8 +1084,8 @@ Trigger *Table_triggers_list::find_trigger(const LEX_CSTRING *name,
(trigger= *parent);
parent= &trigger->next)
{
if (my_strcasecmp(table_alias_charset,
trigger->name.str, name->str) == 0)
if (lex_string_cmp(table_alias_charset,
&trigger->name, name) == 0)
{
if (remove_from_list)
{
@ -1633,8 +1633,8 @@ void Table_triggers_list::add_trigger(trg_event_type event,
for ( ; *parent ; parent= &(*parent)->next, position++)
{
if (ordering_clause != TRG_ORDER_NONE &&
!my_strcasecmp(table_alias_charset, anchor_trigger_name->str,
(*parent)->name.str))
!lex_string_cmp(table_alias_charset, anchor_trigger_name,
&(*parent)->name))
{
if (ordering_clause == TRG_ORDER_FOLLOWS)
{