summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2012-09-08 20:33:03 -0700
committerIgor Babaev <igor@askmonty.org>2012-09-08 20:33:03 -0700
commit92eadf641590560cbc29ece9c37c7ed493a89468 (patch)
tree8a4c13608f71d1a698ce371fd30b724eb069ef78 /sql/field.h
parent0f393f07dd8cf58985612651d0f45018b64399dc (diff)
downloadmariadb-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.h')
-rw-r--r--sql/field.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/field.h b/sql/field.h
index 9d2fcd9ee58..7ec57698ac9 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -175,7 +175,6 @@ public:
*/
TABLE *table; // Pointer for table
TABLE *orig_table; // Pointer to original table
- THD *thd; // Used when table == NULL
const char * const *table_name;
const char *field_name;
/** reference to the list of options or NULL */
@@ -452,7 +451,7 @@ public:
*/
inline bool real_maybe_null(void) { return null_ptr != 0; }
- inline THD *get_thd() { return table ? table->in_use : thd; }
+ inline THD *get_thd() { return table ? table->in_use : current_thd; }
enum {
LAST_NULL_BYTE_UNDEF= 0
@@ -492,7 +491,7 @@ public:
Field *clone(MEM_ROOT *mem_root, TABLE *new_table);
Field *clone(MEM_ROOT *mem_root, TABLE *new_table, my_ptrdiff_t diff,
bool stat_flag= FALSE);
- Field *clone(THD *thd_arg, MEM_ROOT *mem_root, my_ptrdiff_t diff);
+ Field *clone(MEM_ROOT *mem_root, my_ptrdiff_t diff);
inline void move_field(uchar *ptr_arg,uchar *null_ptr_arg,uchar null_bit_arg)
{
ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg;