MDEV-7113 difference between check_vcol_func_processor and check_partition_func_processor

MDEV-6789 segfault in Item_func_from_unixtime::get_date on updating table with virtual columns

* prohibit VALUES in partitioning expression
* prohibit user and system variables in virtual column expressions
* fix Item_func_date_format to cache locale (for %M/%W to return the same as MONTHNAME/DAYNAME)
* fix Item_func_from_unixtime to cache time_zone directly, not THD (and not to crash)
* added tests for other incorrectly allowed (in vcols) functions to see that they don't crash
This commit is contained in:
Sergei Golubchik 2014-11-18 15:42:40 +01:00
commit 5d0122bd77
8 changed files with 155 additions and 15 deletions

View file

@ -688,6 +688,7 @@ public:
class Item_func_date_format :public Item_str_func
{
MY_LOCALE *locale;
int fixed_length;
const bool is_time_format;
String value;
@ -705,7 +706,7 @@ public:
class Item_func_from_unixtime :public Item_temporal_func
{
THD *thd;
Time_zone *tz;
public:
Item_func_from_unixtime(Item *a) :Item_temporal_func(a) {}
const char *func_name() const { return "from_unixtime"; }
@ -1046,10 +1047,4 @@ public:
bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
};
/* Function prototypes */
bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
timestamp_type type, String *str);
#endif /* ITEM_TIMEFUNC_INCLUDED */