hi, i got the same error when I ported sqlite to an operating system using a proprietary file system. The reason was that our file system did not support sparse files. i.e. the fstat-command returned the wrong file-size. Maybe you should independently of SQLite try to * create a file, * write data to it * do an fseek over the end of the file * write data to the file and then determine the size with fstat. In my case that was not working. It was a bug of the underlying file system and not of SQLite... best Martin
----- Ursprüngliche Mail ---- Von: weiyang wang <[EMAIL PROTECTED]> An: sqlite-users@sqlite.org Gesendet: Donnerstag, den 24. August 2006, 09:52:37 Uhr Betreff: [sqlite] journal-off assert hi, i am trying to integrate sqlite into mobile platform, and porting layer, like 'win_os.c' , have been created for that purpose. the integrated sqlite works well on our mobile platform with the default settings, but error come out when i try to tune the performance with 'pragma cache_size = 1'. what i have done is: /* create a new database*/ sqlite3_open("contacts.db", &contactsdb); /*tune the cache_size for m */ sqlite3_exec(contactsdb,"pragma default_cache_size = 1" , callback, 0, &zErrMsg); /*create a table */ sqlite3_exec(contactsdb,"create table IF NOT EXISTS contacts (name text,phone int)" , callback, 0, &zErrMsg); /*insert values into the table, totally 250 entries*/ for ( i< 250) { sqlite3_exec(("insert xxx,xxx"); } the symptom is : after the size of the database increased to 3K, the prgram can not insert entries into the table anymore. the error returned is ' The database disk image is malformed' i have checked the porting layer i have made, the read, write, and offset operations seems correct. then, i recompile the sqlite codes with SQLITE_DEBUG and add ' sqlite3_exec(contactsdb,"PRAGMA vdbe_trace=ON" , callback, 0, &zErrMsg);', an assetion stalled the execution: "assert( pPager->journalOff==jSz );" in pager.c the stacked vaules at the broken time is : pPager->journalOff= 1544 jSz= 1543 file size of contacts.db-journal is 1543 (checked from windows) i guess the problems are related to file offset, reading, and writing. or related to bugs of SQlite, i am not quite sure. so, is there anyone can help me out? best regards, yang