Skip to content

Commit 1cc9299

Browse files
committed
Small code cleanup for recent UPDATE SET (values) patch.
1 parent 6e8596a commit 1cc9299

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

src/backend/parser/gram.y

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.561 2006/09/02 20:34:47 momjian Exp $
14+
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.562 2006/09/02 20:52:01 momjian Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -238,7 +238,7 @@ static void doNegateFloat(Value *v);
238238
qualified_name_list any_name any_name_list
239239
any_operator expr_list attrs
240240
target_list update_col_list update_target_list
241-
update_value_list insert_column_list
241+
update_value_list set_opt insert_column_list
242242
values_list def_list indirection opt_indirection
243243
group_clause TriggerFuncArgs select_limit
244244
opt_select_limit opclass_item_list
@@ -5526,21 +5526,7 @@ opt_nowait: NOWAIT { $$ = TRUE; }
55265526
*****************************************************************************/
55275527

55285528
UpdateStmt: UPDATE relation_expr_opt_alias
5529-
SET update_target_list
5530-
from_clause
5531-
where_clause
5532-
returning_clause
5533-
{
5534-
UpdateStmt *n = makeNode(UpdateStmt);
5535-
n->relation = $2;
5536-
n->targetList = $4;
5537-
n->fromClause = $5;
5538-
n->whereClause = $6;
5539-
n->returningList = $7;
5540-
$$ = (Node *)n;
5541-
}
5542-
| UPDATE relation_expr_opt_alias
5543-
SET update_target_lists_list
5529+
SET set_opt
55445530
from_clause
55455531
where_clause
55465532
returning_clause
@@ -5555,6 +5541,11 @@ UpdateStmt: UPDATE relation_expr_opt_alias
55555541
}
55565542
;
55575543

5544+
set_opt:
5545+
update_target_list { $$ = $1; }
5546+
| update_target_lists_list { $$ = $1; }
5547+
;
5548+
55585549

55595550
/*****************************************************************************
55605551
*
@@ -5981,7 +5972,7 @@ update_target_lists_el:
59815972
{
59825973
/* merge update_value_list with update_col_list */
59835974
ResTarget *res_col = (ResTarget *) lfirst(col_cell);
5984-
ResTarget *res_val = (ResTarget *) lfirst(val_cell);
5975+
Node *res_val = (Node *) lfirst(val_cell);
59855976

59865977
res_col->val = (Node *)copyObject(res_val);
59875978
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy