Skip to content

Commit a7b06f2

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parent 9649229 commit a7b06f2

File tree

2 files changed

+17
-25
lines changed

2 files changed

+17
-25
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,5 +582,9 @@ Thu May 13 13:51:26 CEST 1999
582582
Mon May 17 18:13:30 CEST 1999
583583

584584
- Synced preproc.y with gram.y.
585+
586+
Fri May 21 18:13:44 CEST 1999
587+
588+
- Synced preproc.y with gram.y.
585589
- Set library version to 3.0.0
586590
- Set ecpg version to 2.6.0

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ adjust_array(enum ECPGttype type_enum, int *dimension, int *length, int type_dim
814814
%type <str> ViewStmt LoadStmt CreatedbStmt opt_database1 opt_database2 location
815815
%type <str> DestroydbStmt ClusterStmt grantee RevokeStmt encoding
816816
%type <str> GrantStmt privileges operation_commalist operation
817-
%type <str> cursor_clause opt_cursor opt_readonly opt_of opt_lmode
817+
%type <str> opt_cursor opt_lmode
818818
%type <str> case_expr when_clause_list case_default case_arg when_clause
819819
%type <str> select_clause opt_select_limit select_limit_value
820820
%type <str> select_offset_value table_list using_expr join_expr
@@ -2724,7 +2724,9 @@ UpdateStmt: UPDATE relation_name
27242724
* CURSOR STATEMENTS
27252725
*
27262726
*****************************************************************************/
2727-
CursorStmt: DECLARE name opt_cursor CURSOR FOR SelectStmt cursor_clause
2727+
CursorStmt: DECLARE name opt_cursor CURSOR FOR
2728+
{ ForUpdateNotAllowed = 1; }
2729+
SelectStmt
27282730
{
27292731
struct cursor *ptr, *this;
27302732

@@ -2744,7 +2746,7 @@ CursorStmt: DECLARE name opt_cursor CURSOR FOR SelectStmt cursor_clause
27442746
this->next = cur;
27452747
this->name = $2;
27462748
this->connection = connection;
2747-
this->command = cat2_str(cat5_str(make1_str("declare"), mm_strdup($2), $3, make1_str("cursor for"), $6), $7);
2749+
this->command = cat5_str(make1_str("declare"), mm_strdup($2), $3, make1_str("cursor for"), $7);
27482750
this->argsinsert = argsinsert;
27492751
this->argsresult = argsresult;
27502752
argsinsert = argsresult = NULL;
@@ -2762,20 +2764,6 @@ opt_cursor: BINARY { $$ = make1_str("binary"); }
27622764
| /*EMPTY*/ { $$ = make1_str(""); }
27632765
;
27642766

2765-
cursor_clause: FOR opt_readonly { $$ = cat2_str(make1_str("for"), $2); }
2766-
| /*EMPTY*/ { $$ = make1_str(""); }
2767-
2768-
;
2769-
2770-
opt_readonly: READ ONLY { $$ = make1_str("read only"); }
2771-
| UPDATE opt_of
2772-
{
2773-
yyerror("DECLARE/UPDATE not supported; Cursors must be READ ONLY.");
2774-
}
2775-
;
2776-
2777-
opt_of: OF columnList { $$ = make2_str(make1_str("of"), $2); }
2778-
27792767
/*****************************************************************************
27802768
*
27812769
* QUERY:
@@ -2793,7 +2781,7 @@ opt_of: OF columnList { $$ = make2_str(make1_str("of"), $2); }
27932781
SelectStmt: select_clause sort_clause for_update_clause opt_select_limit
27942782
{
27952783
if (strlen($3) > 0 && ForUpdateNotAllowed != 0)
2796-
yyerror("SELECT FOR UPDATE is not allowed in this context");
2784+
yyerror("FOR UPDATE is not allowed in this context");
27972785

27982786
ForUpdateNotAllowed = 0;
27992787
$$ = cat4_str($1, $2, $3, $4);
@@ -2941,6 +2929,10 @@ for_update_clause: FOR UPDATE update_list
29412929
{
29422930
$$ = make1_str("for update");
29432931
}
2932+
| FOR READ ONLY
2933+
{
2934+
$$ = make1_str("for read only");
2935+
}
29442936
| /* EMPTY */
29452937
{
29462938
$$ = make1_str("");
@@ -3356,11 +3348,7 @@ Character: character '(' Iconst ')'
33563348
yyerror(errortext);
33573349
}
33583350
else if (atol($3) > BLCKSZ - 128) {
3359-
/* we can store a char() of length up to the size
3360-
* of a page (8KB) - page headers and friends but
3361-
* just to be safe here... - ay 6/95
3362-
*/
3363-
sprintf(errortext, "length for type '%s' cannot exceed %d",BLCKSZ-128);
3351+
sprintf(errortext, "length for type '%s' cannot exceed %d",$1,BLCKSZ - 128);
33643352
yyerror(errortext);
33653353
}
33663354

@@ -4721,7 +4709,7 @@ opt_options: Op ColId
47214709
* Declare a prepared cursor. The syntax is different from the standard
47224710
* declare statement, so we create a new rule.
47234711
*/
4724-
ECPGCursorStmt: DECLARE name opt_cursor CURSOR FOR ident cursor_clause
4712+
ECPGCursorStmt: DECLARE name opt_cursor CURSOR FOR ident
47254713
{
47264714
struct cursor *ptr, *this;
47274715
struct variable *thisquery = (struct variable *)mm_alloc(sizeof(struct variable));
@@ -4742,7 +4730,7 @@ ECPGCursorStmt: DECLARE name opt_cursor CURSOR FOR ident cursor_clause
47424730
this->next = cur;
47434731
this->name = $2;
47444732
this->connection = connection;
4745-
this->command = cat5_str(make1_str("declare"), mm_strdup($2), $3, make1_str("cursor for ?"), $7);
4733+
this->command = cat4_str(make1_str("declare"), mm_strdup($2), $3, make1_str("cursor for ?"));
47464734
this->argsresult = NULL;
47474735

47484736
thisquery->type = &ecpg_query;

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