I am running a small but critical application on an Android phone. It uses an sqlite database as its main data storage. After over a year of near flawless functioning, it suddenly crashed at a critical point a few days ago as a result of the infamous "database disk image is malformed" problem. This caused some embarassment as I couldn't access the system to fix it for a few hours.
I'm aware that such situations should be very rare. But I'm now coding in some code to more gracefully recover from such a situation, since I can't afford to have it happen again (and it may be due to the phone's hardware, in which case it might now start to happen more frequently - but again I can't afford a crash even once more).
However, to test my recovery code, I need to generate the same error, and due to a stupid mistake I lost the copy of the database that was creating the problem.
My question is - is there something I can do to an sqlite database that would result in the "database disk image is malformed" error? I can then test my recovery code.