Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve inconsistent result issue in gpdtm_plpgsql test case #491

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions src/test/regress/expected/gpdtm_plpgsql.out
Original file line number Diff line number Diff line change
Expand Up @@ -536,18 +536,30 @@ CREATE TABLE test_parse_arr (a bigserial, b int[]);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
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;
a | b
---+-----------
1 | {{1,2,3}}
2 |
(2 rows)
SELECT parse_arr(x) FROM
(
SELECT '(1, 2, 3)' AS x
UNION ALL
SELECT NULL AS x
UNION ALL
SELECT '(4, 5, 6)' AS x
ORDER BY x
) AS q;
SELECT a FROM test_parse_arr ORDER BY a;
a
---
1
2
3
(3 rows)

SELECT b FROM test_parse_arr ORDER BY b;
b
-----------
{{1,2,3}}
{{4,5,6}}

(3 rows)

--
-- Test if sequence server information outlives a plpgsql exception and corresponding subtransaction rollback (MPP-25193)
Expand Down
21 changes: 13 additions & 8 deletions src/test/regress/sql/gpdtm_plpgsql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,19 @@ $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;
SELECT parse_arr(x) FROM
(
SELECT '(1, 2, 3)' AS x
UNION ALL
SELECT NULL AS x
UNION ALL
SELECT '(4, 5, 6)' AS x
ORDER BY x
) AS q;

SELECT a FROM test_parse_arr ORDER BY a;

SELECT b FROM test_parse_arr ORDER BY b;

--
-- Test if sequence server information outlives a plpgsql exception and corresponding subtransaction rollback (MPP-25193)
Expand Down
Loading