/ View Ticket
Login
Ticket UUID: bb4bdb9f7f654b0bb9f34cfbacf5462acb4ce09d
Title: Zeroblob truncated by an index on an expression
Status: Fixed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Virtual_Machine Resolution: Fixed
Last Modified: 2019-01-25 20:09:23
Version Found In:
User Comments:
drh added on 2019-01-25 20:01:15:

When a table has an index on an expression, then inserting a zeroblob into an indexed column of that table might cause the zeroblob to be truncated.

CREATE TABLE t1(a,b,c);
CREATE INDEX t1bbc ON t1(b, b+c);
INSERT INTO t1(a,b,c) VALUES(1,zeroblob(8),3);
SELECT a, b, length(b), c FROM t1;

The correct answer is

1,X'0000000000000000',8,3

But the answer returned is:

1,X'',0,3

This issue was discovered during internal testing. There have been no reports of this from the wild.