Re: BufFileRead() error signalling - Mailing list pgsql-hackers

From Ibrar Ahmed
Subject Re: BufFileRead() error signalling
Date
Msg-id 157598317991.13092.10640296975039971799.pgcf@coridan.postgresql.org
Whole thread Raw
In response to Re: BufFileRead() error signalling  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: BufFileRead() error signalling  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
You are checking file->dirty twice, first before calling the function and within the function too. Same for the Assert.
Forexample.
 
size_t
BufFileRead(BufFile *file, void *ptr, size_t size)
{   
     size_t      nread = 0;
     size_t      nthistime;
     if (file->dirty)
     {   
         BufFileFlush(file);
         Assert(!file->dirty);
     }
static void
 BufFileFlush(BufFile *file)
 {
     if (file->dirty)
         BufFileDumpBuffer(file);
     Assert(!file->dirty);

The new status of this patch is: Waiting on Author

pgsql-hackers by date:

Previous
From: "Karl O. Pinc"
Date:
Subject: Re: proposal: minscale, rtrim, btrim functions for numeric
Next
From: Ranier Vilela
Date:
Subject: RE: [Proposal] Level4 Warnings show many shadow vars