diff options
author | bell@sanja.is.com.ua <> | 2004-02-18 01:08:52 +0200 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2004-02-18 01:08:52 +0200 |
commit | 14b9fa3588a35c8e7df3961eba06e6e590eabfcf (patch) | |
tree | 65aff983542f7b988996319163a7a3e003e845f4 /sql/item_row.cc | |
parent | 8a865250c4180ee197c4626560eb46c2cea0a696 (diff) | |
download | mariadb-git-14b9fa3588a35c8e7df3961eba06e6e590eabfcf.tar.gz |
revision of fix_fields() calls (BUG2838)
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r-- | sql/item_row.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sql/item_row.cc b/sql/item_row.cc index 7f847bd1d4e..2b0cd38e3c1 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -62,19 +62,21 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref) { if ((*arg)->fix_fields(thd, tabl, arg)) return 1; - used_tables_cache |= (*arg)->used_tables(); - if (const_item_cache&= (*arg)->const_item() && !with_null) + // we can't assign 'item' before, because fix_fields() can change arg + Item *item= *arg; + used_tables_cache |= item->used_tables(); + if (const_item_cache&= item->const_item() && !with_null) { - if ((*arg)->cols() > 1) - with_null|= (*arg)->null_inside(); + if (item->cols() > 1) + with_null|= item->null_inside(); else { - (*arg)->val_int(); - with_null|= (*arg)->null_value; + item->val_int(); + with_null|= item->null_value; } } - maybe_null|= (*arg)->maybe_null; - with_sum_func= with_sum_func || (*arg)->with_sum_func; + maybe_null|= item->maybe_null; + with_sum_func= with_sum_func || item->with_sum_func; } return 0; } |