diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-09-26 14:42:30 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-09-26 14:42:30 +0400 |
commit | 0b69c44e945658e82b4c5d532694795136018f12 (patch) | |
tree | 37e11ffbdff3a6aa55340cb7b789d529cea61387 /sql/opt_range.h | |
parent | 7d60030c0200b982c13a4c6a9023cf7190b2510a (diff) | |
download | mariadb-git-0b69c44e945658e82b4c5d532694795136018f12.tar.gz |
MDEV-5067: Valgrind warnings (Invalid read) in QPF_table_access::print_explain
- Query plan footprint (in new terms, "EXPLAIN structure") should always keep
a copy of key_name. This is because the table might be a temporary table which
may be already freed by the time we use query plan footprint.
Diffstat (limited to 'sql/opt_range.h')
-rw-r--r-- | sql/opt_range.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h index eeb4e4b77ad..f2e8b92e7d0 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -346,7 +346,7 @@ public: void add_key_name(String *str, bool *first); /* Save information about quick select's query plan */ - virtual void save_info(QPF_quick_select *qpf)= 0; + virtual void save_info(MEM_ROOT *alloc, QPF_quick_select *qpf)= 0; /* Return 1 if any index used by this quick select @@ -473,7 +473,7 @@ public: { file->position(record); } int get_type() { return QS_TYPE_RANGE; } void add_keys_and_lengths(String *key_names, String *used_lengths); - void save_info(QPF_quick_select *qpf); + void save_info(MEM_ROOT *alloc, QPF_quick_select *qpf); #ifndef DBUG_OFF void dbug_dump(int indent, bool verbose); #endif @@ -610,7 +610,7 @@ public: #ifndef DBUG_OFF void dbug_dump(int indent, bool verbose); #endif - void save_info(QPF_quick_select *qpf); + void save_info(MEM_ROOT *alloc, QPF_quick_select *qpf); bool push_quick_back(QUICK_RANGE_SELECT *quick_sel_range); @@ -674,7 +674,7 @@ public: int get_next(); int get_type() { return QS_TYPE_INDEX_INTERSECT; } void add_keys_and_lengths(String *key_names, String *used_lengths); - void save_info(QPF_quick_select *qpf); + void save_info(MEM_ROOT *alloc, QPF_quick_select *qpf); }; @@ -712,7 +712,7 @@ public: bool unique_key_range() { return false; } int get_type() { return QS_TYPE_ROR_INTERSECT; } void add_keys_and_lengths(String *key_names, String *used_lengths); - void save_info(QPF_quick_select *qpf); + void save_info(MEM_ROOT *alloc, QPF_quick_select *qpf); bool is_keys_used(const MY_BITMAP *fields); #ifndef DBUG_OFF void dbug_dump(int indent, bool verbose); @@ -791,7 +791,7 @@ public: bool unique_key_range() { return false; } int get_type() { return QS_TYPE_ROR_UNION; } void add_keys_and_lengths(String *key_names, String *used_lengths); - void save_info(QPF_quick_select *qpf); + void save_info(MEM_ROOT *alloc, QPF_quick_select *qpf); bool is_keys_used(const MY_BITMAP *fields); #ifndef DBUG_OFF void dbug_dump(int indent, bool verbose); @@ -940,7 +940,7 @@ public: #endif bool is_agg_distinct() { return have_agg_distinct; } bool loose_scan_is_scanning() { return is_index_scan; } - void save_info(QPF_quick_select *qpf); + void save_info(MEM_ROOT *alloc, QPF_quick_select *qpf); }; |