From 5acd391e8b2d4d760ae7f96a59413c9ea247e9b1 Mon Sep 17 00:00:00 2001 From: Nikita Malyavin Date: Wed, 4 Sep 2019 04:29:03 +1000 Subject: MDEV-16039 Crash when selecting virtual columns generated using functions with DAYNAME() * Allocate items on thd->mem_root while refixing vcol exprs * Make vcol tree changes register and roll them back after the statement is executed. Explanation: Due to collation implementation specifics an Item tree could change while fixing. The tricky thing here is to make it on a proper arena. It's usually not a problem when a field is deterministic, however, makes a pain vice-versa, during allocation allocating. A non-deterministic field should be refixed on each statement, since it depends on the environment state. Changing the tree will be temporary and therefore it should be reverted after the statement execution. --- sql/table.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/table.h') diff --git a/sql/table.h b/sql/table.h index 90a85b9b07e..f3a7f278604 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1559,6 +1559,7 @@ public: TABLE *tmp_table, TMP_TABLE_PARAM *tmp_table_param, bool with_cleanup); + int fix_vcol_exprs(THD *thd); }; -- cgit v1.2.1