diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-03-03 18:44:10 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-03-05 16:25:29 +0100 |
commit | ff93b77fd62bdb708e2b2b34f4e2202c12e727c4 (patch) | |
tree | 47b0e1bac37b65480da19faabd2fb85e3a947a58 /sql/sql_show.cc | |
parent | 5a3a79ce5f20a862abdde505a683df1148e0dc37 (diff) | |
download | mariadb-git-ff93b77fd62bdb708e2b2b34f4e2202c12e727c4.tar.gz |
MDEV-9641 MDEV-9644 NULLIF assertions
* only copy args[0] to args[2] after fix_fields (when all item
substitutions have already happened)
* change QT_ITEM_FUNC_NULLIF_TO_CASE (that allows to print NULLIF
as CASE) to QT_ITEM_ORIGINAL_FUNC_NULLIF (that prohibits it).
So that NULLIF-to-CASE is allowed by default and only disabled
explicitly for SHOW VIEW|FUNCTION|PROCEDURE and mysql_make_view.
By default it is allowed (in particular in error messages and
debug output, that can happen anytime before or after optimizer).
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 4adc0eccc06..b6a753f993c 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2352,7 +2352,8 @@ static int show_create_view(THD *thd, TABLE_LIST *table, String *buff) We can't just use table->query, because our SQL_MODE may trigger a different syntax, like when ANSI_QUOTES is defined. */ - table->view->unit.print(buff, QT_ORDINARY); + table->view->unit.print(buff, enum_query_type(QT_ORDINARY | + QT_ITEM_ORIGINAL_FUNC_NULLIF)); if (table->with_check != VIEW_CHECK_NONE) { |