Skip to content

Commit ef21a89

Browse files
kahatlendahlerlend
authored andcommitted
Bug#33824300: hypergraph: Wrong results from hash join with long string types
Post-push fix: Fix unstable test case. Change-Id: I0472f7730b4bb3355797074fddf201a96f73455c
1 parent 4a7cb24 commit ef21a89

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

mysql-test/include/hash_join.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2679,9 +2679,10 @@ DROP TABLE t1, t2;
26792679
CREATE TABLE t(b LONGBLOB);
26802680
INSERT INTO t VALUES
26812681
(0x0800), (0x04b9), (0x0c00), (0x06cb), (0x1000), (0x0f6b), (0x0b73);
2682+
ANALYZE TABLE t;
26822683
let $query =
26832684
SELECT HEX(t1.b), HEX(t2.b) FROM t AS t1, t AS t2 WHERE t1.b = t2.b;
2684-
--replace_regex $elide_cost
2685+
--replace_regex $elide_costs
26852686
--eval EXPLAIN FORMAT=TREE $query
26862687
--sorted_result
26872688
--eval $query

mysql-test/r/hash_join.result

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4248,13 +4248,16 @@ DROP TABLE t1, t2;
42484248
CREATE TABLE t(b LONGBLOB);
42494249
INSERT INTO t VALUES
42504250
(0x0800), (0x04b9), (0x0c00), (0x06cb), (0x1000), (0x0f6b), (0x0b73);
4251+
ANALYZE TABLE t;
4252+
Table Op Msg_type Msg_text
4253+
test.t analyze status OK
42514254
EXPLAIN FORMAT=TREE SELECT HEX(t1.b), HEX(t2.b) FROM t AS t1, t AS t2 WHERE t1.b = t2.b;
42524255
EXPLAIN
4253-
-> Filter: (t2.b = t1.b) (cost=6.12 rows=7)
4254-
-> Inner hash join (<hash>(t2.b)=<hash>(t1.b)) (cost=6.12 rows=7)
4255-
-> Table scan on t2 (cost=0.0522 rows=7)
4256+
-> Filter: (t2.b = t1.b) (rows=7)
4257+
-> Inner hash join (<hash>(t2.b)=<hash>(t1.b)) (rows=7)
4258+
-> Table scan on t2 (rows=7)
42564259
-> Hash
4257-
-> Table scan on t1 (cost=0.95 rows=7)
4260+
-> Table scan on t1 (rows=7)
42584261

42594262
SELECT HEX(t1.b), HEX(t2.b) FROM t AS t1, t AS t2 WHERE t1.b = t2.b;
42604263
HEX(t1.b) HEX(t2.b)

mysql-test/r/hash_join_hypergraph.result

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4206,12 +4206,15 @@ DROP TABLE t1, t2;
42064206
CREATE TABLE t(b LONGBLOB);
42074207
INSERT INTO t VALUES
42084208
(0x0800), (0x04b9), (0x0c00), (0x06cb), (0x1000), (0x0f6b), (0x0b73);
4209+
ANALYZE TABLE t;
4210+
Table Op Msg_type Msg_text
4211+
test.t analyze status OK
42094212
EXPLAIN FORMAT=TREE SELECT HEX(t1.b), HEX(t2.b) FROM t AS t1, t AS t2 WHERE t1.b = t2.b;
42104213
EXPLAIN
4211-
-> Inner hash join (<hash>(t1.b)=<hash>(t2.b)), extra conditions: (t1.b = t2.b) (cost=1.21..2.24 rows=4.9)
4212-
-> Table scan on t1 (cost=0.0357..0.25 rows=7)
4214+
-> Inner hash join (<hash>(t1.b)=<hash>(t2.b)), extra conditions: (t1.b = t2.b) (rows=4.9)
4215+
-> Table scan on t1 (rows=7)
42134216
-> Hash
4214-
-> Table scan on t2 (cost=0.0357..0.25 rows=7)
4217+
-> Table scan on t2 (rows=7)
42154218

42164219
SELECT HEX(t1.b), HEX(t2.b) FROM t AS t1, t AS t2 WHERE t1.b = t2.b;
42174220
HEX(t1.b) HEX(t2.b)

0 commit comments

Comments
 (0)