1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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

@ -2069,7 +2069,7 @@ bool Field_int::get_date(MYSQL_TIME *ltime,date_mode_t fuzzydate)
ASSERT_COLUMN_MARKED_FOR_READ;
Longlong_hybrid nr(val_int(), (flags & UNSIGNED_FLAG));
return int_to_datetime_with_warn(get_thd(), nr, ltime,
fuzzydate, field_name.str);
fuzzydate, table->s, field_name.str);
}
@ -2256,7 +2256,7 @@ uint Field::fill_cache_field(CACHE_FIELD *copy)
bool Field::get_date(MYSQL_TIME *to, date_mode_t mode)
{
StringBuffer<40> tmp;
Temporal::Warn_push warn(get_thd(), NullS, to, mode);
Temporal::Warn_push warn(get_thd(), NULL, NullS, to, mode);
Temporal_hybrid *t= new(to) Temporal_hybrid(get_thd(), &warn,
val_str(&tmp), mode);
return !t->is_valid_temporal();
@ -4832,7 +4832,7 @@ bool Field_real::get_date(MYSQL_TIME *ltime,date_mode_t fuzzydate)
ASSERT_COLUMN_MARKED_FOR_READ;
double nr= val_real();
return double_to_datetime_with_warn(get_thd(), nr, ltime, fuzzydate,
field_name.str);
table->s, field_name.str);
}
@ -6318,8 +6318,8 @@ bool Field_year::get_date(MYSQL_TIME *ltime,date_mode_t fuzzydate)
if (tmp || field_length != 4)
tmp+= 1900;
return int_to_datetime_with_warn(get_thd(),
Longlong_hybrid(tmp * 10000, true),
ltime, fuzzydate, field_name.str);
Longlong_hybrid(tmp * 10000, true),
ltime, fuzzydate, table->s, field_name.str);
}
@ -8919,10 +8919,18 @@ int Field_geom::store(const char *from, size_t length, CHARSET_INFO *cs)
geom_type != Field::GEOM_GEOMETRYCOLLECTION &&
(uint32) geom_type != wkb_type)
{
const char *db= table->s->db.str;
const char *tab_name= table->s->error_table_name();
if (!db)
db= "";
if (!tab_name)
tab_name= "";
my_error(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, MYF(0),
Geometry::ci_collection[geom_type]->m_name.str,
Geometry::ci_collection[wkb_type]->m_name.str,
field_name.str,
db, tab_name, field_name.str,
(ulong) table->in_use->get_stmt_da()->
current_row_for_warning());
goto err_exit;
@ -10917,7 +10925,8 @@ void Field::set_datetime_warning(Sql_condition::enum_warning_level level,
THD *thd= get_thd();
if (thd->really_abort_on_warning() && level >= Sql_condition::WARN_LEVEL_WARN)
thd->push_warning_truncated_value_for_field(level, typestr,
str->ptr(), field_name.str);
str->ptr(), table->s,
field_name.str);
else
set_warning(level, code, cuted_increment);
}
@ -10927,10 +10936,18 @@ void Field::set_warning_truncated_wrong_value(const char *type_arg,
const char *value)
{
THD *thd= get_thd();
const char *db_name= table->s->db.str;
const char *table_name= table->s->error_table_name();
if (!db_name)
db_name= "";
if (!table_name)
table_name= "";
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER_THD(thd, ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
type_arg, value, field_name.str,
type_arg, value, db_name, table_name, field_name.str,
static_cast<ulong>(thd->get_stmt_da()->
current_row_for_warning()));
}