diff options
author | Igor Babaev <igor@askmonty.org> | 2012-09-08 20:33:03 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2012-09-08 20:33:03 -0700 |
commit | 92eadf641590560cbc29ece9c37c7ed493a89468 (patch) | |
tree | 8a4c13608f71d1a698ce371fd30b724eb069ef78 /sql/field.cc | |
parent | 0f393f07dd8cf58985612651d0f45018b64399dc (diff) | |
download | mariadb-git-92eadf641590560cbc29ece9c37c7ed493a89468.tar.gz |
Part 2 of the fix for bug mdev-504.
Any Field object should use current_thd instead of table->in_use
when THD is needed if table == NULL.
This patch fixes the crash of test case from mdev-504.test.
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/field.cc b/sql/field.cc index faf1f80610a..610d56ce37a 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1319,7 +1319,7 @@ String *Field::val_int_as_str(String *val_buffer, bool unsigned_val) Field::Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg, uchar null_bit_arg, utype unireg_check_arg, const char *field_name_arg) - :ptr(ptr_arg), null_ptr(null_ptr_arg), table(0), orig_table(0), thd(0), + :ptr(ptr_arg), null_ptr(null_ptr_arg), table(0), orig_table(0), table_name(0), field_name(field_name_arg), option_list(0), option_struct(0), key_start(0), part_of_key(0), part_of_key_not_clustered(0), part_of_sortkey(0), @@ -1874,12 +1874,11 @@ Field *Field::clone(MEM_ROOT *root, TABLE *new_table, my_ptrdiff_t diff, } -Field *Field::clone(THD *thd_arg, MEM_ROOT *root, my_ptrdiff_t diff) +Field *Field::clone(MEM_ROOT *root, my_ptrdiff_t diff) { Field *tmp; if ((tmp= (Field*) memdup_root(root,(char*) this,size_of()))) { - tmp->thd= thd_arg; tmp->move_field_offset(diff); } return tmp; @@ -2780,7 +2779,7 @@ int Field_new_decimal::store(longlong nr, bool unsigned_val) } if (store_value(&decimal_value)) err= 1; - else if (err && !thd->got_warning) + else if (err && !get_thd()->got_warning) err= warn_if_overflow(err); return err; } |