One more bit of interesting information. if( db->aDb[pOp->p1].pSchema->schema_cookie!=u.av.iMeta ){ fenestra_sqlite3_dump_stack_trace("OP_VerifyCookie"); sqlite3ResetInternalSchema(db, pOp->p1); }
The call to fenestra_sqlite3_dump_stack_trace is never invoked. Whatever is resetting the internal schema isn't coming from here. On Wed, Jan 25, 2012 at 9:02 AM, John Elrick <john.elr...@fenestra.com>wrote: > > On Tue, Jan 24, 2012 at 7:46 PM, Richard Hipp <d...@sqlite.org> wrote: > >> On Tue, Jan 24, 2012 at 7:37 PM, John Elrick <john.elr...@fenestra.com >> >wrote: >> >> > >> > It appears that the value is set here: >> > >> > u.av.pBt = db->aDb[pOp->p1].pBt; >> > if( u.av.pBt ){ >> > sqlite3BtreeGetMeta(u.av.pBt, BTREE_SCHEMA_VERSION, (u32 >> *)&u.av.iMeta); >> > u.av.iGen = db->aDb[pOp->p1].pSchema->iGeneration; >> > }else{ >> > u.av.iGen = u.av.iMeta = 0; >> > } >> > >> > >> > I added a log trace to the else condition and it never fired off, so >> > something is causing db->aDb[pOp->p1].pSchema->iGeneration to change >> > relative to pOp->p3. Give me some guidance as to where to dig and I'll >> be >> > glad to do so >> > >> >> iGeneration changes in only one place in the code: >> http://www.sqlite.org/src/artifact/5069f2248?ln=431 >> >> May I recommend that you put a printf() before this line >> >> http://www.sqlite.org/src/artifact/fc1b97fa6816?ln=3022 >> >> And have that printf display the following values: >> >> db (rendered using %p) >> pOp->p1 (using %d) >> db->aDb[pOp->p1].pSchema (using %p) >> db->aDb[pOp->p1].pSchema->schema_cookie (using %d) >> db->aDb[pOp->p1].pSchema->iGeneration (using %d) >> iMeta (using %d) >> pOp->p2 (using %d) >> pOp->p3 (using %d) >> p->zSql (using %s) >> >> > Progress. A couple of representatives > > current state = 'db=03FB1188, db->aDb[pOp->p1].pSchema=02110AB0, > db->aDb[pOp->p1].pSchema->schema_cookie=27, > db->aDb[pOp->p1].pSchema->iGeneration=63, u.av.iMeta=27, u.av.iGen=63, > pOp->p1=1, pOp->p2=27, pOp->p3=0' > > sql = 'update alerter_links set is_dirty = null ' > > current state = 'db=03FB1188, db->aDb[pOp->p1].pSchema=02110AB0, > db->aDb[pOp->p1].pSchema->schema_cookie=27, > db->aDb[pOp->p1].pSchema->iGeneration=63, u.av.iMeta=27, u.av.iGen=63, > pOp->p1=1, pOp->p2=27, pOp->p3=0' > > sql = 'select bd.behavior_oid as behavior_oid from > computation_definitions cd , behavior_dependents bd where > bd.behavior_oid = cd.behavior_oid and bd.response_definition_oid = > :response_definition_oid ' > > current state = 'db=03FB1188, db->aDb[pOp->p1].pSchema=02110B18, > db->aDb[pOp->p1].pSchema->schema_cookie=63, > db->aDb[pOp->p1].pSchema->iGeneration=4, u.av.iMeta=63, u.av.iGen=4, > pOp->p1=0, pOp->p2=63, pOp->p3=2' > > sql = 'select distinct FORM_DEFINITIONS.FORM_DEFINITION_OID from > FORM_DEFINITIONS where FORM_DEFINITIONS.guid=:FORM_DEFINITIONS_guid order > by FORM_DEFINITIONS.rowid ' > > current state = 'db=03FB1188, db->aDb[pOp->p1].pSchema=02110B18, > db->aDb[pOp->p1].pSchema->schema_cookie=63, > db->aDb[pOp->p1].pSchema->iGeneration=5, u.av.iMeta=63, u.av.iGen=5, > pOp->p1=0, pOp->p2=63, pOp->p3=2' > > sql = 'select distinct FORM_DEFINITIONS.FORM_DEFINITION_OID from > FORM_FLAGS, FORM_DEFINITIONS, MANIFESTS, SURVEYS where > MANIFESTS.MANIFEST_OID=:MANIFESTS_MANIFEST_OID and > FORM_DEFINITIONS.FORM_DEFINITION_OID=:FORM_DEFINITIONS_FORM_DEFINITION_OID > and FORM_FLAGS.definition_parent=FORM_DEFINITIONS.FORM_DEFINITION_OID and > FORM_FLAGS.instance_parent=MANIFESTS.MANIFEST_OID and > FORM_DEFINITIONS.definition_parent=SURVEYS.SURVEY_OID and > MANIFESTS.definition_parent=SURVEYS.SURVEY_OID order by > FORM_DEFINITIONS.rowid ' > > Obviously, iGeneration and p3 are out of sync. So, what exactly is > pOp->p3 ? > > -- John Elrick Fenestra Technologies 540-868-1377 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users