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:
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user