|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.133 2000/12/22 23:12:03 tgl Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.134 2001/01/18 04:01:42 inoue Exp $ |
12 | 12 | * |
13 | 13 | * |
14 | 14 | * INTERFACE ROUTINES |
@@ -1348,15 +1348,26 @@ LockClassinfoForUpdate(Oid relid, HeapTuple rtup, |
1348 | 1348 | rtup->t_self=classTuple->t_self; |
1349 | 1349 | ReleaseSysCache(classTuple); |
1350 | 1350 |
|
1351 | | -test=heap_mark4update(relationRelation,rtup,buffer); |
1352 | | -switch (test) |
| 1351 | +while (1) |
1353 | 1352 | { |
1354 | | -caseHeapTupleSelfUpdated: |
1355 | | -caseHeapTupleMayBeUpdated: |
1356 | | -break; |
1357 | | -default: |
1358 | | -elog(ERROR,"LockStatsForUpdate couldn't lock relid %u",relid); |
1359 | | -return false; |
| 1353 | +ItemPointerDatatidsave; |
| 1354 | + |
| 1355 | +ItemPointerCopy(&(rtup->t_self),&tidsave); |
| 1356 | +test=heap_mark4update(relationRelation,rtup,buffer); |
| 1357 | +switch (test) |
| 1358 | +{ |
| 1359 | +caseHeapTupleSelfUpdated: |
| 1360 | +caseHeapTupleMayBeUpdated: |
| 1361 | +break; |
| 1362 | +caseHeapTupleUpdated: |
| 1363 | +ReleaseBuffer(*buffer); |
| 1364 | +if (!ItemPointerEquals(&(rtup->t_self),&tidsave)) |
| 1365 | +continue; |
| 1366 | +default: |
| 1367 | +elog(ERROR,"LockClassinfoForUpdate couldn't lock relid %u",relid); |
| 1368 | +return false; |
| 1369 | +} |
| 1370 | +break; |
1360 | 1371 | } |
1361 | 1372 | RelationInvalidateHeapTuple(relationRelation,rtup); |
1362 | 1373 | if (confirmCommitted) |
@@ -1634,8 +1645,7 @@ UpdateStats(Oid relid, long reltuples) |
1634 | 1645 | #ifdefOLD_FILE_NAMING |
1635 | 1646 | in_place_upd= (IsReindexProcessing()||IsBootstrapProcessingMode()); |
1636 | 1647 | #else |
1637 | | -in_place_upd= (IsIgnoringSystemIndexes()|| (IsReindexProcessing()&& |
1638 | | -relid==RelOid_pg_class)); |
| 1648 | +in_place_upd= (IsIgnoringSystemIndexes()||IsReindexProcessing()); |
1639 | 1649 | #endif/* OLD_FILE_NAMING */ |
1640 | 1650 |
|
1641 | 1651 | if (!in_place_upd) |
|