diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-06-17 18:57:29 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-06-17 18:57:29 +0000 |
commit | 6775c0108039a13458004d893e4a17b4ae3fae9d (patch) | |
tree | b6d42449d0dfff50ef52fc8ce9a59dd298d8c107 /src/backend/executor/functions.c | |
parent | 23347231a53bc373710db71559a194d87f60a7cb (diff) | |
download | postgresql-6775c0108039a13458004d893e4a17b4ae3fae9d.tar.gz postgresql-6775c0108039a13458004d893e4a17b4ae3fae9d.zip |
Revert an ill-considered portion of my patch of 12-Mar, which tried to save a
few lines in sql_exec_error_callback() by using the function source string
field that the patch added to SQL function cache entries. This doesn't work
because the fn_extra field isn't filled in yet during init_sql_fcache().
Probably it could be made to work, but it doesn't seem appropriate to contort
the main code paths to make an error-reporting path a tad faster. Per report
from Pavel Stehule.
Diffstat (limited to 'src/backend/executor/functions.c')
-rw-r--r-- | src/backend/executor/functions.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c index 8beea3f5396..d5ff4c12139 100644 --- a/src/backend/executor/functions.c +++ b/src/backend/executor/functions.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.117 2007/06/06 23:00:37 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.118 2007/06/17 18:57:29 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -765,11 +765,21 @@ sql_exec_error_callback(void *arg) * If there is a syntax error position, convert to internal syntax error */ syntaxerrposition = geterrposition(); - if (syntaxerrposition > 0 && fcache->src) + if (syntaxerrposition > 0) { + bool isnull; + Datum tmp; + char *prosrc; + + tmp = SysCacheGetAttr(PROCOID, func_tuple, Anum_pg_proc_prosrc, + &isnull); + if (isnull) + elog(ERROR, "null prosrc"); + prosrc = DatumGetCString(DirectFunctionCall1(textout, tmp)); errposition(0); internalerrposition(syntaxerrposition); - internalerrquery(fcache->src); + internalerrquery(prosrc); + pfree(prosrc); } /* |