On Sep 11, 2009, at 1:58 PM, gprand wrote:

>
> Hi Richard,
>
> First, thanks for replying to my problem.
>
> Definitely answer to your assumptions ist no. I can see the correct  
> sql
> statement into the debugger, nothing is malformed. Checking  
> sizeof(char)
> delivers 1. Processing the first 100 bytes does'nt produce error.  
> Much more,
> processing of sqlite3_exec cause the error.
> It looks to me, that something goes wrong when sqlite creates its  
> internal
> mastertable. May be, the error message belongs to this table, not to  
> the
> database file? Unfortunately, the debugger is spoofed in some  
> conditions, he
> cannot trace the tokenizer and I do not look through enough.

Here is something to try:

Compile the library with SQLITE_DEBUG defined. Then before running the  
test,
put a breakpoint in each of sqlite3Corrupt() and corruptSchema()  
functions.
See which one it hits and post the stack trace.

Dan.



> Regards,
>
> Gottfried
>
>
> D. Richard Hipp wrote:
>>
>>
>> On Sep 10, 2009, at 2:23 AM, gprand wrote:
>>> Program's output is:
>>> OPENX   16  /database_file.db 01002
>>> OPEN    16  /database_file.db
>>> READ    16    100       0 0
>>> SQL error: database disk image is malformed
>>
>> This indicates that SQLite is reading the first 100 bytes of the
>> database file (the database file header) and is either unable to read
>> those 100 bytes or after looking at those bytes determines that the
>> database file is malformed.
>>
>> Possible causes:  (1) your file I/O subsystem is doing some kind of  
>> \n
>> to \r\n translation.  (2) when you copied the database file onto the
>> device, your copy utility corrupted the database file (again,  
>> possibly
>> by \r to \r\n translation)  (3) your compiler somehow thinks that
>> sizeof(char)!=1.
>>
>> There might be other causes, but those are the ones that come to  
>> mind.
>>
>>> CLOSE   16
>>
>> D. Richard Hipp
>> [email protected]
>>
>>
>>
>> _______________________________________________
>> sqlite-users mailing list
>> [email protected]
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>>
>
> -- 
> View this message in context: 
> http://www.nabble.com/sqlite3_exec-fails-on-arm-tp25293839p25396004.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to