summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorFrazer Clement <frazer@mysql.com>2009-10-08 16:36:36 +0100
committerFrazer Clement <frazer@mysql.com>2009-10-08 16:36:36 +0100
commitc7470df2feb72cbab98201b2e0a9ebec72a7fdd9 (patch)
tree36cd457b45a072505bff483a2d8740c8d8ff1ea7 /mysql-test
parent0d0f06da3a7ced9da59cca517a9ffead95c8f8d2 (diff)
parentfd04391340e9480857e0a31426cdefea21b5a036 (diff)
downloadmariadb-git-c7470df2feb72cbab98201b2e0a9ebec72a7fdd9.tar.gz
Merge 5.0-bugteam-> 5.1-bugteam
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/type_bit.result10
-rw-r--r--mysql-test/t/type_bit.test11
2 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index b831771d9c5..51feab0a421 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -749,6 +749,16 @@ bin(a1)
110000111111111
110001011111111
drop table t1bit7, t2bit7;
+#
+# Bug42803: Field_bit does not have unsigned_flag field,
+# can lead to bad memory access
+#
+CREATE TABLE t1 (a BIT(7), b BIT(9), KEY(a, b));
+INSERT INTO t1 VALUES(0, 0), (5, 3), (5, 6), (6, 4), (7, 0);
+EXPLAIN SELECT a+0, b+0 FROM t1 WHERE a > 4 and b < 7 ORDER BY 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 2 NULL 4 Using where; Using index; Using filesort
+DROP TABLE t1;
End of 5.0 tests
create table t1(a bit(7));
insert into t1 values(0x40);
diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
index dc5120db430..530389b3ab9 100644
--- a/mysql-test/t/type_bit.test
+++ b/mysql-test/t/type_bit.test
@@ -397,6 +397,17 @@ insert into t2bit7 values (b'110011011111111');
select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
drop table t1bit7, t2bit7;
+
+--echo #
+--echo # Bug42803: Field_bit does not have unsigned_flag field,
+--echo # can lead to bad memory access
+--echo #
+CREATE TABLE t1 (a BIT(7), b BIT(9), KEY(a, b));
+INSERT INTO t1 VALUES(0, 0), (5, 3), (5, 6), (6, 4), (7, 0);
+EXPLAIN SELECT a+0, b+0 FROM t1 WHERE a > 4 and b < 7 ORDER BY 2;
+DROP TABLE t1;
+
+
--echo End of 5.0 tests
#