summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorNikita Malyavin <nikitamalyavin@gmail.com>2019-09-04 04:29:03 +1000
committerNikita Malyavin <nikitamalyavin@gmail.com>2020-07-21 16:18:00 +1000
commit5acd391e8b2d4d760ae7f96a59413c9ea247e9b1 (patch)
tree7c76c0dace6ba4cc0c4f1dd4c855c9b8688878fa /sql/sql_class.cc
parentca9276e37ea29468406d5ec7c17d2ad5c032637f (diff)
downloadmariadb-git-5acd391e8b2d4d760ae7f96a59413c9ea247e9b1.tar.gz
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.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 655824d93fe..69bfbac6920 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -3482,7 +3482,7 @@ void select_dumpvar::cleanup()
Query_arena::Type Query_arena::type() const
{
DBUG_ASSERT(0); /* Should never be called */
- return STATEMENT;
+ return Type::STATEMENT;
}
@@ -3535,7 +3535,7 @@ Statement::Statement(LEX *lex_arg, MEM_ROOT *mem_root_arg,
Query_arena::Type Statement::type() const
{
- return STATEMENT;
+ return Type::STATEMENT;
}