diff options
author | Amit Kapila <akapila@postgresql.org> | 2018-10-03 09:14:09 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2018-10-03 09:14:09 +0530 |
commit | ca5ca25d08710d7f5aaf0e390aae284bc594a6da (patch) | |
tree | 17a51d82cd1350a90dc11597ef6eddfd465fb8b2 /src/test/regress/sql/select_parallel.sql | |
parent | a051c19c3cf4415b36e6333a83a113de4d90a973 (diff) | |
download | postgresql-ca5ca25d08710d7f5aaf0e390aae284bc594a6da.tar.gz postgresql-ca5ca25d08710d7f5aaf0e390aae284bc594a6da.zip |
MAXALIGN the target address where we store flattened value.
The API (EOH_flatten_into) that flattens the expanded value representation
expects the target address to be maxaligned. All it's usage adhere to that
principle except when serializing datums for parallel query. Fix that
usage.
Diagnosed-by: Tom Lane
Author: Tom Lane and Amit Kapila
Backpatch-through: 9.6
Discussion: https://postgr.es/m/11629.1536550032@sss.pgh.pa.us
Diffstat (limited to 'src/test/regress/sql/select_parallel.sql')
-rw-r--r-- | src/test/regress/sql/select_parallel.sql | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/test/regress/sql/select_parallel.sql b/src/test/regress/sql/select_parallel.sql index 938c708d18f..e0f99accb4d 100644 --- a/src/test/regress/sql/select_parallel.sql +++ b/src/test/regress/sql/select_parallel.sql @@ -410,7 +410,23 @@ ORDER BY 1; SELECT * FROM information_schema.foreign_data_wrapper_options ORDER BY 1, 2, 3; --- test interation between subquery and partial_paths +-- test passing expanded-value representations to workers +CREATE FUNCTION make_some_array(int,int) returns int[] as +$$declare x int[]; + begin + x[1] := $1; + x[2] := $2; + return x; + end$$ language plpgsql parallel safe; +CREATE TABLE fooarr(f1 text, f2 int[], f3 text); +INSERT INTO fooarr VALUES('1', ARRAY[1,2], 'one'); + +PREPARE pstmt(text, int[]) AS SELECT * FROM fooarr WHERE f1 = $1 AND f2 = $2; +EXPLAIN (COSTS OFF) EXECUTE pstmt('1', make_some_array(1,2)); +EXECUTE pstmt('1', make_some_array(1,2)); +DEALLOCATE pstmt; + +-- test interaction between subquery and partial_paths SET LOCAL min_parallel_table_scan_size TO 0; CREATE VIEW tenk1_vw_sec WITH (security_barrier) AS SELECT * FROM tenk1; EXPLAIN (COSTS OFF) |