mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fixed sql_mode issue in BUG#48164, will ignore sql_mode when generating constants, also warnings will not be tolerated
This commit is contained in:
@@ -1949,18 +1949,28 @@ bool partition_info::fix_column_value_functions(THD *thd,
|
||||
{
|
||||
uchar *val_ptr;
|
||||
uint len= field->pack_length();
|
||||
ulong save_sql_mode;
|
||||
bool save_got_warning;
|
||||
|
||||
if (!(column_item= get_column_item(column_item,
|
||||
field)))
|
||||
{
|
||||
result= TRUE;
|
||||
goto end;
|
||||
}
|
||||
if (column_item->save_in_field(field, TRUE))
|
||||
save_sql_mode= thd->variables.sql_mode;
|
||||
thd->variables.sql_mode= 0;
|
||||
save_got_warning= thd->got_warning;
|
||||
thd->got_warning= 0;
|
||||
if (column_item->save_in_field(field, TRUE) ||
|
||||
thd->got_warning)
|
||||
{
|
||||
my_error(ER_WRONG_TYPE_COLUMN_VALUE_ERROR, MYF(0));
|
||||
result= TRUE;
|
||||
goto end;
|
||||
}
|
||||
thd->got_warning= save_got_warning;
|
||||
thd->variables.sql_mode= save_sql_mode;
|
||||
if (!(val_ptr= (uchar*) sql_calloc(len)))
|
||||
{
|
||||
mem_alloc_error(len);
|
||||
|
||||
Reference in New Issue
Block a user