[sqlite] Corrupted database files

2014-06-05 Thread Lasse Jansen
Hi, we have a Mac app that uses CoreData which internally uses SQLite. Some of the queries are not expressible within CoreData, so we send them manually using the sqlite library that comes with Mac OS X. Now some of our users have reported that their database file got corrupted and after some

Re: [sqlite] Corrupted database files

2014-06-05 Thread RSmith
On 2014/06/05 13:21, Lasse Jansen wrote: Hi, we have a Mac app that uses CoreData which internally uses SQLite. Some of the queries are not expressible within CoreData, so we send them manually using the sqlite library that comes with Mac OS X. Now some of our users have reported that their

Re: [sqlite] Corrupted database files

2014-06-05 Thread Richard Hipp
On Thu, Jun 5, 2014 at 7:21 AM, Lasse Jansen la...@lasselog.com wrote: Hi, we have a Mac app that uses CoreData which internally uses SQLite. Some of the queries are not expressible within CoreData, so we send them manually using the sqlite library that comes with Mac OS X. Now some of our

Re: [sqlite] Corrupted database files

2014-06-05 Thread David Empson
On 5/06/2014, at 11:21 pm, Lasse Jansen la...@lasselog.com wrote: Hi, we have a Mac app that uses CoreData which internally uses SQLite. Some of the queries are not expressible within CoreData, so we send them manually using the sqlite library that comes with Mac OS X. Now some of our users

Re: [sqlite] Corrupted database files

2014-06-05 Thread Lasse Jansen
Unfortunately CoreData is closed source and is distributed as part of the Mac OS X SDK so there is no way to update it. 2014-06-05 13:33 GMT+02:00 RSmith rsm...@rsweb.co.za: On 2014/06/05 13:21, Lasse Jansen wrote: Hi, we have a Mac app that uses CoreData which internally uses SQLite.

Re: [sqlite] Corrupted database files

2014-06-05 Thread Lasse Jansen
Thanks for the suggestion, I think I'll try this. I probably need to detect the kind of error and use some retry-mechanism ... 2014-06-05 13:35 GMT+02:00 Richard Hipp d...@sqlite.org: On Thu, Jun 5, 2014 at 7:21 AM, Lasse Jansen la...@lasselog.com wrote: Hi, we have a Mac app that uses

Re: [sqlite] Corrupted database files

2014-06-05 Thread Lasse Jansen
Thanks, spawning another process is a good idea. Filing a bug with Apple is probably not going to work, they don't encourage accessing a CoreData managed database without going through CoreData. 2014-06-05 13:49 GMT+02:00 David Empson demp...@emptech.co.nz: On 5/06/2014, at 11:21 pm, Lasse

Re: [sqlite] Corrupted database files

2014-06-05 Thread Simon Slavin
On 5 Jun 2014, at 1:16pm, Lasse Jansen la...@lasselog.com wrote: Thanks, spawning another process is a good idea. If you're going to continue to use SQLite in your own code on a Mac I encourage you to include the amalgamation files (.h and .c) rather than referring to a dynamic library. That

[sqlite] Corrupted Database

2011-10-31 Thread Özgür KELEŞ
Hi, We use sqlite in our industrial devices. But sometimes the database corrupted. We could not find the problem , how it can be possible to corrupt the database. It is possible to see powerless on devices and OS crashes cause of electromagnetic noises, rarely. I attached some of corrupted

Re: [sqlite] Corrupted Database

2011-10-31 Thread Igor Tandetnik
Özgür KELEŞ ozgur.ke...@enmos.com wrote: We use sqlite in our industrial devices. But sometimes the database corrupted. We could not find the problem , how it can be possible to corrupt the database. http://www.sqlite.org/lockingv3.html Section 6.0 How To Corrupt Your Database Files -- Igor

Re: [sqlite] Corrupted database file.

2011-01-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/05/2011 11:05 AM, Greg Morehead wrote: Any insights on how this could occur would be greatly appreciated. http://www.sqlite.org/lockingv3.html#how_to_corrupt Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment:

Re: [sqlite] Corrupted database with duplicated primary keys

2010-11-19 Thread Israel Lins Albuquerque
Due to attach limits this is the part 001 of the file! - Israel Lins Albuquerque israel...@polibrasnet.com.br escreveu: Attached has a database corrupted. We use the version 3.6.23.1 in wince. the command: pragma integrity_check; show many errors and Duplicate pk was

Re: [sqlite] Corrupted database with duplicated primary keys

2010-11-19 Thread Israel Lins Albuquerque
Due to attach limits this is the part 002 of the file! - Israel Lins Albuquerque israel...@polibrasnet.com.br escreveu: Attached has a database corrupted. We use the version 3.6.23.1 in wince. the command: pragma integrity_check; show many errors and Duplicate pk was

[sqlite] Corrupted database with duplicated primary keys

2010-11-11 Thread Israel Lins Albuquerque
Attached has a database corrupted. We use the version 3.6.23.1 in wince. the command: pragma integrity_check; show many errors and Duplicate pk was founded using: SELECT u_pkey, count(*) FROM tp_gpsdata GROUP BY u_pkey HAVING count(*) 1 ; this returns only 1 record SELECT * FROM

Re: [sqlite] Corrupted database (image is malformed): always the same size

2009-12-21 Thread Gianandrea Gobbo
Max Vlasov ha scritto: On Fri, Dec 18, 2009 at 6:27 PM, Gianandrea Gobbo go...@solari.it wrote: Gianandrea, I once had an experience with fixing a modified code that led to database disk image malformation. If you can reproduce the bug with a comparatively few number of steps, I'd recommend

Re: [sqlite] Corrupted database (image is malformed): always the same size

2009-12-21 Thread Simon Slavin
On 21 Dec 2009, at 8:00am, Gianandrea Gobbo wrote: At this stage, I cannot think of an applicative bug that leads to this kind of corruption, where the database results always in the same size. The only time I ever saw a number of files all truncated to the same length, the fault was in

Re: [sqlite] Corrupted database (image is malformed): always the same size

2009-12-19 Thread Artur Reilin
I also using 2.8, but i wondering why your database has 200 kb from the beginning. my databases have only 3 or 4 kb's. But at my host if i am using sqlite queries which are $db- like, i get the same error. funny thing, but the database is not malformed... On 18 Dec 2009, at 3:27pm, Gianandrea

[sqlite] Corrupted database (image is malformed): always the same size

2009-12-18 Thread Gianandrea Gobbo
I'm using sqlite (2.8) on an embedded product, running a Linux kernel. I'm experiencing sometimes a database corruption, and listing some tables contents gets me a SQL error: database disk image is malformed. Ok, there can be many reasons for this, but the strange thing that puzzles me is that

Re: [sqlite] Corrupted database (image is malformed): always the same size

2009-12-18 Thread Simon Slavin
On 18 Dec 2009, at 3:27pm, Gianandrea Gobbo wrote: I'm using sqlite (2.8) on an embedded product, running a Linux kernel. I'm experiencing sometimes a database corruption, and listing some tables contents gets me a SQL error: database disk image is malformed. Ok, there can be many reasons

Re: [sqlite] Corrupted database (image is malformed): always the same size

2009-12-18 Thread Max Vlasov
On Fri, Dec 18, 2009 at 6:27 PM, Gianandrea Gobbo go...@solari.it wrote: I'm using sqlite (2.8) on an embedded product, running a Linux kernel. I'm experiencing sometimes a database corruption, and listing some tables contents gets me a SQL error: database disk image is malformed. Ok, there

Re: [sqlite] Corrupted database

2009-10-14 Thread Filip Navara
On Mon, Oct 12, 2009 at 8:56 PM, McClellen, Chris cmcclel...@weather.com wrote: What is your synchronous set to?  Full?  FYI If you are using .NET data providers, it is set to Normal by default. Normal or Off, but no power failure was involved. (Yes, System.Data.SQLite is used) If it is not

Re: [sqlite] Corrupted database

2009-10-14 Thread McClellen, Chris
Subject: Re: [sqlite] Corrupted database On Oct 14, 2009, at 12:42 AM, McClellen, Chris wrote: But it does happen and we can reproduce it. Hard killing a thread is essentially equivalent to turning off the power. We have always assumed that it is different. When you write data to a file, the write

Re: [sqlite] Corrupted database

2009-10-14 Thread Dan Kennedy
corrupted? Dan. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Dan Kennedy Sent: Tuesday, October 13, 2009 12:35 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Corrupted database On Oct 13, 2009

Re: [sqlite] Corrupted database

2009-10-14 Thread Teg
Of Dan Kennedy MC Sent: Wednesday, October 14, 2009 12:36 AM MC To: General Discussion of SQLite Database MC Subject: Re: [sqlite] Corrupted database MC On Oct 14, 2009, at 12:42 AM, McClellen, Chris wrote: But it does happen and we can reproduce it. Hard killing a thread is essentially

Re: [sqlite] Corrupted database

2009-10-14 Thread McClellen, Chris
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Teg Sent: Wednesday, October 14, 2009 12:10 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Corrupted database Hello Chris, It's always a mistake to use

Re: [sqlite] Corrupted database

2009-10-14 Thread Reusche, Andrew
We get a 2 returned when we check synchronous. I think that's the enum for full. We do not explicitely kill any threads, but when we decide to reboot or shutdown, we call ExitProcess(0) without stopping any DB threads, and I'm sure this isn't very healthy. Andrew This communication (including

Re: [sqlite] Corrupted database

2009-10-14 Thread D. Richard Hipp
On Oct 14, 2009, at 2:51 PM, Reusche, Andrew wrote: We get a 2 returned when we check synchronous. I think that's the enum for full. We do not explicitely kill any threads, but when we decide to reboot or shutdown, we call ExitProcess(0) without stopping any DB threads, and I'm sure

Re: [sqlite] Corrupted database

2009-10-14 Thread Teg
...@sqlite.org] On Behalf Of Teg MC Sent: Wednesday, October 14, 2009 12:10 PM MC To: General Discussion of SQLite Database MC Subject: Re: [sqlite] Corrupted database MC Hello Chris, MC It's always a mistake to use TerminateThread. Even Microsoft warns MC against it. From MSDN: MC - If the target

Re: [sqlite] Corrupted database

2009-10-14 Thread McClellen, Chris
Discussion of SQLite Database Subject: Re: [sqlite] Corrupted database On Oct 14, 2009, at 2:51 PM, Reusche, Andrew wrote: We get a 2 returned when we check synchronous. I think that's the enum for full. We do not explicitely kill any threads, but when we decide to reboot or shutdown, we call

Re: [sqlite] Corrupted database

2009-10-14 Thread D. Richard Hipp
On Oct 14, 2009, at 2:59 PM, McClellen, Chris wrote: I think the issue is : Thread 1 does exitprocess/terminateprocess (or process.kill, or anything like that) Thread 2 does write() -- the write I believe can be interrupted when partially complete in these cases (only part of the blocks

Re: [sqlite] Corrupted database

2009-10-14 Thread Filip Navara
Subject: Re: [sqlite] Corrupted database On Mon, Oct 12, 2009 at 8:56 PM, McClellen, Chris cmcclel...@weather.com wrote: What is your synchronous set to?  Full?  FYI If you are using .NET data providers, it is set to Normal by default. Normal or Off, but no power failure was involved. (Yes

Re: [sqlite] Corrupted database

2009-10-14 Thread Filip Navara
On Wed, Oct 14, 2009 at 6:06 PM, Dan Kennedy danielk1...@gmail.com wrote: The problem I think may be people using TerminateThread();  that's how you hard kill a thread.  It seems that can interrupt an I/O operation -- ie an operation that writes more than one cluster at a time.  Meaning,

Re: [sqlite] Corrupted database

2009-10-13 Thread McClellen, Chris
To: General Discussion of SQLite Database Subject: Re: [sqlite] Corrupted database On Oct 13, 2009, at 1:56 AM, McClellen, Chris wrote: What is your synchronous set to? Full? FYI If you are using .NET data providers, it is set to Normal by default. If it is not set to full, I have seen

[sqlite] Corrupted database

2009-10-12 Thread Filip Navara
Hello, for a few months we have been occasionally getting corrupted databases in the field. So far we were unable to acquire any of them from our customers, but this week I finally got hold of one. Output from pragma integrity_check is included below. The schema is the following: CREATE VIRTUAL

Re: [sqlite] Corrupted database

2009-10-12 Thread McClellen, Chris
-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Filip Navara Sent: Monday, October 12, 2009 12:38 PM To: General Discussion of SQLite Database Subject: [sqlite] Corrupted database Hello, for a few months we have been occasionally getting corrupted databases

Re: [sqlite] Corrupted database

2009-10-12 Thread Dan Kennedy
failure. That's the theory, anyway. Dan. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Filip Navara Sent: Monday, October 12, 2009 12:38 PM To: General Discussion of SQLite Database Subject: [sqlite] Corrupted

[sqlite] Corrupted database with Atomic write sector ?

2009-05-28 Thread SuperCommit
Hi, We have performance issues with SQLite running on our file system (remote FS using Atomic Write Sector). In fact we are limited with the number of write by second allowed by our file system, let’s say we have 10 write/s After a series of benchmarks the log file (journal) seems to be the

Re: [sqlite] Corrupted database repairing

2008-08-12 Thread Alexey Pechnikov
It's very dificult decision. I'm prefer to use some callback function for logging all queries. But I don't know how to realise this callback - trace and profile callbacks can't show query string with variables values. 2008/8/11, Dennis Cote [EMAIL PROTECTED]: Alexey Pechnikov wrote: Can I get

Re: [sqlite] Corrupted database repairing

2008-08-11 Thread Dennis Cote
Alexey Pechnikov wrote: Can I get full log of sql statements for to sent it other network or store to outher device? Alexey, You may want to read http://www.sqlite.org/cvstrac/wiki?p=UndoRedo for an example of using triggers to generate SQL to modify a database. This example is used

Re: [sqlite] Corrupted database repairing

2008-07-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alexey Pechnikov wrote: Maybe sqlite3_trace() or sqlite3_profile() can help with what you're looking for here. Unfortunately sqlite3_trace isn't that useful as it only tells you the text of the sql statement but not any bound parameters. The way

Re: [sqlite] Corrupted database repairing

2008-07-26 Thread Alexey Pechnikov
В сообщении от Saturday 26 July 2008 10:23:57 Roger Binns написал(а): Alexey Pechnikov wrote: Maybe sqlite3_trace() or sqlite3_profile() can help with what you're looking for here. Unfortunately sqlite3_trace isn't that useful as it only tells you the text of the sql statement but not any

Re: [sqlite] Corrupted database repairing

2008-07-25 Thread Alexey Pechnikov
В сообщении от Friday 25 July 2008 03:40:22 Roger Binns написал(а): Alexey Pechnikov wrote: Is any way to repair corrupted database? From a theoretical point of view the only way to repair a corrupted database is if there are multiple redundant copies of data or of generating that data.

Re: [sqlite] Corrupted database repairing

2008-07-25 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alexey Pechnikov wrote: May be on FS layer? I specifically said VFS which is SQLite functionality - see http://www.sqlite.org/c3ref/vfs.html and http://www.sqlite.org/c3ref/io_methods.html Which FS can help me for this? I'm using ext3 FS now on

Re: [sqlite] Corrupted database repairing

2008-07-25 Thread Alexey Pechnikov
В сообщении от Friday 25 July 2008 12:16:39 Roger Binns написал(а): Alexey Pechnikov wrote: May be on FS layer? I specifically said VFS which is SQLite functionality - see http://www.sqlite.org/c3ref/vfs.html and http://www.sqlite.org/c3ref/io_methods.html Thanks, last link may be helpful

Re: [sqlite] Corrupted database repairing

2008-07-25 Thread Derrell Lipman
On Fri, Jul 25, 2008 at 5:23 AM, Alexey Pechnikov [EMAIL PROTECTED] wrote: Database servers such as Oracle or PostgreSQL have transactions log and restore log. Those logs are effectively duplicates of the data or ways of reconstructing the data. SQLite has a transaction log for the

Re: [sqlite] Corrupted database repairing

2008-07-25 Thread Alexey Pechnikov
В сообщении от Friday 25 July 2008 16:32:26 Derrell Lipman написал(а): Can I get full log of sql statements for to sent it other network or store to outher device? Maybe sqlite3_trace() or sqlite3_profile() can help with what you're looking for here. Thanks!

[sqlite] Corrupted database repairing

2008-07-24 Thread Alexey Pechnikov
Hello! Is any way to repair corrupted database? May be I have archive copy of database and corrupted this pages - can I get correct pages and merge their with archive database? P.S. I have no corrupted database now but this question is important for me. Best regards, Alexey.

Re: [sqlite] Corrupted database repairing

2008-07-24 Thread Alexey Pechnikov
В сообщении от Thursday 24 July 2008 20:48:08 Alexey Pechnikov написал(а): Hello! Is any way to repair corrupted database? May be I have archive copy of database and corrupted this pages - can I get correct pages and merge their with archive database? P.S. I have no corrupted database now

Re: [sqlite] Corrupted database repairing

2008-07-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alexey Pechnikov wrote: Is any way to repair corrupted database? - From a theoretical point of view the only way to repair a corrupted database is if there are multiple redundant copies of data or of generating that data. Since SQLite doesn't do