Re: [sqlite] SQLITE_CORRUPT error

2010-05-11 Thread daksh jasra
Thank you Roger,
TH3 is proprietary and requires a license,Do you know how can I obtain a 
license to access and use TH3?

Thanks,
Daksh




From: Roger Binns <rog...@rogerbinns.com>
To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
Sent: Tue, May 11, 2010 11:11:29 AM
Subject: Re: [sqlite] SQLITE_CORRUPT error

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 05/10/2010 04:07 PM, daksh jasra wrote:
> I have ported SQLITE over VRTX based embedded platform,

I'd suggest licensing the TH3 test suite in order to verify your port.  You
could be doing something like getting an operating wrong once the database
reaches a certain size, is an exact multiple of some interesting number etc.

  http://www.sqlite.org/th3.html

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvpgbAACgkQmOOfHg372QTPeQCgo2W6ytS8FH360YoBFkQg60YQ
Q+UAoNS5JUdy7/Vtr85mlXNfrMEk2Wyt
=32se
-END PGP SIGNATURE-
___
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


Re: [sqlite] SQLITE_CORRUPT error

2010-05-11 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 05/10/2010 04:07 PM, daksh jasra wrote:
> I have ported SQLITE over VRTX based embedded platform,

I'd suggest licensing the TH3 test suite in order to verify your port.  You
could be doing something like getting an operating wrong once the database
reaches a certain size, is an exact multiple of some interesting number etc.

  http://www.sqlite.org/th3.html

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvpgbAACgkQmOOfHg372QTPeQCgo2W6ytS8FH360YoBFkQg60YQ
Q+UAoNS5JUdy7/Vtr85mlXNfrMEk2Wyt
=32se
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLITE_CORRUPT error

2010-05-10 Thread daksh jasra
Hey Guy's,
I have ported SQLITE over VRTX based embedded platform, now after using for a 1 
year suddenly started getting SQLITE_CORRUPT ERORR, used queue and mutex at 
application level to make sqilte DB access thread safe as sqlite library itself 
is compiled without thread safe options, Strange thing is that whenever 
SQLITE_CORRUPT error comes it comes only while accessing a particular table out 
of 5 tables other tables are fine, pragma integrity_check; also fails after 
this error. I will highly appreciate if someone can give out possible cause of 
this kinda issue.
Thanks,DJ
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLITE_CORRUPT error

2009-06-24 Thread Andrea Galeazzi
So I'm gonna find this fix in the 3.6.16 version right?
I'd like to avoid to download it directly from cvs...
D. Richard Hipp ha scritto:
> On Jun 23, 2009, at 3:16 AM, Andrea Galeazzi wrote:
>
>   
>> Any news about this problem?
>> 
>
> http://www.sqlite.org/cvstrac/tktview?tn=3929
>
>   
>> galea...@korg.it ha scritto:
>>
>> In order to be more confidence about what I'm saying, I downloaded the
>> precompiled sqlite console 3.6.15 (windows  version), I executed the
>> statement above and I've got the following error:
>>
>> sqlite3.exe malformed_db.db
>> SQLite version 3.6.15
>> Enter ".help" for instructions
>> Enter SQL statements terminated with a ";"
>> sqlite> INSERT INTO PlayList_Song(id_song, id_playlist, song_number)  
>> VALUES
>>...> (5235, 9, 256);
>> SQL error: database disk image is malformed
>> sqlite> .q
>>
>> Then I tried with a previous version and the statement has been well
>> executed. A colleague of mine made the same test  and he had the same
>> troubles. So I don't thing it's a compiler issue.
>> Did you make the test with windows console? Have I send you the
>> database again?
>> Thanks for your helpfulness!
>>
>>
>>
>> 
>>> Citando "D. Richard Hipp" :
>>>
>>>
>>>   
 On Jun 18, 2009, at 12:36 PM, galea...@korg.it wrote:


 
> This statement is giving me truoble:
> INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES
> (5235, 9, 256)
>
>   
 That INSERT statement works fine for me.

 Did you try recompiling with optimizations turned off?



 D. Richard Hipp
 d...@hwaci.com



 ___
 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
>>>
>>> __ Informazioni da ESET NOD32 Antivirus, versione del  
>>> database delle firme digitali 4177 (20090622) __
>>>
>>> Il messaggio è stato controllato da ESET NOD32 Antivirus.
>>>
>>> www.nod32.it
>>>
>>>
>>>
>>>
>>>
>>>   
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
>
> D. Richard Hipp
> d...@hwaci.com
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> __ Informazioni da ESET NOD32 Antivirus, versione del database delle 
> firme digitali 4182 (20090624) __
>
> Il messaggio è stato controllato da ESET NOD32 Antivirus.
>
> www.nod32.it
>
>
>
>
>   

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


Re: [sqlite] SQLITE_CORRUPT error

2009-06-23 Thread D. Richard Hipp

On Jun 23, 2009, at 3:16 AM, Andrea Galeazzi wrote:

> Any news about this problem?

http://www.sqlite.org/cvstrac/tktview?tn=3929

> galea...@korg.it ha scritto:
>
> In order to be more confidence about what I'm saying, I downloaded the
> precompiled sqlite console 3.6.15 (windows  version), I executed the
> statement above and I've got the following error:
>
> sqlite3.exe malformed_db.db
> SQLite version 3.6.15
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> INSERT INTO PlayList_Song(id_song, id_playlist, song_number)  
> VALUES
>...> (5235, 9, 256);
> SQL error: database disk image is malformed
> sqlite> .q
>
> Then I tried with a previous version and the statement has been well
> executed. A colleague of mine made the same test  and he had the same
> troubles. So I don't thing it's a compiler issue.
> Did you make the test with windows console? Have I send you the
> database again?
> Thanks for your helpfulness!
>
>
>
>> Citando "D. Richard Hipp" :
>>
>>
>>> On Jun 18, 2009, at 12:36 PM, galea...@korg.it wrote:
>>>
>>>
 This statement is giving me truoble:
 INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES
 (5235, 9, 256)

>>> That INSERT statement works fine for me.
>>>
>>> Did you try recompiling with optimizations turned off?
>>>
>>>
>>>
>>> D. Richard Hipp
>>> d...@hwaci.com
>>>
>>>
>>>
>>> ___
>>> 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
>>
>> __ Informazioni da ESET NOD32 Antivirus, versione del  
>> database delle firme digitali 4177 (20090622) __
>>
>> Il messaggio è stato controllato da ESET NOD32 Antivirus.
>>
>> www.nod32.it
>>
>>
>>
>>
>>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] SQLITE_CORRUPT error

2009-06-23 Thread Andrea Galeazzi
Any news about this problem?
galea...@korg.it ha scritto:

In order to be more confidence about what I'm saying, I downloaded the  
precompiled sqlite console 3.6.15 (windows  version), I executed the  
statement above and I've got the following error:

sqlite3.exe malformed_db.db
SQLite version 3.6.15
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES
...> (5235, 9, 256);
SQL error: database disk image is malformed
sqlite> .q

Then I tried with a previous version and the statement has been well  
executed. A colleague of mine made the same test  and he had the same  
troubles. So I don't thing it's a compiler issue.
Did you make the test with windows console? Have I send you the  
database again?
Thanks for your helpfulness!



> Citando "D. Richard Hipp" :
>
>   
>> On Jun 18, 2009, at 12:36 PM, galea...@korg.it wrote:
>>
>> 
>>> This statement is giving me truoble:
>>> INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES
>>> (5235, 9, 256)
>>>   
>> That INSERT statement works fine for me.
>>
>> Did you try recompiling with optimizations turned off?
>>
>>
>>
>> D. Richard Hipp
>> d...@hwaci.com
>>
>>
>>
>> ___
>> 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
>
> __ Informazioni da ESET NOD32 Antivirus, versione del database delle 
> firme digitali 4177 (20090622) __
>
> Il messaggio è stato controllato da ESET NOD32 Antivirus.
>
> www.nod32.it
>
>
>
>
>   

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


Re: [sqlite] SQLITE_CORRUPT error

2009-06-19 Thread galeazzi
Citando "D. Richard Hipp" :

>
> On Jun 18, 2009, at 12:36 PM, galea...@korg.it wrote:
>
>> This statement is giving me truoble:
>> INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES
>> (5235, 9, 256)
>
> That INSERT statement works fine for me.
>
> Did you try recompiling with optimizations turned off?
>
>
>
> D. Richard Hipp
> d...@hwaci.com
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>

In order to be more confidence about what I'm saying, I downloaded the  
precompiled sqlite console 3.6.15 (windows  version), I executed the  
statement above and I've got the following error:

sqlite3.exe malformed_db.db
SQLite version 3.6.15
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES
...> (5235, 9, 256);
SQL error: database disk image is malformed
sqlite> .q

Then I tried with a previous version and the statement has been well  
executed. A colleague of mine made the same test  and he had the same  
troubles. So I don't thing it's a compiler issue.
Did you make the test with windows console? Have I send you the  
database again?
Thanks for your helpfulness!

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


Re: [sqlite] SQLITE_CORRUPT error

2009-06-18 Thread D. Richard Hipp

On Jun 18, 2009, at 12:36 PM, galea...@korg.it wrote:

> This statement is giving me truoble:
> INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES
> (5235, 9, 256)

That INSERT statement works fine for me.

Did you try recompiling with optimizations turned off?



D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] SQLITE_CORRUPT error

2009-06-18 Thread galeazzi
This statement is giving me truoble:
INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES  
(5235, 9, 256)
Citando "D. Richard Hipp" :

>
> On Jun 18, 2009, at 9:04 AM, galea...@korg.it wrote:
>
>> I updated sqlite version from 3.6.14 to 15, now when I try to run a
>> C++ code to fill the database I have SQLITE_CORRUPT error.
>
> Even with your new database that uses NOCASE in place of KORGCOLLATE,
> I don't have any problems.
>
> What query, specifically, is giving you trouble?
>
> Also:  We sometimes run into compiler bugs.  Please try recompiling
> with optimization disabled and see if that clears the problem.  If it
> does, that suggests the problem is in your compiler.
>
>
> D. Richard Hipp
> d...@hwaci.com
>
>
>
> ___
> 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


Re: [sqlite] SQLITE_CORRUPT error

2009-06-18 Thread D. Richard Hipp

On Jun 18, 2009, at 9:04 AM, galea...@korg.it wrote:

> I updated sqlite version from 3.6.14 to 15, now when I try to run a
> C++ code to fill the database I have SQLITE_CORRUPT error.

Even with your new database that uses NOCASE in place of KORGCOLLATE,  
I don't have any problems.

What query, specifically, is giving you trouble?

Also:  We sometimes run into compiler bugs.  Please try recompiling  
with optimization disabled and see if that clears the problem.  If it  
does, that suggests the problem is in your compiler.


D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] SQLITE_CORRUPT error

2009-06-18 Thread D. Richard Hipp

On Jun 18, 2009, at 9:04 AM, galea...@korg.it wrote:

> I updated sqlite version from 3.6.14 to 15, now when I try to run a
> C++ code to fill the database I have SQLITE_CORRUPT error.

Works fine when I run it with your database.

I cannot access any of the indices, though, since I lack the  
KORGCOLLATE collating function.  So maybe the problem is in one of  
your indices.  Have you tried running REINDEX?


D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] SQLITE_CORRUPT error

2009-06-18 Thread D. Richard Hipp

On Jun 18, 2009, at 11:01 AM, galea...@korg.it wrote:

> I run "PRAGMA integrity_check" using version 3.6.14 at the end of the
> code and it executed a query with only one row "ok", so where do I
> have to send the databbase?

d...@sqlite.org

>
> Thanks
>
> Citando "D. Richard Hipp" :
>
>>
>> On Jun 18, 2009, at 9:04 AM, galea...@korg.it wrote:
>>
>>> I updated sqlite version from 3.6.14 to 15, now when I try to run a
>>> C++ code to fill the database I have SQLITE_CORRUPT error.
>>
>> New logic was added to version 3.6.15 to detect database corruption
>> sooner.
>>
>> What happens when you run "PRAGMA integrity_check" using version
>> 3.6.14?  Do you see the problem then too?  If so, that means your
>> database is corrupt and it was simply going undetected before.  If
>> not, then please email you database and I will have a look.
>>
>>
>>> This error
>>> happens in the accessPayload method (btree.c) in the condition
>>> if( rc==SQLITE_OK && amt>0 ){
>>>return SQLITE_CORRUPT_BKPT;
>>> }
>>> where rc is SQLITE_OK but amt = 12070.
>>> It follows a part of call stack:
>>> int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void  
>>> *pBuf){
>>> ..
>>>rc = accessPayload(pCur, offset, amt, (unsigned char*)pBuf, 0,  
>>> 0);
>>>  }
>>>
>>> static int saveCursorPosition(BtCursor *pCur){
>>> ...
>>>  if( pKey ){
>>>  rc = sqlite3BtreeKey(pCur, 0, (int)pCur->nKey, pKey);
>>>
>>> static int saveAllCursors(BtShared *pBt, Pgno iRoot, BtCursor
>>> *pExcept){
>>>  BtCursor *p;
>>>  assert( sqlite3_mutex_held(pBt->mutex) );
>>>  assert( pExcept==0 || pExcept->pBt==pBt );
>>>  for(p=pBt->pCursor; p; p=p->pNext){
>>>if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) &&
>>>p->eState==CURSOR_VALID ){
>>>  int rc = saveCursorPosition(p);
>>>  if( SQLITE_OK!=rc ){
>>>return rc;
>>>  }
>>>}
>>>  }
>>>  return SQLITE_OK;
>>> }
>>>
>>> int sqlite3BtreeDelete(BtCursor *pCur){
>>>  .
>>>(rc = restoreCursorPosition(pCur))!=0 ||
>>>(rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur))!=0 ||
>>>(rc = sqlite3PagerWrite(pPage->pDbPage))!=0
>>>  ){
>>>return rc;
>>>
>>>
>>> The statement is:
>>> "INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES
>>> (?, ?, ?)"
>>> and the table is:
>>> CREATE TABLE PlayList_Song (
>>>id_song INT NOT NULL,
>>>id_playlist INT NOT NULL,
>>>song_number INTEGER NOT NULL,
>>> PRIMARY KEY (id_playlist, song_number),
>>> CONSTRAINT fk_PlayList_Song1 FOREIGN KEY (id_song)
>>>REFERENCES Song (id)
>>>ON DELETE CASCADE
>>>ON UPDATE CASCADE,
>>> CONSTRAINT fk_PlayList_Song2 FOREIGN KEY (id_playlist)
>>>REFERENCES PlayList (id)
>>>ON DELETE CASCADE
>>>ON UPDATE CASCADE);
>>>
>>> CREATE INDEX PlayList_Song_song_number_idx ON
>>> PlayList_Song(song_number);
>>>
>>> Have you got any ideas about this problem? Is it a bug of new  
>>> version?
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>> D. Richard Hipp
>> d...@hwaci.com
>>
>>
>>
>> ___
>> 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

D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] SQLITE_CORRUPT error

2009-06-18 Thread galeazzi
I run "PRAGMA integrity_check" using version 3.6.14 at the end of the  
code and it executed a query with only one row "ok", so where do I  
have to send the databbase?
Thanks

Citando "D. Richard Hipp" :

>
> On Jun 18, 2009, at 9:04 AM, galea...@korg.it wrote:
>
>> I updated sqlite version from 3.6.14 to 15, now when I try to run a
>> C++ code to fill the database I have SQLITE_CORRUPT error.
>
> New logic was added to version 3.6.15 to detect database corruption
> sooner.
>
> What happens when you run "PRAGMA integrity_check" using version
> 3.6.14?  Do you see the problem then too?  If so, that means your
> database is corrupt and it was simply going undetected before.  If
> not, then please email you database and I will have a look.
>
>
>> This error
>> happens in the accessPayload method (btree.c) in the condition
>> if( rc==SQLITE_OK && amt>0 ){
>> return SQLITE_CORRUPT_BKPT;
>> }
>> where rc is SQLITE_OK but amt = 12070.
>> It follows a part of call stack:
>> int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
>>  ..
>> rc = accessPayload(pCur, offset, amt, (unsigned char*)pBuf, 0, 0);
>>   }
>>
>> static int saveCursorPosition(BtCursor *pCur){
>> ...
>>   if( pKey ){
>>   rc = sqlite3BtreeKey(pCur, 0, (int)pCur->nKey, pKey);
>>
>> static int saveAllCursors(BtShared *pBt, Pgno iRoot, BtCursor
>> *pExcept){
>>   BtCursor *p;
>>   assert( sqlite3_mutex_held(pBt->mutex) );
>>   assert( pExcept==0 || pExcept->pBt==pBt );
>>   for(p=pBt->pCursor; p; p=p->pNext){
>> if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) &&
>> p->eState==CURSOR_VALID ){
>>   int rc = saveCursorPosition(p);
>>   if( SQLITE_OK!=rc ){
>> return rc;
>>   }
>> }
>>   }
>>   return SQLITE_OK;
>> }
>>
>>  int sqlite3BtreeDelete(BtCursor *pCur){
>>   .
>> (rc = restoreCursorPosition(pCur))!=0 ||
>> (rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur))!=0 ||
>> (rc = sqlite3PagerWrite(pPage->pDbPage))!=0
>>   ){
>> return rc;
>>
>>
>> The statement is:
>> "INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES
>> (?, ?, ?)"
>> and the table is:
>> CREATE TABLE PlayList_Song (
>> id_song INT NOT NULL,
>> id_playlist INT NOT NULL,
>> song_number INTEGER NOT NULL,
>> PRIMARY KEY (id_playlist, song_number),
>> CONSTRAINT fk_PlayList_Song1 FOREIGN KEY (id_song)
>> REFERENCES Song (id)
>> ON DELETE CASCADE
>> ON UPDATE CASCADE,
>> CONSTRAINT fk_PlayList_Song2 FOREIGN KEY (id_playlist)
>> REFERENCES PlayList (id)
>> ON DELETE CASCADE
>> ON UPDATE CASCADE);
>>
>> CREATE INDEX PlayList_Song_song_number_idx ON
>> PlayList_Song(song_number);
>>
>> Have you got any ideas about this problem? Is it a bug of new version?
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> D. Richard Hipp
> d...@hwaci.com
>
>
>
> ___
> 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


Re: [sqlite] SQLITE_CORRUPT error

2009-06-18 Thread D. Richard Hipp

On Jun 18, 2009, at 9:04 AM, galea...@korg.it wrote:

> I updated sqlite version from 3.6.14 to 15, now when I try to run a
> C++ code to fill the database I have SQLITE_CORRUPT error.

New logic was added to version 3.6.15 to detect database corruption  
sooner.

What happens when you run "PRAGMA integrity_check" using version  
3.6.14?  Do you see the problem then too?  If so, that means your  
database is corrupt and it was simply going undetected before.  If  
not, then please email you database and I will have a look.


> This error
> happens in the accessPayload method (btree.c) in the condition
> if( rc==SQLITE_OK && amt>0 ){
> return SQLITE_CORRUPT_BKPT;
> }
> where rc is SQLITE_OK but amt = 12070.
> It follows a part of call stack:
> int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
>   ..
> rc = accessPayload(pCur, offset, amt, (unsigned char*)pBuf, 0, 0);
>   }
>
> static int saveCursorPosition(BtCursor *pCur){
> ...
>   if( pKey ){
>   rc = sqlite3BtreeKey(pCur, 0, (int)pCur->nKey, pKey);
>
> static int saveAllCursors(BtShared *pBt, Pgno iRoot, BtCursor  
> *pExcept){
>   BtCursor *p;
>   assert( sqlite3_mutex_held(pBt->mutex) );
>   assert( pExcept==0 || pExcept->pBt==pBt );
>   for(p=pBt->pCursor; p; p=p->pNext){
> if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) &&
> p->eState==CURSOR_VALID ){
>   int rc = saveCursorPosition(p);
>   if( SQLITE_OK!=rc ){
> return rc;
>   }
> }
>   }
>   return SQLITE_OK;
> }
>
>  int sqlite3BtreeDelete(BtCursor *pCur){
>   .
> (rc = restoreCursorPosition(pCur))!=0 ||
> (rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur))!=0 ||
> (rc = sqlite3PagerWrite(pPage->pDbPage))!=0
>   ){
> return rc;
>
>
> The statement is:
> "INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES
> (?, ?, ?)"
> and the table is:
> CREATE TABLE PlayList_Song (
> id_song INT NOT NULL,
> id_playlist INT NOT NULL,
> song_number INTEGER NOT NULL,
> PRIMARY KEY (id_playlist, song_number),
> CONSTRAINT fk_PlayList_Song1 FOREIGN KEY (id_song)
> REFERENCES Song (id)
> ON DELETE CASCADE
> ON UPDATE CASCADE,
> CONSTRAINT fk_PlayList_Song2 FOREIGN KEY (id_playlist)
> REFERENCES PlayList (id)
> ON DELETE CASCADE
> ON UPDATE CASCADE);
>
> CREATE INDEX PlayList_Song_song_number_idx ON  
> PlayList_Song(song_number);
>
> Have you got any ideas about this problem? Is it a bug of new version?
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

D. Richard Hipp
d...@hwaci.com



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


[sqlite] SQLITE_CORRUPT error

2009-06-18 Thread galeazzi
I updated sqlite version from 3.6.14 to 15, now when I try to run a  
C++ code to fill the database I have SQLITE_CORRUPT error. This error  
happens in the accessPayload method (btree.c) in the condition
if( rc==SQLITE_OK && amt>0 ){
 return SQLITE_CORRUPT_BKPT;
}
where rc is SQLITE_OK but amt = 12070.
It follows a part of call stack:
int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
..
 rc = accessPayload(pCur, offset, amt, (unsigned char*)pBuf, 0, 0);
   }

static int saveCursorPosition(BtCursor *pCur){
...
   if( pKey ){
   rc = sqlite3BtreeKey(pCur, 0, (int)pCur->nKey, pKey);

static int saveAllCursors(BtShared *pBt, Pgno iRoot, BtCursor *pExcept){
   BtCursor *p;
   assert( sqlite3_mutex_held(pBt->mutex) );
   assert( pExcept==0 || pExcept->pBt==pBt );
   for(p=pBt->pCursor; p; p=p->pNext){
 if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) &&
 p->eState==CURSOR_VALID ){
   int rc = saveCursorPosition(p);
   if( SQLITE_OK!=rc ){
 return rc;
   }
 }
   }
   return SQLITE_OK;
}

  int sqlite3BtreeDelete(BtCursor *pCur){
   .
 (rc = restoreCursorPosition(pCur))!=0 ||
 (rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur))!=0 ||
 (rc = sqlite3PagerWrite(pPage->pDbPage))!=0
   ){
 return rc;


The statement is:
"INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES  
(?, ?, ?)"
and the table is:
CREATE TABLE PlayList_Song (
 id_song INT NOT NULL,
 id_playlist INT NOT NULL,
 song_number INTEGER NOT NULL,
PRIMARY KEY (id_playlist, song_number),
CONSTRAINT fk_PlayList_Song1 FOREIGN KEY (id_song)
 REFERENCES Song (id)
 ON DELETE CASCADE
 ON UPDATE CASCADE,
CONSTRAINT fk_PlayList_Song2 FOREIGN KEY (id_playlist)
 REFERENCES PlayList (id)
 ON DELETE CASCADE
 ON UPDATE CASCADE);

CREATE INDEX PlayList_Song_song_number_idx ON PlayList_Song(song_number);

Have you got any ideas about this problem? Is it a bug of new version?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLITE_CORRUPT error

2008-01-03 Thread Kees Nuyt
On Thu, 3 Jan 2008 13:52:03 -0500, "Griggs, Donald"
<[EMAIL PROTECTED]> wrote:

>Maybe this is implied, but you might also try to .DUMP tables
>*invididually* if .DUMP'ing the entire database fails.

I didn't think of that, but yes, that is a good suggestion.
I hope it helps the original poster.
-- 
  (  Kees Nuyt
  )
c[_]

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] SQLITE_CORRUPT error

2008-01-03 Thread Griggs, Donald
 Regarding:
>>I suspect the answer is no, but is there any way to salvage any of the
data?

>You could try the .dump command in the command line tool, but I'm
afraid you're out of luck.



Maybe this is implied, but you might also try to .DUMP tables
*invididually* if .DUMP'ing the entire database fails.


 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQLITE_CORRUPT error

2008-01-03 Thread Kees Nuyt

Hi Doug,

On Wed, 2 Jan 2008 21:47:45 -0600, "Doug" <[EMAIL PROTECTED]>
wrote:

>I have a customer that has a database that has somehow become corrupted.
>I'm fairly certain he was on v3.4.1 but I'll double check. The database
>isn't completely bad, I can look at the master table and one of the two
>tables in the database. But if the second table is touched SQLITE_CORRUPT
>is returned. Running sqlite3_analyzer returns the following (StatData is
>the second table)
>
>Analyzing table StatData...
>
>ERROR: SQLITE_CORRUPT
>
>SQLITE_CORRUPT
>
>while executing
>
>"btree_next $csr"
>
>("foreach" body line 32)
>
>invoked from within
>
>"foreach {name rootpage} [db eval $sql] {
>
>puts stderr "Analyzing table $name..."
>
># Code below traverses the table being analyzed (table name $name..."
>
>He is running with pragma synchronous off, but I thought that only opened up
>the possibility for corruption if there was a power, OS, or hardware
>failure, which he doesn't think occurred (it is Windows, and the server was
>rebooted at some point.)

Some versions of Windows are known to fail to flush buffers to
disk at shutdown, because the system time-out "wait for hard
disk to complete flush" is too short.

Some applications don't listen to shutdown messages, and are
simply killed by the operating system, without commiting their
transaction, and without journal files, SLQite can't recover
(rollback unfinished transactions) when the database is opened.

Some tweaks to speedup shutdown kill services and applications
too fast.
Etc.

http://www.sqlite.org/pragma.html#pragma_synchronous 
http://www.sqlite.org/atomiccommit.html 

>I suspect the answer is no, but is there any way to salvage any of the data?

You could try the .dump command in the command line tool, but
I'm afraid you're out of luck.

>Thanks
>
>Doug
-- 
  (  Kees Nuyt
  )
c[_]

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] SQLITE_CORRUPT error

2008-01-02 Thread Doug
I have a customer that has a database that has somehow become corrupted.
I'm fairly certain he was on v3.4.1 but I'll double check. The database
isn't completely bad, I can look at the master table and one of the two
tables in the database. But if the second table is touched SQLITE_CORRUPT
is returned. Running sqlite3_analyzer returns the following (StatData is
the second table)

Analyzing table StatData...

ERROR: SQLITE_CORRUPT

SQLITE_CORRUPT

while executing

"btree_next $csr"

("foreach" body line 32)

invoked from within

"foreach {name rootpage} [db eval $sql] {

puts stderr "Analyzing table $name..."

# Code below traverses the table being analyzed (table name $name..."

He is running with pragma synchronous off, but I thought that only opened up
the possibility for corruption if there was a power, OS, or hardware
failure, which he doesn't think occurred (it is Windows, and the server was
rebooted at some point.)

I suspect the answer is no, but is there any way to salvage any of the data?

 

Thanks

Doug