Greetings.
I'm trying to run simple update....
update TREE set number = number + 1 where child = ? and parent = ? and number > ?
During execution of this query the following func is called: static int sqlite3pager_opentemp(char *zFile, OsFile *fd) from pager.c and temporary file is created in my temp directory.
Is it expected behaviour?
Dmytro Bogovych wrote:
sqlite> create table ITEMS(number INTEGER); sqlite> insert into ITEMS(number) values(1); sqlite> insert into ITEMS(number) values(2); sqlite> insert into ITEMS(number) values(3); sqlite> insert into ITEMS(number) values(4); sqlite> begin; sqlite> update ITEMS set number=number+1 where number>2; -- here I've got breakpoint triggering in sqlite3pager_opentemp.
SQLite is using the temporary file to hold a statement-level rollback journal so that the partial results of the UPDATE can be rolled back if it encounters an error half way through.
You can circumvent this by doing
UPDATE OR ROLLBACK
or
UPDATE OR IGNORE
instead of just plain
UPDATE
-- D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565