Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My wife uses Audacity all day and every few days there is a corrupt sqlite file (duplicate key) which cannot be (as far as we know) repaired/reimported etc from Audacity. I can fix it manually if it's important, but usually just throw the file away and things work again.


Duplicate keys in a SQLite file sounds like an audacity bug. :(


Maybe. The SQLite list of gotchas [0] is quite something. NULLs in the PK? Sure. FKs don’t actually do anything unless you pass a PRAGMA? Why not? Etc. I could easily see someone not fully grasping just how much SQLite lets pass by default, and thus not having a test catch it.

[0]: https://www.sqlite.org/quirks.html


Yeah, it definitely is. And it's fixable manually. Kind of the advantage to an open file format with nice tooling.


It also sounds like something that could be manually prevented ahead of time. If you can crack open the file on first save and add the right uniqueness constraint, that should make Audacity crash when it tries to corrupt the data.


> ... that should make Audacity crash when it tries to corrupt the data.

That'd be fairly non-optimal behaviour. ;)

When the application tries to add wrong data (eg duplicate key violating uniqueness constraint), SQLite will return an error.

The application should handle things better than by crashing. In theory anyway. :)


If your choices are a crash or corruption, choose the crash.


Sure, data integrity is important.

But hopefully the choices are a bit better than just those two. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: