Assert failure when CREATE TEMP TABLE
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: pgsql-bugs@postgresql.org
Date: 2023-10-16T11:02:29Z
Lists: pgsql-bugs
I came across an Assert failure while running sqlancer. The repro query
is
CREATE TEMP TABLE t0 (c0 int4range CHECK ((('')||(0.005014271491241007) NOT
IN (upper(''), ((' 9O')||FALSE))) BETWEEN SYMMETRIC
(initcap('dj')LIKE(((('EizW~')||t0.c0) COLLATE "en_AG.utf8"))) AND
((((0.18773675)::MONEY) IN (0.52246463::MONEY))AND(t0.c0 BETWEEN SYMMETRIC
((t0.c0+t0.c0)) AND t0.c0)))) USING heap ON COMMIT DROP;
The failure happens in init_toast_snapshot():
/*
* Catalog snapshots can be returned by GetOldestSnapshot() even if not
* registered or active. That easily hides bugs around not having a
* snapshot set up - most of the time there is a valid catalog snapshot.
* So additionally insist that the current snapshot is registered or
* active.
*/
Assert(HaveRegisteredOrActiveSnapshot());
And 'git bisect' says that the first bad commit is 2489d76c, which makes
me confused because the problemed query does not seem to involve
nullingrels stuff.
Thanks
Richard
Commits
-
Ensure we have a snapshot while dropping ON COMMIT DROP temp tables.
- 57e6e861d437 16.1 landed
- 0d1a7cd14ee1 15.5 landed
- 54b208f90963 17.0 landed
- a295684b8914 11.22 landed
- f6e1ee3cfa3e 14.10 landed
- 1e678175c575 13.13 landed
- 07eb22a7761f 12.17 landed