mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Goodbye ABORT. Hello ERROR for all errors.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.11 1998/01/05 03:29:15 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.12 1998/01/07 21:00:56 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -49,7 +49,7 @@ _hash_doinsert(Relation rel, HashItem hitem)
|
||||
/* we need a scan key to do our search, so build one */
|
||||
itup = &(hitem->hash_itup);
|
||||
if ((natts = rel->rd_rel->relnatts) != 1)
|
||||
elog(ABORT, "Hash indices valid for only one index key.");
|
||||
elog(ERROR, "Hash indices valid for only one index key.");
|
||||
itup_scankey = _hash_mkscankey(rel, itup, metap);
|
||||
|
||||
/*
|
||||
@@ -167,7 +167,7 @@ _hash_insertonpg(Relation rel,
|
||||
if (PageGetFreeSpace(page) < itemsz)
|
||||
{
|
||||
/* it doesn't fit on an empty page -- give up */
|
||||
elog(ABORT, "hash item too large");
|
||||
elog(ERROR, "hash item too large");
|
||||
}
|
||||
}
|
||||
_hash_checkpage(page, LH_OVERFLOW_PAGE);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.14 1998/01/05 03:29:20 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.15 1998/01/07 21:01:00 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Overflow pages look like ordinary relation pages.
|
||||
@@ -65,7 +65,7 @@ _hash_addovflpage(Relation rel, Buffer *metabufp, Buffer buf)
|
||||
oaddr = _hash_getovfladdr(rel, metabufp);
|
||||
if (oaddr == InvalidOvflAddress)
|
||||
{
|
||||
elog(ABORT, "_hash_addovflpage: problem with _hash_getovfladdr.");
|
||||
elog(ERROR, "_hash_addovflpage: problem with _hash_getovfladdr.");
|
||||
}
|
||||
ovflblkno = OADDR_TO_BLKNO(OADDR_OF(SPLITNUM(oaddr), OPAGENUM(oaddr)));
|
||||
Assert(BlockNumberIsValid(ovflblkno));
|
||||
@@ -172,7 +172,7 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp)
|
||||
{
|
||||
if (++splitnum >= NCACHED)
|
||||
{
|
||||
elog(ABORT, OVMSG);
|
||||
elog(ERROR, OVMSG);
|
||||
}
|
||||
metap->OVFL_POINT = splitnum;
|
||||
metap->SPARES[splitnum] = metap->SPARES[splitnum - 1];
|
||||
@@ -190,7 +190,7 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp)
|
||||
free_page++;
|
||||
if (free_page >= NCACHED)
|
||||
{
|
||||
elog(ABORT, OVMSG);
|
||||
elog(ERROR, OVMSG);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -206,7 +206,7 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp)
|
||||
if (_hash_initbitmap(rel, metap, OADDR_OF(splitnum, offset),
|
||||
1, free_page))
|
||||
{
|
||||
elog(ABORT, "overflow_page: problem with _hash_initbitmap.");
|
||||
elog(ERROR, "overflow_page: problem with _hash_initbitmap.");
|
||||
}
|
||||
metap->SPARES[splitnum]++;
|
||||
offset++;
|
||||
@@ -214,7 +214,7 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp)
|
||||
{
|
||||
if (++splitnum >= NCACHED)
|
||||
{
|
||||
elog(ABORT, OVMSG);
|
||||
elog(ERROR, OVMSG);
|
||||
}
|
||||
metap->OVFL_POINT = splitnum;
|
||||
metap->SPARES[splitnum] = metap->SPARES[splitnum - 1];
|
||||
@@ -262,7 +262,7 @@ found:
|
||||
offset = (i ? bit - metap->SPARES[i - 1] : bit);
|
||||
if (offset >= SPLITMASK)
|
||||
{
|
||||
elog(ABORT, OVMSG);
|
||||
elog(ERROR, OVMSG);
|
||||
}
|
||||
|
||||
/* initialize this page */
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.14 1998/01/05 03:29:22 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.15 1998/01/07 21:01:08 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Postgres hash pages look like ordinary relation pages. The opaque
|
||||
@@ -85,7 +85,7 @@ _hash_metapinit(Relation rel)
|
||||
|
||||
if ((nblocks = RelationGetNumberOfBlocks(rel)) != 0)
|
||||
{
|
||||
elog(ABORT, "Cannot initialize non-empty hash table %s",
|
||||
elog(ERROR, "Cannot initialize non-empty hash table %s",
|
||||
RelationGetRelationName(rel));
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ _hash_metapinit(Relation rel)
|
||||
* created the first two buckets above.
|
||||
*/
|
||||
if (_hash_initbitmap(rel, metap, OADDR_OF(lg2nelem, 1), lg2nelem + 1, 0))
|
||||
elog(ABORT, "Problem with _hash_initbitmap.");
|
||||
elog(ERROR, "Problem with _hash_initbitmap.");
|
||||
|
||||
/* all done */
|
||||
_hash_wrtnorelbuf(rel, metabuf);
|
||||
@@ -192,7 +192,7 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access)
|
||||
|
||||
if (blkno == P_NEW)
|
||||
{
|
||||
elog(ABORT, "_hash_getbuf: internal error: hash AM does not use P_NEW");
|
||||
elog(ERROR, "_hash_getbuf: internal error: hash AM does not use P_NEW");
|
||||
}
|
||||
switch (access)
|
||||
{
|
||||
@@ -201,7 +201,7 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access)
|
||||
_hash_setpagelock(rel, blkno, access);
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "_hash_getbuf: invalid access (%d) on new blk: %s",
|
||||
elog(ERROR, "_hash_getbuf: invalid access (%d) on new blk: %s",
|
||||
access, RelationGetRelationName(rel));
|
||||
break;
|
||||
}
|
||||
@@ -228,7 +228,7 @@ _hash_relbuf(Relation rel, Buffer buf, int access)
|
||||
_hash_unsetpagelock(rel, blkno, access);
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "_hash_relbuf: invalid access (%d) on blk %x: %s",
|
||||
elog(ERROR, "_hash_relbuf: invalid access (%d) on blk %x: %s",
|
||||
access, blkno, RelationGetRelationName(rel));
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ _hash_chgbufaccess(Relation rel,
|
||||
_hash_relbuf(rel, *bufp, from_access);
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "_hash_chgbufaccess: invalid access (%d) on blk %x: %s",
|
||||
elog(ERROR, "_hash_chgbufaccess: invalid access (%d) on blk %x: %s",
|
||||
from_access, blkno, RelationGetRelationName(rel));
|
||||
break;
|
||||
}
|
||||
@@ -335,7 +335,7 @@ _hash_setpagelock(Relation rel,
|
||||
RelationSetSingleRLockPage(rel, &iptr);
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "_hash_setpagelock: invalid access (%d) on blk %x: %s",
|
||||
elog(ERROR, "_hash_setpagelock: invalid access (%d) on blk %x: %s",
|
||||
access, blkno, RelationGetRelationName(rel));
|
||||
break;
|
||||
}
|
||||
@@ -362,7 +362,7 @@ _hash_unsetpagelock(Relation rel,
|
||||
RelationUnsetSingleRLockPage(rel, &iptr);
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "_hash_unsetpagelock: invalid access (%d) on blk %x: %s",
|
||||
elog(ERROR, "_hash_unsetpagelock: invalid access (%d) on blk %x: %s",
|
||||
access, blkno, RelationGetRelationName(rel));
|
||||
break;
|
||||
}
|
||||
@@ -546,7 +546,7 @@ _hash_splitpage(Relation rel,
|
||||
_hash_checkpage(opage, LH_OVERFLOW_PAGE);
|
||||
if (PageIsEmpty(opage))
|
||||
{
|
||||
elog(ABORT, "_hash_splitpage: empty overflow page %d", oblkno);
|
||||
elog(ERROR, "_hash_splitpage: empty overflow page %d", oblkno);
|
||||
}
|
||||
oopaque = (HashPageOpaque) PageGetSpecialPointer(opage);
|
||||
}
|
||||
@@ -588,7 +588,7 @@ _hash_splitpage(Relation rel,
|
||||
/* we're guaranteed that an ovfl page has at least 1 tuple */
|
||||
if (PageIsEmpty(opage))
|
||||
{
|
||||
elog(ABORT, "_hash_splitpage: empty ovfl page %d!",
|
||||
elog(ERROR, "_hash_splitpage: empty ovfl page %d!",
|
||||
oblkno);
|
||||
}
|
||||
ooffnum = FirstOffsetNumber;
|
||||
@@ -685,7 +685,7 @@ _hash_splitpage(Relation rel,
|
||||
oopaque = (HashPageOpaque) PageGetSpecialPointer(opage);
|
||||
if (PageIsEmpty(opage))
|
||||
{
|
||||
elog(ABORT, "_hash_splitpage: empty overflow page %d",
|
||||
elog(ERROR, "_hash_splitpage: empty overflow page %d",
|
||||
oblkno);
|
||||
}
|
||||
ooffnum = FirstOffsetNumber;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.12 1998/01/05 03:29:24 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.13 1998/01/07 21:01:13 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Because we can be doing an index scan on a relation while we
|
||||
@@ -76,7 +76,7 @@ _hash_dropscan(IndexScanDesc scan)
|
||||
}
|
||||
|
||||
if (chk == (HashScanList) NULL)
|
||||
elog(ABORT, "hash scan list trashed; can't find 0x%lx", scan);
|
||||
elog(ERROR, "hash scan list trashed; can't find 0x%lx", scan);
|
||||
|
||||
if (last == (HashScanList) NULL)
|
||||
HashScans = chk->hashsl_next;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.12 1998/01/05 03:29:26 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.13 1998/01/07 21:01:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -79,7 +79,7 @@ _hash_formitem(IndexTuple itup)
|
||||
|
||||
/* disallow nulls in hash keys */
|
||||
if (itup->t_info & INDEX_NULL_MASK)
|
||||
elog(ABORT, "hash indices cannot include null keys");
|
||||
elog(ERROR, "hash indices cannot include null keys");
|
||||
|
||||
/* make a copy of the index tuple with room for the sequence number */
|
||||
tuplen = IndexTupleSize(itup);
|
||||
|
Reference in New Issue
Block a user