diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/access/gist/gist.c | 6 | ||||
-rw-r--r-- | src/backend/catalog/aclchk.c | 6 | ||||
-rw-r--r-- | src/backend/catalog/heap.c | 20 | ||||
-rw-r--r-- | src/backend/catalog/index.c | 11 | ||||
-rw-r--r-- | src/backend/catalog/pg_operator.c | 21 | ||||
-rw-r--r-- | src/backend/catalog/pg_type.c | 6 | ||||
-rw-r--r-- | src/backend/commands/_deadcode/recipe.c | 9 | ||||
-rw-r--r-- | src/backend/commands/comment.c | 2 | ||||
-rw-r--r-- | src/backend/executor/execMain.c | 13 | ||||
-rw-r--r-- | src/backend/utils/adt/sets.c | 4 | ||||
-rw-r--r-- | src/backend/utils/cache/catcache.c | 5 | ||||
-rw-r--r-- | src/backend/utils/time/tqual.c | 29 |
12 files changed, 40 insertions, 92 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 6b873ab84af..9c9e8aeee7f 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.48 1999/12/10 03:55:42 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.49 2000/01/17 23:57:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -98,9 +98,9 @@ gistbuild(Relation heap, /* no locking is needed */ - setheapoverride(true); /* so we can see the new pg_index tuple */ + CommandCounterIncrement(); /* so we can see the new pg_index tuple */ + initGISTstate(&giststate, index); - setheapoverride(false); pred = predInfo->pred; oldPred = predInfo->oldPred; diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c index 09aa138cf7c..0e1a98d07cd 100644 --- a/src/backend/catalog/aclchk.c +++ b/src/backend/catalog/aclchk.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.35 2000/01/16 20:04:54 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.36 2000/01/17 23:57:43 tgl Exp $ * * NOTES * See acl.h. @@ -149,10 +149,8 @@ ChangeAcl(char *relname, replaces[Anum_pg_class_relacl - 1] = 'r'; values[Anum_pg_class_relacl - 1] = (Datum) new_acl; tuple = heap_modifytuple(tuple, relation, values, nulls, replaces); - /* XXX handle index on pg_class? */ - setheapoverride(true); + heap_update(relation, &tuple->t_self, tuple, NULL); - setheapoverride(false); /* keep the catalog indices up to date */ CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0476f2c8223..d61df6561b6 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.116 2000/01/17 02:04:12 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.117 2000/01/17 23:57:43 tgl Exp $ * * * INTERFACE ROUTINES @@ -1065,7 +1065,7 @@ DeleteRelationTuple(Relation rel) pg_class_desc = heap_openr(RelationRelationName, RowExclusiveLock); tup = SearchSysCacheTupleCopy(RELOID, - ObjectIdGetDatum(rel->rd_att->attrs[0]->attrelid), + ObjectIdGetDatum(rel->rd_id), 0, 0, 0); if (!HeapTupleIsValid(tup)) { @@ -1509,31 +1509,25 @@ heap_drop_with_catalog(char *relname) DeleteAttributeTuples(rel); /* ---------------- - * delete comments + * delete comments, statistics, and constraints * ---------------- */ DeleteComments(RelationGetRelid(rel)); - /* ---------------- - * delete statistics - * ---------------- - */ RemoveStatistics(rel); + RemoveConstraints(rel); + /* ---------------- - * delete type tuple. here we want to see the effects - * of the deletions we just did, so we use setheapoverride(). + * delete type tuple * ---------------- */ - setheapoverride(true); DeleteTypeTuple(rel); - setheapoverride(false); /* ---------------- * delete relation tuple * ---------------- */ - /* must delete fake tuple in cache */ DeleteRelationTuple(rel); /* @@ -1541,8 +1535,6 @@ heap_drop_with_catalog(char *relname) */ ReleaseRelationBuffers(rel); - RemoveConstraints(rel); - /* ---------------- * unlink the relation's physical file and finish up. * ---------------- diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 7c7ffa3250d..84009d6282b 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.101 1999/12/20 10:40:40 wieck Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.102 2000/01/17 23:57:43 tgl Exp $ * * * INTERFACE ROUTINES @@ -904,19 +904,16 @@ InitIndexStrategy(int numatts, /* ---------------- * fill in the index strategy structure with information - * from the catalogs. Note: we use heap override mode - * in order to be allowed to see the correct information in the - * catalogs, even though our transaction has not yet committed. + * from the catalogs. First we must advance the command counter + * so that we will see the newly-entered index catalog tuples. * ---------------- */ - setheapoverride(true); + CommandCounterIncrement(); IndexSupportInitialize(strategy, support, attrelid, accessMethodObjectId, amstrategies, amsupport, numatts); - setheapoverride(false); - /* ---------------- * store the strategy information in the index reldesc * ---------------- diff --git a/src/backend/catalog/pg_operator.c b/src/backend/catalog/pg_operator.c index a143c807c77..45c284cd9d0 100644 --- a/src/backend/catalog/pg_operator.c +++ b/src/backend/catalog/pg_operator.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.47 2000/01/10 17:14:31 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.48 2000/01/17 23:57:43 tgl Exp $ * * NOTES * these routines moved here from commands/define.c and somewhat cleaned up. @@ -775,6 +775,9 @@ OperatorDef(char *operatorName, opKey[1].sk_argument = ObjectIdGetDatum(leftTypeId); opKey[2].sk_argument = ObjectIdGetDatum(rightTypeId); + /* Make sure we can see the shell even if it is new in current cmd */ + CommandCounterIncrement(); + pg_operator_scan = heap_beginscan(pg_operator_desc, 0, SnapshotSelf, /* no cache? */ @@ -790,9 +793,7 @@ OperatorDef(char *operatorName, nulls, replaces); - setheapoverride(true); heap_update(pg_operator_desc, &tup->t_self, tup, NULL); - setheapoverride(false); } else elog(ERROR, "OperatorDef: no operator %u", operatorObjectId); @@ -875,7 +876,13 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId) pg_operator_desc = heap_openr(OperatorRelationName, RowExclusiveLock); - /* check and update the commutator, if necessary */ + /* + * check and update the commutator & negator, if necessary + * + * First make sure we can see them... + */ + CommandCounterIncrement(); + opKey[0].sk_argument = ObjectIdGetDatum(commId); pg_operator_scan = heap_beginscan(pg_operator_desc, @@ -920,9 +927,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId) nulls, replaces); - setheapoverride(true); heap_update(pg_operator_desc, &tup->t_self, tup, NULL); - setheapoverride(false); if (RelationGetForm(pg_operator_desc)->relhasindex) { @@ -954,9 +959,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId) nulls, replaces); - setheapoverride(true); heap_update(pg_operator_desc, &tup->t_self, tup, NULL); - setheapoverride(false); if (RelationGetForm(pg_operator_desc)->relhasindex) { @@ -994,9 +997,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId) nulls, replaces); - setheapoverride(true); heap_update(pg_operator_desc, &tup->t_self, tup, NULL); - setheapoverride(false); if (RelationGetForm(pg_operator_desc)->relhasindex) { diff --git a/src/backend/catalog/pg_type.c b/src/backend/catalog/pg_type.c index 2b9e9d6eccd..3de8020595c 100644 --- a/src/backend/catalog/pg_type.c +++ b/src/backend/catalog/pg_type.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.46 2000/01/10 20:23:28 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.47 2000/01/17 23:57:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -481,9 +481,7 @@ TypeCreate(char *typeName, nulls, replaces); - setheapoverride(true); heap_update(pg_type_desc, &tup->t_self, tup, NULL); - setheapoverride(false); typeObjectId = tup->t_data->t_oid; } @@ -558,9 +556,7 @@ TypeRename(char *oldTypeName, char *newTypeName) namestrcpy(&(((Form_pg_type) GETSTRUCT(oldtup))->typname), newTypeName); - setheapoverride(true); heap_update(pg_type_desc, &oldtup->t_self, oldtup, NULL); - setheapoverride(false); /* update the system catalog indices */ CatalogOpenIndices(Num_pg_type_indices, Name_pg_type_indices, idescs); diff --git a/src/backend/commands/_deadcode/recipe.c b/src/backend/commands/_deadcode/recipe.c index dc0928fe97b..9a5eda6906f 100644 --- a/src/backend/commands/_deadcode/recipe.c +++ b/src/backend/commands/_deadcode/recipe.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/recipe.c,v 1.8 2000/01/10 17:14:33 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/recipe.c,v 1.9 2000/01/17 23:57:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -211,9 +211,10 @@ beginRecipe(RecipeStmt *stmt) /* * before we plan, we want to see all the changes we did, during * the rewrite phase, such as creating the tee tables, - * setheapoverride() allows us to see the changes + * CommandCounterIncrement() allows us to see the changes */ - setheapoverride(true); + CommandCounterIncrement(); + plan = planner(parsetree); /* ---------------------------------------------------------- @@ -265,8 +266,6 @@ beginRecipe(RecipeStmt *stmt) } /* if (teeInfo) */ - setheapoverride(false); - /* define a portal for this viewer input */ /* for now, eyes can only have one input */ snprintf(portalName, 1024, "%s%d", e->nodeName, 0); diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c index 93feb9e8054..9ebf207199c 100644 --- a/src/backend/commands/comment.c +++ b/src/backend/commands/comment.c @@ -165,9 +165,7 @@ void CreateComments(Oid oid, char *comment) { } else { desctuple = heap_modifytuple(searchtuple, description, values, nulls, replaces); - setheapoverride(true); heap_update(description, &searchtuple->t_self, desctuple, NULL); - setheapoverride(false); modified = TRUE; } diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 352e368d99a..fa98950ac1f 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -26,7 +26,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.104 2000/01/05 18:23:46 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.105 2000/01/17 23:57:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -723,18 +723,13 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate) FreeTupleDesc(tupdesc); /* - * XXX rather than having to call setheapoverride(true) - * and then back to false, we should change the arguments - * to heap_open() instead.. - * - * XXX no, we should use commandCounterIncrement... + * Advance command counter so that the newly-created + * relation's catalog tuples will be visible to heap_open. */ - setheapoverride(true); + CommandCounterIncrement(); intoRelationDesc = heap_open(intoRelationId, AccessExclusiveLock); - - setheapoverride(false); } } } diff --git a/src/backend/utils/adt/sets.c b/src/backend/utils/adt/sets.c index ba94496cea5..baa4e67b33d 100644 --- a/src/backend/utils/adt/sets.c +++ b/src/backend/utils/adt/sets.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.28 1999/11/24 00:44:35 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.29 2000/01/17 23:57:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -113,9 +113,7 @@ SetDefine(char *querystr, char *typename) replNull, repl); - setheapoverride(true); heap_update(procrel, &tup->t_self, newtup, NULL); - setheapoverride(false); setoid = newtup->t_data->t_oid; } diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index c9f26f38ad0..aa76d46862f 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.56 2000/01/10 16:13:15 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.57 2000/01/17 23:57:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1047,8 +1047,7 @@ SearchSysCache(struct catcache * cache, * if this isn't bootstrap (initdb) time, use the index. * ---------------- */ - CACHE2_elog(DEBUG, "SearchSysCache: performing scan (override==%d)", - heapisoverride()); + CACHE1_elog(DEBUG, "SearchSysCache: performing scan"); if ((RelationGetForm(relation))->relhasindex && !IsBootstrapProcessingMode()) diff --git a/src/backend/utils/time/tqual.c b/src/backend/utils/time/tqual.c index 4a96c5736cf..32479fb2780 100644 --- a/src/backend/utils/time/tqual.c +++ b/src/backend/utils/time/tqual.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.33 1999/12/10 12:34:14 wieck Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.34 2000/01/17 23:57:47 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -26,31 +26,6 @@ Snapshot SerializableSnapshot = NULL; bool ReferentialIntegritySnapshotOverride = false; -/* - * XXX Transaction system override hacks start here - */ -#ifndef GOODAMI - -TransactionId HeapSpecialTransactionId = InvalidTransactionId; -CommandId HeapSpecialCommandId = FirstCommandId; - -void -setheapoverride(bool on) -{ - if (on) - { - TransactionIdStore(GetCurrentTransactionId(), - &HeapSpecialTransactionId); - HeapSpecialCommandId = GetCurrentCommandId(); - } - else - HeapSpecialTransactionId = InvalidTransactionId; -} - -#endif /* !defined(GOODAMI) */ -/* - * XXX Transaction system override hacks end here - */ /* * HeapTupleSatisfiesItself @@ -311,7 +286,7 @@ HeapTupleSatisfiesUpdate(HeapTuple tuple) } else if (TransactionIdIsCurrentTransactionId(th->t_xmin)) { - if (CommandIdGEScanCommandId(th->t_cmin) && !heapisoverride()) + if (CommandIdGEScanCommandId(th->t_cmin)) return HeapTupleInvisible; /* inserted after scan * started */ |