diff options
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/sql/item.cc b/sql/item.cc index 267560b0709..813eaf41b45 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1279,7 +1279,7 @@ bool Item::fix_fields(THD *thd, // We do not check fields which are fixed during construction DBUG_ASSERT(fixed == 0 || basic_const_item()); fixed= 1; - return 0; + return FALSE; } double Item_ref_null_helper::val() @@ -1447,9 +1447,9 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } } if (!tmp) - return -1; + return TRUE; if (!refer) - return 1; + return TRUE; if (tmp == not_found_field && refer == (Item **)not_found_item) { if (upward_lookup) @@ -1463,7 +1463,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) // Call to report error find_field_in_tables(thd, this, tables, ref, 1, 1); } - return -1; + return TRUE; } else if (refer != (Item **)not_found_item) { @@ -1471,7 +1471,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { my_error(ER_ILLEGAL_REFERENCE, MYF(0), name, "forward reference in item list"); - return -1; + return TRUE; } Item_ref *rf; @@ -1481,16 +1481,16 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) (char *)field_name); register_item_tree_changing(ref); if (!rf) - return 1; + return TRUE; /* 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; + return TRUE; mark_as_dependent(thd, last, cursel, rf); - return 0; + return FALSE; } else { @@ -1503,7 +1503,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) (char *)cached_table->alias, (char *)field_name); if (!rf) - return 1; + return TRUE; /* rf is Item_ref => never substitute other items (in this case) during fix_fields() => we can use rf after fix_fields() @@ -1513,7 +1513,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } } else if (!tmp) - return -1; + return TRUE; /* if it is not expression from merged VIEW we will set this field. @@ -1564,12 +1564,12 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) thd->host_or_ip, field_name, tab); - return 1; + return TRUE; } } #endif fixed= 1; - return 0; + return FALSE; } void Item_field::cleanup() @@ -2209,9 +2209,9 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference) } if (!ref) - return 1; + return TRUE; else if (!tmp) - return -1; + return TRUE; else if (ref == (Item **)not_found_item && tmp == not_found_field) { if (upward_lookup) @@ -2229,7 +2229,7 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference) REPORT_ALL_ERRORS); } ref= 0; - return 1; + return TRUE; } else if (tmp != not_found_field) { @@ -2238,10 +2238,10 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference) { Item_field* fld; if (!((*reference)= fld= new Item_field(tmp))) - return 1; + return TRUE; mark_as_dependent(thd, last, thd->lex->current_select, fld); register_item_tree_changing(reference); - return 0; + return FALSE; } /* We can leave expression substituted from view for next PS/SP @@ -2261,7 +2261,7 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference) { my_error(ER_ILLEGAL_REFERENCE, MYF(0), name, "forward reference in item list"); - return -1; + return TRUE; } mark_as_dependent(thd, last, thd->lex->current_select, this); @@ -2269,14 +2269,14 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference) } } else if (!ref) - return 1; + return TRUE; else { if (!(*ref)->fixed) { my_error(ER_ILLEGAL_REFERENCE, MYF(0), name, "forward reference in item list"); - return -1; + return TRUE; } ref= thd->lex->current_select->ref_pointer_array + counter; } @@ -2299,7 +2299,7 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference) ((*ref)->with_sum_func? "reference on group function": "forward reference in item list")); - return 1; + return TRUE; } max_length= (*ref)->max_length; maybe_null= (*ref)->maybe_null; @@ -2309,8 +2309,8 @@ bool Item_ref::fix_fields(THD *thd, TABLE_LIST *tables, Item **reference) fixed= 1; if (ref && (*ref)->check_cols(1)) - return 1; - return 0; + return TRUE; + return FALSE; } @@ -2416,17 +2416,17 @@ bool Item_default_value::fix_fields(THD *thd, if (!arg) { fixed= 1; - return 0; + return FALSE; } if (arg->fix_fields(thd, table_list, &arg)) - return 1; + return TRUE; if (arg->type() == REF_ITEM) { Item_ref *ref= (Item_ref *)arg; if (ref->ref[0]->type() != FIELD_ITEM) { - return 1; + return TRUE; } arg= ref->ref[0]; } @@ -2435,16 +2435,16 @@ bool Item_default_value::fix_fields(THD *thd, { my_printf_error(ER_NO_DEFAULT_FOR_FIELD, ER(ER_NO_DEFAULT_FOR_FIELD), MYF(0), field_arg->field->field_name); - return 1; + return TRUE; } if (!(def_field= (Field*) sql_alloc(field_arg->field->size_of()))) - return 1; + return TRUE; memcpy(def_field, field_arg->field, field_arg->field->size_of()); def_field->move_field(def_field->table->default_values - def_field->table->record[0]); set_field(def_field); fixed= 1; - return 0; + return FALSE; } void Item_default_value::print(String *str) @@ -2472,14 +2472,14 @@ bool Item_insert_value::fix_fields(THD *thd, { DBUG_ASSERT(fixed == 0); if (arg->fix_fields(thd, table_list, &arg)) - return 1; + return TRUE; if (arg->type() == REF_ITEM) { Item_ref *ref= (Item_ref *)arg; if (ref->ref[0]->type() != FIELD_ITEM) { - return 1; + return TRUE; } arg= ref->ref[0]; } @@ -2488,7 +2488,7 @@ bool Item_insert_value::fix_fields(THD *thd, { Field *def_field= (Field*) sql_alloc(field_arg->field->size_of()); if (!def_field) - return 1; + return TRUE; memcpy(def_field, field_arg->field, field_arg->field->size_of()); def_field->move_field(def_field->table->insert_values - def_field->table->record[0]); @@ -2502,7 +2502,7 @@ bool Item_insert_value::fix_fields(THD *thd, tmp_field->table, &my_charset_bin)); } fixed= 1; - return 0; + return FALSE; } void Item_insert_value::print(String *str) |