Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6775c01

Browse files
committed
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 stringfield that the patch added to SQL function cache entries. This doesn't workbecause 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 contortthe main code paths to make an error-reporting path a tad faster. Per reportfrom Pavel Stehule.
1 parent2334723 commit6775c01

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

‎src/backend/executor/functions.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.117 2007/06/06 23:00:37 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.118 2007/06/17 18:57:29 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -765,11 +765,21 @@ sql_exec_error_callback(void *arg)
765765
* If there is a syntax error position, convert to internal syntax error
766766
*/
767767
syntaxerrposition=geterrposition();
768-
if (syntaxerrposition>0&&fcache->src)
768+
if (syntaxerrposition>0)
769769
{
770+
boolisnull;
771+
Datumtmp;
772+
char*prosrc;
773+
774+
tmp=SysCacheGetAttr(PROCOID,func_tuple,Anum_pg_proc_prosrc,
775+
&isnull);
776+
if (isnull)
777+
elog(ERROR,"null prosrc");
778+
prosrc=DatumGetCString(DirectFunctionCall1(textout,tmp));
770779
errposition(0);
771780
internalerrposition(syntaxerrposition);
772-
internalerrquery(fcache->src);
781+
internalerrquery(prosrc);
782+
pfree(prosrc);
773783
}
774784

775785
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp