summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-04-19 15:58:15 +0200
committerSergei Golubchik <serg@mariadb.org>2017-04-30 14:58:11 +0200
commit5ccaabe9620bcf9e960ae019d7e27e5998a772bd (patch)
tree6bc64bbc1d6b2cce1f37dbab8304da5f1694efe9 /sql
parentd17093b2edfbd1422f224c553eb73c9263eeeb1a (diff)
downloadmariadb-git-5ccaabe9620bcf9e960ae019d7e27e5998a772bd.tar.gz
MDEV-10355 Weird error message upon CREATE TABLE with DEFAULT
post-fix for 0b52b28b91 * restore EXPLAIN output * remove redundant code
Diffstat (limited to 'sql')
-rw-r--r--sql/item.cc32
-rw-r--r--sql/item.h9
2 files changed, 18 insertions, 23 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 5d6c4bb67a6..579b6539fb4 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -9418,27 +9418,24 @@ void Item_cache::store(Item *item)
void Item_cache::print(String *str, enum_query_type query_type)
{
if (example && // There is a cached item
- (query_type & QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS)) // Caller is show-create-table
+ (query_type & QT_NO_DATA_EXPANSION)) // Caller is show-create-table
{
// Instead of "cache" or the cached value, print the cached item name
example->print(str, query_type);
+ return;
}
- else
+
+ if (value_cached)
{
- if (value_cached && !(query_type & QT_NO_DATA_EXPANSION))
- {
- print_value(str);
- return;
- }
- if (!(query_type & QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS))
- str->append(STRING_WITH_LEN("<cache>("));
- if (example)
- example->print(str, query_type);
- else
- Item::print(str, query_type);
- if (!(query_type & QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS))
- str->append(')');
+ print_value(str);
+ return;
}
+ str->append(STRING_WITH_LEN("<cache>("));
+ if (example)
+ example->print(str, query_type);
+ else
+ Item::print(str, query_type);
+ str->append(')');
}
/**
@@ -10669,8 +10666,7 @@ void Virtual_column_info::print(String *str)
(enum_query_type)(QT_ITEM_ORIGINAL_FUNC_NULLIF |
QT_ITEM_IDENT_SKIP_DB_NAMES |
QT_ITEM_IDENT_SKIP_TABLE_NAMES |
- QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS |
- QT_TO_SYSTEM_CHARSET |
- QT_NO_DATA_EXPANSION),
+ QT_NO_DATA_EXPANSION |
+ QT_TO_SYSTEM_CHARSET),
LOWEST_PRECEDENCE);
}
diff --git a/sql/item.h b/sql/item.h
index a0137144140..42e9fd94331 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -5475,17 +5475,16 @@ public:
{
Item::vcol_func_processor_result *res= (Item::vcol_func_processor_result*)arg;
example->check_vcol_func_processor(arg);
+ /*
+ Item_cache of a non-deterministic function requires re-fixing
+ even if the function itself doesn't (e.g. CURRENT_TIMESTAMP)
+ */
if (res->errors & VCOL_NOT_STRICTLY_DETERMINISTIC)
res->errors|= VCOL_SESSION_FUNC;
return false;
}
return mark_unsupported_function("cache", arg, VCOL_IMPOSSIBLE);
}
- bool cleanup_excluding_fields_processor(void* arg)
- {
- cleanup();
- return 0;
- }
void cleanup()
{
clear();