summaryrefslogtreecommitdiff
path: root/mysql-test/r/select.result
diff options
context:
space:
mode:
authorunknown <gkodinov@mysql.com>2006-06-14 15:57:23 +0300
committerunknown <gkodinov@mysql.com>2006-06-14 15:57:23 +0300
commit89ce81ceedc465115cafd39f29a05689a6da7205 (patch)
tree9bc88f4c90a2f5b771ff2124ca18c4cba6c1eda9 /mysql-test/r/select.result
parent86334edf2e37bf69ec601b9b7d419587316dc424 (diff)
downloadmariadb-git-89ce81ceedc465115cafd39f29a05689a6da7205.tar.gz
Bug #18895: BIT values cause joins to fail
The Field::eq() considered instances of Field_bit that differ only in bit_ptr/bit_ofs equal. This caused equality conditions optimization (build_equal_items_for_cond()) to make bad field substitutions that result in wrong predicates. Field_bit requires an overloaded eq() function that checks the bit_ptr/bit_ofs in addition to Field::eq(). mysql-test/r/select.result: Bug #18895: BIT values cause joins to fail - test case mysql-test/t/select.test: Bug #18895: BIT values cause joins to fail - test case sql/field.h: Bug #18895: BIT values cause joins to fail - eq() method overloaded for Field_bit
Diffstat (limited to 'mysql-test/r/select.result')
-rw-r--r--mysql-test/r/select.result20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 4c1e64cc1cb..e80e8f9ec41 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -3359,3 +3359,23 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY,b b 5 NULL 3 Using where
1 SIMPLE t2 ref c c 5 test.t1.a 2 Using where
DROP TABLE t1, t2;
+create table t1 (
+a int unsigned not null auto_increment primary key,
+b bit not null,
+c bit not null
+);
+create table t2 (
+a int unsigned not null auto_increment primary key,
+b bit not null,
+c int unsigned not null,
+d varchar(50)
+);
+insert into t1 (b,c) values (0,1), (0,1);
+insert into t2 (b,c) values (0,1);
+select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d
+from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1
+where t1.b <> 1 order by t1.a;
+a t1.b + 0 t1.c + 0 a t2.b + 0 c d
+1 0 1 1 0 1 NULL
+2 0 1 NULL NULL NULL NULL
+drop table t1,t2;