summaryrefslogtreecommitdiff
path: root/sql/partition_info.cc
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@mysql.com>2009-10-28 00:06:11 +0100
committerMikael Ronstrom <mikael@mysql.com>2009-10-28 00:06:11 +0100
commitcc43a2089cf6f45afb2cb5c15e2a077b075b80f8 (patch)
treec1fcb43351b49dbe46e54315e8101e8d3fc81eb8 /sql/partition_info.cc
parentfbac63638067b13331ac14cf4acee80221844dd9 (diff)
downloadmariadb-git-cc43a2089cf6f45afb2cb5c15e2a077b075b80f8.tar.gz
Fixed sql_mode issue in BUG#48164, will ignore sql_mode when generating constants, also warnings will not be tolerated
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r--sql/partition_info.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 131e1dcf3a6..9d9aa5d4e95 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -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);