diff options
author | Mikael Ronstrom <mikael@mysql.com> | 2009-10-28 00:06:11 +0100 |
---|---|---|
committer | Mikael Ronstrom <mikael@mysql.com> | 2009-10-28 00:06:11 +0100 |
commit | 59cc5189900e08e770239f2d53cb83cb194e8b3c (patch) | |
tree | c1fcb43351b49dbe46e54315e8101e8d3fc81eb8 /sql/partition_info.cc | |
parent | 7f446fc76bd810adc3c6d34d7d0459082e4cb52a (diff) | |
download | mariadb-git-59cc5189900e08e770239f2d53cb83cb194e8b3c.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.cc | 12 |
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); |