Re: Assert failed in snprintf.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Assert failed in snprintf.c
Date
Msg-id 23503.1538405310@sss.pgh.pa.us
Whole thread Raw
In response to Assert failed in snprintf.c  (Jaime Casanova <jaime.casanova@2ndquadrant.com>)
Responses has_column_privilege behavior (was Re: Assert failed in snprintf.c)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Jaime Casanova <jaime.casanova@2ndquadrant.com> writes:
> sqlsmith made it again, attached is the query (run against regression
> database) that makes the assert fail and the backtrace.
> this happens in head only (or at least 11 is fine).

Ah.  Looks like the has_column_privilege stuff is incautious about whether
it's handed a valid table OID:

regression=# select has_column_privilege(42::oid, 'z'::text, 'q'::text);
server closed the connection unexpectedly

In older branches I get

regression=# select has_column_privilege(42::oid, 'z'::text, 'q'::text);
ERROR:  column "z" of relation "(null)" does not exist

but that's only because glibc's snprintf is forgiving about getting a
NULL pointer for %s.  On some other platforms it'd end in SIGSEGV.

Will fix, thanks for report!

            regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: automatic restore point
Next
From: "Bossart, Nathan"
Date:
Subject: Re: Add SKIP LOCKED to VACUUM and ANALYZE