google-code-export / sqljet

Automatically exported from code.google.com/p/sqljet
0 stars 1 forks source link

sqlite files produced by latest versions of IOS devices fail #170

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Backup an iOS 6 device using latest verison of iTunes
2. Use any extractor (e.g. https://sourceforge.net/projects/iphoneanalyzer/ to 
extract)
3. Open any sqlite file using the sqljet browser 

What is the expected output? What do you see instead?

org.tmatesoft.sqljet.core.SqlJetException: NOTADB: error code is NOTADB
    at org.tmatesoft.sqljet.core.internal.btree.SqlJetBtree.lockBtree(SqlJetBtree.java:755)
    at org.tmatesoft.sqljet.core.internal.btree.SqlJetBtree.beginTrans(SqlJetBtree.java:923)
    at org.tmatesoft.sqljet.core.internal.btree.SqlJetBtree.lockWithRetry(SqlJetBtree.java:2310)
    at org.tmatesoft.sqljet.core.internal.btree.SqlJetBtreeCursor.<init>(SqlJetBtreeCursor.java:225)
    at org.tmatesoft.sqljet.core.internal.btree.SqlJetBtree.getCursor(SqlJetBtree.java:2292)
    at org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable.pushState(SqlJetBtreeTable.java:131)
    at org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable.init(SqlJetBtreeTable.java:108)
    at org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable.<init>(SqlJetBtreeTable.java:89)
    at org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeSchemaTable.<init>(SqlJetBtreeSchemaTable.java:41)
    at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.openSchemaTable(SqlJetSchema.java:158)
    at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.init(SqlJetSchema.java:164)
    at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.<init>(SqlJetSchema.java:154)
    at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine$2.runSynchronized(SqlJetEngine.java:282)
    at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine.runSynchronized(SqlJetEngine.java:217)
    at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine.readSchema(SqlJetEngine.java:276)
    at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine.refreshSchema(SqlJetEngine.java:310)
    at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine.getSchemaInternal(SqlJetEngine.java:316)
    at org.tmatesoft.sqljet.core.table.SqlJetDb.getSchema(SqlJetDb.java:183)
    at org.tmatesoft.sqljet.browser.core.schema.SchemaComponent.open(SchemaComponent.java:51)
    at org.tmatesoft.sqljet.browser.core.BrowserComponentManager.stateChanged(BrowserComponentManager.java:220)
    at org.tmatesoft.sqljet.browser.core.BrowserComponentManager.open(BrowserComponentManager.java:195)
    at org.tmatesoft.sqljet.browser.core.actions.OpenAction.actionPerformed(OpenAction.java:68)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
    at java.awt.Component.processMouseEvent(Component.java:6505)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:682)
    at java.awt.EventQueue$3.run(EventQueue.java:680)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:696)
    at java.awt.EventQueue$4.run(EventQueue.java:694)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

What version of the product are you using? On what operating system?

1.1.5 (and previous versions) on multiple OS

Please provide any additional information below.

Files are validates as working with other sqlite clients

Original issue reported on code.google.com by l...@leocrawford.org.uk on 17 Dec 2012 at 8:07

GoogleCodeExporter commented 9 years ago
Could you attach there any file that causes the issue, please? Thanks in 
advance.

Original comment by sergey.s...@gmail.com on 18 Dec 2012 at 10:04

GoogleCodeExporter commented 9 years ago
Hi,

I'm happy to share an example file, but wouldn't want it to be
widely publicly accessible.

If you're happy to let me know an email address, I'm happy to send an
example.

Leo

Original comment by l...@leocrawford.org.uk on 20 Dec 2012 at 4:58

GoogleCodeExporter commented 9 years ago
Of course:

sergey.scherbina@gmail.com

Thanks you.

Original comment by sergey.s...@gmail.com on 20 Dec 2012 at 5:00

GoogleCodeExporter commented 9 years ago
Hi Leo,

I've looked your db file and found that it uses WAL 
(http://www.sqlite.org/wal.html) feature which just isn't supported yet in 
SqlJet. Sorry. In future we're planning to try implement WAL support in SqlJet 
but right now I can't say exactly when it'll be done.

You could use an advice which is stated in "Backwards Compatibility":

"The database file format is unchanged for WAL mode. However, the WAL file and 
the wal-index are new concepts and so older versions of SQLite will not know 
how to recover a crashed SQLite database that was operating in WAL mode when 
the crash occurred. To prevent older versions of SQLite from trying to recover 
a WAL-mode database (and making matters worse) the database file format version 
numbers (bytes 18 and 19 in the database header) are increased from 1 to 2 in 
WAL mode. Thus, if an older version of SQLite attempts to connect to an SQLite 
database that is operating in WAL mode, it will report an error along the lines 
of "file is encrypted or is not a database".

One can explicitly change out of WAL mode using a pragma such as this:

PRAGMA journal_mode=DELETE;
Deliberately changing out of WAL mode changes the database file format version 
numbers back to 1 so that older versions of SQLite can once again access the 
database file."

Original comment by sergey.s...@gmail.com on 22 Dec 2012 at 1:00