On Sat, Apr 12, 2014 at 5:04 PM, Alexander Bich <quy...@gmail.com> wrote:

> Hi there,
>
> I was trying to upgrade SQLite version in my C++ application from
> 3.8.0.2 to 3.8.4.3. Unfortunately after upgrade my application became
> experience major problems. I tracked down the bug and got an SQL
> script which gives different result on different versions of SQLite.
>
> Original script is rather big, so I tried to omit unessential things.
> That's the minimal script:
>
>
> CREATE TABLE items (id INTEGER PRIMARY KEY, key INTEGER NOT NULL,
> status INTEGER NOT NULL);
> CREATE UNIQUE INDEX items_key_status ON items (key, status);
> CREATE INDEX items_status_partial ON items (status) WHERE status = 1;
> INSERT INTO items (key, status) VALUES (123, 1);
> UPDATE OR REPLACE items SET status = 0 WHERE id = 1;
> SELECT COUNT(*) FROM items WHERE status = 1;
>

The UPDATE OR REPLACE also seems to be an essential component.  The
following simplified test case causes an assertion fault:

CREATE TABLE t1(a,b);
CREATE UNIQUE INDEX t1ab ON t1(a,b);
CREATE INDEX t1b ON t1(b) WHERE b=1;
INSERT INTO t1(a,b) VALUES(123,456);
UPDATE OR REPLACE t1 SET b=789;



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to