diff options
author | ramil@mysql.com <> | 2005-07-26 12:18:35 +0500 |
---|---|---|
committer | ramil@mysql.com <> | 2005-07-26 12:18:35 +0500 |
commit | afb1ad8415ec912eda86c5ea8e1abc98088c89b8 (patch) | |
tree | 8b9fa06617c2acc9c5ecdd4d350efb672d2587c1 /sql/field.cc | |
parent | bbd06a333a8df4c44c84312119237842780b18f8 (diff) | |
download | mariadb-git-afb1ad8415ec912eda86c5ea8e1abc98088c89b8.tar.gz |
a fix (bug #11546: Bad error message from inserting out of range values, SQL_MODE='tradition').
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc index 3fdd7ab45e6..2fb60ec1fd9 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7846,7 +7846,10 @@ int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs) { set_rec_bits(0xff, bit_ptr, bit_ofs, bit_len); memset(ptr, 0xff, field_length); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + if (table->in_use->really_abort_on_warning()) + set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1); + else + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } /* delta is >= -1 here */ @@ -8063,7 +8066,10 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs) memset(ptr, 0xff, field_length); if (bits) *ptr&= ((1 << bits) - 1); /* set first byte */ - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + if (table->in_use->really_abort_on_warning()) + set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1); + else + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } bzero(ptr, delta); |