Hello Patrik,

As a trouble-shooting step. I'd add a second table with a checksum of
the blob. Maybe an MD5 and then every time I accessed the row of the
DB for any reason, I'd re-check the MD5 of the blob. Then break/assert
when  the  program notices the blob is no longer correct.

I use gigs of blobs and have no issues with corruption. Assuming the
blob actually gets entered correctly, I imagine either the DB is
becoming corrupt or something in your program is writing to the blob
when you don't expect it.

C



Sunday, February 26, 2012, 3:47:18 PM, you wrote:

PN> I only load "data" from a particular row when I need to display it. The
PN> "data" that got corrupted isn't read for some time and even if I close
PN> down the program and restarts the computer the same corruption is there
PN> on the same row. It is saved into "data", although I don't modify it in
PN> any way.

PN> Patrik

PN> On 02/26/2012 09:12 PM, Pavel Ivanov wrote:
>> My guess is you read blob data incorrectly. You get pointer to the data
>> from SQLite, but actually read the data when memory has been already reused
>> for other purposes.
>> 
>> Pavel
>> 
>> 
>> On Sunday, February 26, 2012, Patrik Nilsson <nipatriknils...@gmail.com>
>> wrote:
>>> Dear All,
>>>
>>> I have a table called page (defined below) and have noticed that the
>>> data-variable (blob) sometimes get corrupted. How do I set up a log to
>>> debug what is happening. What I want is a log file saved with my file,
>>> so I can backtrace the error.
>>>
>>> This is also to be able to send in a good bug report to the developers
>>> of SQLite.
>>>
>>> I don't know the exact steps to reproduce the error, but the following
>>> might give someone a clue:
>>>
>>> 1) Add rows (one by one) with data.
>>> 2) Update sortorder for the whole table with begin/commit
>>> 3) After these and maybe some other steps (i.e. updating a row's data
>>> with new data), I discover that a random row of the table has a
>>> corrupted data-blob.
>>>
>>> I have made a verify function for the whole table of the data-blobs. The
>>> data-blob can contain images varying in size from a few hundred bytes to
>>> some (about 5) megabytes of images. (Currently only png-images.)
>>>
>>> Best regards,
>>> Patrik
>>>
>>>
>>> create table if not exists page ( id integer primary key autoincrement,
>>> type integer, sortorder integer, width integer, height integer, size
>>> integer, deleted integer default 0, zoom integer default 0, modified
>>> datetime default (datetime('now','localtime')), comment text, data blob )
>>>
>>> _______________________________________________
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
PN> _______________________________________________
PN> sqlite-users mailing list
PN> sqlite-users@sqlite.org
PN> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users




-- 
Best regards,
 Teg                            mailto:t...@djii.com

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

Reply via email to