mirror of
https://github.com/postgres/postgres.git
synced 2025-09-11 00:12:06 +03:00
heap_fetch requires buffer pointer, must be released; heap_getnext
no longer returns buffer pointer, can be gotten from scan; descriptor; bootstrap can create multi-key indexes; pg_procname index now is multi-key index; oidint2, oidint4, oidname are gone (must be removed from regression tests); use System Cache rather than sequential scan in many places; heap_modifytuple no longer takes buffer parameter; remove unused buffer parameter in a few other functions; oid8 is not index-able; remove some use of single-character variable names; cleanup Buffer variables usage and scan descriptor looping; cleaned up allocation and freeing of tuples; 18k lines of diff;
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.30 1998/08/16 05:37:04 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.31 1998/08/19 02:02:11 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1071,7 +1071,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
|
||||
* --Nels, Jan '93
|
||||
*/
|
||||
scan = heap_beginscan(relation, false, SnapshotNow, 2, entry);
|
||||
tuple = heap_getnext(scan, false, (Buffer *) NULL);
|
||||
tuple = heap_getnext(scan, 0);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(DEBUG, "clause_pred_clause_test: unknown pred_op");
|
||||
@@ -1102,7 +1102,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
|
||||
ObjectIdGetDatum(clause_op));
|
||||
|
||||
scan = heap_beginscan(relation, false, SnapshotNow, 3, entry);
|
||||
tuple = heap_getnext(scan, false, (Buffer *) NULL);
|
||||
tuple = heap_getnext(scan, 0);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(DEBUG, "clause_pred_clause_test: unknown clause_op");
|
||||
@@ -1134,7 +1134,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
|
||||
Int16GetDatum(test_strategy));
|
||||
|
||||
scan = heap_beginscan(relation, false, SnapshotNow, 3, entry);
|
||||
tuple = heap_getnext(scan, false, (Buffer *) NULL);
|
||||
tuple = heap_getnext(scan, 0);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(DEBUG, "clause_pred_clause_test: unknown test_op");
|
||||
|
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.18 1998/08/10 02:26:25 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.19 1998/08/19 02:02:13 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -496,7 +496,9 @@ xfunc_func_expense(LispValue node, LispValue args)
|
||||
funcid = get_funcid((Func) node);
|
||||
|
||||
/* look up tuple in cache */
|
||||
tupl = SearchSysCacheTuple(PROOID, ObjectIdGetDatum(funcid), 0, 0, 0);
|
||||
tupl = SearchSysCacheTuple(PROOID,
|
||||
ObjectIdGetDatum(funcid),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(tupl))
|
||||
elog(ERROR, "Cache lookup failed for procedure %d", funcid);
|
||||
proc = (Form_pg_proc) GETSTRUCT(tupl);
|
||||
@@ -610,7 +612,7 @@ xfunc_width(LispValue clause)
|
||||
{
|
||||
/* base case: width is width of this attribute */
|
||||
tupl = SearchSysCacheTuple(TYPOID,
|
||||
PointerGetDatum(get_vartype((Var) clause)),
|
||||
ObjectIdGetDatum(get_vartype((Var) clause)),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(tupl))
|
||||
elog(ERROR, "Cache lookup failed for type %d",
|
||||
@@ -1307,7 +1309,9 @@ xfunc_func_width(RegProcedure funcid, LispValue args)
|
||||
|
||||
/* lookup function and find its return type */
|
||||
Assert(RegProcedureIsValid(funcid));
|
||||
tupl = SearchSysCacheTuple(PROOID, ObjectIdGetDatum(funcid), 0, 0, 0);
|
||||
tupl = SearchSysCacheTuple(PROOID,
|
||||
ObjectIdGetDatum(funcid),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(tupl))
|
||||
elog(ERROR, "Cache lookup failed for procedure %d", funcid);
|
||||
proc = (Form_pg_proc) GETSTRUCT(tupl);
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.18 1998/07/27 19:38:00 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.19 1998/08/19 02:02:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -65,7 +65,7 @@ relation_info(Query *root, Index relid,
|
||||
|
||||
relationObjectId = getrelid(relid, root->rtable);
|
||||
relationTuple = SearchSysCacheTuple(RELOID,
|
||||
ObjectIdGetDatum(relationObjectId),
|
||||
ObjectIdGetDatum(relationObjectId),
|
||||
0, 0, 0);
|
||||
if (HeapTupleIsValid(relationTuple))
|
||||
{
|
||||
@@ -153,7 +153,7 @@ index_info(Query *root, bool first, int relid, IdxInfoRetval *info)
|
||||
}
|
||||
if (!HeapScanIsValid(scan))
|
||||
elog(ERROR, "index_info: scan not started");
|
||||
indexTuple = heap_getnext(scan, 0, (Buffer *) NULL);
|
||||
indexTuple = heap_getnext(scan, 0);
|
||||
if (!HeapTupleIsValid(indexTuple))
|
||||
{
|
||||
heap_endscan(scan);
|
||||
@@ -414,9 +414,7 @@ find_inheritance_children(Oid inhparent)
|
||||
key[0].sk_argument = ObjectIdGetDatum((Oid) inhparent);
|
||||
relation = heap_openr(InheritsRelationName);
|
||||
scan = heap_beginscan(relation, 0, SnapshotNow, 1, key);
|
||||
while (HeapTupleIsValid(inheritsTuple =
|
||||
heap_getnext(scan, 0,
|
||||
(Buffer *) NULL)))
|
||||
while (HeapTupleIsValid(inheritsTuple = heap_getnext(scan, 0)))
|
||||
{
|
||||
inhrelid = ((InheritsTupleForm) GETSTRUCT(inheritsTuple))->inhrel;
|
||||
list = lappendi(list, inhrelid);
|
||||
@@ -450,12 +448,8 @@ VersionGetParents(Oid verrelid)
|
||||
relation = heap_openr(VersionRelationName);
|
||||
key[0].sk_argument = ObjectIdGetDatum(verrelid);
|
||||
scan = heap_beginscan(relation, 0, SnapshotNow, 1, key);
|
||||
for (;;)
|
||||
while (HeapTupleIsValid(versionTuple = heap_getnext(scan, 0)))
|
||||
{
|
||||
versionTuple = heap_getnext(scan, 0,
|
||||
(Buffer *) NULL);
|
||||
if (!HeapTupleIsValid(versionTuple))
|
||||
break;
|
||||
verbaseid = ((VersionTupleForm)
|
||||
GETSTRUCT(versionTuple))->verbaseid;
|
||||
|
||||
|
Reference in New Issue
Block a user