Hello again,

Following the email I sent yesterday, I've discovered why I get a SQLITE_SCHEMA error: VACUUM changes the schema version numbering. The question is why? The schema is exactly the same, it has the same tables, columns and indexes. Sure, the data is now compacted, but what has this to do with the schema? Am I missing something?

Thanks again,

-- Tito

On 5 ago 2004, at 3:39, Tito Ciuro wrote:

Hello,

This happens with SQLite 3.0.3 on Mac OS X 10.3.4.

I'm issuing a simple 'SELECT * FROM people' on my database. When I reach 'sqlite3VdbeExec', it falls on the following error:

if( rc==SQLITE_OK && iMeta!=pOp->p2 ){
sqlite3SetString(&p->zErrMsg, "database schema has changed", (char*)0);
rc = SQLITE_SCHEMA;
}


In my code, I execute the query like this:

int result = sqlite3_prepare(db, query, strlen(query), &_vm, &query_tail);

I get SQLITE_OK back. '_vm' is also set. Then I call:

result = sqlite3_step(_vm);

and I get result == 1. The error string tells me "database schema has changed". The weird thing is that if I inspect the database, all records in the people table are there! What's going on?

Any ideas?

Thanks,

-- Tito



Reply via email to