maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #08882
Re: MDEV-8372 Use helper methods introduced in MDEV-7824 all around the code
Hi, Alexander!
Ok to push, thanks!
On Aug 10, Alexander Barkov wrote:
> diff --git a/sql/field.cc b/sql/field.cc
> index 25506d6..e45cbdd 100644
> --- a/sql/field.cc
> +++ b/sql/field.cc
> @@ -10077,16 +10077,14 @@ Create_field::Create_field(Field *old_field,Field *orig_field)
> if (!default_now) // Give a constant default
> {
> /* Get the value from default_values */
> - my_ptrdiff_t diff= orig_field->table->default_values_offset();
> - orig_field->move_field_offset(diff); // Points now at default_values
> - if (!orig_field->is_real_null())
> + const uchar *dv= orig_field->table->s->default_values;
> + if (!orig_field->is_null_in_record(dv))
> {
> StringBuffer<MAX_FIELD_WIDTH> tmp(charset);
> - String *res= orig_field->val_str(&tmp);
> + String *res= orig_field->val_str(&tmp, orig_field->ptr_in_record(dv));
ouch, that's kinda confusing.
but ok, it's an old one, let's keep it for now.
> char *pos= (char*) sql_strmake(res->ptr(), res->length());
> def= new Item_string(pos, res->length(), charset);
> }
> - orig_field->move_field_offset(-diff); // Back to record[0]
> }
> }
> }
> diff --git a/sql/sql_select.cc b/sql/sql_select.cc
> index d59769b..e720db9 100644
> --- a/sql/sql_select.cc
> +++ b/sql/sql_select.cc
> @@ -16477,20 +16477,17 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
Only two places, I hoped there would be more...
Regards,
Sergei
References