mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Fix compile error. Make transaction/work optional on all transaction
statements. More cleanups of psql help. Fix for shift/reduce on UNION in subselect.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.17 1998/07/25 00:17:28 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.18 1998/07/26 01:18:04 momjian Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@@ -125,7 +125,7 @@ Oid param_type(int t); /* used in parse_expr.c */
|
||||
ProcedureStmt, RecipeStmt, RemoveAggrStmt, RemoveOperStmt,
|
||||
RemoveFuncStmt, RemoveStmt,
|
||||
RenameStmt, RevokeStmt, RuleStmt, TransactionStmt, ViewStmt, LoadStmt,
|
||||
CreatedbStmt, DestroydbStmt, VacuumStmt, CursorStmt, SubSelect,
|
||||
CreatedbStmt, DestroydbStmt, VacuumStmt, CursorStmt, SubSelect, SubUnion,
|
||||
UpdateStmt, InsertStmt, SelectStmt, NotifyStmt, DeleteStmt, ClusterStmt,
|
||||
ExplainStmt, VariableSetStmt, VariableShowStmt, VariableResetStmt,
|
||||
CreateUserStmt, AlterUserStmt, DropUserStmt
|
||||
@@ -339,7 +339,6 @@ Oid param_type(int t); /* used in parse_expr.c */
|
||||
%left '.'
|
||||
%left '[' ']'
|
||||
%nonassoc TYPECAST
|
||||
%nonassoc REDUCE
|
||||
%left UNION
|
||||
%%
|
||||
|
||||
@@ -2027,9 +2026,9 @@ TransactionStmt: ABORT_TRANS opt_trans
|
||||
}
|
||||
;
|
||||
|
||||
opt_trans: WORK { $$ = NULL; }
|
||||
| TRANSACTION { $$ = NULL: }
|
||||
| /*EMPTY*/ { $$ = NULL; }
|
||||
opt_trans: WORK { $$ = TRUE; }
|
||||
| TRANSACTION { $$ = TRUE; }
|
||||
| /*EMPTY*/ { $$ = TRUE; }
|
||||
;
|
||||
|
||||
|
||||
@@ -2438,6 +2437,23 @@ SelectStmt: SELECT opt_unique res_target_list2
|
||||
}
|
||||
;
|
||||
|
||||
SubSelect: SELECT opt_unique res_target_list2
|
||||
from_clause where_clause
|
||||
group_clause having_clause
|
||||
union_clause
|
||||
{
|
||||
SelectStmt *n = makeNode(SelectStmt);
|
||||
n->unique = $2;
|
||||
n->targetList = $3;
|
||||
n->fromClause = $4;
|
||||
n->whereClause = $5;
|
||||
n->groupClause = $6;
|
||||
n->havingClause = $7;
|
||||
n->unionClause = $8;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
;
|
||||
|
||||
union_clause: UNION opt_union select_list
|
||||
{
|
||||
SelectStmt *n = (SelectStmt *)lfirst($3);
|
||||
@@ -2448,20 +2464,19 @@ union_clause: UNION opt_union select_list
|
||||
{ $$ = NIL; }
|
||||
;
|
||||
|
||||
select_list: select_list UNION opt_union SubSelect
|
||||
select_list: select_list UNION opt_union SubUnion
|
||||
{
|
||||
SelectStmt *n = (SelectStmt *)$4;
|
||||
n->unionall = $3;
|
||||
$$ = lappend($1, $4);
|
||||
}
|
||||
| SubSelect
|
||||
| SubUnion
|
||||
{ $$ = lcons($1, NIL); }
|
||||
;
|
||||
|
||||
SubSelect: SELECT opt_unique res_target_list2
|
||||
SubUnion: SELECT opt_unique res_target_list2
|
||||
from_clause where_clause
|
||||
group_clause having_clause
|
||||
union_clause
|
||||
{
|
||||
SelectStmt *n = makeNode(SelectStmt);
|
||||
n->unique = $2;
|
||||
@@ -2471,7 +2486,6 @@ SubSelect: SELECT opt_unique res_target_list2
|
||||
n->whereClause = $5;
|
||||
n->groupClause = $6;
|
||||
n->havingClause = $7;
|
||||
n->unionClause = $8;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
;
|
||||
|
||||
@@ -97,136 +97,137 @@ typedef union
|
||||
#define MATCH 324
|
||||
#define MINUTE_P 325
|
||||
#define MONTH_P 326
|
||||
#define NATIONAL 327
|
||||
#define NATURAL 328
|
||||
#define NCHAR 329
|
||||
#define NO 330
|
||||
#define NOT 331
|
||||
#define NOTIFY 332
|
||||
#define NULL_P 333
|
||||
#define NUMERIC 334
|
||||
#define ON 335
|
||||
#define OPTION 336
|
||||
#define OR 337
|
||||
#define ORDER 338
|
||||
#define OUTER_P 339
|
||||
#define PARTIAL 340
|
||||
#define POSITION 341
|
||||
#define PRECISION 342
|
||||
#define PRIMARY 343
|
||||
#define PRIVILEGES 344
|
||||
#define PROCEDURE 345
|
||||
#define PUBLIC 346
|
||||
#define REFERENCES 347
|
||||
#define REVOKE 348
|
||||
#define RIGHT 349
|
||||
#define ROLLBACK 350
|
||||
#define SECOND_P 351
|
||||
#define SELECT 352
|
||||
#define SET 353
|
||||
#define SUBSTRING 354
|
||||
#define TABLE 355
|
||||
#define TIME 356
|
||||
#define TIMESTAMP 357
|
||||
#define TIMEZONE_HOUR 358
|
||||
#define TIMEZONE_MINUTE 359
|
||||
#define TO 360
|
||||
#define TRAILING 361
|
||||
#define TRANSACTION 362
|
||||
#define TRIM 363
|
||||
#define UNION 364
|
||||
#define UNIQUE 365
|
||||
#define UPDATE 366
|
||||
#define USER 367
|
||||
#define USING 368
|
||||
#define VALUES 369
|
||||
#define VARCHAR 370
|
||||
#define VARYING 371
|
||||
#define VIEW 372
|
||||
#define WHERE 373
|
||||
#define WITH 374
|
||||
#define WORK 375
|
||||
#define YEAR_P 376
|
||||
#define ZONE 377
|
||||
#define FALSE_P 378
|
||||
#define TRIGGER 379
|
||||
#define TRUE_P 380
|
||||
#define TYPE_P 381
|
||||
#define ABORT_TRANS 382
|
||||
#define AFTER 383
|
||||
#define AGGREGATE 384
|
||||
#define ANALYZE 385
|
||||
#define BACKWARD 386
|
||||
#define BEFORE 387
|
||||
#define BINARY 388
|
||||
#define CACHE 389
|
||||
#define CLUSTER 390
|
||||
#define COPY 391
|
||||
#define CYCLE 392
|
||||
#define DATABASE 393
|
||||
#define DELIMITERS 394
|
||||
#define DO 395
|
||||
#define EACH 396
|
||||
#define EXPLAIN 397
|
||||
#define EXTEND 398
|
||||
#define FORWARD 399
|
||||
#define FUNCTION 400
|
||||
#define HANDLER 401
|
||||
#define INCREMENT 402
|
||||
#define INDEX 403
|
||||
#define INHERITS 404
|
||||
#define INSTEAD 405
|
||||
#define ISNULL 406
|
||||
#define LANCOMPILER 407
|
||||
#define LISTEN 408
|
||||
#define LOAD 409
|
||||
#define LOCK_P 410
|
||||
#define LOCATION 411
|
||||
#define MAXVALUE 412
|
||||
#define MINVALUE 413
|
||||
#define MOVE 414
|
||||
#define NEW 415
|
||||
#define NONE 416
|
||||
#define NOTHING 417
|
||||
#define NOTNULL 418
|
||||
#define OIDS 419
|
||||
#define OPERATOR 420
|
||||
#define PROCEDURAL 421
|
||||
#define RECIPE 422
|
||||
#define RENAME 423
|
||||
#define RESET 424
|
||||
#define RETURNS 425
|
||||
#define ROW 426
|
||||
#define RULE 427
|
||||
#define SEQUENCE 428
|
||||
#define SETOF 429
|
||||
#define SHOW 430
|
||||
#define START 431
|
||||
#define STATEMENT 432
|
||||
#define STDIN 433
|
||||
#define STDOUT 434
|
||||
#define TRUSTED 435
|
||||
#define VACUUM 436
|
||||
#define VERBOSE 437
|
||||
#define VERSION 438
|
||||
#define ARCHIVE 439
|
||||
#define PASSWORD 440
|
||||
#define CREATEDB 441
|
||||
#define NOCREATEDB 442
|
||||
#define CREATEUSER 443
|
||||
#define NOCREATEUSER 444
|
||||
#define VALID 445
|
||||
#define UNTIL 446
|
||||
#define IDENT 447
|
||||
#define SCONST 448
|
||||
#define Op 449
|
||||
#define ICONST 450
|
||||
#define PARAM 451
|
||||
#define FCONST 452
|
||||
#define OP 453
|
||||
#define UMINUS 454
|
||||
#define TYPECAST 455
|
||||
#define REDUCE 456
|
||||
#define NAMES 327
|
||||
#define NATIONAL 328
|
||||
#define NATURAL 329
|
||||
#define NCHAR 330
|
||||
#define NO 331
|
||||
#define NOT 332
|
||||
#define NOTIFY 333
|
||||
#define NULL_P 334
|
||||
#define NUMERIC 335
|
||||
#define ON 336
|
||||
#define OPTION 337
|
||||
#define OR 338
|
||||
#define ORDER 339
|
||||
#define OUTER_P 340
|
||||
#define PARTIAL 341
|
||||
#define POSITION 342
|
||||
#define PRECISION 343
|
||||
#define PRIMARY 344
|
||||
#define PRIVILEGES 345
|
||||
#define PROCEDURE 346
|
||||
#define PUBLIC 347
|
||||
#define REFERENCES 348
|
||||
#define REVOKE 349
|
||||
#define RIGHT 350
|
||||
#define ROLLBACK 351
|
||||
#define SECOND_P 352
|
||||
#define SELECT 353
|
||||
#define SET 354
|
||||
#define SUBSTRING 355
|
||||
#define TABLE 356
|
||||
#define TIME 357
|
||||
#define TIMESTAMP 358
|
||||
#define TIMEZONE_HOUR 359
|
||||
#define TIMEZONE_MINUTE 360
|
||||
#define TO 361
|
||||
#define TRAILING 362
|
||||
#define TRANSACTION 363
|
||||
#define TRIM 364
|
||||
#define UNION 365
|
||||
#define UNIQUE 366
|
||||
#define UPDATE 367
|
||||
#define USER 368
|
||||
#define USING 369
|
||||
#define VALUES 370
|
||||
#define VARCHAR 371
|
||||
#define VARYING 372
|
||||
#define VIEW 373
|
||||
#define WHERE 374
|
||||
#define WITH 375
|
||||
#define WORK 376
|
||||
#define YEAR_P 377
|
||||
#define ZONE 378
|
||||
#define FALSE_P 379
|
||||
#define TRIGGER 380
|
||||
#define TRUE_P 381
|
||||
#define TYPE_P 382
|
||||
#define ABORT_TRANS 383
|
||||
#define AFTER 384
|
||||
#define AGGREGATE 385
|
||||
#define ANALYZE 386
|
||||
#define BACKWARD 387
|
||||
#define BEFORE 388
|
||||
#define BINARY 389
|
||||
#define CACHE 390
|
||||
#define CLUSTER 391
|
||||
#define COPY 392
|
||||
#define CYCLE 393
|
||||
#define DATABASE 394
|
||||
#define DELIMITERS 395
|
||||
#define DO 396
|
||||
#define EACH 397
|
||||
#define EXPLAIN 398
|
||||
#define EXTEND 399
|
||||
#define FORWARD 400
|
||||
#define FUNCTION 401
|
||||
#define HANDLER 402
|
||||
#define INCREMENT 403
|
||||
#define INDEX 404
|
||||
#define INHERITS 405
|
||||
#define INSTEAD 406
|
||||
#define ISNULL 407
|
||||
#define LANCOMPILER 408
|
||||
#define LISTEN 409
|
||||
#define LOAD 410
|
||||
#define LOCK_P 411
|
||||
#define LOCATION 412
|
||||
#define MAXVALUE 413
|
||||
#define MINVALUE 414
|
||||
#define MOVE 415
|
||||
#define NEW 416
|
||||
#define NONE 417
|
||||
#define NOTHING 418
|
||||
#define NOTNULL 419
|
||||
#define OIDS 420
|
||||
#define OPERATOR 421
|
||||
#define PROCEDURAL 422
|
||||
#define RECIPE 423
|
||||
#define RENAME 424
|
||||
#define RESET 425
|
||||
#define RETURNS 426
|
||||
#define ROW 427
|
||||
#define RULE 428
|
||||
#define SEQUENCE 429
|
||||
#define SETOF 430
|
||||
#define SHOW 431
|
||||
#define START 432
|
||||
#define STATEMENT 433
|
||||
#define STDIN 434
|
||||
#define STDOUT 435
|
||||
#define TRUSTED 436
|
||||
#define VACUUM 437
|
||||
#define VERBOSE 438
|
||||
#define VERSION 439
|
||||
#define ENCODING 440
|
||||
#define ARCHIVE 441
|
||||
#define PASSWORD 442
|
||||
#define CREATEDB 443
|
||||
#define NOCREATEDB 444
|
||||
#define CREATEUSER 445
|
||||
#define NOCREATEUSER 446
|
||||
#define VALID 447
|
||||
#define UNTIL 448
|
||||
#define IDENT 449
|
||||
#define SCONST 450
|
||||
#define Op 451
|
||||
#define ICONST 452
|
||||
#define PARAM 453
|
||||
#define FCONST 454
|
||||
#define OP 455
|
||||
#define UMINUS 456
|
||||
#define TYPECAST 457
|
||||
|
||||
|
||||
extern YYSTYPE yylval;
|
||||
|
||||
Reference in New Issue
Block a user