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

Commitb399805

Browse files
committed
Eliminate elog()'s hardwired limit on length of an error message.
This change seems necessary in conjunction with long queries, and itcleans up some bogosity in connection with long EXPLAIN texts anyway.Note that current libpq will accept any length error message (at leastuntil it runs out of memory); prior versions have a limit of 8K, butwill cleanly discard excess error text, so there shouldn't be anybig compatibility problems with old clients.
1 parent1e4f019 commitb399805

File tree

4 files changed

+245
-145
lines changed

4 files changed

+245
-145
lines changed

‎src/backend/commands/explain.c

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 1994-5, Regents of the University of California
66
*
7-
* $Id: explain.c,v 1.46 1999/08/31 01:28:28 tgl Exp $
7+
* $Id: explain.c,v 1.47 1999/09/11 19:06:36 tgl Exp $
88
*
99
*/
1010

@@ -28,7 +28,6 @@ typedef struct ExplainState
2828
}ExplainState;
2929

3030
staticchar*Explain_PlanToString(Plan*plan,ExplainState*es);
31-
staticvoidprintLongNotice(constchar*header,constchar*message);
3231
staticvoidExplainOneQuery(Query*query,boolverbose,CommandDestdest);
3332

3433
/* Convert a null string pointer into "<>" */
@@ -110,7 +109,7 @@ ExplainOneQuery(Query *query, bool verbose, CommandDest dest)
110109
s=nodeToString(plan);
111110
if (s)
112111
{
113-
printLongNotice("QUERY DUMP:\n\n",s);
112+
elog(NOTICE,"QUERY DUMP:\n\n%s",s);
114113
pfree(s);
115114
}
116115
}
@@ -120,7 +119,7 @@ ExplainOneQuery(Query *query, bool verbose, CommandDest dest)
120119
s=Explain_PlanToString(plan,es);
121120
if (s)
122121
{
123-
printLongNotice("QUERY PLAN:\n\n",s);
122+
elog(NOTICE,"QUERY PLAN:\n\n%s",s);
124123
pfree(s);
125124
}
126125
}
@@ -332,7 +331,6 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
332331
}
333332
es->rtable=saved_rtable;
334333
}
335-
return;
336334
}
337335

338336
staticchar*
@@ -346,22 +344,3 @@ Explain_PlanToString(Plan *plan, ExplainState *es)
346344
explain_outNode(&str,plan,0,es);
347345
returnstr.data;
348346
}
349-
350-
/*
351-
* Print a message that might exceed the size of the elog message buffer.
352-
* This is a crock ... there shouldn't be an upper limit to what you can elog().
353-
*/
354-
staticvoid
355-
printLongNotice(constchar*header,constchar*message)
356-
{
357-
intlen=strlen(message);
358-
359-
elog(NOTICE,"%.20s%.*s",header,ELOG_MAXLEN-64,message);
360-
len-=ELOG_MAXLEN-64;
361-
while (len>0)
362-
{
363-
message+=ELOG_MAXLEN-64;
364-
elog(NOTICE,"%.*s",ELOG_MAXLEN-64,message);
365-
len-=ELOG_MAXLEN-64;
366-
}
367-
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp