Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita7b06f2

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parent9649229 commita7b06f2

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>ViewStmtLoadStmtCreatedbStmtopt_database1opt_database2location
815815
%type<str>DestroydbStmtClusterStmtgranteeRevokeStmtencoding
816816
%type<str>GrantStmtprivilegesoperation_commalistoperation
817-
%type<str>cursor_clauseopt_cursoropt_readonlyopt_ofopt_lmode
817+
%type<str>opt_cursoropt_lmode
818818
%type<str>case_exprwhen_clause_listcase_defaultcase_argwhen_clause
819819
%type<str>select_clauseopt_select_limitselect_limit_value
820820
%type<str>select_offset_valuetable_listusing_exprjoin_expr
@@ -2724,7 +2724,9 @@ UpdateStmt: UPDATE relation_name
27242724
*CURSOR STATEMENTS
27252725
*
27262726
*****************************************************************************/
2727-
CursorStmt:DECLAREnameopt_cursorCURSORFORSelectStmtcursor_clause
2727+
CursorStmt:DECLAREnameopt_cursorCURSORFOR
2728+
{ ForUpdateNotAllowed =1; }
2729+
SelectStmt
27282730
{
27292731
structcursor *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:FORopt_readonly{$$ = cat2_str(make1_str("for"),$2); }
2766-
|/*EMPTY*/ {$$ = make1_str(""); }
2767-
2768-
;
2769-
2770-
opt_readonly:READONLY{$$ = make1_str("read only"); }
2771-
|UPDATEopt_of
2772-
{
2773-
yyerror("DECLARE/UPDATE not supported; Cursors must be READ ONLY.");
2774-
}
2775-
;
2776-
2777-
opt_of:OFcolumnList {$$ = 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_clausesort_clausefor_update_clauseopt_select_limit
27942782
{
27952783
if (strlen($3) >0 && ForUpdateNotAllowed !=0)
2796-
yyerror("SELECTFOR 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+
|FORREADONLY
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
elseif (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:DECLAREnameopt_cursorCURSORFORidentcursor_clause
4712+
ECPGCursorStmt:DECLAREnameopt_cursorCURSORFORident
47254713
{
47264714
structcursor *ptr, *this;
47274715
structvariable *thisquery = (structvariable *)mm_alloc(sizeof(structvariable));
@@ -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)

[8]ページ先頭

©2009-2025 Movatter.jp