Can you post your code? In particular the place where it fails and you retry? Michael D. Black Senior Scientist Advanced Analytics Directorate Northrop Grumman Information Systems
________________________________ From: sqlite-users-boun...@sqlite.org on behalf of Dario Napolitano Sent: Mon 8/16/2010 11:33 AM To: sqlite-users@sqlite.org Subject: EXTERNAL:[sqlite] Record corruption on Mac OS X 10.6 (Snow Leopard) Hello everyone. I have developed a conversion tool to generate a SQLite database from a MySQL one. The tool is a simple C Cocoa application in which I have statically compiled the amalgamation source of SQLite. The tool has a reading thread that pulls records from MySQL and a writing thread that saves them into the SQLite database, via a locking queue. The SQLite connection is created on the main thread and then handed off to the writing thread which is the only one to use it. This tool worked correctly under Mac Os 10.5 (Leopard), but since upgrading to Snow Leopard the output database contains several corrupted records (about 300 out of 75000). The corrupted records are generally random (different on each execution) and are corrupted *only* in the TEXT columns, while INTEGER and BLOB columns are unharmed. Also the corruption only happens in one of the 3 tables that are processed, the one with several TEXT fields. The corruption involves *all* the TEXT fields in a record or none at all. I have done extensive debugging to rule out unrelated causes. Specifically I have also tried to issue the INSERT statement followed by a SELECT to check what was just inserted by comparing it with the same memory buffer: the data that goes into the INSERT is not the same that comes back with the SELECT. Also, upon detecting the corruption, the program deletes the just inserted record and issues the same INSERT statement, which manages to correctly insert the data. Without the workaround out of about 75000 records about 300 end up corrupted, whereas with the 'try-again' method I found no corrupted records afterwards. I used the same check on the far larger BLOB records and there was no issue with them. Has anyone had the same experience? Any clue on what might have caused it? It definitely seems related to Os X 10.6, as it worked on 2 distinct Macs with 10.5 and it fails on both with 10.6. Thanks for any help. _______________________________________________ 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