Commit Graph

28 Commits

Author SHA1 Message Date
drh
22c04f8199 Allow comparison operators of a register against itself.
Ticket [188f912b51cd802a],

FossilOrigin-Name: 401c9d30e06191d938503aae024bc453d960fa64dc812ed86c661f94533247fd
2019-12-24 01:53:05 +00:00
drh
20cee7d0bb Always disallow the use of non-deterministic functions in CHECK constraints,
even date/time functions that use the 'now' or similar keywords.  Provide
improved error messages when this requirement is not met.
Ticket [830277d9db6c3ba1]

FossilOrigin-Name: 2978b65ebe25eeabe543b67cb266308cceb20082a4ae71565d6d083d7c08bc9f
2019-10-30 18:50:08 +00:00
drh
bffdd63633 When computing an expression value for an index-on-expression or a CHECK
constraint and the expressions uses a REAL table column, but the value of
that column is an integer (in other words, when it is using the 
store-real-as-integer optimization) be sure to promote the value to real
before evaluating the expression.  Ticket [57af00b6642ecd68].

FossilOrigin-Name: 0658c16e311393c8a347b1bd41fa5dbfd2e184aa75d84c011aa8dbac79b632e9
2019-09-02 00:58:44 +00:00
dan
8b65e5919d When processing a BETWEEN or CASE expression, avoid transforming a node of the original expression into a TK_REGISTER node. Instead, take a copy and use it instead. Fix for [1be72aab9].
FossilOrigin-Name: 7ef7b23cbb1b9ace9f853238d9133320c153e6c3417e6823ab6394ee1fe56358
2019-07-17 14:34:17 +00:00
dan
0d92571d65 Disallow string constants enclosed in double-quotes within new CREATE TABLE and CREATE INDEX statements. It is still possible to enclose column names in double-quotes, and existing database schemas that use double-quotes for strings can still be loaded. This addresses ticket [9b78184b].
FossilOrigin-Name: 1685610ef8e0dc9218b02461ceab14dc6114f4f5ef7fcda0da395094aff443e1
2019-05-20 17:14:25 +00:00
drh
978896e0eb Fix the check.test script so that it works on Windows.
FossilOrigin-Name: 8822eb5d790bf8d4302c3f2dc05ab672193b309fb11771c4b3eea8a77f37e299
2017-03-20 14:44:07 +00:00
drh
a3b2da9889 Fix a problem in the enhanced PRAGMA integrity_check where it verifies
CHECK constraints: Do not be confused by the reuse of the Table.pCheck field
by VIEWs with named columns.  Problem discovered by OSS-Fuzz.

FossilOrigin-Name: 019dd3d5ba4a596c4ec3b5f0de8402c72196af0faca9138edbc0f1f4957cae60
2017-03-17 03:21:14 +00:00
drh
8a284dcefe Enhance "PRAGMA integrity_check" so that it verifies CHECK constraints.
FossilOrigin-Name: 549bae0856004ff65b505175460abd598b30fe57
2017-02-22 14:15:37 +00:00
drh
98bfa16db2 Fix to previous check-in: Make sure CHECK constraints involving the ROWID
are not ignored when the ROWID changes.

FossilOrigin-Name: 7782cb1dd5914b867caf5ff2f0f837407abbfd7a
2016-02-10 18:24:05 +00:00
drh
f9c8ce3ced Standardize the error messages generated by constraint failures to a format
of "$TYPE constraint failed: $DETAIL".  This involves many changes to the
expected output of test cases.

FossilOrigin-Name: 54b221929744b1bcdbcc2030fef2e510618afd41
2013-11-05 13:33:55 +00:00
drh
1e7d43c977 Silently ignore database name qualifiers in CHECK constraints and in
partial index WHERE clauses.

FossilOrigin-Name: 2e8c845eb5011a2743dace333aa38383588f2080
2013-08-02 14:18:18 +00:00
drh
ddd1fc7283 Do not raise an error if an unknown SQL function is found in a CHECK
constraint while parsing the schema of an existing database.

FossilOrigin-Name: cda790280a52d65f98a45bacb9123367b159ac7c
2013-01-08 12:48:10 +00:00
drh
4dc330dd33 Adjust the parser so that certain legacy schema constructs (that are not
valid according to the syntax diagram) continue to be accepted, so that
older databases that happen to use those constructs are still readable.
This fixes an issue introduced by check-in [1b75f301affac6]

FossilOrigin-Name: a1c014d8a87c8940b3a037d8d8cc4d5678809802
2012-05-07 19:21:36 +00:00
drh
2938f924cc If a CHECK constraint is named, report that name on the error message when
the constraint fails.

FossilOrigin-Name: 9a0f90d9deb335ac71044b8afa81538d85cc7ccf
2012-03-07 19:13:29 +00:00
shaneh
f33a7a8cef Minor changes to test scripts to support various SQLITE_OMIT options.
FossilOrigin-Name: 97f8a886b6314b044a0522a88f569798fdfb3ef9
2009-12-31 19:48:29 +00:00
drh
dda70fe38e Remove leftover "breakpoint" commands from test scripts. Also remove blank
lines at the end of scripts. (CVS 6721)

FossilOrigin-Name: 1fef16ec2b89981770cf44f606a420fbe031a7a4
2009-06-05 17:09:11 +00:00
drh
d9da78a2c8 Changes to insure that lookaside memory allocations are never used to hold
schema content.
Ticket #3743. (CVS 6377)

FossilOrigin-Name: ea74d8dc62f5784089aa8ef098e97c505a79b176
2009-03-24 15:08:09 +00:00
drh
2e06c67c08 The REPLACE conflict resolution falls back to FAIL when on a
CHECK constraint violation.  Ticket #2525. (CVS 4178)

FossilOrigin-Name: b213614abff90c65cc7228c87f4973150e8a9679
2007-07-23 19:39:46 +00:00
danielk1977
4b2688ab31 Modifications so that compilation and testing with the various OMIT macros defined works. (CVS 3276)
FossilOrigin-Name: c6ea353bd9f5fe6c9cc3349d2034ada283f9c80e
2006-06-20 11:01:07 +00:00
drh
aa01c7e2cd Fix CHECK constraints to use alternative conflict resolution. Ticket #1717. (CVS 3137)
FossilOrigin-Name: c0d20fa97f94313e6b7ee5b4baa236ef5b664d76
2006-03-15 16:26:10 +00:00
danielk1977
3bdca9c9a5 Test suite fixes for builds that define OMIT symbols. (CVS 2962)
FossilOrigin-Name: 3a54a33dcb7e765ee3773397407e8929a8cfe1a9
2006-01-17 09:35:01 +00:00
danielk1977
1576cd9251 Fixes for OMIT_SUBQUERY builds: Disable where clause OR->IN optimization. Include EXISTS keyword (for new CREATE TABLE syntax). Test file fixes. (CVS 2943)
FossilOrigin-Name: 8e79a0c24a03ccf960d6ccfb7c6b9b0f7c614e9b
2006-01-14 08:02:28 +00:00
drh
8a51256c0c Create separate affinities for INTEGER and REAL. (CVS 2766)
FossilOrigin-Name: ce06c123d0c5663dbaf263c2e0aaf5d9cdeb2ccd
2005-11-14 22:29:05 +00:00
drh
4284fb0778 Prohibit parameters in CHECK constraint expressions. (CVS 2758)
FossilOrigin-Name: bb94ef64b227839a0ef4156985e2f5a061a78e2c
2005-11-03 12:33:28 +00:00
drh
0cd2d4c9a1 Add the ignore_check_constraints pragma. VACUUM works even on a database
that contains table entries that violate check constraints. (CVS 2757)

FossilOrigin-Name: be83bfee0211396a0038ffb125897199bea9a73f
2005-11-03 02:15:02 +00:00
drh
06f6541e2f Disallow subqueries in CHECK constraints. (CVS 2756)
FossilOrigin-Name: db27afc4cdc5b51c1fa0e83dbd6d4a4a69c5b642
2005-11-03 02:03:13 +00:00
drh
6275b88b9e CHECK constraints that evaluate to NULL pass. (CVS 2755)
FossilOrigin-Name: 55b314a22c69fbe129b024e953f3230b67eaaa87
2005-11-03 01:22:30 +00:00
drh
ffe07b2dc1 First cut at supporting CHECK constraints. Everything appears to work,
but much more testing is needed as well as documentation. (CVS 2754)

FossilOrigin-Name: 2313d912baeca0fd516d524f16708953de483729
2005-11-03 00:41:17 +00:00