Comments - CHECK constraint introduced, when make it really useful?
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
Simple Example which makes sure there are no entries inserted or updated which have overlapping time spans. Most important: This solution should be thread safe: CREATE TABLE Test ( startTime bigint(20), stopTime bigint(20), CONSTRAINT overlapping CHECK ( (SELECT COUNT(*) FROM Test r WHERE r.startTime < stopTime AND r.endTime > startTime LIMIT 1) = 0 ) ); Even more elegant would it be to put the CHECK content into a function. But I consider that to be a luxury.
I suggest adding this as a feature request on JIRA, especially if it's valid on another DBMS.
Sorry, my bad. What I was looking for where ASSERTIONS, and they are nearly implemented by nobody.