Skip to content

Commit 3869e9a

Browse files
committed
Be a bit less cavalier with both the code and the comment for UNKNOWN fix.
1 parent ff645bf commit 3869e9a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/pl/plpgsql/src/pl_exec.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.264 2010/08/19 16:54:43 heikki Exp $
11+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.265 2010/08/19 17:31:43 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -5524,14 +5524,16 @@ exec_eval_using_params(PLpgSQL_execstate *estate, List *params)
55245524
if (ppd->types[i] == UNKNOWNOID)
55255525
{
55265526
/*
5527-
* Treat 'unknown' parameters as text, that's what most people
5528-
* would expect. The backend can coerce unknown constants in a
5529-
* more intelligent way, but not unknown Params.
5527+
* Treat 'unknown' parameters as text, since that's what most
5528+
* people would expect. SPI_execute_with_args can coerce unknown
5529+
* constants in a more intelligent way, but not unknown Params.
5530+
* This code also takes care of copying into the right context.
5531+
* Note we assume 'unknown' has the representation of C-string.
55305532
*/
55315533
ppd->types[i] = TEXTOID;
55325534
if (!isnull)
55335535
{
5534-
ppd->values[i] = CStringGetTextDatum((char *) ppd->values[i]);
5536+
ppd->values[i] = CStringGetTextDatum(DatumGetCString(ppd->values[i]));
55355537
ppd->freevals[i] = true;
55365538
}
55375539
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy