Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] drop collection and REBUILD corrupts the file #1665

Closed
nant1086 opened this issue May 2, 2020 · 1 comment
Closed

[BUG] drop collection and REBUILD corrupts the file #1665

nant1086 opened this issue May 2, 2020 · 1 comment
Labels

Comments

@nant1086
Copy link

nant1086 commented May 2, 2020

Version: litedb-ce-v5.0.7 / LiteDB Studio 1.0.2.0 / Windows 10 / Net Core 3

Describe the bug
First of all, I think this project is amazing!, after some toying with it, I found a scenario which throws an error and I wasn't able to access the database anymore

Steps to reproduce

  1. Open the file with ConnectionType.Shared,
  2. Insert rows to 1 single collection, there is one single collection only
  3. With LiteDB Studio, execute drop collection then rebuild with collation or selecting the rebuild word only
  4. Try to connect to the file and this error is thrown: Unable to cast object of type 'LiteDB.Engine.HeaderPage' to type 'LiteDB.Engine.IndexPage'.

A possible workaround is to delete all rows instead of dropping the collection, then rebuild to reduce the file size, and everything works ok

I hope this bug isn't so hard to solve, good luck!

@lbnascimento
Copy link
Collaborator

@nant1086 This issue has been fixed in the master and its fix will be present in the next incremental release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants