...or indeed this malicious-but-valid table-schema design would prove 
problematic.

Other that might cause similar headaches are:

CREATE TABLE t(x text     // )WITHOUT ROWID;
);

or

CREATE TABLE t(x text);  // )WITHOUT ROWID;

etc.

It would require a rather convoluted check to be very sure.... but if you do not expect maliciously designed table schemas, this should not be a problem - and if you do, I suggest checking in your code after getting the sql schema and doing some minor parsing.


On 2014/05/07 15:51, Igor Tandetnik wrote:
On 5/7/2014 9:40 AM, RSmith wrote:
SELECT instr(upper(sql),'WITHOUT ROWID')>1 FROM sqlite_master WHERE
type='table' AND tbl_name='YourTableName'

Returns 1 for tables made without rowid, 0 for the rest.

CREATE TABLE t(x text default 'WITHOUT ROWID');


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

Reply via email to