1
- /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.190.2.6 2002/09/11 08:50:29 meskes Exp $ */
1
+ /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.190.2.7 2002/09/20 06:19:07 meskes Exp $ */
2
2
3
3
/* Copyright comment */
4
4
%{
@@ -203,7 +203,7 @@ make_name(void)
203
203
GET GLOBAL GRANT GROUP_P
204
204
HANDLER HAVING HOUR_P
205
205
206
- ILIKE IMMEDIATE IMMUTABLE IN_P INCREMENT INDEX INHERITS
206
+ ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IN_P INCREMENT INDEX INHERITS
207
207
INITIALLY INNER_P INOUT INPUT INSENSITIVE INSERT INSTEAD INT
208
208
INTEGER INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION
209
209
@@ -289,8 +289,8 @@ make_name(void)
289
289
%type <str> comment_text ConstraintDeferrabilitySpec TableElementList
290
290
%type <str> key_match ColLabel SpecialRuleRelation ColId columnDef
291
291
%type <str> ColConstraint ColConstraintElem drop_type Bconst
292
- %type <str> TableConstraint OptTableElementList Xconst prep_type_clause
293
- %type <str> ConstraintElem key_actions ColQualList type_name PrepareStmt
292
+ %type <str> TableConstraint OptTableElementList Xconst
293
+ %type <str> ConstraintElem key_actions ColQualList type_name
294
294
%type <str> target_list target_el update_target_list alias_clause
295
295
%type <str> update_target_el opt_id qualified_name database_name
296
296
%type <str> access_method attr_name index_name name func_name
@@ -301,7 +301,7 @@ make_name(void)
301
301
%type <str> trim_list in_expr substr_for attrs TableFuncElement
302
302
%type <str> Typename SimpleTypename Numeric opt_float opt_numeric
303
303
%type <str> opt_decimal Character character opt_varying opt_charset
304
- %type <str> opt_collate opt_timezone opt_interval table_ref DeallocateStmt
304
+ %type <str> opt_collate opt_timezone opt_interval table_ref
305
305
%type <str> row_descriptor row_list ConstDatetime trans_options
306
306
%type <str> SelectStmt into_clause OptTemp ConstraintAttributeSpec
307
307
%type <str> opt_table opt_all sort_clause sortby_list ConstraintAttr
@@ -322,7 +322,7 @@ make_name(void)
322
322
%type <str> def_elem def_list definition DefineStmt select_with_parens
323
323
%type <str> opt_instead event RuleActionList opt_using CreateAssertStmt
324
324
%type <str> RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type
325
- %type <str> RuleStmt opt_column opt_name oper_argtypes NumConst ExecuteStmt
325
+ %type <str> RuleStmt opt_column opt_name oper_argtypes NumConst
326
326
%type <str> MathOp RemoveFuncStmt aggr_argtype for_update_clause
327
327
%type <str> RemoveAggrStmt opt_procedural select_no_parens CreateCastStmt
328
328
%type <str> RemoveOperStmt RenameStmt all_Op opt_Trusted opt_lancompiler
@@ -362,13 +362,13 @@ make_name(void)
362
362
%type <str> CreateFunctionStmt createfunc_opt_list func_table
363
363
%type <str> DropUserStmt copy_from copy_opt_list opt_mode copy_opt_item
364
364
%type <str> opt_oids TableLikeClause key_action opt_definition
365
- %type <str> opt_assignment row r_expr qual_Op qual_all_Op opt_default
365
+ %type <str> cast_context row r_expr qual_Op qual_all_Op opt_default
366
366
%type <str> CreateConversionStmt any_operator opclass_item_list
367
- %type <str> iso_level convert_list prep_type_list
367
+ %type <str> iso_level convert_list
368
368
%type <str> convert_args type_list CharacterWithLength ConstCharacter
369
369
%type <str> CharacterWithoutLength BitWithLength BitWithoutLength
370
- %type <str> ConstBit GenericType TableFuncElementList execute_param_clause
371
- %type <str> execute_param_list opt_sort_clause
370
+ %type <str> ConstBit GenericType TableFuncElementList
371
+ %type <str> opt_sort_clause
372
372
373
373
%type <str> ECPGWhenever ECPGConnect connection_target ECPGOpen
374
374
%type <str> indicator ECPGExecute ECPGPrepare opt_ecpg_using ecpg_into
@@ -456,7 +456,7 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); }
456
456
| CreateTrigStmt { output_statement($1 , 0 , connection); }
457
457
| CreateUserStmt { output_statement($1 , 0 , connection); }
458
458
| ClusterStmt { output_statement($1 , 0 , connection); }
459
- | DeallocateStmt { output_statement($1 , 0 , connection); }
459
+ /* | DeallocateStmt { output_statement($1, 0, connection); }*/
460
460
| DefineStmt { output_statement($1 , 0 , connection); }
461
461
| DropStmt { output_statement($1 , 0 , connection); }
462
462
| TruncateStmt { output_statement($1 , 0 , connection); }
@@ -468,16 +468,15 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); }
468
468
| DropTrigStmt { output_statement($1 , 0 , connection); }
469
469
| DropRuleStmt { output_statement($1 , 0 , connection); }
470
470
| DropUserStmt { output_statement($1 , 0 , connection); }
471
- | ExplainStmt { output_statement($1 , 0 , connection); }
472
- | ExecuteStmt { output_statement($1 , 0 , connection); }
471
+ | ExplainStmt { output_statement($1 , 0 , connection); }/* | ExecuteStmt { output_statement($1, 0, connection); }*/
473
472
| FetchStmt { output_statement($1 , 1 , connection); }
474
473
| GrantStmt { output_statement($1 , 0 , connection); }
475
474
| IndexStmt { output_statement($1 , 0 , connection); }
476
475
| ListenStmt { output_statement($1 , 0 , connection); }
477
476
| UnlistenStmt { output_statement($1 , 0 , connection); }
478
477
| LockStmt { output_statement($1 , 0 , connection); }
479
478
| NotifyStmt { output_statement($1 , 0 , connection); }
480
- | PrepareStmt { output_statement($1 , 0 , connection); }
479
+ /* | PrepareStmt { output_statement($1, 0, connection); }*/
481
480
| ReindexStmt { output_statement($1 , 0 , connection); }
482
481
| RemoveAggrStmt { output_statement($1 , 0 , connection); }
483
482
| RemoveOperStmt { output_statement($1 , 0 , connection); }
@@ -671,12 +670,15 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); }
671
670
*
672
671
*****************************************************************************/
673
672
674
- CreateUserStmt : CREATE USER UserId OptUserList
675
- { $$ = cat_str(3 , make_str(" create user" ), $3 , $4 ); }
676
- | CREATE USER UserId WITH OptUserList
673
+ CreateUserStmt : CREATE USER UserId opt_with OptUserList
677
674
{ $$ = cat_str(4 , make_str(" create user" ), $3 , make_str(" with" ), $5 ); }
678
675
;
679
676
677
+ opt_with : WITH { $$ = make_str(" with" ); }
678
+ | /* EMPTY*/ { $$ = EMPTY; }
679
+ ;
680
+
681
+
680
682
/* ****************************************************************************
681
683
*
682
684
* Alter a postgresql DBMS user
@@ -1865,18 +1867,14 @@ opt_class: any_name { $$ = $1; }
1865
1867
;
1866
1868
1867
1869
CreateFunctionStmt : CREATE opt_or_replace FUNCTION func_name func_args
1868
- RETURNS func_return createfunc_opt_list opt_with
1870
+ RETURNS func_return createfunc_opt_list opt_definition
1869
1871
{ $$ = cat_str(8 , make_str(" create" ), $2 , make_str(" function" ), $4 , $5 , make_str(" returns" ), $7 , $8 ); }
1870
1872
;
1871
1873
1872
1874
opt_or_replace : OR REPLACE { $$ = make_str(" or replace" ); }
1873
1875
| /* EMPTY*/ { $$ = EMPTY; }
1874
1876
;
1875
1877
1876
- opt_with : WITH definition { $$ = cat2_str(make_str(" with" ), $2 ); }
1877
- | /* EMPTY*/ { $$ = EMPTY; }
1878
- ;
1879
-
1880
1878
func_args : ' (' func_args_list ' )'
1881
1879
{ $$ = cat_str(3 , make_str(" (" ), $2 , make_str(" )" )); }
1882
1880
| ' (' ' )'
@@ -2019,14 +2017,14 @@ any_operator:
2019
2017
;
2020
2018
2021
2019
CreateCastStmt : CREATE CAST ' (' ConstTypename AS ConstTypename ' )'
2022
- WITH FUNCTION function_with_argtypes opt_assignment opt_definition
2023
- { $$ = cat_str(7 , make_str(" create cast (" ), $4 , make_str(" as" ), $6 , make_str(" ) with function" ), $10 , $11 ); }
2024
- | CREATE CAST ' (' ConstTypename AS ConstTypename ' )'
2025
- WITH FUNCTION opt_assignment
2020
+ WITH FUNCTION function_with_argtypes cast_context
2026
2021
{ $$ = cat_str(6 , make_str(" create cast (" ), $4 , make_str(" as" ), $6 , make_str(" ) with function" ), $10 ); }
2022
+ | CREATE CAST ' (' ConstTypename AS ConstTypename ' )'
2023
+ WITHOUT FUNCTION cast_context
2024
+ { $$ = cat_str(6 , make_str(" create cast (" ), $4 , make_str(" as" ), $6 , make_str(" ) without function" ), $10 ); }
2027
2025
;
2028
2026
2029
- opt_assignment : AS ASSIGNMENT { $$ = make_str(" as assignment" ); }
2027
+ cast_context : AS ASSIGNMENT { $$ = make_str(" as assignment" ); }
2030
2028
| /* EMPTY*/ { $$ = EMPTY; }
2031
2029
;
2032
2030
@@ -2363,54 +2361,38 @@ ExplainStmt: EXPLAIN opt_verbose OptimizableStmt
2363
2361
{ $$ = cat_str(4 , make_str(" explain" ), $2 , $3 , $4 ); }
2364
2362
;
2365
2363
2366
- /* ****************************************************************************
2367
- *
2368
- * QUERY:
2369
- * PREPARE <plan_name> [(args, ...)] AS <query>
2370
- *
2371
- *****************************************************************************/
2364
+ /*
2365
+
2366
+ conflicts with ecpg
2372
2367
2373
2368
PrepareStmt: PREPARE name prep_type_clause AS OptimizableStmt
2374
2369
{ $$ = cat_str(5, make_str("prepare"), $2, $3, make_str("as"), $5); }
2375
2370
;
2376
2371
2377
2372
prep_type_clause: '(' prep_type_list ')' { $$ = cat_str(3, make_str("("), $2, make_str(")")); }
2378
- | /* EMPTY */ { $$ = EMPTY; }
2373
+ | /* EMPTY * / { $$ = EMPTY; }
2379
2374
;
2380
2375
2381
2376
prep_type_list: Typename { $$ = $1; }
2382
2377
| prep_type_list ',' Typename { $$ = cat_str(3, $1, make_str(","), $3); }
2383
2378
;
2384
2379
2385
- /* ****************************************************************************
2386
- *
2387
- * QUERY:
2388
- * EXECUTE <plan_name> [(params, ...)] [INTO ...]
2389
- *
2390
- *****************************************************************************/
2391
-
2392
2380
ExecuteStmt: EXECUTE name execute_param_clause into_clause
2393
2381
{ $$ = cat_str(4, make_str("execute"), $2, $3, $4); }
2394
2382
;
2395
2383
2396
2384
execute_param_clause: '(' execute_param_list ')' { $$ = cat_str(3, make_str("("), $2, make_str(")")); }
2397
- | /* EMPTY */ { $$ = EMPTY; }
2385
+ | /* EMPTY * / { $$ = EMPTY; }
2398
2386
;
2399
2387
2400
2388
execute_param_list: a_expr { $$ = $1; }
2401
2389
| execute_param_list ',' a_expr { $$ = cat_str(3, $1, make_str(","), $3); }
2402
2390
;
2403
-
2404
- /* ****************************************************************************
2405
- *
2406
- * QUERY:
2407
- * DEALLOCATE [PREPARE] <plan_name>
2408
- *
2409
- *****************************************************************************/
2410
2391
2411
2392
DeallocateStmt: DEALLOCATE name { $$ = cat2_str(make_str("deallocate"), $2); }
2412
2393
| DEALLOCATE PREPARE name { $$ = cat2_str(make_str("deallocate prepare"), $3); }
2413
2394
;
2395
+ */
2414
2396
2415
2397
/* ****************************************************************************
2416
2398
* *
@@ -4112,7 +4094,10 @@ ECPGCursorStmt: DECLARE name opt_cursor CURSOR FOR ident
4112
4094
* prepared statement
4113
4095
*/
4114
4096
ECPGDeallocate : DEALLOCATE PREPARE ident
4115
- { $$ = cat_str(3 , make_str(" ECPGdeallocate(__LINE__, \" " ), $3 , make_str(" \" );" )); };
4097
+ { $$ = cat_str(3 , make_str(" ECPGdeallocate(__LINE__, \" " ), $3 , make_str(" \" );" )); }
4098
+ | DEALLOCATE ident
4099
+ { $$ = cat_str(2 , make_str(" ECPGdeallocate(__LINE__, \" " ), $2 , make_str(" \" );" )); }
4100
+ ;
4116
4101
4117
4102
/*
4118
4103
* variable declaration inside the exec sql declare block
@@ -5177,6 +5162,7 @@ unreserved_keyword:
5177
5162
| HOUR_P { $$ = make_str(" hour" ); }
5178
5163
| IMMEDIATE { $$ = make_str(" immediate" ); }
5179
5164
| IMMUTABLE { $$ = make_str(" immutable" ); }
5165
+ | IMPLICIT_P { $$ = make_str(" implicit" ); }
5180
5166
| INCREMENT { $$ = make_str(" increment" ); }
5181
5167
| INDEX { $$ = make_str(" index" ); }
5182
5168
| INHERITS { $$ = make_str(" inherits" ); }
0 commit comments