When I run the Tcl script below with SQLite 3.6.16, I get this error
message:

        malformed database schema (T1_idx) - no such table: main.T1

Here is the script:

        file delete "DB1.dat"
        sqlite3 DB1 "DB1.dat"
        DB1 eval {CREATE TABLE T1 (name text NOT NULL);CREATE INDEX
T1_idx ON T1(name);}
        DB1 close
        sqlite3 DB1 "DB1.dat"
        DB1 eval {PRAGMA reverse_unordered_selects=1}
        DB1 eval {SELECT * FROM T1}

The error occurs on the last line of the script.  Commenting out the
line "DB1 eval {PRAGMA reverse_unordered_selects=1}" makes the problem
go away.  Executing the pragma so it's done after the SELECT makes the
problem go away.  Not closing and re-opening the database makes the
problem go away.  Executing a different pragma, instead of
reverse_unordered_selects, makes the problem go away.

I have been using PRAGMA reverse_unordered_selects for a few months, and
it has revealed a couple of unintentional dependencies on order --
thanks!  I just recently realized that the PRAGMAS need to be executed
once for each database connection, rather than once per process...when I
made that change, this problem started showing up.  It seems to depend
on the particulars of the schema of the first table on which a SELECT is
done after opening the database.

I have reproduced this on a Linux machine, as well as machines running
Sun Solaris and IBM AIX.  I am attempting to try this with a more recent
version of SQLite, but that is unfortunately not trivial in my
environment.

Thanks,

Robin Albrecht
Staff Engineer
Mentor Graphics Corp.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to