diff options
author | Martin Hansson <mhansson@mysql.com> | 2009-04-29 14:00:34 +0200 |
---|---|---|
committer | Martin Hansson <mhansson@mysql.com> | 2009-04-29 14:00:34 +0200 |
commit | 45cbd32697abbc29d793746f58faecef90c15aaa (patch) | |
tree | 406e101e58d4e13926739ab9b3f9a23d08daccb6 /mysql-test/t/myisam.test | |
parent | e7c4b2dfc77ae7cc8012f43b05991bdda044a459 (diff) | |
download | mariadb-git-45cbd32697abbc29d793746f58faecef90c15aaa.tar.gz |
Bug#43737: Select query return bad result
A bug in the initialization of key segment information made it point
to the wrong bit, since a bit index was used when its int value
was needed. This lead to misinterpretation of bit columns
read from MyISAM record format when a NULL bit pushed them over
a byte boundary.
Fixed by using the int value of the bit instead.
mysql-test/r/myisam.result:
Bug#43737: Test result.
mysql-test/t/myisam.test:
Bug#43737: Test case.
storage/myisam/mi_open.c:
Bug#43737: fix.
Diffstat (limited to 'mysql-test/t/myisam.test')
-rw-r--r-- | mysql-test/t/myisam.test | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 6d7e03b1c28..ba6bc05cfea 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1478,5 +1478,30 @@ let $MYSQLD_DATADIR= `select @@datadir`; --exec $MYISAMCHK -d $MYSQLD_DATADIR/test/t1 DROP TABLE t1; +# +# Bug#43737: Select query return bad result +# +CREATE TABLE t1 ( + c INT, + d bit(1), + e INT, + f VARCHAR(1), + g BIT(1), + h BIT(1), + KEY (h, d, e, g) +); +INSERT INTO t1 VALUES + ( 3, 1, 1, 'a', 0, 0 ), + ( 3, 1, 5, 'a', 0, 0 ), + ( 10, 1, 2, 'a', 0, 1 ), + ( 10, 1, 3, 'a', 0, 1 ), + ( 10, 1, 4, 'a', 0, 1 ); + +SELECT f FROM t1 WHERE d = 1 AND e = 2 AND g = 0 AND h = 1; + +SELECT h+0, d + 0, e, g + 0 FROM t1; + +DROP TABLE t1; + --echo End of 5.1 tests |