1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Call sqlite3Prepare() directly, rather than going through sqlite3_prepare(),

when processing the sqlite_master.sql column for a schema.

FossilOrigin-Name: cc49380ea76a4a05843d3a0bdfb925464dc9d72c33cf5ab5243dd07d161ad038
This commit is contained in:
drh
2019-10-05 18:33:25 +00:00
parent 4d29448114
commit a22d2fca33
3 changed files with 21 additions and 8 deletions

View File

@@ -57,6 +57,18 @@ int sqlite3IndexHasDuplicateRootPage(Index *pIndex){
return 0;
}
/* forward declaration */
static int sqlite3Prepare(
sqlite3 *db, /* Database handle. */
const char *zSql, /* UTF-8 encoded SQL statement. */
int nBytes, /* Length of zSql in bytes. */
u32 prepFlags, /* Zero or more SQLITE_PREPARE_* flags */
Vdbe *pReprepare, /* VM being reprepared */
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
const char **pzTail /* OUT: End of parsed string */
);
/*
** This is the callback routine for the code that initializes the
** database. See sqlite3Init() below for additional information.
@@ -106,7 +118,8 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){
db->init.newTnum = sqlite3Atoi(argv[3]);
db->init.orphanTrigger = 0;
db->init.azInit = argv;
TESTONLY(rcp = ) sqlite3_prepare(db, argv[4], -1, &pStmt, 0);
pStmt = 0;
TESTONLY(rcp = ) sqlite3Prepare(db, argv[4], -1, 0, 0, &pStmt, 0);
rc = db->errCode;
assert( (rc&0xFF)==(rcp&0xFF) );
db->init.iDb = saved_iDb;