aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/bufmgr.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-02-21 18:47:12 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-02-21 18:47:12 +0000
commit393f313227fba2b7905cfbd69b3e4c18d762bf4f (patch)
tree0eab81bd6705a19b625880d9b5cefb1d50c78d78 /src/backend/storage/buffer/bufmgr.c
parentee97d103ccf68ae45343caea4188ca3dd5ce7365 (diff)
downloadpostgresql-393f313227fba2b7905cfbd69b3e4c18d762bf4f.tar.gz
postgresql-393f313227fba2b7905cfbd69b3e4c18d762bf4f.zip
Change parse-time representation of float literals (which include oversize
integers) to be strings instead of 'double'. We convert from string form to internal representation only after type resolution has determined the correct type for the constant. This eliminates loss-of-precision worries and gets rid of the change in behavior seen at 17 digits with the previous kluge.
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r--src/backend/storage/buffer/bufmgr.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index d6120affabe..f5d61323310 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.73 2000/02/17 05:00:38 inoue Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.74 2000/02/21 18:47:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -453,6 +453,7 @@ BufferAlloc(Relation reln,
*/
Assert(buf->refcount == 0);
buf->refcount = 1;
+ Assert(PrivateRefCount[BufferDescriptorGetBuffer(buf) - 1] == 0);
PrivateRefCount[BufferDescriptorGetBuffer(buf) - 1] = 1;
if (buf->flags & BM_DIRTY)
@@ -542,6 +543,7 @@ BufferAlloc(Relation reln,
inProgress = FALSE;
buf->flags &= ~BM_IO_IN_PROGRESS;
TerminateBufferIO(buf);
+ Assert(PrivateRefCount[BufferDescriptorGetBuffer(buf)-1] == 1);
PrivateRefCount[BufferDescriptorGetBuffer(buf) - 1] = 0;
buf->refcount--;
buf = (BufferDesc *) NULL;
@@ -568,6 +570,7 @@ BufferAlloc(Relation reln,
{
TerminateBufferIO(buf);
/* give up the buffer since we don't need it any more */
+ Assert(PrivateRefCount[BufferDescriptorGetBuffer(buf)-1] == 1);
PrivateRefCount[BufferDescriptorGetBuffer(buf) - 1] = 0;
Assert(buf->refcount > 0);
buf->refcount--;
@@ -1469,8 +1472,16 @@ ReleaseRelationBuffers(Relation rel)
if (!(buf->flags & BM_FREE))
{
/* Assert checks that buffer will actually get freed! */
- Assert(PrivateRefCount[i - 1] == 1 &&
- buf->refcount == 1);
+ Assert(buf->refcount == 1);
+ if (PrivateRefCount[i - 1] <= 0)
+ {
+ fprintf(stderr, "Nonpositive PrivateRefCount on buffer for %s\n",
+ RelationGetRelationName(rel));
+ fflush(stderr);
+ * ((char *) 0) = 0;
+ abort();
+ }
+ Assert(PrivateRefCount[i - 1] == 1);
/* ReleaseBuffer expects we do not hold the lock at entry */
SpinRelease(BufMgrLock);
holding = false;