Skip to content

Commit

Permalink
fix:full outer join with string_agg function panic (#12995)
Browse files Browse the repository at this point in the history
Co-authored-by: sundyli <[email protected]>
Co-authored-by: Jk Xu <[email protected]>
  • Loading branch information
3 people authored Oct 7, 2023
1 parent 6f76ae6 commit 895bf95
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/query/functions/src/scalars/string_multi_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ fn regexp_substr_fn(args: &[ValueRef<AnyType>], ctx: &mut EvalContext) -> Value<
if let Err(err) = regexp::validate_regexp_arguments("regexp_substr", pos, occur, None) {
ctx.set_error(builder.len(), err);
StringType::push_default(&mut builder);
validity.push(false);
continue;
}

Expand All @@ -898,6 +899,7 @@ fn regexp_substr_fn(args: &[ValueRef<AnyType>], ctx: &mut EvalContext) -> Value<
Err(err) => {
ctx.set_error(builder.len(), err);
StringType::push_default(&mut builder);
validity.push(false);
continue;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,31 @@ CREATE TABLE t1(s String NULL, pat String NULL, pos Int64 NULL, occu Int64 NULL,
statement ok
INSERT INTO t1 (s, pat, pos, occu, mt) VALUES (NULL, '[a-z]+', 1, 1, ''), ('abc def ghi', NULL, 1, 1, 'c'), ('abc def ghi', '[a-z]+', NULL, 1, 'c'), ('abc def ghi', '[a-z]+', 1, NULL, 'c'), ('abc def ghi', '[a-z]+', 1, 1, NULL), ('abc def ghi', '[a-z]+', 1, 1, 'c')

statement ok
DROP TABLE IF EXISTS tt1

statement ok
CREATE TABLE tt1(a boolean not null, b int not null, c int64 not null, d string not null) Engine = Fuse

statement ok
INSERT INTO tt1 VALUES (true,826203185,-3958367336395157675,'Jd695'),(true,-1439480114,-4881196055243782954,'Lzcda'),(true,-1439480114,-4881196055243782954,'Lzcda'),(false,733863457,6458421525263813535,'m8maS'),(true,-739644074,4390046195034875158,'zWvEj'),(true,-1611495410,-2002171580743726810,'rtOs8')

statement ok
DROP TABLE IF EXISTS tt2

statement ok
CREATE TABLE tt2(b int not null) Engine = Fuse

statement ok
INSERT INTO tt2 VALUES (-1448403955),(1978682043),(775979323),(-2057711809),(183393966),(618200641)

statement error 1001
SELECT string_agg(regexp_substr(tt1.d, '-', tt1.c)), tt1.a FROM tt1 FULL OUTER JOIN tt2 USING(b) GROUP BY ROLLUP (tt1.a)


statement ok
DROP TABLE IF EXISTS tt1


statement ok
DROP TABLE IF EXISTS tt2

1 comment on commit 895bf95

@vercel
Copy link

@vercel vercel bot commented on 895bf95 Oct 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.