Re: No error checking when reading from file using zstd in pg_dump - Mailing list pgsql-hackers

From Tom Lane
Subject Re: No error checking when reading from file using zstd in pg_dump
Date
Msg-id 517794.1750082166@sss.pgh.pa.us
Whole thread Raw
In response to Re: No error checking when reading from file using zstd in pg_dump  (Evgeniy Gorbanev <gorbanyoves@basealt.ru>)
List pgsql-hackers
I think the real problem here is that what the code is doing is
precisely not what is documented in compress_io.h:

    /*
     * Read 'size' bytes of data from the file and store them into 'ptr'.
     * Optionally it will store the number of bytes read in 'rsize'.
     *
     * Returns true on success and throws an internal error otherwise.
     */
    bool        (*read_func) (void *ptr, size_t size, size_t *rsize,
                              CompressFileHandle *CFH);

I've not checked to see what the other users of this API do, but
if they're all like this then we need to fix that comment.
Otherwise we probably need to make them all alike; even if there's
not a bug today, one will soon appear from someone believing the
comment.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_upgrade fails with an error "object doesn't exist"
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Remove unused #include's in src/backend/utils/adt/*