diff options
author | halfspawn <j.brauge@qualiac.com> | 2018-03-30 11:23:28 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2018-04-11 09:59:13 +0200 |
commit | 73f3842bf7cea9b9d56badaf2b400c513cf578cb (patch) | |
tree | a4befe1fba1e8de5d76c755077d992eaceb00ba3 /sql/item_subselect.cc | |
parent | dd127799bc179da10cc24c5d5cd105c9a5584730 (diff) | |
download | mariadb-git-10.3-MDEV-11953.tar.gz |
MDEV-15739 sql_mode=ORACLE: Make LPAD and RPAD return NULL instead of empty string10.3-MDEV-11953
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 6378e9b76bf..5a447cef23a 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -123,14 +123,7 @@ void Item_subselect::init(st_select_lex *select_lex, else engine= new subselect_single_select_engine(select_lex, result, this); } - { - SELECT_LEX *upper= unit->outer_select(); - if (upper->parsing_place == IN_HAVING) - upper->subquery_in_having= 1; - /* The subquery is an expression cache candidate */ - upper->expr_cache_may_be_used[upper->parsing_place]= TRUE; - } - DBUG_PRINT("info", ("engine: %p", engine)); + DBUG_PRINT("info", ("engine: 0x%lx", (ulong)engine)); DBUG_VOID_RETURN; } @@ -219,7 +212,8 @@ Item_subselect::~Item_subselect() if (own_engine) delete engine; else - engine->cleanup(); + if (engine) // can be empty in case of EOM + engine->cleanup(); engine= NULL; DBUG_VOID_RETURN; } @@ -243,6 +237,14 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref) DBUG_ASSERT(unit->thd == thd); + { + SELECT_LEX *upper= unit->outer_select(); + if (upper->parsing_place == IN_HAVING) + upper->subquery_in_having= 1; + /* The subquery is an expression cache candidate */ + upper->expr_cache_may_be_used[upper->parsing_place]= TRUE; + } + status_var_increment(thd_param->status_var.feature_subquery); DBUG_ASSERT(fixed == 0); |