Kees Nuyt <[EMAIL PROTECTED]> wrote:
> 
> >I know I can't create an invalid view,
> >because SQLite refuses to create it,
> >but this seems a problem to me... could SQLite just open the database, and
> >complain only on the invalid views (i.e. for instance when I open the view
> >to query the data in it)?
> 
> If you define views the way you are supposed to define
> them, with SQL:
> 
> CREATE VIEW viewname AS 
>   SELECT ...... 
> ;
> 
> they are validated against the schema immediately, and
> rejected if they are not valid. Views that refer to
> tables or columns that no longer exist won't give a
> schema error, but an error about what's missing when
> the view is executed, just like an invalid SELECT
> statement would do.
> 
> So, it is not a problem until you create your own
> problem by using undocumented, unsupported backdoors.
> Consider it the same as patching table pages by
> hex-editing the database file.
> 
> Feel free to do it, but don't expect a safety net.
> 

I think there must have been a bug in older versions of
SQLite that allowed some invalid VIEWs to be inserted into
the sqlite_master table.  I don't think Marco was messing
around with the writable_schema pragma in order to insert
the invalid VIEWs.  He just happened to have the misfortune
of using a version of SQLite that failed to completely validate
his input.

--
D. Richard Hipp <[EMAIL PROTECTED]>

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

Reply via email to