Skip to content

Commit 1811e42

Browse files
committed
minor fix
1 parent 99a7dda commit 1811e42

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

expected/plpgsql_check_active.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3689,7 +3689,7 @@ select * from plpgsql_check_function('dyn_sql_2', security_warnings := true);
36893689
------------------------------------------------------------
36903690
error:42703:9:EXECUTE:column "c" not found in data type tp
36913691
Query: select $1.c
3692-
-- ^
3692+
-- ^
36933693
(3 rows)
36943694

36953695
drop function dyn_sql_2();
@@ -3704,7 +3704,7 @@ drop type tp;
37043704
create or replace function dyn_sql_2()
37053705
returns void as $$
37063706
declare
3707-
r record;
3707+
r record;
37083708
result int;
37093709
begin
37103710
select 10 a, 20 b into r;
@@ -3725,7 +3725,7 @@ select * from plpgsql_check_function('dyn_sql_2', security_warnings := true);
37253725
-------------------------------------------------------------------------
37263726
error:42703:8:EXECUTE:could not identify column "a" in record data type
37273727
Query: select $1.a + $1.b
3728-
-- ^
3728+
-- ^
37293729
(3 rows)
37303730

37313731
drop function dyn_sql_2();

sql/plpgsql_check_active.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2699,7 +2699,7 @@ drop type tp;
26992699
create or replace function dyn_sql_2()
27002700
returns void as $$
27012701
declare
2702-
r record;
2702+
r record;
27032703
result int;
27042704
begin
27052705
select 10 a, 20 b into r;

src/stmtwalk.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ dynsql_param_ref(ParseState *pstate, ParamRef *pref)
7676
param->paramkind = PARAM_EXTERN;
7777
param->paramid = pref->number;
7878
param->paramtype = TupleDescAttr(tupdesc, 0)->atttypid;
79+
param->location = pref->location;
7980

8081
/*
8182
* SPI_execute_with_args doesn't allow pass typmod.
8283
*/
8384
param->paramtypmod = -1;
84-
param->paramcollid = DEFAULT_COLLATION_OID;
85+
param->paramcollid = InvalidOid;
8586

8687
ReleaseTupleDesc(tupdesc);
8788
}

0 commit comments

Comments
 (0)