summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-11-04 11:16:13 +0100
committerSergei Golubchik <serg@mariadb.org>2016-12-12 20:27:24 +0100
commitfd0044041bf70d5d8bbb530285055da585384ff1 (patch)
tree0cf9923eaeeb9facd2751e3b8df67f9b1394079c /sql/item_timefunc.h
parent867809f23a8f09b1ac0aa8f9212ac8afd572efc5 (diff)
downloadmariadb-git-fd0044041bf70d5d8bbb530285055da585384ff1.tar.gz
don't convert WEEK(x) to WEEK(x, @@default_week_format)
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r--sql/item_timefunc.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 3d2b5c8c9e9..1e905c44fdf 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -334,6 +334,7 @@ public:
class Item_func_week :public Item_int_func
{
public:
+ Item_func_week(THD *thd, Item *a): Item_int_func(thd, a) {}
Item_func_week(THD *thd, Item *a, Item *b): Item_int_func(thd, a, b) {}
longlong val_int();
const char *func_name() const { return "week"; }
@@ -343,6 +344,16 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
+ bool check_vcol_func_processor(void *arg)
+ {
+ if (arg_count == 2)
+ return FALSE;
+ return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
+ }
+ bool check_valid_arguments_processor(void *int_arg)
+ {
+ return arg_count == 2;
+ }
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_func_week>(thd, mem_root, this); }
};
@@ -981,7 +992,12 @@ class Item_extract :public Item_int_func
bool eq(const Item *item, bool binary_cmp) const;
void print(String *str, enum_query_type query_type);
bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
+ bool check_vcol_func_processor(void *arg)
+ {
+ if (int_type != INTERVAL_WEEK)
+ return FALSE;
+ return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
+ }
bool check_valid_arguments_processor(void *int_arg)
{
switch (int_type) {