Skip to content

Commit 246feb3

Browse files
committed
add more tests
1 parent 7737e9f commit 246feb3

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

src/query/service/src/pipelines/processors/transforms/hash_join/join_hash_table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ impl HashJoinState for JoinHashTable {
708708
.contains(&row_ptr)
709709
{
710710
let mut row_state = self.hash_join_desc.right_join_desc.row_state.write();
711-
row_state.entry(row_ptr.clone()).or_insert(0_usize);
711+
row_state.entry(row_ptr).or_insert(0_usize);
712712
unmatched_build_indexes.push(row_ptr);
713713
}
714714
}

tests/logictest/suites/base/15_query/join.test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,16 @@ select * from (SELECT number AS a FROM numbers(10)) x right join (SELECT number
399399
3
400400
4
401401

402+
statement query II
403+
select * from (SELECT number AS a FROM numbers(1000)) x right join (SELECT number AS a FROM numbers(5)) y on x.a = y.a order by x.a;
404+
405+
----
406+
0 0
407+
1 1
408+
2 2
409+
3 3
410+
4 4
411+
402412
statement query II
403413
select * from numbers(10) x join (select 1::UInt64 number) y on x.number = y.number;
404414

tests/logictest/suites/crdb/join

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,28 @@ SELECT * FROM str1 LEFT OUTER JOIN str2 ON str1.s = str2.s order by str1.a;
670670
3 c NULL NULL
671671
4 D NULL NULL
672672

673+
statement ok
674+
INSERT INTO str1 VALUES (1, 'a' ), (2, 'A'), (3, 'c'), (4, 'D');
675+
676+
statement query ITIT
677+
select * from str1 right join str2 on str1.s = str2.s order by str2.a;
678+
679+
----
680+
2 A 1 A
681+
2 A 1 A
682+
NULL NULL 2 B
683+
NULL NULL 3 C
684+
NULL NULL 4 E
685+
686+
statement query ITIT
687+
select * from str1 right join str2 on false order by str2.a;
688+
689+
----
690+
NULL NULL 1 A
691+
NULL NULL 2 B
692+
NULL NULL 3 C
693+
NULL NULL 4 E
694+
673695
-- statement query
674696
-- SELECT s, str1.s, str2.s FROM str1 FULL OUTER JOIN str2 USING(s);
675697

0 commit comments

Comments
 (0)