Skip to content
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
15 changes: 13 additions & 2 deletions src/test/regress/expected/extract_deparse.out
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,20 @@ EXCEPTION
WHEN invalid_parameter_value THEN NULL;
END
$$;
SELECT bool_and(result::boolean) AS extract_field_injection_blocked
-- Positive control: the same expression with a valid field must still be
-- pushed down, so the check below cannot pass merely because the expression
-- stopped reaching the workers.
SELECT EXTRACT('year' FROM ts) = 2026 AS extract_field_pushdown_works
FROM extract_deparse_source
WHERE id = 1;
extract_field_pushdown_works
---------------------------------------------------------------------
t
(1 row)

SELECT bool_and(result::int = 0) AS extract_field_injection_blocked
FROM run_command_on_workers($$
SELECT to_regclass('extract_deparse.injected') IS NULL
SELECT count(*) FROM pg_class WHERE relname = 'injected'
$$);
extract_field_injection_blocked
---------------------------------------------------------------------
Expand Down
15 changes: 13 additions & 2 deletions src/test/regress/expected/pg19.out
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,20 @@ EXCEPTION
WHEN invalid_parameter_value THEN NULL;
END
$$;
SELECT bool_and(result::boolean) AS extract_field_injection_blocked
-- Positive control: the same expression with a valid field must still be
-- pushed down, so the check below cannot pass merely because the expression
-- stopped reaching the workers.
SELECT EXTRACT('year' FROM ts) = 2026 AS extract_field_pushdown_works
FROM extract_deparse_source
WHERE id = 1;
extract_field_pushdown_works
---------------------------------------------------------------------
t
(1 row)

SELECT bool_and(result::int = 0) AS extract_field_injection_blocked
FROM run_command_on_workers($$
SELECT to_regclass('pg19_repack.injected') IS NULL
SELECT count(*) FROM pg_class WHERE relname = 'injected'
$$);
extract_field_injection_blocked
---------------------------------------------------------------------
Expand Down
11 changes: 9 additions & 2 deletions src/test/regress/sql/extract_deparse.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ EXCEPTION
END
$$;

SELECT bool_and(result::boolean) AS extract_field_injection_blocked
-- Positive control: the same expression with a valid field must still be
-- pushed down, so the check below cannot pass merely because the expression
-- stopped reaching the workers.
SELECT EXTRACT('year' FROM ts) = 2026 AS extract_field_pushdown_works
FROM extract_deparse_source
WHERE id = 1;

SELECT bool_and(result::int = 0) AS extract_field_injection_blocked
FROM run_command_on_workers($$
SELECT to_regclass('extract_deparse.injected') IS NULL
SELECT count(*) FROM pg_class WHERE relname = 'injected'
$$);

SET client_min_messages TO ERROR;
Expand Down
11 changes: 9 additions & 2 deletions src/test/regress/sql/pg19.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,16 @@ EXCEPTION
END
$$;

SELECT bool_and(result::boolean) AS extract_field_injection_blocked
-- Positive control: the same expression with a valid field must still be
-- pushed down, so the check below cannot pass merely because the expression
-- stopped reaching the workers.
SELECT EXTRACT('year' FROM ts) = 2026 AS extract_field_pushdown_works
FROM extract_deparse_source
WHERE id = 1;

SELECT bool_and(result::int = 0) AS extract_field_injection_blocked
FROM run_command_on_workers($$
SELECT to_regclass('pg19_repack.injected') IS NULL
SELECT count(*) FROM pg_class WHERE relname = 'injected'
$$);
SET citus.shard_count TO 4;

Expand Down
Loading