diff options
author | unknown <gluh@eagle.(none)> | 2007-10-16 13:19:01 +0500 |
---|---|---|
committer | unknown <gluh@eagle.(none)> | 2007-10-16 13:19:01 +0500 |
commit | 55a3a64eb1f971f40c9c1cb4068f2b15eeec8bb9 (patch) | |
tree | 1be6661e0b402cfbe41f506836d9a4534381ed33 /sql/item.cc | |
parent | 9bb3c7ebdd1a4b2d2cbe08917402af40b0f998a8 (diff) | |
parent | 048006e2f9a4cc0ffd39eb160c6810ae84e78328 (diff) | |
download | mariadb-git-55a3a64eb1f971f40c9c1cb4068f2b15eeec8bb9.tar.gz |
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
sql/item.cc:
Auto merged
sql/item.h:
manual merge
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/item.cc b/sql/item.cc index d1a847afe03..3177c0fb1e8 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4247,7 +4247,7 @@ bool Item::is_datetime() } -String *Item::check_well_formed_result(String *str) +String *Item::check_well_formed_result(String *str, bool send_error) { /* Check whether we got a well-formed string */ CHARSET_INFO *cs= str->charset(); @@ -4263,8 +4263,14 @@ String *Item::check_well_formed_result(String *str) uint diff= str->length() - wlen; set_if_smaller(diff, 3); octet2hex(hexbuf, str->ptr() + wlen, diff); - if (thd->variables.sql_mode & - (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)) + if (send_error) + { + my_error(ER_INVALID_CHARACTER_STRING, MYF(0), + cs->csname, hexbuf); + return 0; + } + if ((thd->variables.sql_mode & + (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES))) { level= MYSQL_ERROR::WARN_LEVEL_ERROR; null_value= 1; |