我正在开发一个使用sqlite的Android应用 在某些设备上,一切运行顺畅 但是在某些设备上数据库被破坏了。
此外,看起来这个问题出现在特定设备上(数百个中的3个 - 所有相同型号)。所以也许在设备内部存储器上存在坏块 事实上,我可以在“小车”上重现这个问题。平板电脑(我可以很容易地重现数据库损坏) 为此,我只是在其中一个数据库表中循环插入数据。过了一会儿,数据库已损坏。在另一台设备(从未在损坏的数据库中运行的设备)上执行完全相同的操作时,数据库不会损坏。
我设法检索了sqlite数据库并运行了*** in database main ***
Main freelist: freelist leaf count too big on page 15684
Main freelist: invalid page number 167772160
On tree page 51 cell 19: Rowid 28967 out of order
On tree page 51 cell 19: Child page depth differs
On tree page 15143 cell 0: invalid page number 15712
On tree page 10027 cell 18: invalid page number 15700
On tree page 10168 cell 15: invalid page number 15687
On tree page 15083 cell 0: invalid page number 15717
On tree page 15497 cell 0: invalid page number 15726
On tree page 9460 cell 24: invalid page number 15704
On tree page 13664 cell 0: invalid page number 15724
On tree page 14803 cell 0: invalid page number 15722
On tree page 10811 cell 0: invalid page number 15703
On tree page 45 cell 0: invalid page number 15739
On tree page 13941 cell 0: invalid page number 15730
On tree page 13941 cell 70: invalid page number 15694
On tree page 13941 cell 62: Rowid 24273 out of order
On tree page 14620 cell 0: invalid page number 15732
On tree page 14620 cell 35: invalid page number 15695
On tree page 13734 cell 0: invalid page number 15743
On tree page 15639 cell 0: invalid page number 15737
On tree page 15639 cell 82: invalid page number 15733
On tree page 15639 cell 81: invalid page number 15731
On tree page 15639 cell 80: invalid page number 15725
On tree page 15639 cell 79: invalid page number 15721
On tree page 15639 cell 78: invalid page number 15718
On tree page 15639 cell 77: invalid page number 15713
On tree page 15639 cell 76: invalid page number 15710
On tree page 15639 cell 75: invalid page number 15709
On tree page 15639 cell 74: invalid page number 15706
On tree page 15639 cell 73: invalid page number 15701
On tree page 15639 cell 72: invalid page number 15696
On tree page 15639 cell 71: invalid page number 15692
On tree page 15639 cell 70: invalid page number 15689
On tree page 15639 cell 69: invalid page number 15685
On tree page 15639 cell 67: Rowid 99423 out of order
On tree page 15639 cell 66: Rowid 99411 out of order
On tree page 15677 cell 21: 2nd reference to page 3760
On tree page 15677 cell 15: 2nd reference to page 3670
On tree page 15677 cell 13: 2nd reference to page 3638
On tree page 15677 cell 12: 2nd reference to page 3624
On tree page 15677 cell 11: 2nd reference to page 3606
On tree page 15677 cell 9: 2nd reference to page 3577
On tree page 15677 cell 7: 2nd reference to page 3545
On tree page 15677 cell 4: 2nd reference to page 3498
On tree page 15677 cell 1: 2nd reference to page 3449
On tree page 15639 cell 66: Child page depth differs
On tree page 15639 cell 65: Rowid 99399 out of order
On tree page 15639 cell 65: Child page depth differs
On tree page 15639 cell 62: Rowid 99363 out of order
On tree page 15639 cell 1: Rowid 98631 out of order
On tree page 3746 cell 95: 2nd reference to page 3853
On tree page 3746 cell 87: 2nd reference to page 3839
On tree page 3746 cell 80: 2nd reference to page 3824
On tree page 3746 cell 57: 2nd reference to page 3779
On tree page 3746 cell 43: 2nd reference to page 3750
On tree page 3746 cell 35: 2nd reference to page 3731
On tree page 3746 cell 11: 2nd reference to page 3685
On tree page 3548 cell 93: 2nd reference to page 3650
On tree page 3548 cell 64: 2nd reference to page 3591
On tree page 3548 cell 47: 2nd reference to page 3558
On tree page 3548 cell 33: 2nd reference to page 3527
On tree page 3548 cell 26: 2nd reference to page 3513
On tree page 3548 cell 0: 2nd reference to page 3467
On tree page 3354 cell 85: 2nd reference to page 3439
On tree page 14960 cell 0: invalid page number 15723
On tree page 14960 cell 64: invalid page number 15698
On tree page 3613 cell 39: 2nd reference to page 3811
On tree page 3613 cell 38: 2nd reference to page 3795
On tree page 15647 cell 0: invalid page number 15744
On tree page 15647 cell 27: invalid page number 15728
On tree page 15647 cell 26: invalid page number 15714
On tree page 15647 cell 25: invalid page number 15702
On tree page 15647 cell 24: invalid page number 15686
On tree page 3741 cell 12: 2nd reference to page 3718
On tree page 3433 cell 8: 2nd reference to page 3483
On tree page 15283 cell 0: invalid page number 15742
On tree page 15283 cell 50: invalid page number 15719
On tree page 15283 cell 49: invalid page number 15697
On tree page 15449 cell 5: Rowid 12544 out of order
On tree page 3702 cell 20: 2nd reference to page 3701
On tree page 14774 cell 0: invalid page number 15738
On tree page 14774 cell 61: invalid page number 15715
On tree page 14774 cell 60: invalid page number 15691
On tree page 2910 cell 42: 2nd reference to page 3873
Page 5128 is never used
Page 5129 is never used
Page 5130 is never used
Page 5131 is never used
Page 8656 is never used
Page 8727 is never used
Page 8832 is never used
Page 8834 is never used
Page 8886 is never used
Page 8890 is never used
Page 8948 is never used
Page 9008 is never used
Page 9063 is never used
Page 9122 is never used
Page 9178 is never used
结果如下:
https://sqlite.org/howtocorrupt.html
我已阅读$("form.signupform").submit(function(e) {
e.preventDefault(); // <-- add this
var data = $(this).serialize();
var url = $(this).attr("action");
以尝试了解我的数据库是如何损坏的。
pragma integrity_check的结果怎么办?我真的不知道如何处理这些信息。你是否注意到任何可以帮助我理解发生了什么的信息? 关于如何在Android设备上检查磁盘完整性的任何想法(理想情况下在OS启动之前)?你认为我应该朝这个方向看吗?