summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authorDmitry Shulga <dmitry.shulga@mariadb.com>2021-01-29 18:58:53 +0700
committerDmitry Shulga <dmitry.shulga@mariadb.com>2021-01-29 18:58:53 +0700
commitaada8f03d67abdb9e9d30611f92d73110ac0a2eb (patch)
treea556e62183cc85cd578a4d123a7eaa12b194e663 /sql/sql_lex.h
parentbdae8bb6fdb7e9c7875f9a3fff02eadadea50dab (diff)
downloadmariadb-git-bb-10.3-MDEV-22786-1.tar.gz
MDEV-22786: VALUES ((VALUES(1))) leads to SIGSEGV in Item_field::type_handlerbb-10.3-MDEV-22786-1
Draft patch based on proposal described on the bug report's page to fix the crash
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 55929ed7df6..55df258321e 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1401,7 +1401,7 @@ public:
bool cond_pushdown_is_allowed() const
{ return !olap && !explicit_limit && !tvc; }
-
+
private:
bool m_non_agg_field_used;
bool m_agg_func_used;
@@ -1413,12 +1413,23 @@ private:
/* a list of USE/FORCE/IGNORE INDEX */
List<Index_hint> *index_hints;
+ /*
+ The following data members are for storing original values of corresponding
+ LEX counterpart members changed on parse phase in TVC handling.
+ */
+ List<Item> save_field_list;
+ List<List_item> save_many_values;
+ List<Item> *save_insert_list;
public:
inline void add_where_field(st_select_lex *sel)
{
DBUG_ASSERT(this != sel);
select_n_where_fields+= sel->select_n_where_fields;
}
+
+ void backup_tvc_affectable_lex_fields(LEX *lex);
+
+ void restore_tvc_affectable_lex_fields(LEX *lex);
};
typedef class st_select_lex SELECT_LEX;
@@ -4045,12 +4056,7 @@ public:
return false;
}
- void tvc_start()
- {
- field_list.empty();
- many_values.empty();
- insert_list= 0;
- }
+ void tvc_start();
bool tvc_finalize();
bool tvc_finalize_derived();