summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <kgeorge@mysql.com>2008-12-09 19:58:50 +0200
committerGeorgi Kodinov <kgeorge@mysql.com>2008-12-09 19:58:50 +0200
commit5705e3abda5e354a39d531a72c3ddf98d7812b30 (patch)
tree6d8549d8e695be5327d1ac7d12f166170c386f95 /sql/item_cmpfunc.cc
parent1da82b612ab555a3e082c8dd52f4c2eaecda1a87 (diff)
parentbd8657786a185fee54cfbc35b7ef5142e8508073 (diff)
downloadmariadb-git-5705e3abda5e354a39d531a72c3ddf98d7812b30.tar.gz
merged 37936 to 5.1-bugteam
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index c5de0b3df08..c6b70440b41 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -394,19 +394,16 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
TABLE *table= field->table;
ulong orig_sql_mode= thd->variables.sql_mode;
enum_check_fields orig_count_cuted_fields= thd->count_cuted_fields;
- my_bitmap_map *old_write_map;
- my_bitmap_map *old_read_map;
+ my_bitmap_map *old_maps[2];
ulonglong orig_field_val; /* original field value if valid */
- LINT_INIT(old_write_map);
- LINT_INIT(old_read_map);
+ LINT_INIT(old_maps[0]);
+ LINT_INIT(old_maps[1]);
LINT_INIT(orig_field_val);
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);
- }
+ dbug_tmp_use_all_columns(table, old_maps,
+ table->read_set, table->write_set);
/* For comparison purposes allow invalid dates like 2000-01-32 */
thd->variables.sql_mode= (orig_sql_mode & ~MODE_NO_ZERO_DATE) |
MODE_INVALID_DATES;
@@ -441,10 +438,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
thd->variables.sql_mode= orig_sql_mode;
thd->count_cuted_fields= orig_count_cuted_fields;
if (table)
- {
- dbug_tmp_restore_column_map(table->write_set, old_write_map);
- dbug_tmp_restore_column_map(table->read_set, old_read_map);
- }
+ dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_maps);
}
return result;
}