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
c60f70b5
Commit
c60f70b5
authored
Dec 11, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename pg_plan and pg_eval to be more meaningful.
parent
645cc132
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
43 additions
and
40 deletions
+43
-40
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+3
-3
src/backend/catalog/pg_proc.c
src/backend/catalog/pg_proc.c
+2
-2
src/backend/commands/_deadcode/version.c
src/backend/commands/_deadcode/version.c
+3
-3
src/backend/commands/dbcommands.c
src/backend/commands/dbcommands.c
+3
-3
src/backend/commands/user.c
src/backend/commands/user.c
+6
-6
src/backend/executor/functions.c
src/backend/executor/functions.c
+2
-2
src/backend/executor/spi.c
src/backend/executor/spi.c
+1
-1
src/backend/optimizer/path/xfunc.c
src/backend/optimizer/path/xfunc.c
+2
-2
src/backend/rewrite/rewriteDefine.c
src/backend/rewrite/rewriteDefine.c
+2
-2
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+15
-12
src/include/tcop/tcopprot.h
src/include/tcop/tcopprot.h
+4
-4
No files found.
src/backend/catalog/heap.c
View file @
c60f70b5
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.4
0 1997/12/01 21:00:35
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.4
1 1997/12/11 17:35:59
momjian Exp $
*
* INTERFACE ROUTINES
* heap_create() - Create an uncataloged heap relation
...
...
@@ -1510,7 +1510,7 @@ start:;
sprintf
(
str
,
"select %s%s from %.*s"
,
attrdef
->
adsrc
,
cast
,
NAMEDATALEN
,
rel
->
rd_rel
->
relname
.
data
);
setheapoverride
(
true
);
planTree_list
=
(
List
*
)
pg_plan
(
str
,
NULL
,
0
,
&
queryTree_list
,
None
);
planTree_list
=
(
List
*
)
pg_p
arse_and_p
lan
(
str
,
NULL
,
0
,
&
queryTree_list
,
None
);
setheapoverride
(
false
);
query
=
(
Query
*
)
(
queryTree_list
->
qtrees
[
0
]);
...
...
@@ -1580,7 +1580,7 @@ StoreRelCheck(Relation rel, ConstrCheck *check)
sprintf
(
str
,
"select 1 from %.*s where %s"
,
NAMEDATALEN
,
rel
->
rd_rel
->
relname
.
data
,
check
->
ccsrc
);
setheapoverride
(
true
);
planTree_list
=
(
List
*
)
pg_plan
(
str
,
NULL
,
0
,
&
queryTree_list
,
None
);
planTree_list
=
(
List
*
)
pg_p
arse_and_p
lan
(
str
,
NULL
,
0
,
&
queryTree_list
,
None
);
setheapoverride
(
false
);
query
=
(
Query
*
)
(
queryTree_list
->
qtrees
[
0
]);
...
...
src/backend/catalog/pg_proc.c
View file @
c60f70b5
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.1
0 1997/11/25 21:58:48
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.1
1 1997/12/11 17:36:01
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -215,7 +215,7 @@ ProcedureCreate(char *procedureName,
if
(
strcmp
(
languageName
,
"sql"
)
==
0
)
{
plan_list
=
pg_plan
(
prosrc
,
typev
,
parameterCount
,
plan_list
=
pg_p
arse_and_p
lan
(
prosrc
,
typev
,
parameterCount
,
&
querytree_list
,
dest
);
/* typecheck return value */
...
...
src/backend/commands/_deadcode/version.c
View file @
c60f70b5
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.
8 1997/11/25 21:59:11
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.
9 1997/12/11 17:36:08
momjian Exp $
*
* NOTES
* At the point the version is defined, 2 physical relations are created
...
...
@@ -95,7 +95,7 @@ eval_as_new_xact(char *query)
* CommitTransactionCommand(); StartTransactionCommand();
*/
CommandCounterIncrement
();
pg_e
val
(
query
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_e
xec_query
(
query
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
}
#endif
...
...
@@ -157,7 +157,7 @@ VersionCreate(char *vname, char *bname)
sprintf
(
query_buf
,
"SELECT * INTO TABLE %s from %s where 1 =2"
,
vname
,
bname
);
pg_e
val
(
query_buf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_e
xec_query
(
query_buf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
/*
* Creating the ``v_added'' relation
...
...
src/backend/commands/dbcommands.c
View file @
c60f70b5
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.
2 1997/11/24 05:32:18
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.
3 1997/12/11 17:36:04
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -95,7 +95,7 @@ createdb(char *dbname, char *dbpath)
sprintf
(
buf
,
"insert into pg_database (datname, datdba, datpath)"
" values (
\'
%s
\'
,
\'
%d
\'
,
\'
%s
\'
);"
,
dbname
,
user_id
,
loc
);
pg_e
val
(
buf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_e
xec_query
(
buf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
}
void
...
...
@@ -133,7 +133,7 @@ destroydb(char *dbname)
*/
sprintf
(
buf
,
"delete from pg_database where pg_database.oid =
\'
%d
\'
::oid"
,
db_id
);
pg_e
val
(
buf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_e
xec_query
(
buf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
/*
* remove the data directory. If the DELETE above failed, this will
...
...
src/backend/commands/user.c
View file @
c60f70b5
/*-------------------------------------------------------------------------
*
* user.c--
* use pg_e
val
to create a new user in the catalog
* use pg_e
xec_query
to create a new user in the catalog
*
* Copyright (c) 1994, Regents of the University of California
*
...
...
@@ -43,7 +43,7 @@ void UpdatePgPwdFile(char* sql) {
filename
=
crypt_getpwdfilename
();
sprintf
(
sql
,
"copy %s to '%s' using delimiters '#'"
,
UserRelationName
,
filename
);
pg_e
val
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_e
xec_query
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
}
/*---------------------------------------------------------------------
...
...
@@ -147,7 +147,7 @@ void DefineUser(CreateUserStmt *stmt) {
}
strcat
(
sql_end
,
")"
);
pg_e
val
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_e
xec_query
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
/* Add the stuff here for groups.
*/
...
...
@@ -250,7 +250,7 @@ extern void AlterUser(AlterUserStmt *stmt) {
if
(
sql_end
!=
sql
)
{
sql_end
+=
strlen
(
sql_end
);
sprintf
(
sql_end
,
" where usename = '%s'"
,
stmt
->
user
);
pg_e
val
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_e
xec_query
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
}
/* do the pg_group stuff here */
...
...
@@ -346,7 +346,7 @@ extern void RemoveUser(char* user) {
elog
(
NOTICE
,
"Dropping database %s"
,
dbase
[
ndbase
]);
sprintf
(
sql
,
"drop database %s"
,
dbase
[
ndbase
]);
pfree
((
void
*
)
dbase
[
ndbase
]);
pg_e
val
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_e
xec_query
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
}
if
(
dbase
)
pfree
((
void
*
)
dbase
);
...
...
@@ -369,7 +369,7 @@ extern void RemoveUser(char* user) {
/* Remove the user from the pg_user table
*/
sprintf
(
sql
,
"delete from %s where usename = '%s'"
,
UserRelationName
,
user
);
pg_e
val
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_e
xec_query
(
sql
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
UpdatePgPwdFile
(
sql
);
...
...
src/backend/executor/functions.c
View file @
c60f70b5
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.1
3 1997/11/25 21:59:19
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.1
4 1997/12/11 17:36:16
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -113,7 +113,7 @@ init_execution_state(FunctionCachePtr fcache,
planTree_list
=
(
List
*
)
pg_plan
(
fcache
->
src
,
fcache
->
argOidVect
,
nargs
,
&
queryTree_list
,
None
);
pg_p
arse_and_p
lan
(
fcache
->
src
,
fcache
->
argOidVect
,
nargs
,
&
queryTree_list
,
None
);
for
(
i
=
0
;
i
<
queryTree_list
->
len
;
i
++
)
{
...
...
src/backend/executor/spi.c
View file @
c60f70b5
...
...
@@ -640,7 +640,7 @@ _SPI_execute(char *src, int tcount, _SPI_plan * plan)
argtypes
=
plan
->
argtypes
;
}
ptlist
=
planTree_list
=
(
List
*
)
pg_plan
(
src
,
argtypes
,
nargs
,
&
queryTree_list
,
None
);
pg_p
arse_and_p
lan
(
src
,
argtypes
,
nargs
,
&
queryTree_list
,
None
);
_SPI_current
->
qtlist
=
queryTree_list
;
...
...
src/backend/optimizer/path/xfunc.c
View file @
c60f70b5
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.
7 1997/11/25 21:59:50
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.
8 1997/12/11 17:36:29
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -534,7 +534,7 @@ xfunc_func_expense(LispValue node, LispValue args)
nargs
=
proc
->
pronargs
;
if
(
nargs
>
0
)
argOidVect
=
proc
->
proargtypes
;
planlist
=
(
List
)
pg_plan
(
pq_src
,
argOidVect
,
nargs
,
planlist
=
(
List
)
pg_p
arse_and_p
lan
(
pq_src
,
argOidVect
,
nargs
,
&
parseTree_list
,
None
);
if
(
IsA
(
node
,
Func
))
set_func_planlist
((
Func
)
node
,
planlist
);
...
...
src/backend/rewrite/rewriteDefine.c
View file @
c60f70b5
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.
8 1997/11/25 22:06:04
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.
9 1997/12/11 17:36:38
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -136,7 +136,7 @@ InsertRule(char *rulname,
rulname
,
evtype
,
eventrel_oid
,
evslot_index
,
actionbuf
,
qualbuf
,
is_instead
);
pg_e
val
(
rulebuf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_e
xec_query
(
rulebuf
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
return
(
LastOidProcessed
);
}
...
...
src/backend/tcop/postgres.c
View file @
c60f70b5
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.5
5 1997/11/25 22:06:14
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.5
6 1997/12/11 17:36:42
momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -395,7 +395,7 @@ ReadCommand(char *inBuf, bool multiplexedBackend)
}
List
*
pg_plan
(
char
*
query_string
,
/* string to execute */
pg_p
arse_and_p
lan
(
char
*
query_string
,
/* string to execute */
Oid
*
typev
,
/* argument types */
int
nargs
,
/* number of arguments */
QueryTreeList
**
queryListP
,
/* pointer to the parse trees */
...
...
@@ -537,7 +537,10 @@ pg_plan(char *query_string, /* string to execute */
if
(
ShowPlannerStats
)
ResetUsage
();
/* call that optimizer */
plan
=
planner
(
querytree
);
if
(
ShowPlannerStats
)
{
fprintf
(
stderr
,
"! Planner Stats:
\n
"
);
...
...
@@ -580,7 +583,7 @@ pg_plan(char *query_string, /* string to execute */
}
/* ----------------------------------------------------------------
* pg_e
val
()
* pg_e
xec_query
()
*
* Takes a querystring, runs the parser/utilities or
* parser/planner/executor over it as necessary
...
...
@@ -597,13 +600,13 @@ pg_plan(char *query_string, /* string to execute */
*/
void
pg_e
val
(
char
*
query_string
,
char
**
argv
,
Oid
*
typev
,
int
nargs
)
pg_e
xec_query
(
char
*
query_string
,
char
**
argv
,
Oid
*
typev
,
int
nargs
)
{
pg_e
val
_dest
(
query_string
,
argv
,
typev
,
nargs
,
whereToSendOutput
);
pg_e
xec_query
_dest
(
query_string
,
argv
,
typev
,
nargs
,
whereToSendOutput
);
}
void
pg_e
val
_dest
(
char
*
query_string
,
/* string to execute */
pg_e
xec_query
_dest
(
char
*
query_string
,
/* string to execute */
char
**
argv
,
/* arguments */
Oid
*
typev
,
/* argument types */
int
nargs
,
/* number of arguments */
...
...
@@ -617,9 +620,9 @@ pg_eval_dest(char *query_string,/* string to execute */
QueryTreeList
*
querytree_list
;
/* plan the queries */
plan_list
=
pg_plan
(
query_string
,
typev
,
nargs
,
&
querytree_list
,
dest
);
plan_list
=
pg_p
arse_and_p
lan
(
query_string
,
typev
,
nargs
,
&
querytree_list
,
dest
);
/* pg_plan could have failed */
/* pg_p
arse_and_p
lan could have failed */
if
(
querytree_list
==
NULL
)
return
;
...
...
@@ -668,7 +671,7 @@ pg_eval_dest(char *query_string,/* string to execute */
#ifdef INDEXSCAN_PATCH
/*
* Print moved in pg_plan. DZ - 27-8-1996
* Print moved in pg_p
arse_and_p
lan. DZ - 27-8-1996
*/
#else
/* ----------------
...
...
@@ -1340,7 +1343,7 @@ PostgresMain(int argc, char *argv[])
if
(
IsUnderPostmaster
==
false
)
{
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"$Revision: 1.5
5 $ $Date: 1997/11/25 22:06:14
$"
);
puts
(
"$Revision: 1.5
6 $ $Date: 1997/12/11 17:36:42
$"
);
}
/* ----------------
...
...
@@ -1510,7 +1513,7 @@ PostgresMain(int argc, char *argv[])
}
StartTransactionCommand
();
pg_e
val
(
parser_input
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
pg_e
xec_query
(
parser_input
,
(
char
**
)
NULL
,
(
Oid
*
)
NULL
,
0
);
if
(
ShowStats
)
ShowUsage
();
...
...
@@ -1540,7 +1543,7 @@ PostgresMain(int argc, char *argv[])
* (3) commit the current transaction
*
* Note: if we had an empty input buffer, then we didn't
* call pg_e
val
, so we don't bother to commit this transaction.
* call pg_e
xec_query
, so we don't bother to commit this transaction.
* ----------------
*/
if
(
!
IsEmptyQuery
)
...
...
src/include/tcop/tcopprot.h
View file @
c60f70b5
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: tcopprot.h,v 1.
8 1997/11/25 22:07:10
momjian Exp $
* $Id: tcopprot.h,v 1.
9 1997/12/11 17:36:58
momjian Exp $
*
* OLD COMMENTS
* This file was created so that other c files could get the two
...
...
@@ -23,11 +23,11 @@
#ifndef BOOTSTRAP_INCLUDE
extern
List
*
pg_plan
(
char
*
query_string
,
Oid
*
typev
,
int
nargs
,
pg_p
arse_and_p
lan
(
char
*
query_string
,
Oid
*
typev
,
int
nargs
,
QueryTreeList
**
queryListP
,
CommandDest
dest
);
extern
void
pg_e
val
(
char
*
query_string
,
char
**
argv
,
Oid
*
typev
,
int
nargs
);
extern
void
pg_e
xec_query
(
char
*
query_string
,
char
**
argv
,
Oid
*
typev
,
int
nargs
);
extern
void
pg_e
val
_dest
(
char
*
query_string
,
char
**
argv
,
Oid
*
typev
,
pg_e
xec_query
_dest
(
char
*
query_string
,
char
**
argv
,
Oid
*
typev
,
int
nargs
,
CommandDest
dest
);
#endif
/* BOOTSTRAP_HEADER */
...
...
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