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

Commit3ec9fb8

Browse files
committed
Add a little more error checking and reporting to readDatum().
1 parent31c1fea commit3ec9fb8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

‎src/backend/nodes/readfuncs.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.111 2001/06/19 22:39:11 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.112 2001/07/03 16:52:48 tgl Exp $
1212
*
1313
* NOTES
1414
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -2052,7 +2052,11 @@ readDatum(bool typbyval)
20522052
token=pg_strtok(&tokenLength);
20532053
length=atoui(token);
20542054

2055-
token=pg_strtok(&tokenLength);/* skip the '[' */
2055+
token=pg_strtok(&tokenLength);/* read the '[' */
2056+
if (token==NULL||token[0]!='[')
2057+
elog(ERROR,"readDatum: expected '%s', got '%s'; length = %lu",
2058+
"[",token ? (constchar*)token :"[NULL]",
2059+
(unsigned long)length);
20562060

20572061
if (typbyval)
20582062
{
@@ -2080,9 +2084,10 @@ readDatum(bool typbyval)
20802084
res=PointerGetDatum(s);
20812085
}
20822086

2083-
token=pg_strtok(&tokenLength);/*skip the ']' */
2087+
token=pg_strtok(&tokenLength);/*read the ']' */
20842088
if (token==NULL||token[0]!=']')
2085-
elog(ERROR,"readDatum: ']' expected, length = %lu",
2089+
elog(ERROR,"readDatum: expected '%s', got '%s'; length = %lu",
2090+
"]",token ? (constchar*)token :"[NULL]",
20862091
(unsigned long)length);
20872092

20882093
returnres;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp