Re: [sqlite] Not sure how to interrupt this
Marc L. Allen wrote: > Oh.. you're positing a second party. Ok.. now I'm interested to see if there > was one. Not necessarily. "Someone" includes the program that prepared the statement. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Not sure how to interrupt this
I think SQLITE_SCHEMA can happen even if you run things like CREATE TABLE or ALTER TABLE on the same connection. Also ATTACH DATABASE and DETACH DATABASE should invalidate all statements prepared before that. Pavel On Thu, Jun 28, 2012 at 9:58 AM, Marc L. Allen wrote: > Oh.. you're positing a second party. Ok.. now I'm interested to see if there > was one. > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik > Sent: Thursday, June 28, 2012 9:55 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Not sure how to interrupt this > > Marc L. Allen wrote: >> How could the schema have changed? > > Someone ran CREATE TABLE or VACUUM or similar on the database (possibly via a > different connection). > -- > Igor Tandetnik > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Not sure how to interrupt this
Jeff Archer wrote: >> Igor Tandetnik itandetnik at mvps.org Thu Jun 28 09:38:27 EDT 2012 >> My guess is that a) you have prepared your statement with > sqlite3_prepare_v2 (as opposed to sqlite3_prepare)... > > > Statement was prepared with sqlite3_prepare16_v2() > > Database file was created only moments earlier. Did you prepare the INSERT statement in between running CREATE TABLE and CREATE INDEX, by any chance? Or perhaps CREATE TABLE for a different table? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Not sure how to interrupt this
Oh.. you're positing a second party. Ok.. now I'm interested to see if there was one. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: Thursday, June 28, 2012 9:55 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Not sure how to interrupt this Marc L. Allen wrote: > How could the schema have changed? Someone ran CREATE TABLE or VACUUM or similar on the database (possibly via a different connection). -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Not sure how to interrupt this
Marc L. Allen wrote: > How could the schema have changed? Someone ran CREATE TABLE or VACUUM or similar on the database (possibly via a different connection). -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Not sure how to interrupt this
How could the schema have changed? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: Thursday, June 28, 2012 9:38 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Not sure how to interrupt this Jeff Archer wrote: > I have SQLITE_CONFIG_LOG callback installed: > sqlite3_config(SQLITE_CONFIG_LOG, cb_sqlite_config_log, > /*pUserData*/NULL); > > I get the following message through the SQLITE_CONFIG_LOG callback > during the sqlite3_step(): > errcode: SQLITE_SCHEMA (17) > message: statement aborts at 80: [INSERT INTO [Scans](ScanID, > Timestamp, EndTime, Result) VALUES(NULL, @Timestamp, @Timestamp, > @Result);] database schema has changed My guess is that a) you have prepared your statement with sqlite3_prepare_v2 (as opposed to sqlite3_prepare), and b) the schema did in fact change between the time the statement was prepared and the time it got executed. In this case, SQLite would internally intercept SQLITE_SCHEMA (but apparently, not before logging it), then finalize, re-prepare and re-execute the statement. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Not sure how to interrupt this
Jeff Archer wrote: > I have SQLITE_CONFIG_LOG callback installed: > sqlite3_config(SQLITE_CONFIG_LOG, cb_sqlite_config_log, /*pUserData*/NULL); > > I get the following message through the SQLITE_CONFIG_LOG callback during > the sqlite3_step(): > errcode: SQLITE_SCHEMA (17) > message: statement aborts at 80: [INSERT INTO [Scans](ScanID, Timestamp, > EndTime, Result) VALUES(NULL, @Timestamp, @Timestamp, @Result);] database > schema has changed My guess is that a) you have prepared your statement with sqlite3_prepare_v2 (as opposed to sqlite3_prepare), and b) the schema did in fact change between the time the statement was prepared and the time it got executed. In this case, SQLite would internally intercept SQLITE_SCHEMA (but apparently, not before logging it), then finalize, re-prepare and re-execute the statement. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Not sure how to interrupt this
I think he wants to know why he is receiving what appears to be an error notification via the callback. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Adam DeVita Sent: Thursday, June 28, 2012 9:05 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Not sure how to interrupt this SQLITE DONE is what you get when you successfully run an insert. What is the problem? Adam On Wed, Jun 27, 2012 at 7:02 PM, Jeff Archer wrote: > I am getting back SQLITE_DONE (101) from sqlite3_step() and the > statement is clearly being executed. > > SQL: "INSERT INTO [Scans](ScanID, Timestamp, EndTime, Result) > VALUES(NULL, @Timestamp, @Timestamp, @Result);" > > The table has been created as: > CREATE TABLE [Scans] > (ScanID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT > ,Timestamp DATETIME NOT NULL UNIQUE > ,EndTime DATETIME NOT NULL DEFAULT CURRENT_TIME > ,Result VARCHAR > ); > CREATE INDEX Scans_vwScan_Index on Scans(ScanID, Timestamp, EndTime, > Result); CREATE INDEX Scans_Timestamp_Index on Scans(Timestamp); > > I have SQLITE_CONFIG_LOG callback installed: > sqlite3_config(SQLITE_CONFIG_LOG, cb_sqlite_config_log, > /*pUserData*/NULL); > > I get the following message through the SQLITE_CONFIG_LOG callback > during the sqlite3_step(): > errcode: SQLITE_SCHEMA (17) > message: statement aborts at 80: [INSERT INTO [Scans](ScanID, > Timestamp, EndTime, Result) VALUES(NULL, @Timestamp, @Timestamp, > @Result);] database schema has changed > > SQLITE_VERSION"3.7.13" - amalgamation > > Jeff Archer > Nanotronics Imaging > jsarc...@nanotronicsimaging.com > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- VerifEye Technologies Inc. 905-948-0015x245 151 Whitehall Dr, Unit 2 Markham ON, L3R 9T1 Canada ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Not sure how to interrupt this
SQLITE DONE is what you get when you successfully run an insert. What is the problem? Adam On Wed, Jun 27, 2012 at 7:02 PM, Jeff Archer wrote: > I am getting back SQLITE_DONE (101) from sqlite3_step() and the statement > is clearly being executed. > > SQL: "INSERT INTO [Scans](ScanID, Timestamp, EndTime, Result) VALUES(NULL, > @Timestamp, @Timestamp, @Result);" > > The table has been created as: > CREATE TABLE [Scans] > (ScanID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT > ,Timestamp DATETIME NOT NULL UNIQUE > ,EndTime DATETIME NOT NULL DEFAULT CURRENT_TIME > ,Result VARCHAR > ); > CREATE INDEX Scans_vwScan_Index on Scans(ScanID, Timestamp, EndTime, > Result); > CREATE INDEX Scans_Timestamp_Index on Scans(Timestamp); > > I have SQLITE_CONFIG_LOG callback installed: > sqlite3_config(SQLITE_CONFIG_LOG, cb_sqlite_config_log, /*pUserData*/NULL); > > I get the following message through the SQLITE_CONFIG_LOG callback during > the sqlite3_step(): > errcode: SQLITE_SCHEMA (17) > message: statement aborts at 80: [INSERT INTO [Scans](ScanID, Timestamp, > EndTime, Result) VALUES(NULL, @Timestamp, @Timestamp, @Result);] database > schema has changed > > SQLITE_VERSION"3.7.13" - amalgamation > > Jeff Archer > Nanotronics Imaging > jsarc...@nanotronicsimaging.com > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- VerifEye Technologies Inc. 905-948-0015x245 151 Whitehall Dr, Unit 2 Markham ON, L3R 9T1 Canada ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users