Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1861 05/07/01 14:10:47 ramil@stripped +3 -0
a fix (bug #11546: Bad error message from inserting out of range values,
SQL_MODE='tradition').
sql/field.cc
1.269 05/07/01 14:10:41 ramil@stripped +8 -2
a fix (bug #11546: Bad error message from inserting out of range values,
SQL_MODE='tradition').
raise an error in case of strict mode for bit fields.
mysql-test/t/strict.test
1.14 05/07/01 14:10:41 ramil@stripped +11 -0
a fix (bug #11546: Bad error message from inserting out of range values,
SQL_MODE='tradition').
mysql-test/r/strict.result
1.19 05/07/01 14:10:41 ramil@stripped +7 -0
a fix (bug #11546: Bad error message from inserting out of range values,
SQL_MODE='tradition').
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: ramil
# Host: gw.mysql.r18.ru
# Root: /usr/home/ram/work/5.0.b11546
--- 1.268/sql/field.cc 2005-06-24 13:13:45 +05:00
+++ 1.269/sql/field.cc 2005-07-01 14:10:41 +05:00
@@ -7859,7 +7859,10 @@
{
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 */
@@ -8076,7 +8079,10 @@
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);
--- 1.18/mysql-test/r/strict.result 2005-05-13 13:22:21 +05:00
+++ 1.19/mysql-test/r/strict.result 2005-07-01 14:10:41 +05:00
@@ -1235,3 +1235,10 @@
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
create table t1(a varbinary(65537));
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
+set @@sql_mode='traditional';
+create table t1(a bit(2));
+insert into t1 values(b'101');
+ERROR 22001: Data too long for column 'a' at row 1
+select * from t1;
+a
+drop table t1;
--- 1.13/mysql-test/t/strict.test 2005-05-13 13:22:21 +05:00
+++ 1.14/mysql-test/t/strict.test 2005-07-01 14:10:41 +05:00
@@ -1093,3 +1093,14 @@
create table t1(a varchar(65537));
--error 1074
create table t1(a varbinary(65537));
+
+#
+# BIT fields
+#
+
+set @@sql_mode='traditional';
+create table t1(a bit(2));
+--error 1406
+insert into t1 values(b'101');
+select * from t1;
+drop table t1;
| Thread |
|---|
| • bk commit into 5.0 tree (ramil:1.1861) BUG#11546 | ramil | 1 Jul |