4 ms·
Big fan of sqlite. But have to say I'm surprised to see how much testing it gets. While it's great when it works sqlite databases are definitely temperamental.
by mSparks 10y ago
Big fan of sqlite.
But have to say I'm surprised to see how much testing it gets. While it's great when it works sqlite databases are definitely temperamental.
In fact those test suites being so large is possibly part of the problem. Sounds like they are being overly prescriptive in their testing, which is why it's so damn fussy about the order commands are executed without causing it to leak memory left right and center.
- TickleSteve 10y agoregarding being temperamental.... You're going to have to justify that a bit more, that would not be the overwhelming experience around these parts. Not to say its perfect but its the weight of evidence is in SQLites favour here.
- mSparks 10y agoMeh, like I said, big fan of SQLite. But any use of it in a "serious" application will undoubtably run into: Error: database disk image is malformed On a fairly regular basis. Google gives:About 57,400 results So I'm definitely not the only one.
- TickleSteve 10y agohttp://www.sqlite.org/lockingv3.html#how_to_corrupt http://www.sqlite.org/lockingv3.html#how_to_corrupt http://www.sqlite.org/cvstrac/wiki?p=DatabaseCorruption http://www.sqlite.org/cvstrac/wiki?p=DatabaseCorruption (Just so you know)
- olavgg 10y agoThis is so true, some consumer SSD's are so evil that they do not even honor ATA_CMD_FLUSH. Bad things will happen then.
- mSparks 10y agoYeah. There's that. But there are also numerous memory leaks that have to be carefully managed. Opening and closing the database regularly is usually enough. And if you do manage to let it run long enough to use all the system ram, that will malform the database to. Transactions are particularly bad. One bug I ran into earlier in the year would gobble up 12gb of system ram trying to search and insert a few 10s of mb of text, just because it was leaving prepared statements laying around without telling me.
- TickleSteve 10y agoSounds like a pretty serious bug that would probably affect millions of people.... ... thanks for reporting it. (https://www.sqlite.org/malloc.html https://www.sqlite.org/malloc.html) "No memory leaks. The application is responsible for destroying any objects it allocates." "Robust against allocation failures. If a memory allocation ever fails (that is to say, if malloc() or realloc() ever return NULL) then SQLite will recover gracefully."
- mSparks 10y agoFine. But in practice. By time malloc returns null. It's blown up anything on the system that doesn't recover gracefully. possibly the file system. Which is possibly how the database becomes corrupt. And I see plenty of reported examples and work arounds. Even yum has been suffering from it for years. http://forums.fedoraforum.org/showthread.php?t=260195 http://forums.fedoraforum.org/showthread.php?t=260195 http://www.pvangsgaard.com/2016/03/16/yum-error-database-disk-image-is-malformed/ http://www.pvangsgaard.com/2016/03/16/yum-error-database-dis...
- TickleSteve 10y agoThe number of applications using sqlite successfully is very much greater than 1. You need substantially more evidence than that to state that what appears to be simple user error is actually a design flaw in software that tests specifically for the examples you state and is also well known for the quality of that testing.
- aexaey 10y ago...care to give an example for sqlite being "temperamental"?
- has2k1 10y agoThe testing is only excessive if you do not know the issues(s) they are trying to avoid[1]. [1] https://www.sqlite.org/howtocorrupt.html https://www.sqlite.org/howtocorrupt.html
- mSparks 10y agoI didn't say "excessive" I said "prescriptive". i.e. of the nature (pseudocode): testCommand1(); testCommand2(); testCommand3(); testCommand4(); testCommand5(); testCommand6(); rather than: for 1 to 1000 testCommand(random 1 to 6) 6 lines instead of 2, and less robust testing.