|
1 | | -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.246 2003/07/09 14:53:18 meskes Exp $*/ |
| 1 | +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.247 2003/07/14 10:16:44 meskes Exp $*/ |
2 | 2 |
|
3 | 3 | /* Copyright comment*/ |
4 | 4 | %{ |
@@ -567,7 +567,28 @@ stmt: AlterDatabaseSetStmt{ output_statement($1, 0, connection); } |
567 | 567 | |AlterUserStmt{ output_statement($1,0, connection); } |
568 | 568 | |AnalyzeStmt{ output_statement($1,0, connection); } |
569 | 569 | |CheckPointStmt{ output_statement($1,0, connection); } |
570 | | -|ClosePortalStmt{ output_statement($1,0, connection); } |
| 570 | +|ClosePortalStmt |
| 571 | +{ |
| 572 | +if (INFORMIX_MODE) |
| 573 | +{ |
| 574 | +/* Informix also has a CLOSE DATABASE command that |
| 575 | + essantially works like a DISCONNECT CURRENT |
| 576 | + as far as I know.*/ |
| 577 | +if (strcasecmp($1+strlen("close"),"database") ==0) |
| 578 | +{ |
| 579 | +if (connection) |
| 580 | +mmerror(PARSE_ERROR, ET_ERROR,"no at option for close database statement.\n"); |
| 581 | + |
| 582 | +fprintf(yyout,"{ ECPGdisconnect(__LINE__,\"CURRENT\");"); |
| 583 | +whenever_action(2); |
| 584 | +free($1); |
| 585 | +} |
| 586 | +else |
| 587 | +output_statement($1,0, connection); |
| 588 | +} |
| 589 | +else |
| 590 | +output_statement($1,0, connection); |
| 591 | +} |
571 | 592 | |ClusterStmt{ output_statement($1,0, connection); } |
572 | 593 | |CommentStmt{ output_statement($1,0, connection); } |
573 | 594 | |ConstraintsSetStmt{ output_statement($1,0, connection); } |
@@ -2596,8 +2617,11 @@ prep_type_list: Typename{ $$ = $1; } |
2596 | 2617 | | prep_type_list ',' Typename{ $$ = cat_str(3, $1, make_str(","), $3); } |
2597 | 2618 | ; |
2598 | 2619 |
|
2599 | | -ExecuteStmt: EXECUTE name execute_param_clause into_clause |
2600 | | -{ $$ = cat_str(4, make_str("execute"), $2, $3, $4); } |
| 2620 | +ExecuteStmt: EXECUTE name execute_param_clause |
| 2621 | +{ $$ = cat_str(3, make_str("execute"), $2, $3); } |
| 2622 | +| CREATE OptTemp TABLE qualified_name OptCreateAs AS EXECUTE name execute_param_clause |
| 2623 | +{ $$ = cat_str(8, make_str("create"), $2, make_str("table"), $4, $5, make_str("as execute"), $8, $9); } |
| 2624 | +
|
2601 | 2625 | ; |
2602 | 2626 |
|
2603 | 2627 | execute_param_clause: '(' expr_list ')'{ $$ = cat_str(3, make_str("("), $2, make_str(")")); } |
@@ -2878,23 +2902,12 @@ opt_select_limit:select_limit{ $$ = $1; } |
2878 | 2902 | |/*EMPTY*/{$$ = EMPTY; } |
2879 | 2903 | ; |
2880 | 2904 |
|
2881 | | -select_limit_value:PosIntConst |
2882 | | -{ |
2883 | | -if (atoi($1) <0) |
2884 | | -mmerror(PARSE_ERROR, ET_ERROR,"LIMIT must not be negative"); |
2885 | | -$$ =$1; |
2886 | | -} |
2887 | | -|ALL{$$ = make_str("all"); } |
2888 | | -|PARAM {$$ = make_name(); } |
| 2905 | +select_limit_value:a_expr {$$ =$1; } |
| 2906 | +|ALL{$$ = make_str("all"); } |
| 2907 | +|PARAM {$$ = make_name(); } |
2889 | 2908 | ; |
2890 | 2909 |
|
2891 | | -select_offset_value:PosIntConst |
2892 | | -{ |
2893 | | -if (atoi($1) <0) |
2894 | | -mmerror(PARSE_ERROR, ET_ERROR,"OFFSET must not be negative"); |
2895 | | -$$ =$1; |
2896 | | -} |
2897 | | -|PARAM {$$ = make_name(); } |
| 2910 | +select_offset_value:a_expr {$$ =$1; } |
2898 | 2911 | ; |
2899 | 2912 |
|
2900 | 2913 | /* |
|