You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE OR REPLACE function parse_arr (p_array text)
returns int[] IMMUTABLE
AS $dbvis$
declare
v_return int[][];
v_text text;
v_first int;
BEGIN
if p_array is null
then
return null;
end if;
v_first := 1;
for v_text in
select unnest(string_to_array(p_array, ';'))
loop
v_return := v_return || ARRAY[(string_to_array(regexp_replace(v_text, '[)( ]', '', 'g'), ',')::int[])];
end loop;
RETURN v_return;
END;
$dbvis$ LANGUAGE plpgsql;
CREATE TABLE test_parse_arr (a bigserial, b int[]);
INSERT INTO test_parse_arr (b)
SELECT parse_arr(x) FROM
(
SELECT '(1, 2, 3)' AS x
UNION ALL
SELECT NULL
) AS q;
SELECT * FROM test_parse_arr ORDER BY a;
Cloudberry Database version
PostgreSQL 14.4 (Cloudberry Database 1.5.5 build 77126 commit:64f8d776) (HashData Lightning 1.5.5 build 77126 commit:64f8d776) on aarch64-unknown-linux-gnu, compiled by gcc (GCC) 10.3.0, 64-bit compiled on Jun 17 2024 04:10:34
(1 row)
What happened
Failure in https://code.hashdata.xyz/cloudberry/cbdb-release/-/jobs/883544
What you think should happen instead
a | b
---+-----------
1 | {{1,2,3}}
2 |
How to reproduce
Testcase source:
https://code.hashdata.xyz/cloudberry/database/hashdata-lightning/-/blob/main/contrib/pax_storage/src/test/regress/sql/gpdtm_plpgsql.sql
https://code.hashdata.xyz/cloudberry/database/hashdata-lightning/-/blob/main/src/test/regress/expected/gpdtm_plpgsql.out
Operating System
centos7
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: