diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-08-19 17:31:50 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-08-19 17:31:50 +0000 |
| commit | 3d7feba4b36d67d5fd21231c43524de2ec33fbef (patch) | |
| tree | c0aca55e65925d8a4a0fb77392cb586d96365e4f /src | |
| parent | cc46c4e862214217e5901c2ea4573840a15dc2f4 (diff) | |
Be a bit less cavalier with both the code and the comment for UNKNOWN fix.
Diffstat (limited to 'src')
| -rw-r--r-- | src/pl/plpgsql/src/pl_exec.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index d75b7a90b9f..4a14b0c01af 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.261.2.2 2010/08/19 16:54:48 heikki Exp $ + * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.261.2.3 2010/08/19 17:31:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -5516,14 +5516,16 @@ exec_eval_using_params(PLpgSQL_execstate *estate, List *params) if (ppd->types[i] == UNKNOWNOID) { /* - * Treat 'unknown' parameters as text, that's what most people - * would expect. The backend can coerce unknown constants in a - * more intelligent way, but not unknown Params. + * Treat 'unknown' parameters as text, since that's what most + * people would expect. SPI_execute_with_args can coerce unknown + * constants in a more intelligent way, but not unknown Params. + * This code also takes care of copying into the right context. + * Note we assume 'unknown' has the representation of C-string. */ ppd->types[i] = TEXTOID; if (!isnull) { - ppd->values[i] = CStringGetTextDatum((char *) ppd->values[i]); + ppd->values[i] = CStringGetTextDatum(DatumGetCString(ppd->values[i])); ppd->freevals[i] = true; } } |
