Incorrect Assert in BufFileSize()?

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Incorrect Assert in BufFileSize()?
Date: 2024-05-03 04:03:45
Message-ID: CAApHDvofgZT0VzydhyGH5MMb-XZzNDqqAbzf1eBZV5HDm3+osQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm trying to figure out why BufFileSize() Asserts that file->fileset
isn't NULL, per 1a990b207.

The discussion for that commit is in [1], but I don't see any
explanation of the Assert in the discussion or commit message and
there's no comment explaining why it's there.

The code that comes after the Assert does not look at the fileset
field. With the code as it is, it doesn't seem possible to get the
file size of a non-shared BufFile and I don't see any reason for that.

Should the Assert be checking file->files != NULL?

David

[1] https://postgr.es/m/CAH2-Wzn0ZNLZs3DhCYdLMv4xn1fnM8ugVHPvWz67dSUh1s_%3D2Q%40mail.gmail.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kashif Zeeshan 2024-05-03 05:20:32 Re: Document NULL
Previous Message Alexander Lakhin 2024-05-03 04:00:00 Re: cataloguing NOT NULL constraints