diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-09-04 09:55:59 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-09-04 10:19:58 +0400 |
commit | 7e08ac0b41b50195aa79f6ac185bc69a91a960ca (patch) | |
tree | 3a399827dc8e6bd89bbb6d142f21eda8bd659119 /sql/item.h | |
parent | a071e0e029cd7c155cff1054d9f7f8a6aa898620 (diff) | |
parent | ef00ac4c86daf3294c46a45358da636763fb0049 (diff) | |
download | mariadb-git-7e08ac0b41b50195aa79f6ac185bc69a91a960ca.tar.gz |
Merge 10.2 (up to commit ef00ac4c86daf3294c46a45358da636763fb0049) into 10.3
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h index db3fba15000..694672deabc 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1252,6 +1252,32 @@ public: double val_real_from_decimal(); double val_real_from_date(); + /* + Returns true if this item can be calculated during + value_depends_on_sql_mode() + */ + bool value_depends_on_sql_mode_const_item() + { + /* + Currently we use value_depends_on_sql_mode() only for virtual + column expressions. They should not contain any expensive items. + If we ever get a crash on the assert below, it means + check_vcol_func_processor() is badly implemented for this item. + */ + DBUG_ASSERT(!is_expensive()); + /* + It should return const_item() actually. + But for some reasons Item_field::const_item() returns true + at value_depends_on_sql_mode() call time. + This should be checked and fixed. + */ + return basic_const_item(); + } + virtual Sql_mode_dependency value_depends_on_sql_mode() const + { + return Sql_mode_dependency(); + } + // Get TIME, DATE or DATETIME using proper sql_mode flags for the field type bool get_temporal_with_sql_mode(MYSQL_TIME *ltime); // Check NULL value for a TIME, DATE or DATETIME expression @@ -2289,6 +2315,7 @@ public: inline Item **arguments() const { return args; } inline uint argument_count() const { return arg_count; } inline void remove_arguments() { arg_count=0; } + Sql_mode_dependency value_depends_on_sql_mode_bit_or() const; }; @@ -3029,6 +3056,10 @@ public: { return MONOTONIC_STRICT_INCREASING; } + Sql_mode_dependency value_depends_on_sql_mode() const + { + return Sql_mode_dependency(0, field->value_depends_on_sql_mode()); + } longlong val_int_endpoint(bool left_endp, bool *incl_endp); bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); bool get_date_result(MYSQL_TIME *ltime,ulonglong fuzzydate); @@ -4726,6 +4757,10 @@ public: bool const_item() const { return const_item_cache; } table_map used_tables() const { return used_tables_cache; } Item* build_clone(THD *thd); + Sql_mode_dependency value_depends_on_sql_mode() const + { + return Item_args::value_depends_on_sql_mode_bit_or().soft_to_hard(); + } }; class sp_head; |