|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * 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 $ |
12 | 12 | *
|
13 | 13 | * NOTES
|
14 | 14 | * Most of the read functions for plan nodes are tested. (In fact, they
|
@@ -2052,7 +2052,11 @@ readDatum(bool typbyval)
|
2052 | 2052 | token = pg_strtok(&tokenLength);
|
2053 | 2053 | length = atoui(token);
|
2054 | 2054 |
|
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 ? (const char *) token : "[NULL]", |
| 2059 | + (unsigned long) length); |
2056 | 2060 |
|
2057 | 2061 | if (typbyval)
|
2058 | 2062 | {
|
@@ -2080,9 +2084,10 @@ readDatum(bool typbyval)
|
2080 | 2084 | res = PointerGetDatum(s);
|
2081 | 2085 | }
|
2082 | 2086 |
|
2083 |
| - token = pg_strtok(&tokenLength); /* skip the ']' */ |
| 2087 | + token = pg_strtok(&tokenLength); /* read the ']' */ |
2084 | 2088 | if (token == NULL || token[0] != ']')
|
2085 |
| - elog(ERROR, "readDatum: ']' expected, length = %lu", |
| 2089 | + elog(ERROR, "readDatum: expected '%s', got '%s'; length = %lu", |
| 2090 | + "]", token ? (const char *) token : "[NULL]", |
2086 | 2091 | (unsigned long) length);
|
2087 | 2092 |
|
2088 | 2093 | return res;
|
|
0 commit comments