(text/x-fossil-wiki)
With the following test case, I can reliably reproduce a segfault on my machine:
<pre>
CREATE TABLE t0(c0, c1, c2 AS(1), PRIMARY KEY(c0) FOREIGN KEY(c2) REFERENCES t0);
CREATE VIRTUAL TABLE vt0 USING fts4;
CREATE INDEX i0 ON t0(c2, 0 BETWEEN '' AND c1 COLLATE BINARY, CASE '' WHEN c3 THEN 0 WHEN 0 THEN 0 WHEN '' THEN 0 WHEN 0 THEN c0 ELSE c1 END);
INSERT INTO t0 VALUES (0, 0), ('', 0);
PRAGMA foreign_keys = true;
ANALYZE;
UPDATE t0 SET c1 = c0; -- unexpected: Segmentation fault
</pre>
|