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;
|
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)
|
create table t1 (a varchar(2) character set ucs2)
|
||||||
partition by list column_list (a)
|
partition by list column_list (a)
|
||||||
(partition p0 values in (0x2020),
|
(partition p0 values in (0x2020),
|
||||||
|
@ -8,6 +8,21 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
--enable_warnings
|
--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
|
# 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;
|
uchar *val_ptr;
|
||||||
uint len= field->pack_length();
|
uint len= field->pack_length();
|
||||||
|
ulong save_sql_mode;
|
||||||
|
bool save_got_warning;
|
||||||
|
|
||||||
if (!(column_item= get_column_item(column_item,
|
if (!(column_item= get_column_item(column_item,
|
||||||
field)))
|
field)))
|
||||||
{
|
{
|
||||||
result= TRUE;
|
result= TRUE;
|
||||||
goto end;
|
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));
|
my_error(ER_WRONG_TYPE_COLUMN_VALUE_ERROR, MYF(0));
|
||||||
result= TRUE;
|
result= TRUE;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
thd->got_warning= save_got_warning;
|
||||||
|
thd->variables.sql_mode= save_sql_mode;
|
||||||
if (!(val_ptr= (uchar*) sql_calloc(len)))
|
if (!(val_ptr= (uchar*) sql_calloc(len)))
|
||||||
{
|
{
|
||||||
mem_alloc_error(len);
|
mem_alloc_error(len);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user