1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Add interfaces sqlite3_prepare_v3() and sqlite3_prepare16_v3() with the

extra prepFlags argument.  Add the SQLITE_PREPARE_PERSISTENT option as one
bit in that argument.

FossilOrigin-Name: 4a25c5883380fe5990d8180adb58c3bdc7a3d081bc4c69cd4de3cd57074fb251
This commit is contained in:
drh
2017-06-01 00:54:35 +00:00
parent cdbb126be7
commit 2c2f392dca
15 changed files with 211 additions and 93 deletions

View File

@@ -1214,12 +1214,18 @@ static int dbPrepare(
sqlite3_stmt **ppStmt, /* OUT: Prepared statement */
const char **pzOut /* OUT: Pointer to next SQL statement */
){
unsigned int prepFlags = 0;
#ifdef SQLITE_TEST
if( pDb->bLegacyPrepare ){
return sqlite3_prepare(pDb->db, zSql, -1, ppStmt, pzOut);
}
#endif
return sqlite3_prepare_v2(pDb->db, zSql, -1, ppStmt, pzOut);
/* If the statement cache is large, use the SQLITE_PREPARE_PERSISTENT
** flags, which uses less lookaside memory. But if the cache is small,
** omit that flag to make full use of lookaside */
if( pDb->maxStmt>5 ) prepFlags = SQLITE_PREPARE_PERSISTENT;
return sqlite3_prepare_v3(pDb->db, zSql, -1, prepFlags, ppStmt, pzOut);
}
/*