Commit 6ff6a5ea authored by unknown's avatar unknown

Code cleanup:

- added unsigned_flag= 1; to Item_uint constructors
- removed Item_uint::fix_fields()
- added a comment about fix_fields() call


sql/item.h:
  added unsigned_flag= 1; to Item_uint constructors
  removed Item_uint::fix_fields()
sql/item_func.cc:
  added a comment about fix_fields() call.
parent 3d13c402
...@@ -429,19 +429,13 @@ class Item_uint :public Item_int ...@@ -429,19 +429,13 @@ class Item_uint :public Item_int
public: public:
Item_uint(const char *str_arg, uint length) : Item_uint(const char *str_arg, uint length) :
Item_int(str_arg, (longlong) strtoull(str_arg,(char**) 0,10), length) Item_int(str_arg, (longlong) strtoull(str_arg,(char**) 0,10), length)
{ fixed= 0; } { unsigned_flag= 1; }
Item_uint(uint32 i) :Item_int((longlong) i, 10) Item_uint(uint32 i) :Item_int((longlong) i, 10)
{ fixed= 0; } { unsigned_flag= 1; }
double val() { return ulonglong2double((ulonglong)value); } double val() { return ulonglong2double((ulonglong)value); }
String *val_str(String*); String *val_str(String*);
Item *new_item() { return new Item_uint(name,max_length); } Item *new_item() { return new Item_uint(name,max_length); }
int save_in_field(Field *field, bool no_conversions); int save_in_field(Field *field, bool no_conversions);
bool fix_fields(THD *thd, struct st_table_list *list, Item **item)
{
bool res= Item::fix_fields(thd, list, item);
unsigned_flag= 1;
return res;
}
void print(String *str); void print(String *str);
}; };
......
...@@ -205,6 +205,7 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) ...@@ -205,6 +205,7 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{ {
Item *item; Item *item;
/* We can't yet set item to *arg as fix_fields may change *arg */ /* We can't yet set item to *arg as fix_fields may change *arg */
/* We shouldn't call fix_fields() twice, so check 'fixed' field first */
if ((!(*arg)->fixed && (*arg)->fix_fields(thd, tables, arg)) || if ((!(*arg)->fixed && (*arg)->fix_fields(thd, tables, arg)) ||
(*arg)->check_cols(allowed_arg_cols)) (*arg)->check_cols(allowed_arg_cols))
return 1; /* purecov: inspected */ return 1; /* purecov: inspected */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment