Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
5a447b4a
Commit
5a447b4a
authored
Sep 29, 1997
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MOVE implementation.
parent
4b9fb266
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
49 deletions
+29
-49
src/backend/commands/command.c
src/backend/commands/command.c
+7
-5
src/backend/parser/gram.y
src/backend/parser/gram.y
+18
-41
src/backend/tcop/utility.c
src/backend/tcop/utility.c
+4
-3
No files found.
src/backend/commands/command.c
View file @
5a447b4a
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.1
8 1997/09/20 16:14:05 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.1
9 1997/09/29 05:56:10 vadim
Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
...
...
@@ -99,7 +99,7 @@ PerformPortalFetch(char *name,
{
Portal
portal
;
int
feature
;
QueryDesc
*
queryDesc
;
QueryDesc
queryDesc
;
MemoryContext
context
;
/* ----------------
...
...
@@ -147,9 +147,11 @@ PerformPortalFetch(char *name,
* tell the destination to prepare to recieve some tuples
* ----------------
*/
queryDesc
=
PortalGetQueryDesc
(
portal
);
memcpy
(
&
queryDesc
,
PortalGetQueryDesc
(
portal
),
sizeof
(
queryDesc
));
queryDesc
.
dest
=
dest
;
BeginCommand
(
name
,
queryDesc
->
operation
,
queryDesc
.
operation
,
portal
->
attinfo
,
/* QueryDescGetTypeInfo(queryDesc),
* */
false
,
/* portal fetches don't end up in
...
...
@@ -166,7 +168,7 @@ PerformPortalFetch(char *name,
PortalExecutorHeapMemory
=
(
MemoryContext
)
PortalGetHeapMemory
(
portal
);
ExecutorRun
(
queryDesc
,
PortalGetState
(
portal
),
feature
,
count
);
ExecutorRun
(
&
queryDesc
,
PortalGetState
(
portal
),
feature
,
count
);
/* ----------------
* Note: the "end-of-command" tag is returned by higher-level
...
...
src/backend/parser/gram.y
View file @
5a447b4a
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.5
2 1997/09/26 15:09:11 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.5
3 1997/09/29 05:58:12 vadim
Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -107,7 +107,7 @@ static char *FlattenStringList(List *list);
AddAttrStmt, ClosePortalStmt,
CopyStmt, CreateStmt, CreateSeqStmt, DefineStmt, DestroyStmt,
ExtendStmt, FetchStmt, GrantStmt, CreateTrigStmt, DropTrigStmt,
IndexStmt,
MoveStmt,
ListenStmt, OptimizableStmt,
IndexStmt, ListenStmt, OptimizableStmt,
ProcedureStmt, PurgeStmt,
RecipeStmt, RemoveAggrStmt, RemoveOperStmt, RemoveFuncStmt, RemoveStmt,
RenameStmt, RevokeStmt, RuleStmt, TransactionStmt, ViewStmt, LoadStmt,
...
...
@@ -162,7 +162,7 @@ static char *FlattenStringList(List *list);
%type <ival> copy_dirn, archive_type, OptArchiveType, OptArchiveLocation,
def_type, opt_direction, remove_type, opt_column, event
%type <ival> OptLocation,
opt_move_where,
fetch_how_many
%type <ival> OptLocation, fetch_how_many
%type <list> OptSeqList
%type <defelt> OptSeqElem
...
...
@@ -299,7 +299,6 @@ stmt : AddAttrStmt
| FetchStmt
| GrantStmt
| IndexStmt
| MoveStmt
| ListenStmt
| ProcedureStmt
| PurgeStmt
...
...
@@ -995,7 +994,7 @@ DestroyStmt: DROP TABLE relation_name_list
/*****************************************************************************
*
* QUERY:
*
fetch
[forward | backward] [number | all ] [ in <portalname> ]
*
fetch/move
[forward | backward] [number | all ] [ in <portalname> ]
*
*****************************************************************************/
...
...
@@ -1005,6 +1004,16 @@ FetchStmt: FETCH opt_direction fetch_how_many opt_portal_name
n->direction = $2;
n->howMany = $3;
n->portalname = $4;
n->ismove = false;
$$ = (Node *)n;
}
| MOVE opt_direction fetch_how_many opt_portal_name
{
FetchStmt *n = makeNode(FetchStmt);
n->direction = $2;
n->howMany = $3;
n->portalname = $4;
n->ismove = true;
$$ = (Node *)n;
}
;
...
...
@@ -1021,6 +1030,10 @@ fetch_how_many: Iconst
| /*EMPTY*/ { $$ = 1; /*default*/ }
;
opt_portal_name: IN name { $$ = $2;}
| /*EMPTY*/ { $$ = NULL; }
;
/*****************************************************************************
*
* QUERY:
...
...
@@ -1119,42 +1132,6 @@ RevokeStmt: REVOKE privileges ON relation_name_list FROM grantee
}
;
/*****************************************************************************
*
* QUERY:
* move [<dirn>] [<whereto>] [<portalname>]
*
*****************************************************************************/
MoveStmt: MOVE opt_direction opt_move_where opt_portal_name
{
MoveStmt *n = makeNode(MoveStmt);
n->direction = $2;
n->to = FALSE;
n->where = $3;
n->portalname = $4;
$$ = (Node *)n;
}
| MOVE opt_direction TO Iconst opt_portal_name
{
MoveStmt *n = makeNode(MoveStmt);
n->direction = $2;
n->to = TRUE;
n->where = $4;
n->portalname = $5;
$$ = (Node *)n;
}
;
opt_move_where: Iconst { $$ = $1; }
| /*EMPTY*/ { $$ = 1; /* default */ }
;
opt_portal_name: IN name { $$ = $2;}
| /*EMPTY*/ { $$ = NULL; }
;
/*****************************************************************************
*
* QUERY:
...
...
src/backend/tcop/utility.c
View file @
5a447b4a
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.2
4 1997/09/08 21:47:58 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.2
5 1997/09/29 05:59:16 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -139,7 +139,7 @@ ProcessUtility(Node *parsetree,
bool
forward
;
int
count
;
commandTag
=
"FETCH"
;
commandTag
=
(
stmt
->
ismove
)
?
"MOVE"
:
"FETCH"
;
CHECK_IF_ABORTED
();
forward
=
(
bool
)
(
stmt
->
direction
==
FORWARD
);
...
...
@@ -149,7 +149,8 @@ ProcessUtility(Node *parsetree,
*/
count
=
stmt
->
howMany
;
PerformPortalFetch
(
portalName
,
forward
,
count
,
commandTag
,
dest
);
PerformPortalFetch
(
portalName
,
forward
,
count
,
commandTag
,
(
stmt
->
ismove
)
?
None
:
dest
);
/* /dev/null for MOVE */
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment