Skip to content

Commit cf92593

Browse files
committed
Fix for new Boolean node
The token in nodeTokenType() is actually the whole rest of the string, so we need to take into account the length to do the correct comparison. Without this, postgres_fdw tests fail under -DWRITE_READ_PARSE_PLAN_TREES.
1 parent 941460f commit cf92593

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/nodes/read.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ nodeTokenType(const char *token, int length)
283283
retval = RIGHT_PAREN;
284284
else if (*token == '{')
285285
retval = LEFT_BRACE;
286-
else if (strcmp(token, "true") == 0 || strcmp(token, "false") == 0)
286+
else if ((length == 4 && strncmp(token, "true", 4) == 0) ||
287+
(length == 5 && strncmp(token, "false", 5) == 0))
287288
retval = T_Boolean;
288289
else if (*token == '"' && length > 1 && token[length - 1] == '"')
289290
retval = T_String;

0 commit comments

Comments
 (0)