On 29/3/62 03:00, Igor Tandetnik wrote:
On 3/28/2019 3:21 PM, Mark Wagner wrote:
Imagine I have these two tables and one view defining a join.

CREATE TABLE t (foo);
CREATE TABLE s (bar);
CREATE VIEW v as select * from t join s on (foo = q);

Surprisingly, this last statement succeeds. But if you then close the database and try to open it again, it'll fail with "no such column: q". So, don't do this - you are creating an unusable database file with corrupted schema.


The error doesn't occur unless you actually query the view though, correct?

Here, I get:

  $ ./sqlite3 x.db
  SQLite version 3.27.2 2019-02-25 16:06:06
  Enter ".help" for usage hints.
  sqlite> CREATE TABLE t (foo);
  sqlite> CREATE TABLE s (bar);
  sqlite> CREATE VIEW v as select * from t join s on (foo = q);
  sqlite>
  $ ./sqlite3 x.db
  SQLite version 3.27.2 2019-02-25 16:06:06
  Enter ".help" for usage hints.
  sqlite> SELECT * FROM t;
  sqlite> SELECT * FROM s;
  sqlite> SELECT * FROM v;
  Error: no such column: q


Dan.



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to