Loading sql/field.cc +7 −8 Original line number Diff line number Diff line Loading @@ -1228,7 +1228,7 @@ Field::Field(char *ptr_arg,uint32 length_arg,uchar *null_ptr_arg, field_name(field_name_arg), query_id(0), key_start(0), part_of_key(0), part_of_sortkey(0), unireg_check(unireg_check_arg), field_length(length_arg), null_bit(null_bit_arg), dflt_field(0) field_length(length_arg), null_bit(null_bit_arg) { flags=null_ptr ? 0: NOT_NULL_FLAG; comment.str= (char*) ""; Loading Loading @@ -8964,22 +8964,21 @@ create_field::create_field(Field *old_field,Field *orig_field) old_field->table->timestamp_field != old_field || /* timestamp field */ unireg_check == Field::TIMESTAMP_UN_FIELD)) /* has default val */ { char buff[MAX_FIELD_WIDTH],*pos; String tmp(buff,sizeof(buff), charset), *res; my_ptrdiff_t diff; /* Get the value from default_values */ diff= (my_ptrdiff_t) (orig_field->table->s->default_values- orig_field->table->record[0]); orig_field->move_field(diff); // Points now at default_values bool is_null=orig_field->is_real_null(); res= orig_field->val_str(&tmp); orig_field->move_field(-diff); // Back to record[0] if (!is_null) if (!orig_field->is_real_null()) { char buff[MAX_FIELD_WIDTH],*pos; String tmp(buff,sizeof(buff), charset), *res; res= orig_field->val_str(&tmp); pos= (char*) sql_strmake(res->ptr(), res->length()); def= new Item_string(pos, res->length(), charset); } orig_field->move_field(-diff); // Back to record[0] } } Loading sql/field.h +0 −6 Original line number Diff line number Diff line Loading @@ -53,12 +53,6 @@ class Field char *ptr; // Position to field in record uchar *null_ptr; // Byte where null_bit is /* dflt_field is used only for the fields of temporary tables. It points to the default value of the field in another table from which this field has been created. */ Field *dflt_field; // Field to copy default value from /* Note that you can use table->in_use as replacement for current_thd member only inside of val_*() and store() members (e.g. you can't use it in cons) Loading sql/item.h +2 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,8 @@ class Settable_routine_parameter required, otherwise we only reading it and SELECT privilege might be required. */ Settable_routine_parameter() {} virtual ~Settable_routine_parameter() {} virtual void set_required_privilege(bool rw) {}; /* Loading sql/item_timefunc.cc +4 −32 Original line number Diff line number Diff line Loading @@ -2130,39 +2130,11 @@ longlong Item_date_add_interval::val_int() bool Item_date_add_interval::eq(const Item *item, bool binary_cmp) const { INTERVAL interval, other_interval; String val= value; // Because of const if (this == item) return TRUE; if ((item->type() != FUNC_ITEM) || (arg_count != ((Item_func*) item)->arg_count) || (func_name() != ((Item_func*) item)->func_name())) return FALSE; Item_date_add_interval *other= (Item_date_add_interval*) item; if ((int_type != other->int_type) || (!args[0]->eq(other->args[0], binary_cmp))) return FALSE; if (!args[1]->const_item() || !other->args[1]->const_item()) return (args[1]->eq(other->args[1], binary_cmp)); if (get_interval_value(args[1], int_type, &val, &interval)) return FALSE; val= other->value; if ((get_interval_value(other->args[1], other->int_type, &val, &other_interval)) || ((date_sub_interval ^ interval.neg) ^ (other->date_sub_interval ^ other_interval.neg))) return FALSE; // Assume comparing same types here due to earlier check return memcmp(&interval, &other_interval, sizeof(INTERVAL)) == 0; if (!Item_func::eq(item, binary_cmp)) return 0; return ((int_type == other->int_type) && (date_sub_interval == other->date_sub_interval)); } Loading sql/mysql_priv.h +1 −0 Original line number Diff line number Diff line Loading @@ -704,6 +704,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *t); bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *t); Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, Item ***copy_func, Field **from_field, Field **def_field, bool group, bool modify_item, bool table_cant_handle_bit_fields, bool make_copy_field, Loading Loading
sql/field.cc +7 −8 Original line number Diff line number Diff line Loading @@ -1228,7 +1228,7 @@ Field::Field(char *ptr_arg,uint32 length_arg,uchar *null_ptr_arg, field_name(field_name_arg), query_id(0), key_start(0), part_of_key(0), part_of_sortkey(0), unireg_check(unireg_check_arg), field_length(length_arg), null_bit(null_bit_arg), dflt_field(0) field_length(length_arg), null_bit(null_bit_arg) { flags=null_ptr ? 0: NOT_NULL_FLAG; comment.str= (char*) ""; Loading Loading @@ -8964,22 +8964,21 @@ create_field::create_field(Field *old_field,Field *orig_field) old_field->table->timestamp_field != old_field || /* timestamp field */ unireg_check == Field::TIMESTAMP_UN_FIELD)) /* has default val */ { char buff[MAX_FIELD_WIDTH],*pos; String tmp(buff,sizeof(buff), charset), *res; my_ptrdiff_t diff; /* Get the value from default_values */ diff= (my_ptrdiff_t) (orig_field->table->s->default_values- orig_field->table->record[0]); orig_field->move_field(diff); // Points now at default_values bool is_null=orig_field->is_real_null(); res= orig_field->val_str(&tmp); orig_field->move_field(-diff); // Back to record[0] if (!is_null) if (!orig_field->is_real_null()) { char buff[MAX_FIELD_WIDTH],*pos; String tmp(buff,sizeof(buff), charset), *res; res= orig_field->val_str(&tmp); pos= (char*) sql_strmake(res->ptr(), res->length()); def= new Item_string(pos, res->length(), charset); } orig_field->move_field(-diff); // Back to record[0] } } Loading
sql/field.h +0 −6 Original line number Diff line number Diff line Loading @@ -53,12 +53,6 @@ class Field char *ptr; // Position to field in record uchar *null_ptr; // Byte where null_bit is /* dflt_field is used only for the fields of temporary tables. It points to the default value of the field in another table from which this field has been created. */ Field *dflt_field; // Field to copy default value from /* Note that you can use table->in_use as replacement for current_thd member only inside of val_*() and store() members (e.g. you can't use it in cons) Loading
sql/item.h +2 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,8 @@ class Settable_routine_parameter required, otherwise we only reading it and SELECT privilege might be required. */ Settable_routine_parameter() {} virtual ~Settable_routine_parameter() {} virtual void set_required_privilege(bool rw) {}; /* Loading
sql/item_timefunc.cc +4 −32 Original line number Diff line number Diff line Loading @@ -2130,39 +2130,11 @@ longlong Item_date_add_interval::val_int() bool Item_date_add_interval::eq(const Item *item, bool binary_cmp) const { INTERVAL interval, other_interval; String val= value; // Because of const if (this == item) return TRUE; if ((item->type() != FUNC_ITEM) || (arg_count != ((Item_func*) item)->arg_count) || (func_name() != ((Item_func*) item)->func_name())) return FALSE; Item_date_add_interval *other= (Item_date_add_interval*) item; if ((int_type != other->int_type) || (!args[0]->eq(other->args[0], binary_cmp))) return FALSE; if (!args[1]->const_item() || !other->args[1]->const_item()) return (args[1]->eq(other->args[1], binary_cmp)); if (get_interval_value(args[1], int_type, &val, &interval)) return FALSE; val= other->value; if ((get_interval_value(other->args[1], other->int_type, &val, &other_interval)) || ((date_sub_interval ^ interval.neg) ^ (other->date_sub_interval ^ other_interval.neg))) return FALSE; // Assume comparing same types here due to earlier check return memcmp(&interval, &other_interval, sizeof(INTERVAL)) == 0; if (!Item_func::eq(item, binary_cmp)) return 0; return ((int_type == other->int_type) && (date_sub_interval == other->date_sub_interval)); } Loading
sql/mysql_priv.h +1 −0 Original line number Diff line number Diff line Loading @@ -704,6 +704,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *t); bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *t); Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, Item ***copy_func, Field **from_field, Field **def_field, bool group, bool modify_item, bool table_cant_handle_bit_fields, bool make_copy_field, Loading