diff options
author | unknown <bell@sanja.is.com.ua> | 2004-03-09 12:52:25 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-03-09 12:52:25 +0200 |
commit | b790f31fcef613f27597bf5a2f866c78376b074d (patch) | |
tree | d3c1e37bae62a884fc201f284f48cd2d27f05630 /sql/item.cc | |
parent | 23f9f229d422db7ee55ecb42c93e69da45dd9e51 (diff) | |
parent | ae7eec928c86014f7eef3e48fa28196cf999434c (diff) | |
download | mariadb-git-b790f31fcef613f27597bf5a2f866c78376b074d.tar.gz |
merge
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/subselect.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/sql/item.cc b/sql/item.cc index 5aaeffff5d2..fb8fbbd8556 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -928,6 +928,10 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) (char *)field_name); if (!rf) return 1; + /* + rf is Item_ref => never substitute other items (in this case) + during fix_fields() => we can use rf after fix_fields() + */ if (rf->fix_fields(thd, tables, ref) || rf->check_cols(1)) return 1; @@ -946,6 +950,10 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) (char *)field_name); if (!rf) return 1; + /* + rf is Item_ref => never substitute other items (in this case) + during fix_fields() => we can use rf after fix_fields() + */ return rf->fix_fields(thd, tables, ref) || rf->check_cols(1); } } @@ -1658,16 +1666,15 @@ bool Item_default_value::eq(const Item *item, bool binary_cmp) const } -bool Item_default_value::fix_fields(THD *thd, struct st_table_list *table_list, Item **items) +bool Item_default_value::fix_fields(THD *thd, + struct st_table_list *table_list, + Item **items) { if (!arg) - return false; - bool res= arg->fix_fields(thd, table_list, items); - if (res) - return res; - /* arg->type() can be only REF_ITEM or FIELD_ITEM for it defined as - simple_ident in sql_yacc.yy - */ + return 0; + if (arg->fix_fields(thd, table_list, &arg)) + return 1; + if (arg->type() == REF_ITEM) { Item_ref *ref= (Item_ref *)arg; @@ -1711,13 +1718,9 @@ bool Item_insert_value::fix_fields(THD *thd, struct st_table_list *table_list, Item **items) { - bool res= arg->fix_fields(thd, table_list, items); - if (res) - return res; - /* - arg->type() can be only REF_ITEM or FIELD_ITEM as arg is - a simple_ident in sql_yacc.yy - */ + if (arg->fix_fields(thd, table_list, &arg)) + return 1; + if (arg->type() == REF_ITEM) { Item_ref *ref= (Item_ref *)arg; |