File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.261.2.2 2010/08/19 16:54:48 heikki Exp $
11
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.261.2.3 2010/08/19 17:31:50 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -5516,14 +5516,16 @@ exec_eval_using_params(PLpgSQL_execstate *estate, List *params)
5516
5516
if (ppd -> types [i ] == UNKNOWNOID )
5517
5517
{
5518
5518
/*
5519
- * Treat 'unknown' parameters as text, that's what most people
5520
- * would expect. The backend can coerce unknown constants in a
5521
- * more intelligent way, but not unknown Params.
5519
+ * Treat 'unknown' parameters as text, since that's what most
5520
+ * people would expect. SPI_execute_with_args can coerce unknown
5521
+ * constants in a more intelligent way, but not unknown Params.
5522
+ * This code also takes care of copying into the right context.
5523
+ * Note we assume 'unknown' has the representation of C-string.
5522
5524
*/
5523
5525
ppd -> types [i ] = TEXTOID ;
5524
5526
if (!isnull )
5525
5527
{
5526
- ppd -> values [i ] = CStringGetTextDatum (( char * ) ppd -> values [i ]);
5528
+ ppd -> values [i ] = CStringGetTextDatum (DatumGetCString ( ppd -> values [i ]) );
5527
5529
ppd -> freevals [i ] = true;
5528
5530
}
5529
5531
}
You can’t perform that action at this time.
0 commit comments