From d99994a4603413d7f0a89682f3d2fab5a39cc543 Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 8 Jun 2016 10:34:37 +0300 Subject: [PATCH] Ensure we print the most importaint violating function --- sql/item.cc | 5 ++++- sql/item.h | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index 6a3279e6a84..7c93c5eed73 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1413,9 +1413,12 @@ bool mark_unsupported_function(const char *where, uchar *store, uint result) { Item::vcol_func_processor_result *res= (Item::vcol_func_processor_result*) store; + uint old_errors= res->errors; mark_unsupported_func(where, "check_vcol_func_processor"); res->errors|= result; /* Store type of expression */ - res->name= where ? where : ""; + /* Store the name to the highest violation (normally VCOL_IMPOSSIBLE) */ + if (res->errors > old_errors) + res->name= where ? where : ""; return false; } diff --git a/sql/item.h b/sql/item.h index 1b0a7a26d56..8aa64eb5f3b 100644 --- a/sql/item.h +++ b/sql/item.h @@ -34,10 +34,10 @@ C_MODE_END /* Bits for type of vcol expression */ #define VCOL_DETERMINISTIC 0 /* Normal (no bit set) */ -#define VCOL_NON_DETERMINISTIC 1 -#define VCOL_TIME_FUNC 2 -#define VCOL_IMPOSSIBLE 4 -#define VCOL_UNKNOWN 8 /* UDF used; Need fix_fields() to know */ +#define VCOL_UNKNOWN 1 /* UDF used; Need fix_fields() to know */ +#define VCOL_NON_DETERMINISTIC 2 +#define VCOL_TIME_FUNC 4 +#define VCOL_IMPOSSIBLE 8 class Protocol; struct TABLE_LIST;