ext/pdo_sqlite/sqlite/src/prepare.c
/*
** Check schema cookies in all databases.  If any cookie is out
** of date, return 0.  If all schema cookies are current, return 1.
*/
Check schema cookies in all databases.  If any cookie is out
of date, return 0.  If all schema cookies are current, return 1.
Check schema cookies in all databases . If any cookie is out of date return 0 . If all schema cookies are current return 1 .
static int schemaIsValid(sqlite3 *db){
  int iDb;
  int rc;
  BtCursor *curTemp;
  int cookie;
  int allOk = 1;
  for(iDb=0; allOk && iDb<db->nDb; iDb++){
    Btree *pBt;
    pBt = db->aDb[iDb].pBt;
    if( pBt==0 ) continue;
    rc = sqlite3BtreeCursor(pBt, MASTER_ROOT, 0, 0, 0, &curTemp);
    if( rc==SQLITE_OK ){
      rc = sqlite3BtreeGetMeta(pBt, 1, (u32 *)&cookie);
      if( rc==SQLITE_OK && cookie!=db->aDb[iDb].pSchema->schema_cookie ){
        allOk = 0;
      }
      sqlite3BtreeCloseCursor(curTemp);
    }
  }
  return allOk;
}
static int schemaIsValid ( sqlite3 * db ) { int iDb ; int rc ; BtCursor * curTemp ; int cookie ; int allOk = 1 ; for ( iDb = 0 ; allOk && iDb < db -> nDb ; iDb ++ ) { Btree * pBt ; pBt = db -> aDb [ iDb ] . pBt ; if ( pBt == 0 ) continue ; rc = sqlite3BtreeCursor ( pBt , MASTER_ROOT , 0 , 0 , 0 , & curTemp ) ; if ( rc == SQLITE_OK ) { rc = sqlite3BtreeGetMeta ( pBt , 1 , ( u32 * ) & cookie ) ; if ( rc == SQLITE_OK && cookie != db -> aDb [ iDb ] . pSchema -> schema_cookie ) { allOk = 0 ; } sqlite3BtreeCloseCursor ( curTemp ) ; } } return allOk ; }
Check schema cookies in all databases.
Check schema cookies in all databases .