Hi,

We've encountered what we think is an odd situation and we can't find any explanation for why this is. We're also not sure if its a problem or not.

A brief summary is that we are doing a major database upgrade and are doing (lots) of testing. The box is a Linux box running Ubuntu 14.04 LTS Server. This is a standard box we have used for a few years, we *might* move to 16 LTS shortly.

As part of the testing we noticed that -shm and -wal files were being left after we used sqlite3 on the command line. This puzzled us as we didn't see any errors in our test scripts.

We then narrowed this problem down to doing a simple SELECT statement on a table.

e.g. This is our starting state. Note that nothing is touching these database as they are isolated in a directory, so there is no other process playing with them.

root@demonotifications:/jambuster/notifications/upgrade_test# ls -lt
total 66892
-rw-r--r-- 1 root root 34217984 May 15 10:38 accountmanagement.sqlite
-rw-r--r-- 1 root root    58567 May 15 10:31 upgradedb.sql
-rw-r--r-- 1 root root 34217984 May 13 20:38 accountmanagement.sqlite.orig

root@demonotifications:/jambuster/notifications/upgrade_test# cp accountmanagement.sqlite.orig accountmanagement.sqlite

root@demonotifications:/jambuster/notifications/upgrade_test# sqlite3 accountmanagement.sqlite
-- Loading resources from /root/.sqliterc

SQLite version 3.8.2 2013-12-06 14:53:30
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from device;
UUID isValid Version WhatAmI Application --------------------------------------------------- ---------- ---------- ---------- ------------------ <<REDACTED> 1 1.1 ios_app JambusterForLondon
...... Hundreds more lines of device data which looks correct
<<REDACTED> 1 1.1 ios_app JambusterForLondon

sqlite> .exit
root@demonotifications:/jambuster/notifications/upgrade_test# ls -lt
total 66924
-rw-r--r-- 1 root root 32768 May 15 10:48 accountmanagement.sqlite-shm -rw-r--r-- 1 root root 0 May 15 10:48 accountmanagement.sqlite-wal
-rw-r--r-- 1 root root 34217984 May 15 10:47 accountmanagement.sqlite
-rw-r--r-- 1 root root    58567 May 15 10:31 upgradedb.sql
-rw-r--r-- 1 root root 34217984 May 13 20:38 accountmanagement.sqlite.orig
root@demonotifications:/jambuster/notifications/upgrade_test


As can be seen above, we have accountmanagement.sqlite-shm and accountmanagement.sqlite-wal files left which is odd. All of this from a select statement.

If we do an pragma integrity check we get

  integrity_check
  ---------------
  ok

All the reading we have done seems to indicate that having -shm and -wal files indicates an error, if this was our code, we'd be looking deep into that but a simple select statement shouldn't cause this sort or error, can it?

The select statement has a number of foreign key delete cascades but thats it, and as we are not deleting anything this shouldn't be an issue anyway.

Do we even have a problem? Going back into the database and closing it again, just with the command line utility sqlite3 doesn't clear the files.

Any help or suggestions welcomed.

Thanks

Rob
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to