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:
parent
7f446fc76b
commit
59cc518990
@ -1,4 +1,14 @@
|
||||
drop table if exists t1;
|
||||
set @@sql_mode=allow_invalid_dates;
|
||||
create table t1 (a char, b char, c date)
|
||||
partition by range column_list (a,b,c)
|
||||
( partition p0 values less than (0,0,to_days('3000-11-31')));
|
||||
ERROR HY000: Partition column values of incorrect type
|
||||
create table t1 (a char, b char, c date)
|
||||
partition by range column_list (a,b,c)
|
||||
( partition p0 values less than (0,0,'3000-11-31'));
|
||||
ERROR HY000: Partition column values of incorrect type
|
||||
set @@sql_mode='';
|
||||
create table t1 (a varchar(2) character set ucs2)
|
||||
partition by list column_list (a)
|
||||
(partition p0 values in (0x2020),
|
||||
|
@ -8,6 +8,21 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# BUG#48165, sql_mode gives error
|
||||
#
|
||||
set @@sql_mode=allow_invalid_dates;
|
||||
--error ER_WRONG_TYPE_COLUMN_VALUE_ERROR
|
||||
create table t1 (a char, b char, c date)
|
||||
partition by range column_list (a,b,c)
|
||||
( partition p0 values less than (0,0,to_days('3000-11-31')));
|
||||
|
||||
--error ER_WRONG_TYPE_COLUMN_VALUE_ERROR
|
||||
create table t1 (a char, b char, c date)
|
||||
partition by range column_list (a,b,c)
|
||||
( partition p0 values less than (0,0,'3000-11-31'));
|
||||
set @@sql_mode='';
|
||||
|
||||
#
|
||||
# BUG#48163, Dagger in UCS2 not working as partition value
|
||||
#
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user