There is no "underscore notation" for multiword constraints. "NOT_NULL" is not "NOT NULL" and "PRIMARY KEY" is not "PRIMARY_KEY". As long as whatever you provide can be split up into tokens in a way that matches the grammar there will be no syntax error. It will just not be matching what you think you specified, but didn't.
-----Ursprüngliche Nachricht----- Von: sqlite-users [mailto:[email protected]] Im Auftrag von Aflah Bhari Gesendet: Samstag, 27. Mai 2017 15:48 An: [email protected] Betreff: [sqlite] No check for invalid constraints Hi there, I'm using SQLITE version 3.16.0 on macOS Sierra 10.12.4. I'm experiencing a unique bug where if I put in an primary key constraint with underscores then the primary key does not auto increment when I insert values. *For example:* CREATE TABLE sensor_status(status_id INTEGER *PRIMARY_KEY*, status text NOT_NULL UNIQUE); insert into sensor_status(status) VALUES("ONLINE"); select * from sensor_status; status_id status ---------- ---------- ONLINE *Versus:* CREATE TABLE sensor_status(status_id INTEGER *PRIMARY KEY*, status text NOT_NULL UNIQUE); insert into sensor_status(status) VALUES("ONLINE"); select * from sensor_status; status_id status ---------- ---------- 1 ONLINE I'm not sure what the implications of this are on other constraints such as NOT_NULL which also does not seem to work with the underscore notation. EDIT: I've just realised that there is no check in place for whether the constraint is typed correctly. I'm not sure now if this is necessarily a bug or a feature that hasn't been implemented (intentionally or unintentionally). I'm new to sqlite so I apologise if I'm wasting anyone's time by reporting this :( Thanks, Aflah _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___________________________________________ Gunter Hick Software Engineer Scientific Games International GmbH FN 157284 a, HG Wien Klitschgasse 2-4, A-1130 Vienna, Austria Tel: +43 1 80100 0 E-Mail: [email protected] This communication (including any attachments) is intended for the use of the intended recipient(s) only and may contain information that is confidential, privileged or legally protected. Any unauthorized use or dissemination of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender by return e-mail message and delete all copies of the original communication. Thank you for your cooperation. _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

