1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.3 into 10.4

This commit is contained in:
Marko Mäkelä
2018-12-18 11:33:53 +02:00
143 changed files with 2113 additions and 1913 deletions

View File

@ -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);
}