Update sqlite3_prepare() to sqlite3_prepare_v2() in pdo_sqlite.cpp
Summary:
D20239885 updates the SQLite schema but doesn't bump the version. In theory this was safe, but Daniel15 [ran into an issue](https://fb.workplace.com/groups/
175783763370419/) where an existing request failed with error code [`SQLITE_SCHEMA`](https://sqlite.org/rescode.html#schema) due to executing a stale prepared statement.
From [the SQLite docs](https://sqlite.org/rescode.html#schema):
> The SQLITE_SCHEMA result code indicates that the database schema has changed. This result code can be returned from sqlite3_step() for a prepared statement that was generated using sqlite3_prepare() or sqlite3_prepare16(). If the database schema was changed by some other process in between the time that the statement was prepared and the time the statement was run, this error can result.
> If a prepared statement is generated from sqlite3_prepare_v2() then the statement is automatically re-prepared if the schema changes, up to SQLITE_MAX_SCHEMA_RETRY times (default: 50). The sqlite3_step() interface will only return SQLITE_SCHEMA back to the application if the failure persists after these many retries.
Unfortunately, SQLFacts uses `pdo_sqlite.cpp`, which uses the legacy `sqlite3_prepare()` function. This is a drop-in replacement, and I'm already using `sqlite3_prepare_v2()` in the native autoloader:
https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/fbcode/hphp/util/sqlite-wrapper.cpp?commit=
509e9b894abcb258fbba3cd4ce7599c0ce6356b0&lines=302-303
Created from Diffusion's 'Open in Editor' feature.
Reviewed By: ricklavoie
Differential Revision:
D20269726
fbshipit-source-id:
a5e1046559f719d284cb17d5bcd753b806a141a3