From ff93b77fd62bdb708e2b2b34f4e2202c12e727c4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 3 Mar 2016 18:44:10 +0100 Subject: 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). --- sql/sql_lex.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_lex.cc') diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 54d75338970..fd841094e68 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2689,7 +2689,7 @@ void st_select_lex::print_order(String *str, { if (order->counter_used) { - if (query_type != QT_VIEW_INTERNAL) + if (!(query_type & QT_VIEW_INTERNAL)) { char buffer[20]; size_t length= my_snprintf(buffer, 20, "%d", order->counter); -- cgit v1.2.1