Malformed schema (orphan index) on particular db with the version 3.27.2

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Malformed schema (orphan index) on particular db with the version 3.27.2

Max Vlasov
Hi,

I have a database that used in software since probably 2010, there are many
variants of this database at my hd and everything was fine with it starting
3.6.10 through 3.26.00, I'm not sure about every version, but during the
version history, at least several was used to open it.

But 3.27.2 said
  malformed database schema ({sqlite_autoindex_mytablename}_1) - orphan
index.

if I open the db in 3.26.0 and make VACUUM, then 3.27.2 is ok with it. If I
delete every row except the first one from the table in 3.26, version
3.27.2 still says it's bad.

I tried to google something about this and some of results at the web
contained "orphan index" with a ticket somewhere near jan 2019. I'm not
sure this is related, but maybe some recent change might affect this.

If sqlite now is more constraint with indexes errors due some reasons, I
will probably should reopen my existing databases to check. But if this is
due some bug, fixing it would probably save much time for me :)

Thanks

Max
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Malformed schema (orphan index) on particular db with the version 3.27.2

Richard Hipp-3
On 3/15/19, Max Vlasov <[hidden email]> wrote:
>
> But 3.27.2 said
>   malformed database schema ({sqlite_autoindex_mytablename}_1) - orphan
> index.

This error message arises from enhanced early detection of corrupt
database files that was added to version 3.27.x.  Do you still have
the original database, before you VACUUM-ed it?  If so, what does it
say if you run "PRAGMA integrity_check" on that database.

Can you share the database with me, through private email?  There is
always the possibility that the enhanced early detection of corrupt
databases is giving a false-positive.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Malformed schema (orphan index) on particular db with the version 3.27.2

Max Vlasov
I noticed I replied directly to drh with the integrity_check answer
So I repeat the information here

PRAGMA integrity_check in 3.26.0
says
 *** in database main ***
Page 3 is never used
{ skipped about 20 lines }
Page 268 is never used

Additional information:
- My logic behind the opening includes querying Pragma encoding. So the
error message in question appear on this particular query and not when the
db is opened.
- Today I made a full scan of folder that might contain sqlite bases (based
on excluding obvious files with non-db extensions and checking the rest for
the starting sequence) and within hundreds of sqlite bases (some of them
though are identical backups), only this one and derivatives reveals the
error when performing the PRAGMA on them.

So I suspect that the file is a very rare example of inconsistency of data
not compatible with recent version, but working with older ones.

Max


On Fri, 15 Mar 2019 at 18:00, Richard Hipp <[hidden email]> wrote:

> On 3/15/19, Max Vlasov <[hidden email]> wrote:
> >
> > But 3.27.2 said
> >   malformed database schema ({sqlite_autoindex_mytablename}_1) - orphan
> > index.
>
> This error message arises from enhanced early detection of corrupt
> database files that was added to version 3.27.x.  Do you still have
> the original database, before you VACUUM-ed it?  If so, what does it
> say if you run "PRAGMA integrity_check" on that database.
>
> Can you share the database with me, through private email?  There is
> always the possibility that the enhanced early detection of corrupt
> databases is giving a false-positive.
>
> --
> D. Richard Hipp
> [hidden email]
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Malformed schema (orphan index) on particular db with the version 3.27.2

Simon Slavin-3
On 16 Mar 2019, at 9:34am, Max Vlasov <[hidden email]> wrote:

> So I suspect that the file is a very rare example of inconsistency of data not compatible with recent version, but working with older ones.

Integrity-checking has been improved since 3.26.0.  Newer versions of SQLite check for types of corruption that older versions didn't detect.

So your database file is actually corrupt for both versions.  It's just that the integrity_check routine from the old one didn't notice that type of error.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users