diff options
author | unknown <igor@rurik.mysql.com> | 2004-02-19 01:09:54 -0800 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2004-02-19 01:09:54 -0800 |
commit | f4353d48ccc39527540daf709a1167462b39738c (patch) | |
tree | aa627335f475f099e0d352b39af4e24d6e1ac189 /sql/item_cmpfunc.cc | |
parent | c88e5213d4f8acbbba33d293a9573042818f0aec (diff) | |
parent | 9ce4695da0bfe74e840dcf708da10cac9740e137 (diff) | |
download | mariadb-git-f4353d48ccc39527540daf709a1167462b39738c.tar.gz |
Manual merge
mysql-test/r/func_test.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/user_var.result:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_row.cc:
Auto merged
sql/item_row.h:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/sql_list.h:
Auto merged
sql/sql_select.h:
Auto merged
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index e0bdae769ed..9aa69ee4a0e 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -496,7 +496,6 @@ longlong Item_func_eq::val_int() return value == 0 ? 1 : 0; } - /* Same as Item_func_eq, but NULL = NULL */ void Item_func_equal::fix_length_and_dec() @@ -1652,32 +1651,25 @@ longlong Item_func_bit_and::val_int() return (longlong) (arg1 & arg2); } -Item_cond::Item_cond(THD *thd, Item_cond &item) +Item_cond::Item_cond(THD *thd, Item_cond *item) :Item_bool_func(thd, item), - abort_on_null(item.abort_on_null), - and_tables_cache(item.and_tables_cache) + abort_on_null(item->abort_on_null), + and_tables_cache(item->and_tables_cache) { /* - here should be following text: - - List_iterator_fast<Item*> li(item.list); - while(Item *it= li++) - list.push_back(it); - - but it do not need, - because this constructor used only for AND/OR and - argument list will be copied by copy_andor_arguments call + item->list will be copied by copy_andor_arguments() call */ - } + void Item_cond::copy_andor_arguments(THD *thd, Item_cond *item) { List_iterator_fast<Item> li(item->list); - while(Item *it= li++) + while (Item *it= li++) list.push_back(it->copy_andor_structure(thd)); } + bool Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { @@ -1704,9 +1696,6 @@ Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { // Identical function li.replace(((Item_cond*) item)->list); ((Item_cond*) item)->list.empty(); -#ifdef DELETE_ITEMS - delete (Item_cond*) item; -#endif item= *li.ref(); // new current item } if (abort_on_null) @@ -1792,7 +1781,7 @@ void Item_cond::split_sum_func(Item **ref_pointer_array, List<Item> &fields) uint el= fields.elements; fields.push_front(item); ref_pointer_array[el]= item; - li.replace(new Item_ref(ref_pointer_array + el, 0, item->name)); + li.replace(new Item_ref(ref_pointer_array + el, li.ref(), 0, item->name)); } item->update_used_tables(); used_tables_cache|=item->used_tables(); @@ -2236,11 +2225,11 @@ void Item_func_like::turboBM_compute_suffixes(int *suff) int f = 0; int g = plm1; int *const splm1 = suff + plm1; - CHARSET_INFO *cs=system_charset_info; // QQ Needs to be fixed + CHARSET_INFO *cs= cmp.cmp_collation.collation; *splm1 = pattern_len; - if (cmp.cmp_collation.collation == &my_charset_bin) + if (cs == &my_charset_bin) { int i; for (i = pattern_len - 2; i >= 0; i--) @@ -2338,12 +2327,12 @@ void Item_func_like::turboBM_compute_bad_character_shifts() int *end = bmBc + alphabet_size; int j; const int plm1 = pattern_len - 1; - CHARSET_INFO *cs=system_charset_info; // QQ Needs to be fixed + CHARSET_INFO *cs= cmp.cmp_collation.collation; for (i = bmBc; i < end; i++) *i = pattern_len; - if (cmp.cmp_collation.collation == &my_charset_bin) + if (cs == &my_charset_bin) { for (j = 0; j < plm1; j++) bmBc[(uint) (uchar) pattern[j]] = plm1 - j; @@ -2368,13 +2357,13 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const int shift = pattern_len; int j = 0; int u = 0; - CHARSET_INFO *cs= cmp.cmp_collation.collation; // QQ Needs to be fixed + CHARSET_INFO *cs= cmp.cmp_collation.collation; const int plm1= pattern_len - 1; const int tlmpl= text_len - pattern_len; /* Searching */ - if (cmp.cmp_collation.collation == &my_charset_bin) + if (cs == &my_charset_bin) { while (j <= tlmpl) { |