It returns 'ok':

./sqlite3 energy.sqlite
SQLite version 3.7.15.1 2012-12-19 20:39:10
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> pragma integrity_check;
ok
sqlite>

So, the original database looks ok.

I have compared the two databases (original and backup) and they
only differ in a few bytes in the header. The sizes match.

This is a diff between the hexdumps of both databases:

 diff energy.hex backup.hex
2,3c2,3
< 0000010 0004 0101 4000 2020 0000 f1d0 0000 7600
< 0000020 0000 9700 0000 2100 0000 0300 0000 0100
---
> 0000010 0004 0101 4000 2020 0000 0100 0000 7600
> 0000020 0000 9700 0000 2100 0000 0100 0000 0100
6,7c6,7
< 0000050 0000 0000 0000 0000 0000 0000 0000 0200
< 0000060 2d00 1de2 000d 0000 0004 00e3 7202 2002
---
> 0000050 0000 0000 0000 0000 0000 0000 0000 0100
> 0000060 2d00 27e2 000d 0000 0004 00e3 7202 2002



On 12/21/2012 02:34 PM, Eric Minbiole wrote:
Can you please try running "pragma integrity_check;" on the original
database?  That will give an indication of whether the original database
has any data corruption.


On Fri, Dec 21, 2012 at 4:13 AM, Marco ten Thije<
marco.tenth...@usetechnology.nl>  wrote:

Hello,

We are facing a problem with the '.backup' command using the SQLite
command line interface. The resulting backup-database seems to be corrupt.

We ran into this problem on a ARM9 platform using SQLite 3.7.5, but it can
also be reproduced on the latest 3.7.15.1 version on Intel.

I have attached our database to this email.  These are the steps to
reproduce it:

./sqlite3 energy.sqlite
SQLite version 3.7.15.1 2012-12-19 20:39:10
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>  select count(*) from EnergyLogData;
3306
sqlite>  .backup backup.sqlite
sqlite>  .exit

The above shows the number of records in one of the tables and creates a
backup to a new 'backup.sqlite' database file. But this new file
seems to be corrupt:

./sqlite3 backup.sqlite
SQLite version 3.7.15.1 2012-12-19 20:39:10
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>  select count(*) from EnergyLogData;
Error: database disk image is malformed
sqlite>  .exit

I have look into the Bug database and found ticket 3858, but that one
should already be fixed and we are not writing to the database during
the backup.

Is this a bug or some other problem?

--
Regards,
Marco ten Thije
------------------------------**------------------------------**
------------

*Use system engineering bv*
Loc: Industriestraat 77 - 7482 EW HAAKSBERGEN - The Netherlands  Mail
Address: Postbus 236 - 7480 AE HAAKSBERGEN - The Netherlands
T: +31 53 5741456  F: +31 53 5741458   E: marco.tenthije@usetechnology.**
nl<marco.tenth...@usetechnology.nl>  <mailto:marco.tenthije@**
usetechnology.nl<marco.tenth...@usetechnology.nl>>    I:
www.usetechnology.nl<http://www.usetechnology.nl/>
Chamber of Commerce nr: Veluwe en Twente 528 98210  VAT nr.: NL
8506.54.713B01
------------------------------**------------------------------**
------------
/This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender by
return e-mail and delete this message from your system. Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change. Use system
engineering bv shall not be liable for the improper or incomplete
transmission of the information contained in this communication nor for any
delay in its receipt or damage to your system. Use system engineering bv
does not guarantee that the integrity of this communication has been
maintained nor that this communication is free of viruses, interceptions or
interference. /

_______________________________________________
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


--
Met een vriendelijke groet,
Marco ten Thije
------------------------------------------------------------------------

*Use system engineering bv*
Bezoekadres: Industriestraat 77 - 7482 EW HAAKSBERGEN - The Netherlands Postadres: Postbus 236 - 7480 AE HAAKSBERGEN - The Netherlands T: 053 5741456 F: 053 5741458 E: marco.tenth...@usetechnology.nl <mailto:marco.tenth...@usetechnology.nl> I: www.usetechnology.nl <http://www.usetechnology.nl/>
KvK nr: Veluwe en Twente 528 98210  BTW nr.: NL 8506.54.713B01
------------------------------------------------------------------------
/Dit bericht (inclusief de eventuele bijlagen) is vertrouwelijk. Wanneer u dit bericht ten onrechte heeft ontvangen, dient u de afzender hiervan onmiddellijk per kerende e-mail op de hoogte te brengen en dit bericht te verwijderen uit uw systeem. Elk onbevoegd gebruik en/of onbevoegde verspreiding van dit bericht is niet toegestaan. U wordt erop gewezen dat e-mailberichten aan wijziging onderhevig kunnen zijn. Use system engineering bv is niet aansprakelijk voor de onjuiste en onvolledige overdracht van de informatie in dit bericht noch voor mogelijke vertraging in de ontvangst van dit bericht of schade aan uw systeem als gevolg van dit bericht. Use system engineering bv staat er niet voor in dat de integriteit van dit bericht behouden is gebleven noch dat dit bericht vrij is van virussen, niet is onderschept of vatbaar is geweest voor tussenkomst (door derden). /
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to