title: Can I deliberately corrupt an sqlite3 database for testing?
body: <p>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.  </p>
  
  <p>I'm aware that such situations should be <a href="http://www.sqlite.org/testing.html" rel="nofollow">very rare</a>.  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). </p>
  
  <p>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.</p>
  
  <p>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.    </p>