summaryrefslogtreecommitdiff
path: root/mysql-test/t/type_bit_innodb.test
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2006-04-04 17:54:58 -0700
committerunknown <jimw@mysql.com>2006-04-04 17:54:58 -0700
commitb3b626c31cb6f09cc89e633f500a066af6ef2fb5 (patch)
tree470f8546a50589e9c092da9005875129175816e0 /mysql-test/t/type_bit_innodb.test
parentbfa21dd1520b2f718a1f1aa8c6256f62c91cfff8 (diff)
downloadmariadb-git-b3b626c31cb6f09cc89e633f500a066af6ef2fb5.tar.gz
Bug #13601: Wrong int type for bit
The wrong value was being reported as the field_length for BIT fields, resulting in confusion for at least Connector/J. The field_length is now always the number of bits in the field, as it should be. mysql-test/r/type_bit.result: Add new results mysql-test/r/type_bit_innodb.result: Add new results mysql-test/t/type_bit.test: Add new regression test mysql-test/t/type_bit_innodb.test: Add new regression test sql/field.cc: Fix Field_bit->field_length to actually report the display width, and store the bytes stored in the rec in the new bytes_in_rec member. sql/field.h: Fix Field_bit::field_length to store the correct value, adding Field_bit::bytes_in_rec to remember the number of bytes used for storing the value. Remove Field_bit_as_char::create_length, as it is now redundant. sql/ha_ndbcluster.cc: Handle field_length of Field_bit actually being the display width (# of bits). sql/key.cc: Fix inappropriate use of field->field_length for BIT field.
Diffstat (limited to 'mysql-test/t/type_bit_innodb.test')
-rw-r--r--mysql-test/t/type_bit_innodb.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/type_bit_innodb.test b/mysql-test/t/type_bit_innodb.test
index ec433f40a88..dbca69d67f0 100644
--- a/mysql-test/t/type_bit_innodb.test
+++ b/mysql-test/t/type_bit_innodb.test
@@ -133,3 +133,15 @@ show create table t1;
alter table t1 engine=innodb;
show create table t1;
drop table t1;
+
+#
+# Bug #13601: Wrong field length reported for BIT fields
+#
+create table t1 (a bit(7)) engine=innodb;
+insert into t1 values (0x60);
+--enable_metadata
+select * from t1;
+--disable_metadata
+drop table t1;
+
+--echo End of 5.0 tests