diff options
author | Thomas G. Lockhart <lockhart@fourpalms.org> | 2002-03-09 17:41:04 +0000 |
---|---|---|
committer | Thomas G. Lockhart <lockhart@fourpalms.org> | 2002-03-09 17:41:04 +0000 |
commit | 07ee72fc67d7ffae94e528adb73d9b73ebc4cb4e (patch) | |
tree | ee54b3eeaa2e61b3e14bef53429166b27f4f8247 /src | |
parent | 38b4088518e99fbf8d89303c19077e84e86a9c65 (diff) |
Guard against NULL strings in SET key=val constructs.
Problem noted by Fernando Nasser.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/parser/gram.y | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 6dc850bfeb3..91f856f8980 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.276 2001/12/09 04:39:39 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.276.2.1 2002/03/09 17:41:04 thomas Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -763,14 +763,16 @@ VariableSetStmt: SET ColId TO var_value { VariableSetStmt *n = makeNode(VariableSetStmt); n->name = $2; - n->args = makeList1(makeStringConst($4, NULL)); + if ($4 != NULL) + n->args = makeList1(makeStringConst($4, NULL)); $$ = (Node *) n; } | SET ColId '=' var_value { VariableSetStmt *n = makeNode(VariableSetStmt); n->name = $2; - n->args = makeList1(makeStringConst($4, NULL)); + if ($4 != NULL) + n->args = makeList1(makeStringConst($4, NULL)); $$ = (Node *) n; } | SET TIME ZONE zone_value @@ -799,7 +801,8 @@ VariableSetStmt: SET ColId TO var_value { VariableSetStmt *n = makeNode(VariableSetStmt); n->name = "client_encoding"; - n->args = makeList1(makeStringConst($3, NULL)); + if ($3 != NULL) + n->args = makeList1(makeStringConst($3, NULL)); $$ = (Node *) n; } | SET SESSION AUTHORIZATION ColId_or_Sconst |