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

Commit80c5fea

Browse files
committed
Since this patch is not big I send it here instead. I do not have the
complete source checked out so I cannot commit it myself.Michael
1 parent0cb6bc7 commit80c5fea

File tree

1 file changed

+102
-12
lines changed

1 file changed

+102
-12
lines changed

‎src/backend/parser/gram.y

Lines changed: 102 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.129 2000/01/1806:12:03 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.130 2000/01/1819:08:13 momjian Exp $
1414
*
1515
* HISTORY
1616
* AUTHORDATEMAJOR EVENT
@@ -156,7 +156,7 @@ static Node *doNegate(Node *n);
156156
database_name,access_method_clause,access_method,attr_name,
157157
class,index_name,name,func_name,file_name,aggr_argtype
158158

159-
%type<str>opt_id,opt_portal_name,
159+
%type<str>opt_id,
160160
all_Op,MathOp,opt_name,opt_unique,
161161
OptUseOp,opt_class,SpecialRuleRelation
162162

@@ -199,7 +199,7 @@ static Node *doNegate(Node *n);
199199
opt_with_copy,index_opt_unique,opt_verbose,opt_analyze
200200
%type<boolean>opt_cursor
201201

202-
%type<ival>copy_dirn,def_type,opt_direction,remove_type,
202+
%type<ival>copy_dirn,def_type,direction,remove_type,
203203
opt_column,event,comment_type,comment_cl,
204204
comment_ag,comment_fn,comment_op,comment_tg
205205

@@ -1861,7 +1861,7 @@ comment_text:Sconst { $$ = $1; }
18611861
*
18621862
*****************************************************************************/
18631863

1864-
FetchStmt:FETCHopt_directionfetch_how_manyopt_portal_name
1864+
FetchStmt:FETCHdirectionfetch_how_manyfrom_inname
18651865
{
18661866
FetchStmt *n = makeNode(FetchStmt);
18671867
if ($2 == RELATIVE)
@@ -1877,11 +1877,60 @@ FetchStmt:FETCH opt_direction fetch_how_many opt_portal_name
18771877
}
18781878
n->direction =$2;
18791879
n->howMany =$3;
1880+
n->portalname =$5;
1881+
n->ismove =false;
1882+
$$ = (Node *)n;
1883+
}
1884+
|FETCHfetch_how_manyfrom_inname
1885+
{
1886+
FetchStmt *n = makeNode(FetchStmt);
1887+
if ($2 <0)
1888+
{
1889+
n->howMany = -$2;
1890+
n->direction = BACKWARD;
1891+
}
1892+
else
1893+
{
1894+
n->direction = FORWARD;
1895+
n->howMany =$2;
1896+
}
1897+
n->portalname =$4;
1898+
n->ismove =false;
1899+
$$ = (Node *)n;
1900+
}
1901+
|FETCHdirectionfrom_inname
1902+
{
1903+
FetchStmt *n = makeNode(FetchStmt);
1904+
if ($2 == RELATIVE)
1905+
{
1906+
$2 = FORWARD;
1907+
}
1908+
n->direction =$2;
1909+
n->howMany =1;
18801910
n->portalname =$4;
18811911
n->ismove =false;
18821912
$$ = (Node *)n;
18831913
}
1884-
|MOVEopt_directionfetch_how_manyopt_portal_name
1914+
|FETCHfrom_inname
1915+
{
1916+
FetchStmt *n = makeNode(FetchStmt);
1917+
n->direction = FORWARD;
1918+
n->howMany =1;
1919+
n->portalname =$3;
1920+
n->ismove =false;
1921+
$$ = (Node *)n;
1922+
}
1923+
|FETCHname
1924+
{
1925+
FetchStmt *n = makeNode(FetchStmt);
1926+
n->direction = FORWARD;
1927+
n->howMany =1;
1928+
n->portalname =$2;
1929+
n->ismove =false;
1930+
$$ = (Node *)n;
1931+
}
1932+
1933+
|MOVEdirectionfetch_how_manyfrom_inname
18851934
{
18861935
FetchStmt *n = makeNode(FetchStmt);
18871936
if ($3 <0)
@@ -1891,35 +1940,76 @@ FetchStmt:FETCH opt_direction fetch_how_many opt_portal_name
18911940
}
18921941
n->direction =$2;
18931942
n->howMany =$3;
1943+
n->portalname =$5;
1944+
n->ismove =TRUE;
1945+
$$ = (Node *)n;
1946+
}
1947+
|MOVEfetch_how_manyfrom_inname
1948+
{
1949+
FetchStmt *n = makeNode(FetchStmt);
1950+
if ($2 <0)
1951+
{
1952+
n->howMany = -$2;
1953+
n->direction = BACKWARD;
1954+
}
1955+
else
1956+
{
1957+
n->direction = FORWARD;
1958+
n->howMany =$2;
1959+
}
18941960
n->portalname =$4;
18951961
n->ismove =TRUE;
18961962
$$ = (Node *)n;
18971963
}
1964+
|MOVEdirectionfrom_inname
1965+
{
1966+
FetchStmt *n = makeNode(FetchStmt);
1967+
n->direction =$2;
1968+
n->howMany =1;
1969+
n->portalname =$4;
1970+
n->ismove =TRUE;
1971+
$$ = (Node *)n;
1972+
}
1973+
|MOVEfrom_inname
1974+
{
1975+
FetchStmt *n = makeNode(FetchStmt);
1976+
n->direction = FORWARD;
1977+
n->howMany =1;
1978+
n->portalname =$3;
1979+
n->ismove =TRUE;
1980+
$$ = (Node *)n;
1981+
}
1982+
|MOVEname
1983+
{
1984+
FetchStmt *n = makeNode(FetchStmt);
1985+
n->direction = FORWARD;
1986+
n->howMany =1;
1987+
n->portalname =$2;
1988+
n->ismove =TRUE;
1989+
$$ = (Node *)n;
1990+
}
18981991
;
18991992

1900-
opt_direction:FORWARD{$$ = FORWARD; }
1993+
direction:FORWARD{$$ = FORWARD; }
19011994
|BACKWARD{$$ = BACKWARD; }
19021995
|RELATIVE{$$ = RELATIVE; }
19031996
|ABSOLUTE
19041997
{
19051998
elog(NOTICE,"FETCH/ABSOLUTE not supported, using RELATIVE");
19061999
$$ = RELATIVE;
19072000
}
1908-
|/*EMPTY*/{$$ = FORWARD;/* default*/ }
19092001
;
19102002

19112003
fetch_how_many:Iconst{$$ =$1; }
19122004
|'-'Iconst{$$ = -$2; }
19132005
|ALL{$$ =0;/* 0 means fetch all tuples*/ }
19142006
|NEXT{$$ =1; }
19152007
|PRIOR{$$ = -1; }
1916-
|/*EMPTY*/{$$ =1;/*default*/ }
19172008
;
19182009

1919-
opt_portal_name:INname{$$ =$2; }
1920-
|FROMname{$$ =$2; }
1921-
|/*EMPTY*/{$$ =NULL; }
1922-
;
2010+
from_in:IN
2011+
|FROM
2012+
;
19232013

19242014

19252015
/*****************************************************************************

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp