Commit f2050955 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Guard against NULL strings in SET key=val constructs.

 Problem noted by Fernando Nasser.
parent ee215482
......@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.288 2002/03/08 04:37:17 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.289 2002/03/09 17:37:16 thomas Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
......@@ -790,14 +790,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
......@@ -826,7 +828,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment