Hi everyone,
When executing the statements below, Postgres crashes:
CREATE TABLE t0(c0 BOOLEAN, c1 TEXT);
CREATE STATISTICS s1 ON c0, c1 FROM t0;
INSERT INTO t0(c0) VALUES (FALSE);
VACUUM ANALYZE t0;
SELECT * FROM t0 WHERE t0.c0 OR '' >= t0.c1 COLLATE "C"; -- unexpected: segfault
The server log on the latest trunk version (5925e55) shows the following:
2019-07-14 23:09:58.070 CEST [11236] LOG: server process (PID 11245)
was terminated by signal 11: Segmentation fault
2019-07-14 23:09:58.070 CEST [11236] DETAIL: Failed process was
running: SELECT * FROM t0 WHERE t0.c0 OR '' >= t0.c1 COLLATE "C";
2019-07-14 23:09:58.070 CEST [11236] LOG: terminating any other
active server processes
I could reproduce the segfault on the latest trunk version (PostgreSQL
13devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
8.3.0-6ubuntu1) 8.3.0, 64-bit), beta version (12beta2 (Debian
12~beta2-1.pgdg90+1)), but not on the latest release version (11.4
(Debian 11.4-1.pgdg90+1)). Since the bug is not reproducible on the
latest release version, I assume that this is not a security issue.
Best,
Manuel