SQLite

View Ticket
Login
Ticket Hash: 9621dd78a024d07a3b24ee3351b933ab31922067
Title: Segfault when updating table with generated columns
Status: Fixed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-10-29 03:30:39
Version Found In:
User Comments:
mrigger added on 2019-10-28 22:13:30:

Consider the following test case:

PRAGMA temp_store = MEMORY;
CREATE TEMP TABLE t0(c0, c1 AS(1) CHECK(NULL) UNIQUE NOT NULL, c2 CHECK(1.0) PRIMARY KEY) WITHOUT ROWID;
CREATE UNIQUE INDEX e ON t0(CAST(0.0 AS INT)) WHERE 0;
REINDEX;
INSERT INTO t0(c2) VALUES (0), (1);
REPLACE INTO t0(c2, c0) VALUES (0, 0), (x'9b', NULL);
UPDATE t0 SET c2 = 0 -- Segmentation fault

Unexpectedly, the sequence of statements results in a segfault on my machine.