Re: [sqlite] Problem with incremental_vacuum and WAL

2011-04-07 Thread Jonathan Allin
> After some more diagnosis I discovered that the free list is not > corrupted afterall. It's just that the showdb tool fails to work > properly with databases larger than 4Gb and since the free list trunk > pages are located beyond the 4Gb barrier it caused problems. > What is showdb? I could

Re: [sqlite] Bug: SQLite Encryption Extension And Backup API

2011-04-07 Thread Marcus Grimm
On 06.04.2011 14:21, Ulric Auger wrote: > Hi, > > I think I found a bug creating an encrypted backup. .. > > > > When I use the following function to create a backup of the database, the > backup database becomes unreadable. ... > > > >rc = sqlite3_open(zFilename,); > >if( rc==SQLITE_OK

Re: [sqlite] Problem with incremental_vacuum and WAL

2011-04-07 Thread Filip Navara
On Thu, Apr 7, 2011 at 9:48 AM, Jonathan Allin wrote: > >> After some more diagnosis I discovered that the free list is not >> corrupted afterall. It's just that the showdb tool fails to work >> properly with databases larger than 4Gb and since the free list trunk >>

Re: [sqlite] Problem with incremental_vacuum and WAL

2011-04-07 Thread Filip Navara
After throughout analysis of my original problem I have probably found the culprit. The problem happens when incremental_vacuum (incrVacuumStep) tries to remove the last page and the last page is free list leaf. In that case the following code path is taken: /* Remove the page from the

[sqlite] Left Join Issue

2011-04-07 Thread Suresh Arunachalam
Hi All, I am facing syntax error on Left join with my sqllite setup. The schema and query are given below with error CREATE TABLE CallsList ( ENTRY_ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,NUMBER TEXT NOT NULL,DATE_AND_TIME INTEGER NOT NULL,LINE_ID INTEGER NOT NULL,NUM_OF_CALLS

[sqlite] Question about wal_checkpoint

2011-04-07 Thread Andy Gibbs
Hi, I've been running the latest version of (unreleased) sqlite 3.7.6 from http://www.sqlite.org/draft/download.html and in particular looking at the new improved "pragma wal_checkpoint". However, it doesn't seem to be doing what I hoped it would do. I was expecting that following a pragma

Re: [sqlite] Left Join Issue

2011-04-07 Thread Vitali Kiruta
> > SELECT > CallsList.NUMBER,ContactList.LAST_NAME,CallsList.DATE_AND_TIME,CallsList.READ_STATUS,LineSettingsList.LINE_NAME,CallsList.LINE_ID,CallsList.NUM_OF_CALLS > FROM CallsList WHERE NUMBER<='31'AND CALL_TYPE=0 COLLATE NOCASE LEFT JOIN > ContactList ON

Re: [sqlite] Bug: SQLite Encryption Extension And Backup API

2011-04-07 Thread Ulric Auger
It didn't change anything to call sqlite3_key twice as you suggested. I'm using SQLite 3.7.4 with SEE (SEE v3.7.5 is not available from the SEE download page, that is strange) I hope SQLite team can look into this. Ulric ___ sqlite-users mailing list

Re: [sqlite] Bug: SQLite Encryption Extension And Backup API

2011-04-07 Thread Marcus Grimm
Hi, sorry.. my fault. It should be: if (zKey != NULL) { sqlite3_key(pBackupDb, NULL, 0); sqlite3_rekey(pBackupDb, zKey, strlen(zKey)); } Thats works for me.. Marcus On 07.04.2011 15:58, Ulric Auger wrote: > It didn't change anything to call sqlite3_key twice as you suggested. > >

Re: [sqlite] Bug: SQLite Encryption Extension And Backup API

2011-04-07 Thread Ulric Auger
This is so strange, key/rekey before starting the backup didn't work for me, what work is to call sqlite3_rekey after sqlite3_backup_finish, but what I don't like is that the backup database is not encrypted until the backup finishes. Can SQLite team comment on this? Thanks Ulric int

Re: [sqlite] Bug: SQLite Encryption Extension And Backup API

2011-04-07 Thread Richard Hipp
On Wed, Apr 6, 2011 at 8:21 AM, Ulric Auger wrote: > Hi, > > I think I found a bug creating an encrypted backup. > > > > The source database is encrypted using key: > > aes256:A94A8FE5CCB19BA61C4C0873D391E987982FBBD3 > > > > The source database is readable, I can run select

Re: [sqlite] Bug: SQLite Encryption Extension And Backup API

2011-04-07 Thread Ulric Auger
No it did work, but I found the problem. The problem is caused by no nonce / nonce situation. If source database is created with nonce then there is no problem (the pragma are not even needed) the backup database is properly encrypted. If source database is created with no nonce (my

[sqlite] Weird CHECK behavior

2011-04-07 Thread Duquette, William H (318K)
Howdy! I have a database with tables defined like this: CREATE TABLE table1 ( idINTEGER PRIMARY KEY, value REAL DEFAULT 1.0 CHECK (0.0 <= value) ); CREATE TABLE table2 ( idINTEGER PRIMARY KEY, value REAL DEFAULT 1.0 CHECK (0.0 <= value AND value <= 1.0) ); The following

Re: [sqlite] Weird CHECK behavior

2011-04-07 Thread Jay A. Kreibich
On Thu, Apr 07, 2011 at 02:44:49PM -0700, Duquette, William H (318K) scratched on the wall: > Howdy! > > I have a database with tables defined like this: > > CREATE TABLE table1 ( > idINTEGER PRIMARY KEY, > value REAL DEFAULT 1.0 CHECK (0.0 <= value) > ); > > CREATE TABLE table2 (

Re: [sqlite] Weird CHECK behavior

2011-04-07 Thread Duquette, William H (318K)
On 4/7/11 2:52 PM, "Jay A. Kreibich" wrote: >On Thu, Apr 07, 2011 at 02:44:49PM -0700, Duquette, William H (318K) >scratched on the wall: >> Howdy! >> >> I have a database with tables defined like this: >> >> CREATE TABLE table1 ( >> idINTEGER PRIMARY KEY, >> value

Re: [sqlite] Weird CHECK behavior

2011-04-07 Thread Duquette, William H (318K)
On 4/7/11 2:52 PM, "Jay A. Kreibich" wrote: >On Thu, Apr 07, 2011 at 02:44:49PM -0700, Duquette, William H (318K) >scratched on the wall: >> Howdy! >> >> I have a database with tables defined like this: >> >> CREATE TABLE table1 ( >> idINTEGER PRIMARY KEY, >> value

Re: [sqlite] Weird CHECK behavior

2011-04-07 Thread Jay A. Kreibich
On Thu, Apr 07, 2011 at 03:45:18PM -0700, Duquette, William H (318K) scratched on the wall: > Hmmm. I tried this; but this constraint fails for ANY value I give it. > I tried this: > > CHECK (0.0 <= CAST (value AS real)) > > But this just casts the string 'NONESUCH' to 0.0, which is no

[sqlite] New default table on DB initialization

2011-04-07 Thread RAKESH HEMRAJANI
Hi, Need a default table to be created on database initialization. i was able to achieve that by executing one create statement query at the end of the function openDatabase. however the problem is that on opening the same DB for the second time, the query fails with error table already