Home | History | Annotate | Download | only in orig

Lines Matching defs:Constraint

715 #define SQLITE_CONSTRAINT  19   /* Abort due to constraint violation */
2345 constraint violation is not a
2350 ** encounters a constraint violation, it does not fail. The
2352 ** the constraint problem so INSERT OR REPLACE will always change
2392 ** [foreign key actions] or [REPLACE] constraint resolution are not counted.
2444 ** count, but those made as part of REPLACE constraint resolution are
4369 ** ^[SQLITE_ERROR] means that a run-time error (such as a constraint
5681 ** an error or constraint causes an implicit rollback to occur.
5913 ** <tr><td> 7th <td> int <td> True if column has a NOT NULL constraint
5951 int *pNotNull, /* OUTPUT: True if NOT NULL constraint exists */
6180 ** expr on the right-hand side can be evaluated (and thus the constraint
6207 ** is true, then the constraint is assumed to be fully handled by the
6261 unsigned char op; /* Constraint operator */
6262 unsigned char usable; /* True if this constraint is usable */
6272 int argvIndex; /* if >0, constraint is part of argv to xFilter */
6273 unsigned char omit; /* Do not code a test for this constraint */
6294 ** CAPI3REF: Virtual Table Constraint Operator Codes
6298 ** an operator that is part of a constraint term in the wHERE clause of
6490 ** constraint and the blob is being opened for read/write access)^,
8303 ** constraint handling.
9516 ** CAPI3REF: Determine The Number Of Foreign Key Constraint Violations
9861 ** (which can only happen if a foreign key constraint is violated), the
9878 ** If the attempt to insert the row fails because of some other constraint
9918 ** If any other error (aside from a constraint failure when attempting to
9933 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
9977 ** foreign key constraint violation, are committed. Or, if it returns
9985 ** If any other constraint violation occurs while applying a change (i.e.
9986 ** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is
10134 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
14474 u8 notNull; /* An OE_ code for handling a NOT NULL constraint */
14697 constraint is an instance of the following structure.
14706 ** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x)
14732 u8 isDeferred; /* True if constraint checking is deferred till COMMIT */
14742 ** SQLite supports many different ways to resolve a constraint
14743 ** error. ROLLBACK processing means that a constraint violation
14750 ** occurs. IGNORE means that the particular row that caused the constraint
14753 ** a UNIQUE constraint violation are removed so that the new insert or
14766 #define OE_None 0 /* There is no constraint to check */
14919 #define SQLITE_IDXTYPE_UNIQUE 1 /* Implements a UNIQUE constraint */
15152 #define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */
15434 #define NC_IsCheck 0x0004 /* True if resolving names in a CHECK constraint */
15721 Token constraintName;/* Name of the constraint currently being parsed */
17091 ** this constraint.
22180 ** fragmentation as long as the following constraint holds:
22185 ** that an application can, at any time, verify this constraint.
24496 ** xScratchMalloc(). We verify this constraint in the single-threaded
61655 ** size supplied does not meet this constraint then the page size is not
63013 ** that are contained within a BEGIN...COMMIT block. If a constraint
71818 ** * OP_FkCounter with P2==0 (immediate foreign key constraint)
73878 ** database handles deferred constraint counter to the value it had when
73897 ** committed. If there are outstanding deferred foreign key constraint
73912 sqlite3VdbeError(p, "FOREIGN KEY constraint failed");
74028 ** or hit an 'OR FAIL' constraint and there are no deferred foreign
75016 ** If this constraint is not satisfied, it means that the high-speed
77145 ** Constraint: If you have ENABLE_COLUMN_METADATA then you must
79120 ** 2: UNIQUE constraint failed: P4
79121 ** 3: CHECK constraint failed: P4
79122 ** 4: FOREIGN KEY constraint failed: P4
79168 sqlite3VdbeError(p, "%s constraint failed", azType[pOp->p5-1]);
81262 ** constraint violations present in the database to the value stored
81428 /* Store the current value of the database handles deferred constraint
84172 ** Increment a "constraint counter" by P2 (P2 may be negative or positive).
84173 ** If P1 is non-zero, the database constraint counter is incremented
84191 ** This opcode tests if a foreign key constraint-counter is currently zero.
84195 ** If P1 is non-zero, then the jump is taken if the database constraint-counter
84196 ** is zero (the one that counts deferred constraint violations). If P1 is
84197 ** zero, the jump is taken if the statement constraint-counter is zero
84198 ** (immediate foreign key constraint violations).
85024 ** apply in the case of a constraint failure on an insert or update.
91828 ** to enforce this constraint.
92694 assert( p->iTable>=0 ); /* p cannot be part of a CHECK constraint */
92840 ** a UNIQUE constraint or index.
96517 ** If there is a NOT NULL constraint, then the default value for the
100563 ** parsing a CREATE TABLE statement. A "NOT NULL" constraint has
100812 ** Add a new CHECK constraint to the table currently under construction.
101340 /* Resolve names in all CHECK constraint expressions.
102339 ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
102344 ** is a primary key or unique-constraint on the most recent column added
102473 ** dealing with a primary key or UNIQUE constraint. We have to invent our
102719 ** the constraint occur in different orders, then the constraints are
102741 /* This constraint creates the same index as a previous
102742 ** constraint specified somewhere in the CREATE TABLE statement.
102744 ** constraint and the previous equivalent constraint have explicit
102784 ** index is an implied index for a UNIQUE or PRIMARY KEY constraint) then
102825 /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */
102858 ** OE_Ignore. This is necessary for the correct constraint check
102963 "or PRIMARY KEY constraint cannot be dropped", 0);
103548 ** be set for operations that might fail (due to a constraint) part of
103602 int onError, /* Constraint type */
103617 ** Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation.
103621 int onError, /* Constraint type */
103622 Index *pIdx /* The index that triggers the constraint */
107188 ** If an immediate foreign key constraint is violated,
107191 ** deferred foreign key constraint is violated, no action is taken
107193 ** transaction before fixing the constraint violation, the attempt fails.
107204 ** * When a commit fails due to a deferred foreign key constraint,
107205 ** there is no way to tell which foreign constraint is not satisfied,
107218 ** constraint counter.
107223 ** found (as the constraint is now satisfied).
107247 ** If a delete caused by OR REPLACE violates an FK constraint, an exception
107248 ** is thrown, even if the FK constraint would be satisfied after the new
107254 ** constraint counter is greater than zero,
107259 ** INSERT violates a foreign key constraint. This is necessary as such
107308 ** A foreign key constraint requires that the key columns in the parent
107309 ** table are collectively subject to a UNIQUE or PRIMARY KEY constraint.
107310 ** Given that pParent is the parent table for foreign key constraint pFKey,
107317 ** If the parent key consists of a single column (the foreign key constraint
107322 ** constraint to the parent table column stored in the left-most column
107332 ** UNIQUE or PRIMARY KEY constraint, or
107349 Table *pParent, /* Parent table of FK constraint pFKey */
107458 ** child table of foreign key constraint pFKey. If an SQL UPDATE is executed
107471 ** INSERT immediate Increment the "immediate constraint counter".
107473 ** DELETE immediate Decrement the "immediate constraint counter".
107475 ** INSERT deferred Increment the "deferred constraint counter".
107477 ** DELETE deferred Decrement the "deferred constraint counter".
107487 FKey *pFKey, /* Foreign key constraint */
107490 int nIncr, /* Increment constraint counter by this */
107503 ** any are, then the constraint is considered satisfied. No need to
107531 ** to increment the constraint-counter (i.e. this is an INSERT operation),
107533 ** increment the constraint-counter. */
107557 ** to increment the constraint-counter (i.e. this is an INSERT operation),
107559 ** increment the constraint-counter.
107597 ** one row into the table, raise a constraint immediately instead of
107672 ** from the parent table of foreign key constraint pFKey and, if pFKey is
107679 ** may increase the number of FK constraint problems).
107687 ** DELETE immediate Increment the "immediate constraint counter".
107689 ** throw a "FOREIGN KEY constraint failed" exception.
107691 ** INSERT immediate Decrement the "immediate constraint counter".
107693 ** DELETE deferred Increment the "deferred constraint counter".
107695 ** throw a "FOREIGN KEY constraint failed" exception.
107697 ** INSERT deferred Decrement the "deferred constraint counter".
107799 ** foreign key constraint counter. */
107822 ** to the FKey structure representing the foreign key constraint on table
107858 ** (a) The table is the parent table of a FK constraint, or
107859 ** (b) The table is the child table of a deferred FK constraint and it is
107861 ** constraint violations in the database,
107875 /* Search for a deferred foreign key constraint for which this table
107893 /* If the DELETE has generated immediate foreign key constraint
107926 ** child key for FK constraint *p are modified.
107953 ** parent key for FK constraint *p are modified.
107999 ** table pTab to generate VDBE code to perform foreign key constraint
108074 ** If the parent table of an FK constraint on the current table is
108123 ** outstanding foreign key constraint violation. */
108128 ** be found, adding the child row has violated the FK constraint.
108183 /* If this is a deferred FK constraint, or a CASCADE or SET NULL
108197 ** child table to fire. In these cases the fk constraint counters
108267 ** foreign key constraint. */
108425 pRaise = sqlite3Expr(db, TK_RAISE, "FOREIGN KEY constraint failed");
108553 /* EV: R-30323-21917 Each foreign key constraint in SQLite is
108948 int onError, /* How to handle constraint errors */
109054 int onError /* How to handle constraint errors */
109579 ** parent table in a foreign key constraint. It is safe to set the
109580 ** flag in the second case as if any REPLACE constraint is hit, an
109663 #define CKCNSTRNT_COLUMN 0x01 /* CHECK constraint uses a changing column */
109664 #define CKCNSTRNT_ROWID 0x02 /* CHECK constraint references the ROWID */
109686 ** pExpr is a CHECK constraint on a row that is being UPDATE-ed. The
109690 ** Return true if CHECK constraint pExpr does not use any of the
109692 ** return true if this CHECK constraint can be skipped when validating
109714 ** Generate code to do constraint checks prior to an INSERT or an UPDATE
109757 ** CHECK, and UNIQUE constraints are all checked. If a constraint fails,
109761 ** Constraint type Action What Happens
109794 ** for the constraint is used.
109807 int *pbMayReplace, /* OUT: Set to true if constraint may cause a replace */
109821 int ipkTop = 0; /* Top of the rowid change constraint check */
109822 int ipkBottom = 0; /* Bottom of the rowid change constraint check */
109954 ** to some other UNIQUE constraint is FAIL or IGNORE, then we need
110058 int addrUniqueOk; /* Jump here if the UNIQUE constraint is satisfied */
110131 ** (5) No FK constraint counters need to be updated if a conflict occurs.
110521 int onError, /* How to handle constraint errors */
113199 ** Return a human-readable name for a constraint resolution action.
114230 FKey *pFK; /* A foreign key constraint */
114520 zErr = sqlite3MPrintf(db, "CHECK constraint failed in %s",
115502 ** constraint for a CREATE TABLE. The index should have already
119593 ** an ORDER BY clause. Ticket #3773. We could relax this constraint
123381 int onError /* How to handle constraint errors */
123896 /* Do constraint checks. */
123902 /* Do FK constraint checks. */
126335 #define WHERE_TOP_LIMIT 0x00000010 /* x<EXPR or x<=EXPR constraint */
126336 #define WHERE_BTM_LIMIT 0x00000020 /* x>EXPR or x>=EXPR constraint */
126714 ** The current value for the constraint is left in a register, the index
126717 ** constraint is a TK_EQ or TK_IS, then the current value might be left in
126720 ** For a constraint of the form X=expr, the expression is evaluated in
126908 ** an inequality constraint (such as the "c>=5 AND c<10" in the example) that
126929 ** the right hand side of the equality constraint (t2.b) has BLOB/NONE affinity,
126945 WhereTerm *pTerm; /* A single constraint term */
127038 ** If the most recently coded instruction is a constant range constraint
127231 ** t2.c values is not NULL. If the (t2.c IS NULL) constraint is
127495 VdbeOp *pOp; /* Opcode to access the value of the IN constraint */
127497 /* Reload the constraint value into reg[iReg+j+2]. The same value
127513 ** the IN constraint is not satisfied */
127717 int regBase; /* Base register holding constraint values */
127718 WhereTerm *pRangeStart = 0; /* Inequality constraint at range start */
127719 WhereTerm *pRangeEnd = 0; /* Inequality constraint at range end */
127723 int nConstraint; /* Number of constraint terms */
127728 char *zStartAff; /* Affinity for start of range constraint */
127729 char *zEndAff = 0; /* Affinity for end of range constraint */
127757 /* Find any inequality constraint terms for the start and end
127809 /* Generate code to evaluate all constraint terms using == or IN
127876 /* Load the value for the inequality constraint at the end of the
128328 ** then we cannot use the "t1.a=t2.b" constraint, but we can code
128329 ** the implied "t1.a=123" constraint.
128349 VdbeModuleComment((v, "begin transitive constraint"));
129236 ** inequality constraint (>, <, >= or <=), perform the processing
129536 /* Add a WO_MATCH auxiliary term to the constraint set if the
129800 ** Each function argument translates into an equality constraint against
130178 ** The term returned might by Y=<expr> if there is another constraint in
130317 ** contain a "col=X" term are subject to a NOT NULL constraint.
130400 sqlite3DebugPrintf(" constraint[%d]: col=%d termid=%d op=%d usabled=%d\n",
131203 ** column subject to the range constraint. Or, equivalently, the number of
131391 ** an equality constraint x=VALUE and where that VALUE occurs in
131394 ** for that index. When pExpr==NULL that means the constraint is
131409 Expr *pExpr, /* Expression for VALUE in the x=VALUE constraint */
131456 ** an IN constraint where the right-hand side of the IN operator
131820 ** UNIQUE constraint) with one or more == constraints is better
132076 Index *pIdx, /* The index to be used for a inequality constraint */
132078 WhereTerm *pTerm /* The vector inequality constraint */
132215 /* Do not allow the upper bound of a LIKE optimization range constraint
132813 ** A constraint is marked usable if:
133332 ** Any WhereLoop with an WHERE_COLUMN_EQ constraint on the rowid is one-row.
133456 ** j<pLoop->u.btree.nEq constraint above. Any equality other
135911 "ANY", "STRING", "JOIN_KW", "CONSTRAINT",
135986 /* 29 */ "ccons ::= CONSTRAINT nm",
136019 /* 62 */ "tcons ::= CONSTRAINT nm",
137235 case 29: /* ccons ::= CONSTRAINT nm */
137236 case 62: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==62);
138948 testcase( i==38 ); /* CONSTRAINT */
141181 /* Any deferred constraint violations have now been resolved. */
141326 /* SQLITE_CONSTRAINT */ "constraint failed",
143277 int *pNotNull, /* OUTPUT: True if NOT NULL constraint
146791 int iCons = -1; /* Index of constraint to use */
146793 int iLangidCons = -1; /* Index of langid=x constraint, if present */
146794 int iDocidGe = -1; /* Index of docid>=x constraint, if present */
146795 int iDocidLe = -1; /* Index of docid<=x constraint, if present */
146805 int bDocid; /* True if this constraint is on docid */
146809 /* There exists an unusable MATCH constraint. This means that if
146831 /* A MATCH constraint. Use a full-text search.
146833 ** If there is more than one MATCH constraint available, use the first
146834 ** one encountered. If there is both a MATCH constraint and a direct
146848 /* Equality constraint on the langid column */
148439 sqlite3_value *pCons = 0; /* The MATCH or rowid constraint, if any */
148440 sqlite3_value *pLangid = 0; /* The "langid = ?" constraint, if any */
148441 sqlite3_value *pDocidGe = 0; /* The "docid >= ?" constraint, if any */
148442 sqlite3_value *pDocidLe = 0; /* The "docid <= ?" constraint, if any */
150971 ** that meet the NEAR constraint are included in the counts.
151632 ** instead. This works, as the "languageid=?" constraint will also
160899 ** value, then this operation requires constraint handling.
160925 ** the %_content table. If we hit the duplicate rowid constraint (or any
163757 ** A search constraint.
163763 RtreeDValue rValue; /* Constraint value. */
164488 int i; /* Used to iterate through constraint array */
164577 ** constraint pConstraint.
164580 RtreeConstraint *pConstraint, /* The constraint to test */
164651 ** Check the internal RTree node given by pCellData against constraint p.
164652 ** If this constraint cannot be satisfied by any child within the node,
164656 RtreeConstraint *p, /* The constraint to test */
164691 ** Check the leaf RTree cell given by pCellData against constraint p.
164692 ** If this constraint is not satisfied, set *peWithin to NOT_WITHIN.
164693 ** If the constraint is satisfied, leave *peWithin unchanged.
164695 ** The constraint is of the form: xN op $val
164701 RtreeConstraint *p, /* The constraint to test */
165130 ** as the second argument for a MATCH constraint. The value passed as the
165294 ** constraint used. The first two bytes of idxStr correspond to
165295 ** the constraint in sqlite3_index_info.aConstraintUsage[] with
165298 ** The first of each pair of bytes in idxStr identifies the constraint
165312 ** to which the constraint applies. The leftmost coordinate column
165319 int bMatch = 0; /* True if there exists a MATCH constraint */
165326 /* Check if there exists a MATCH constraint - even an unusable one. If there
165328 ** require the VDBE to evaluate the MATCH constraint, which is not currently
165343 /* We have an equality constraint on the rowid. Use strategy 1. */
166470 ** A constraint has failed while inserting a row into an rtree table.
166476 ** constraint failure. If it is 0, then the constraint that failed is
166477 ** the unique constraint on the id column. Otherwise, it is the rtree
166478 ** (c1<=c2) constraint on columns iCol and iCol+1 that has failed.
166500 "UNIQUE constraint failed: %s.%s", pRtree->zName, zCol
166506 "rtree constraint failed: %s.(%s<=%s)", pRtree->zName, zCol1, zCol2
166536 /* Constraint handling. A write operation on an r-tree table may return
166540 ** 2. The supplied data violates the "x2>=x1" constraint.
166567 goto constraint;
166578 goto constraint;
166584 ** the table. If so, the constraint has failed. */
166599 goto constraint;
166643 constraint:
168138 ** constraint violations).
168239 ** * No constraint handling mode except for "OR ROLLBACK" is supported.
173647 ** scan. However, a schema=? constraint should cause this table to
173650 ** idxNum is normally 0, but will be 1 if a schema=? constraint exists.
173657 /* Look for a valid schema=? constraint. If found, change the idxNum to
173658 ** 1 and request the value of that constraint be sent to xFilter. And
178002 /* This is always a CONSTRAINT conflict. */
178155 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
178325 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
178353 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
180902 /* The query strategy is to look for an equality constraint on the json
180903 ** column. Without such a constraint, the table cannot operate. idxNum is
180904 ** 1 if the constraint is found, 3 if the constraint and zRoot are found,
186437 ** close together to meet the NEAR constraint. Non-zero is returned if it
186447 ** meet the constraint before returning.
186477 ** of the NEAR constraint) is written over the original even as it is
196096 #define FTS5_PLAN_SCAN 5 /* No usable constraint */
196117 ** WHERE constraint, it searches for the following:
196119 ** 1. A MATCH constraint against the special column.
196120 ** 2. A MATCH constraint against the "rank" column.
196121 ** 3. An == constraint against the rowid column.
196122 ** 4. A < or <= constraint against the rowid column.
196123 ** 5. A > or >= constraint against the rowid column.
196139 ** * One rowid range constraint: cost=750.0
196141 ** * An == rowid constraint: cost=100.0
196146 ** * One rowid range constraint: cost=750000.0
196148 ** * An == rowid constraint: cost=10.0
196160 struct Constraint {
196188 struct Constraint *pC = &aConstraint[j];
196194 /* As there exists an unusable MATCH constraint this is an
196232 /* Assign argvIndex values to each constraint in use. */
196235 struct Constraint *pC = &aConstraint[i];
197150 ** Cases 3 and 4 may violate the rowid constraint.