diff options
| author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-18 11:33:53 +0200 |
|---|---|---|
| committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-18 11:33:53 +0200 |
| commit | b5763ecd01ca9155ecce7b2f06e8a8bfce050ff9 (patch) | |
| tree | b0ce48cd6f43a11d7465312dfe14552a8e4f8e3b /sql/sql_time.cc | |
| parent | 375256bae71e3f20d4498990610842b2976b6187 (diff) | |
| parent | 45531949ae115f2ba7b9450cc2386653483211ba (diff) | |
| download | mariadb-git-b5763ecd01ca9155ecce7b2f06e8a8bfce050ff9.tar.gz | |
Merge 10.3 into 10.4
Diffstat (limited to 'sql/sql_time.cc')
| -rw-r--r-- | sql/sql_time.cc | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/sql/sql_time.cc b/sql/sql_time.cc index 3977df675b3..fea23020d7e 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -297,7 +297,7 @@ check_date_with_warn(THD *thd, const MYSQL_TIME *ltime, { ErrConvTime str(ltime); make_truncated_value_warning(thd, Sql_condition::WARN_LEVEL_WARN, - &str, ts_type, 0); + &str, ts_type, 0, 0); return true; } return false; @@ -431,16 +431,17 @@ str_to_datetime_with_warn(THD *thd, CHARSET_INFO *cs, const char *str, size_t length, MYSQL_TIME *to, date_mode_t mode) { - Temporal::Warn_push warn(thd, NullS, to, mode); + Temporal::Warn_push warn(thd, NULL, NullS, to, mode); Temporal_hybrid *t= new(to) Temporal_hybrid(thd, &warn, str, length, cs, mode); return !t->is_valid_temporal(); } bool double_to_datetime_with_warn(THD *thd, double value, MYSQL_TIME *ltime, - date_mode_t fuzzydate, const char *field_name) + date_mode_t fuzzydate, + const TABLE_SHARE *s, const char *field_name) { - Temporal::Warn_push warn(thd, field_name, ltime, fuzzydate); + Temporal::Warn_push warn(thd, s, field_name, ltime, fuzzydate); Temporal_hybrid *t= new (ltime) Temporal_hybrid(thd, &warn, value, fuzzydate); return !t->is_valid_temporal(); } @@ -448,9 +449,10 @@ bool double_to_datetime_with_warn(THD *thd, double value, MYSQL_TIME *ltime, bool decimal_to_datetime_with_warn(THD *thd, const my_decimal *value, MYSQL_TIME *ltime, - date_mode_t fuzzydate, const char *field_name) + date_mode_t fuzzydate, + const TABLE_SHARE *s, const char *field_name) { - Temporal::Warn_push warn(thd, field_name, ltime, fuzzydate); + Temporal::Warn_push warn(thd, s, field_name, ltime, fuzzydate); Temporal_hybrid *t= new (ltime) Temporal_hybrid(thd, &warn, value, fuzzydate); return !t->is_valid_temporal(); } @@ -458,13 +460,14 @@ bool decimal_to_datetime_with_warn(THD *thd, const my_decimal *value, bool int_to_datetime_with_warn(THD *thd, const Longlong_hybrid &nr, MYSQL_TIME *ltime, - date_mode_t fuzzydate, const char *field_name) + date_mode_t fuzzydate, + const TABLE_SHARE *s, const char *field_name) { /* Note: conversion from an integer to TIME can overflow to '838:59:59.999999', so the conversion result can have fractional digits. */ - Temporal::Warn_push warn(thd, field_name, ltime, fuzzydate); + Temporal::Warn_push warn(thd, s, field_name, ltime, fuzzydate); Temporal_hybrid *t= new (ltime) Temporal_hybrid(thd, &warn, nr, fuzzydate); return !t->is_valid_temporal(); } @@ -894,12 +897,12 @@ void make_truncated_value_warning(THD *thd, Sql_condition::enum_warning_level level, const ErrConv *sval, timestamp_type time_type, - const char *field_name) + const TABLE_SHARE *s, const char *field_name) { const char *type_str= Temporal::type_name_by_timestamp_type(time_type); - return thd->push_warning_wrong_or_truncated_value(level, - time_type <= MYSQL_TIMESTAMP_ERROR, - type_str, sval->ptr(), field_name); + return thd->push_warning_wrong_or_truncated_value + (level, time_type <= MYSQL_TIMESTAMP_ERROR, type_str, sval->ptr(), + s, field_name); } |
