diff options
author | unknown <evgen@moonbone.local> | 2006-06-19 04:26:27 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2006-06-19 04:26:27 +0400 |
commit | 9f8c532f0c7d8472cb809be6f80bb596d38b336b (patch) | |
tree | 26fb8012590c77c4fa0d476d5d25b442b7ede610 /sql/item_cmpfunc.cc | |
parent | 610b1a4ebda3d2f7dec8db7a5e8226ac0f07338c (diff) | |
download | mariadb-git-9f8c532f0c7d8472cb809be6f80bb596d38b336b.tar.gz |
rpl_log.test, rpl_stm_log.result:
Fixed failing test case
field.cc, item_cmpfunc.cc, select.result:
After merge fix
mysql-test/r/select.result:
After merge fix
mysql-test/r/rpl_stm_log.result:
Fixed failing test case
sql/item_cmpfunc.cc:
After merge fix
sql/field.cc:
After merge fix
mysql-test/extra/rpl_tests/rpl_log.test:
Fixed failing test case
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index a3464c3bc25..3bff7878f02 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -148,7 +148,7 @@ static void agg_cmp_type(THD *thd, Item_result *type, Item **items, uint nitems) } else if (res == Item::FUNC_ITEM) { - field= items[i]->tmp_table_field_from_field_type(0); + field= items[i]->tmp_table_field_from_field_type(0, 0); if (field) field->move_field(buff, &null_byte, 0); break; @@ -354,9 +354,21 @@ longlong Item_func_nop_all::val_int() static bool convert_constant_item(THD *thd, Field *field, Item **item) { int result= 0; + if (!(*item)->with_subselect && (*item)->const_item()) { + TABLE *table= field->table; + ulong orig_sql_mode= thd->variables.sql_mode; + my_bitmap_map *old_write_map; + my_bitmap_map *old_read_map; + + if (table) + { + old_write_map= dbug_tmp_use_all_columns(table, table->write_set); + old_read_map= dbug_tmp_use_all_columns(table, table->read_set); + } /* For comparison purposes allow invalid dates like 2000-01-32 */ + thd->variables.sql_mode|= MODE_INVALID_DATES; if (!(*item)->save_in_field(field, 1) && !((*item)->null_value)) { Item *tmp= new Item_int_with_ref(field->val_int(), *item, @@ -365,9 +377,12 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item) thd->change_item_tree(item, tmp); result= 1; // Item was replaced } - table->in_use->variables.sql_mode= orig_sql_mode; - dbug_tmp_restore_column_map(table->write_set, old_write_map); - dbug_tmp_restore_column_map(table->read_set, old_read_map); + thd->variables.sql_mode= orig_sql_mode; + if (table) + { + dbug_tmp_restore_column_map(table->write_set, old_write_map); + dbug_tmp_restore_column_map(table->read_set, old_read_map); + } } return result; } |