diff options
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/sql/item.cc b/sql/item.cc index f609bfdf082..ad17cd5811c 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -19,7 +19,7 @@ #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */ +#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */ #include "sql_priv.h" #include <mysql.h> #include <m_ctype.h> @@ -1239,8 +1239,7 @@ bool Item::eq(const Item *item, bool binary_cmp) const type() can be only among basic constant types. */ return type() == item->type() && name.str && item->name.str && - name.length == item->name.length && - !my_strcasecmp(system_charset_info, name.str, item->name.str); + !lex_string_cmp(system_charset_info, &name, &item->name); } @@ -1804,7 +1803,7 @@ Item_splocal::this_item_addr(THD *thd, Item **) void Item_splocal::print(String *str, enum_query_type) { str->reserve(m_name.length+8); - str->append(m_name.str, m_name.length); + str->append(&m_name); str->append('@'); str->qs_append(m_var_idx); } @@ -1929,9 +1928,9 @@ Item_splocal_row_field::this_item_addr(THD *thd, Item **) void Item_splocal_row_field::print(String *str, enum_query_type) { str->reserve(m_name.length + m_field_name.length + 8); - str->append(m_name.str, m_name.length); + str->append(&m_name); str->append('.'); - str->append(m_field_name.str, m_field_name.length); + str->append(&m_field_name); str->append('@'); str->qs_append(m_var_idx); str->append('['); @@ -1967,13 +1966,13 @@ void Item_splocal_row_field_by_name::print(String *str, enum_query_type) // +16 should be enough for .NNN@[""] if (str->reserve(m_name.length + 2 * m_field_name.length + 16)) return; - str->qs_append(m_name.str, m_name.length); + str->qs_append(&m_name); str->qs_append('.'); - str->qs_append(m_field_name.str, m_field_name.length); + str->qs_append(&m_field_name); str->qs_append('@'); str->qs_append(m_var_idx); str->qs_append("[\"", 2); - str->qs_append(m_field_name.str, m_field_name.length); + str->qs_append(&m_field_name); str->qs_append("\"]", 2); } @@ -3202,8 +3201,8 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const (In cases where we would choose wrong we would have to generate a ER_NON_UNIQ_ERROR). */ - return (!my_strcasecmp(system_charset_info, item_field->name.str, - field_name.str) && + return (!lex_string_cmp(system_charset_info, &item_field->name, + &field_name) && (!item_field->table_name || !table_name || (!my_strcasecmp(table_alias_charset, item_field->table_name, table_name) && @@ -5146,8 +5145,8 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list) /* SELECT list element with explicit alias */ if ((*(cur_group->item))->name.str && !table_name && !(*(cur_group->item))->is_autogenerated_name && - !my_strcasecmp(system_charset_info, - (*(cur_group->item))->name.str, field_name->str)) + !lex_string_cmp(system_charset_info, + &(*(cur_group->item))->name, field_name)) { ++cur_match_degree; } @@ -5162,8 +5161,8 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list) DBUG_ASSERT(l_field_name->str != 0); - if (!my_strcasecmp(system_charset_info, - l_field_name->str, field_name->str)) + if (!lex_string_cmp(system_charset_info, + l_field_name, field_name)) ++cur_match_degree; else continue; @@ -8929,7 +8928,7 @@ bool Item_default_value::fix_fields(THD *thd, Item **items) goto error; memcpy((void *)def_field, (void *)field_arg->field, field_arg->field->size_of()); - IF_DBUG(def_field->is_stat_field=1,); // a hack to fool ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED + IF_DBUG_ASSERT(def_field->is_stat_field=1,); // a hack to fool ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED if (def_field->default_value && def_field->default_value->flags) { uchar *newptr= (uchar*) thd->alloc(1+def_field->pack_length()); @@ -9232,8 +9231,8 @@ bool Item_trigger_field::eq(const Item *item, bool binary_cmp) const { return item->type() == TRIGGER_FIELD_ITEM && row_version == ((Item_trigger_field *)item)->row_version && - !my_strcasecmp(system_charset_info, field_name.str, - ((Item_trigger_field *)item)->field_name.str); + !lex_string_cmp(system_charset_info, &field_name, + &((Item_trigger_field *)item)->field_name); } |