diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-03-12 20:16:33 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-03-14 12:45:28 +0100 |
commit | d390e501eb812138db8963098a66d888f8adf490 (patch) | |
tree | 3d67911e2e24129626da8c372ced57a5a58c174b /sql/item_cmpfunc.h | |
parent | 1c6f6dc8924f144770a862d74667d7fa0eba55c1 (diff) | |
download | mariadb-git-d390e501eb812138db8963098a66d888f8adf490.tar.gz |
MDEV-11839 move value caching from get_datetime_value to fix_fields time
Refactor get_datetime_value() not to create Item_cache_temporal(),
but do it always in ::fix_fields() or ::fix_length_and_dec().
Creating items at the execution time doesn't work very well with
virtual columns and check constraints that are fixed and executed
in different THDs.
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r-- | sql/item_cmpfunc.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index f833232de95..82bfd11a94d 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1267,19 +1267,15 @@ public: /* Class to represent a vector of constant DATE/DATETIME values. Values are obtained with help of the get_datetime_value() function. - If the left item is a constant one then its value is cached in the - lval_cache variable. */ class in_datetime :public in_longlong { public: /* An item used to issue warnings. */ Item *warn_item; - /* Cache for the left item. */ - Item *lval_cache; in_datetime(THD *thd, Item *warn_item_arg, uint elements) - :in_longlong(thd, elements), warn_item(warn_item_arg), lval_cache(0) {}; + :in_longlong(thd, elements), warn_item(warn_item_arg) {} void set(uint pos,Item *item); uchar *get_value(Item *item); Item *create_item(THD *thd); @@ -1441,8 +1437,6 @@ public: /* Compare items in the DATETIME context. Values are obtained with help of the get_datetime_value() function. - If the left item is a constant one then its value is cached in the - lval_cache variable. */ class cmp_item_datetime : public cmp_item_scalar { @@ -1450,11 +1444,9 @@ class cmp_item_datetime : public cmp_item_scalar public: /* Item used for issuing warnings. */ Item *warn_item; - /* Cache for the left item. */ - Item *lval_cache; cmp_item_datetime(Item *warn_item_arg) - : warn_item(warn_item_arg), lval_cache(0) {} + : warn_item(warn_item_arg) {} void store_value(Item *item); int cmp(Item *arg); int compare(cmp_item *ci); @@ -2622,7 +2614,7 @@ inline bool is_cond_or(Item *item) Item *and_expressions(Item *a, Item *b, Item **org_item); -longlong get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg, +longlong get_datetime_value(Item ***item_arg, Item **cache_arg, enum_field_types f_type, bool *is_null); |