Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
4e5a947d
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4e5a947d
编写于
11月 13, 2002
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make MOVE/FETCH 0 actually move/fetch 0. Add MOVE LAST to move to end
of cursor.
上级
9b12ab6d
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
36 addition
and
21 deletion
+36
-21
doc/src/sgml/ref/move.sgml
doc/src/sgml/ref/move.sgml
+6
-4
src/backend/commands/portalcmds.c
src/backend/commands/portalcmds.c
+12
-2
src/backend/executor/execMain.c
src/backend/executor/execMain.c
+3
-2
src/backend/parser/gram.y
src/backend/parser/gram.y
+7
-5
src/backend/parser/keywords.c
src/backend/parser/keywords.c
+2
-1
src/backend/tcop/utility.c
src/backend/tcop/utility.c
+2
-3
src/include/commands/portalcmds.h
src/include/commands/portalcmds.h
+2
-2
src/include/nodes/parsenodes.h
src/include/nodes/parsenodes.h
+2
-2
未找到文件。
doc/src/sgml/ref/move.sgml
浏览文件 @
4e5a947d
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/move.sgml,v 1.1
3 2002/04/21 19:02:39 thomas
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/move.sgml,v 1.1
4 2002/11/13 00:44:08 momjian
Exp $
PostgreSQL documentation
-->
...
...
@@ -21,7 +21,8 @@ PostgreSQL documentation
<date>1999-07-20</date>
</refsynopsisdivinfo>
<synopsis>
MOVE [ <replaceable class="PARAMETER">direction</replaceable> ] [ <replaceable class="PARAMETER">count</replaceable> ]
MOVE [ <replaceable class="PARAMETER">direction</replaceable> ]
{<replaceable class="PARAMETER">count</replaceable> | LAST }
{ IN | FROM } <replaceable class="PARAMETER">cursor</replaceable>
</synopsis>
</refsynopsisdiv>
...
...
@@ -37,8 +38,9 @@ MOVE [ <replaceable class="PARAMETER">direction</replaceable> ] [ <replaceable c
<command>MOVE</command> allows a user to move cursor position a specified
number of rows.
<command>MOVE</command> works like the <command>FETCH</command> command,
but only positions the cursor and does
not return rows.
but only positions the cursor and does not return rows.
<replaceable class="PARAMETER">LAST</replaceable> moves to the end
of the cursor.
</para>
<para>
Refer to
...
...
src/backend/commands/portalcmds.c
浏览文件 @
4e5a947d
...
...
@@ -8,13 +8,15 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.
3 2002/09/04 20:31:15
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.
4 2002/11/13 00:44:08
momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <limits.h>
#include "commands/portalcmds.h"
#include "executor/executor.h"
...
...
@@ -55,7 +57,7 @@ PortalCleanup(Portal portal)
*
* name: name of portal
* forward: forward or backward fetch?
* count: # of tuples to fetch
(0 implies all)
* count: # of tuples to fetch
* dest: where to send results
* completionTag: points to a buffer of size COMPLETION_TAG_BUFSIZE
* in which to store a command completion status string.
...
...
@@ -100,6 +102,14 @@ PerformPortalFetch(char *name,
return
;
}
/* If zero count, we are done */
if
(
count
==
0
)
return
;
/* Internally, zero count processes all portal rows */
if
(
count
==
INT_MAX
)
count
=
0
;
/*
* switch into the portal context
*/
...
...
src/backend/executor/execMain.c
浏览文件 @
4e5a947d
...
...
@@ -27,7 +27,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.18
5 2002/11/13 00:39:46
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.18
6 2002/11/13 00:44:08
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1116,7 +1116,8 @@ lnext: ;
/*
* check our tuple count.. if we've processed the proper number
* then quit, else loop again and process more tuples..
* then quit, else loop again and process more tuples. Zero
* number_tuples means no limit.
*/
current_tuple_count
++
;
if
(
numberTuples
==
current_tuple_count
)
...
...
src/backend/parser/gram.y
浏览文件 @
4e5a947d
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.37
6 2002/11/11 22:19:23 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.37
7 2002/11/13 00:44:08 momjian
Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -49,6 +49,7 @@
#include "postgres.h"
#include <ctype.h>
#include <limits.h>
#include "access/htup.h"
#include "catalog/index.h"
...
...
@@ -358,7 +359,7 @@ static void doNegateFloat(Value *v);
KEY
LANCOMPILER LANGUAGE LEADING LEFT LEVEL LIKE LIMIT
LANCOMPILER LANGUAGE L
AST L
EADING LEFT LEVEL LIKE LIMIT
LISTEN LOAD LOCAL LOCALTIME LOCALTIMESTAMP LOCATION
LOCK_P
...
...
@@ -2661,7 +2662,7 @@ FetchStmt: FETCH direction fetch_how_many from_in name
if ($3 < 0)
{
$3 = -$3;
$2 = (($2 == FORWARD)? BACKWARD: FORWARD);
$2 = (($2 == FORWARD)
? BACKWARD: FORWARD);
}
n->direction = $2;
n->howMany = $3;
...
...
@@ -2729,8 +2730,8 @@ direction: FORWARD { $$ = FORWARD; }
fetch_how_many:
Iconst { $$ = $1; }
| '-' Iconst { $$ = - $2; }
/* 0 means fetch all tuples*/
|
ALL { $$ = 0
; }
| ALL { $$ = INT_MAX; }
|
LAST { $$ = INT_MAX
; }
| NEXT { $$ = 1; }
| PRIOR { $$ = -1; }
;
...
...
@@ -7060,6 +7061,7 @@ unreserved_keyword:
| KEY
| LANGUAGE
| LANCOMPILER
| LAST
| LEVEL
| LISTEN
| LOAD
...
...
src/backend/parser/keywords.c
浏览文件 @
4e5a947d
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.1
29 2002/11/11 22:19:23 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.1
30 2002/11/13 00:44:09 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -172,6 +172,7 @@ static const ScanKeyword ScanKeywords[] = {
{
"key"
,
KEY
},
{
"lancompiler"
,
LANCOMPILER
},
{
"language"
,
LANGUAGE
},
{
"last"
,
LAST
},
{
"leading"
,
LEADING
},
{
"left"
,
LEFT
},
{
"level"
,
LEVEL
},
...
...
src/backend/tcop/utility.c
浏览文件 @
4e5a947d
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.18
0 2002/10/21 20:31:52
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.18
1 2002/11/13 00:44:09
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -262,9 +262,8 @@ ProcessUtility(Node *parsetree,
forward
=
(
bool
)
(
stmt
->
direction
==
FORWARD
);
/*
* parser ensures that count is >= 0
and 'fetch ALL' -> 0
* parser ensures that count is >= 0
*/
count
=
stmt
->
howMany
;
PerformPortalFetch
(
portalName
,
forward
,
count
,
(
stmt
->
ismove
)
?
None
:
dest
,
...
...
src/include/commands/portalcmds.h
浏览文件 @
4e5a947d
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: portalcmds.h,v 1.
2 2002/09/04 20:31:42
momjian Exp $
* $Id: portalcmds.h,v 1.
3 2002/11/13 00:44:09
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -18,7 +18,7 @@
/*
* PerformPortalFetch
* Performs the POSTQUEL function FETCH. Fetches count
(or all if 0)
* Performs the POSTQUEL function FETCH. Fetches count
* tuples in portal with name in the forward direction iff goForward.
*
* Exceptions:
...
...
src/include/nodes/parsenodes.h
浏览文件 @
4e5a947d
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.21
2 2002/11/11 22:19:24 tgl
Exp $
* $Id: parsenodes.h,v 1.21
3 2002/11/13 00:44:09 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1277,7 +1277,7 @@ typedef struct FetchStmt
{
NodeTag
type
;
int
direction
;
/* FORWARD or BACKWARD */
int
howMany
;
/* amount to fetch
("ALL" --> 0)
*/
int
howMany
;
/* amount to fetch */
char
*
portalname
;
/* name of portal (cursor) */
bool
ismove
;
/* TRUE if MOVE */
}
FetchStmt
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录