Lines Matching defs:constraints
2505 ** [foreign key constraints]. There should be two additional arguments.
2713 ** CHECK constraints, DEFAULT clauses, expression indexes,
4982 ** WHERE clause constraints and the table content, it might return no rows.
5577 ** within VIEWs, TRIGGERs, CHECK constraints, generated column expressions,
5582 ** used inside of triggers, view, CHECK constraints, or other elements of
5722 ** schema structures such as [CHECK constraints], [DEFAULT clauses],
5744 ** schema structures such as [CHECK constraints], [DEFAULT clauses],
6369 ** If a collating function fails any of the above constraints and that
7442 ** ^(The aConstraint[] array records WHERE clause constraints of the form:
7541 } *aConstraint; /* Table of WHERE clause constraints */
7608 ** tables, the collating sequence of constraints does not matter (for example
7609 ** because the constraints are numeric) and so the sqlite3_vtab_collation()
7833 ** <li> ^([foreign key constraints | Foreign key constraints] are enabled,
8863 ** all foreign key constraints (deferred or immediate) have been
9861 ** support constraints. In this configuration (which is the default) if
10079 ** CAPI3REF: Identify and handle IN constraints in xBestIndex
10228 ** ^(Some constraints, such as [SQLITE_INDEX_CONSTRAINT_ISNULL] and
10230 ** constraints, sqlite3_vtab_rhs_value() always returns SQLITE_NOTFOUND.)^
15262 ** Value constraints (enforced via assert()):
15592 ** the lifetime of the cursor) that defines constraints on which rows
15612 #define BTREE_HINT_RANGE 0 /* Range constraints on queries */
17127 i64 nDeferredCons; /* Net deferred constraints this transaction. */
17128 i64 nDeferredImmCons; /* Net deferred immediate constraints */
17174 ** Value constraints (enforced via assert()):
17190 #define SQLITE_IgnoreChecks 0x00000200 /* Do not enforce check constraints */
17195 #define SQLITE_ForeignKeys 0x00004000 /* Enforce foreign key constraints */
17200 #define SQLITE_DeferFKs 0x00080000 /* Defer all FK constraints */
17251 #define SQLITE_Transitive 0x00000080 /* Transitive constraints */
17349 ** Value constraints (enforced via assert()):
17735 u8 bConstraint; /* True if constraints are supported */
17756 ExprList *pCheck; /* All CHECK constraints */
17819 #define TF_HasNotNull 0x00000800 /* Contains NOT NULL constraints */
18672 ** Value constraints (enforced via assert()):
18741 ** Value constraints (all checked via assert()):
18850 ** Value constraints (all checked via assert())
19201 ** Also used to hold redundant UNIQUE constraints
19264 ** Value constraints (enforced via assert()):
20799 ** provided (enforcement of FK constraints requires the triggers sub-system).
22842 i64 nFkConstraint; /* Number of imm. FK constraints this VM */
22843 i64 nStmtDefCons; /* Number of def. constraints when stmt started */
22844 i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
23485 ** key constraints. Set *pCurrent to zero if all foreign key constraints
31850 /* This only happens when coding check constraints */
85788 ** key constraints to hold up the transaction. This means a commit
95213 ** case occurs when there are no inequality constraints to the right of
95215 ** occurs when there are inequality constraints to the right of the IN
95258 /* There are no inequality constraints following the IN constraint. */
95266 /* There are inequality constraints. */
97628 ** (deferred foreign key constraints). Otherwise, if P1 is zero, the
97629 ** statement counter is incremented (immediate foreign key constraints).
103946 /* Silently ignore database qualifiers inside CHECK constraints and
104492 else if( pNC->ncFlags & NC_IsCheck ) zIn = "CHECK constraints";
105765 ** (1) CHECK constraints NC_IsCheck
108574 ** to NOT NULL constraints in the schema). If no NULL values are possible,
109969 ** constraints, and that constant is coded by the pExpr->pLeft
109990 /* Other columns in the same row for CHECK constraints or
111712 /* Virtual tables are allowed to use constraints like x=NULL. So
112772 /* Verify that constraints are still satisfied */
113996 ** of any foreign key constraints that use the table being renamed as the
119251 ** indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example:
120193 /* If errors are seen, delete the CHECK constraints now, else they might
120607 ** normally holds CHECK constraints on an ordinary table, but for
121659 "UNIQUE constraints");
121764 ** Two UNIQUE or PRIMARY KEY constraints are considered equivalent
121769 ** the constraint occur in different orders, then the constraints are
122738 ** rollback the whole transaction. For operations where all constraints
124514 /* Do FK processing. This call checks that any FK constraints that
124515 ** refer to this table (i.e. constraints attached to other tables)
127155 ** Deferred constraints are implemented using a simple counter associated
127199 ** for FK constraints for which the affected columns are actually
127205 ** For the purposes of immediate FK constraints, the OR REPLACE conflict
127211 ** Immediate constraints are usually handled similarly. The only difference
127467 ** outstanding constraints to resolve. If there are not, there is no need
127797 ** NULL pointer (as there are no FK constraints for which t2 is the parent
127871 ** the entire DELETE if there are no outstanding deferred constraints
127893 ** constraints are violated.
128035 /* Loop through all the foreign key constraints for which pTab is the
128068 ** before actually dropping it in order to check FK constraints.
128138 /* Loop through all the foreign key constraints that refer to this table.
128139 ** (the "child" constraints) */
129930 /* Generate code to check constraints and generate index keys and
129943 int isReplace = 0;/* Set to true if constraints may cause a replace */
129953 ** constraints or (b) there are no triggers and this table is not a
130228 ** This routine also generates code to check constraints. NOT NULL,
130229 ** CHECK, and UNIQUE constraints are all checked. If a constraint fails,
130300 /* Variables associated with retesting uniqueness constraints after
130303 int addrRecheck = 0; /* Jump here to recheck all uniqueness constraints */
130332 /* Test all NOT NULL constraints.
130414 /* If there are no generated columns with NOT NULL constraints
130415 ** and no NOT NULL ON CONFLICT REPLACE constraints, then a single
130423 /* If any NOT NULL ON CONFLICT REPLACE constraints fired on the
130431 } /* end if( has-not-null-constraints ) */
130433 /* Test all CHECK constraints
130447 /* The check constraints do not reference any of the columns being
130478 /* UNIQUE and PRIMARY KEY constraints should be handled in the following
130492 ** The order of constraints used to have OE_Update as (2) and OE_Abort
130498 ** (B) Unique index constraints that do not have OE_Replace as their
130570 ** recheck all of the uniqueness constraints after they have all run.
130587 /* There are not DELETE triggers nor FK constraints. No constraint
130645 ** the UNIQUE constraints have run.
130648 && onError!=overrideError /* Rules for other constraints are different */
130649 && pTab->pIndex /* There exist other constraints */
130754 /* Test all UNIQUE constraints by creating entries for each UNIQUE
131063 /* Recheck all uniqueness constraints after replace triggers have run */
131577 return 0; /* Tables have different CHECK constraints. Ticket #2252 */
131582 ** any foreign key constraints. This is more restrictive than necessary.
131584 ** command, and the VACUUM command disables foreign key constraints. So
136187 /* Verify CHECK constraints */
136924 ** query planner to give == constraints on as many hidden parameters as
137105 pragmaVtabFilter, /* xFilter - configure scan constraints */
138683 ** WHERE clause to enforce the specified constraints. The extra
142330 ** Flattening is subject to the following constraints:
142919 ** a known value due to WHERE clause constraints of the form COLUMN=VALUE.
145120 ** means that flattening does occur on simpler SQL constraints without
148809 /* Fire any BEFORE UPDATE triggers. This happens before constraints are
148894 /* If changing the rowid value, or if there are foreign key constraints
149699 ** disable CHECK and foreign key constraints. */
151423 ** one corresponding WhereLoop object (unless INDEXED BY constraints
151447 u16 nEq; /* Number of equality constraints */
151886 ** Value constraints:
152477 ** this is only guaranteed for TK_ISNULL and TK_IN constraints. If the
152482 ** straight-line code. For constraints of the form X IN (...)
152644 ** Generate code that will evaluate all == and IN constraints for an
152649 ** The index has as many as three equality constraints, but in this
152651 ** constraints are coded. This routine will generate code to evaluate
152660 ** The nExtraReg parameter is 0 or 1. It is 0 if all WHERE clause constraints
152663 ** occurs after the nEq quality constraints.
152676 ** with equality constraints that use BLOB or NONE affinity are set to
152695 u16 nEq; /* The number of == or IN constraints to code */
152744 /* Evaluate the equality constraints
153298 ** there are no IN operators in the constraints, the "addrNxt" label
153530 testcase( pStart->leftCursor!=iCur ); /* transitive constraints */
153565 testcase( pEnd->leftCursor!=iCur ); /* Transitive constraints */
153601 ** inequality constraints (>, <, >= or <=) on the indexed
153619 ** N may be zero if there are inequality constraints.
153620 ** If there are no inequality constraints, then N is at
153624 ** constraints but an index is selected anyway, in order
153675 /* Like optimization range constraints always occur in pairs */
153684 assert( pRangeStart!=0 ); /* LIKE opt constraints */
154373 ** constraints to be generated. The value of stack variable iLoop
154374 ** determines the constraints coded by each iteration, as follows:
154402 /* Defer processing WHERE clause constraints until after outer
154459 /* Insert code to test for implied constraints based on transitivity
154554 goto code_outer_join_constraints; /* WHERE clause constraints */
154571 /* WHERE clause constraints must be deferred until after outer join
154572 ** row elimination has completed, since WHERE clause constraints apply
154859 ** can be optimized using inequality constraints. Return TRUE if it is
155997 /* Add constraints to reduce the search space on a LIKE or GLOB
156000 ** A like pattern of the form "x LIKE 'aBc%'" is changed into constraints
156032 ** the range constraints also work for BLOBs
156588 sqlite3_value *aRhs[1]; /* RHS values for constraints. MUST BE LAST
157036 ** the WHERE clause that specifies that X=Y. Any such constraints will be
157305 ** for an example of a WHERE clause constraints that may not be used on
157408 ** and used to match WHERE clause constraints */
157744 /* Find all WHERE clause constraints referring to this virtual table.
158328 ** equality constraints optimized by the proposed index scan. For example,
158342 ** considering the range constraints. If nEq is 0, then *pnOut is the number of
158344 ** to account for the range constraints pLower and pUpper.
158348 ** and a pair of constraints (x>? AND x<?) reduces the expected number of
158970 ** UNIQUE constraint) with one or more == constraints is better
159264 int nEq, /* Number of prior equality constraints on same index */
159345 int opMask; /* Valid operators for constraints */
159358 WhereTerm *pTop = 0, *pBtm = 0; /* Top and bottom range constraints */
159404 continue; /* ignore IS [NOT] NULL constraints on NOT NULL columns */
159536 /* Range constraints that come from the LIKE optimization are
159685 /* Consider using a skip-scan if there are no WHERE clause constraints
160202 ** Argument pIdxInfo is already populated with all constraints that may
160204 ** function marks a subset of those constraints usable, invokes the
160227 u16 mNoOmit, /* Do not omit these constraints */
160247 /* Set the usable flag on the subset of constraints identified by
160556 int nConstraint; /* Number of constraints in p */
160582 /* First call xBestIndex() with all constraints usable. */
161719 ** simple == constraints against indexed fields. This routine attempts
179656 ** bits, used to describe extra constraints on full-text searches.
181267 ** so search through the constraints to see if a more efficient
185065 ** constraints. In this case it returns 1. If the NEAR expression does not
185930 /* Search for equality and range constraints on the "term" column.
185931 ** And equality constraints on the hidden "languageid" column. */
200694 int aIdx[2]; /* Index of constraints for JSON and ROOT */
200695 int unusableMask = 0; /* Mask of unusable JSON and ROOT constraints */
200696 int idxMask = 0; /* Mask of usable == constraints JSON and ROOT */
200721 /* If there are any unusable constraints on JSON or ROOT, then reject
200838 jsonEachFilter, /* xFilter - configure scan constraints */
200866 jsonEachFilter, /* xFilter - configure scan constraints */
201232 RtreeConstraint *aConstraint; /* Search constraints. */
202640 /* Move to the next entry that matches the configured constraints. */
202825 ** with the configured constraints.
204205 ** with "column" that are interpreted as table constraints.
204435 rtreeFilter, /* xFilter - configure scan constraints */
206730 ** with the configured constraints.
207097 geopolyFilter, /* xFilter - configure scan constraints */
208338 ** * CHECK constraints are not enforced.
208350 ** have no PRIMARY KEY or UNIQUE constraints, but each column should have
210918 ** same schema as the actual target table (less any UNIQUE constraints).
215063 statFilter, /* xFilter - configure scan constraints */
215225 /* Check for constraints against pgno */
215491 dbpageFilter, /* xFilter - configure scan constraints */
219296 int bDeferConstraints; /* True to defer constraints */
219297 int bInvertConstraints; /* Invert when iterating constraints buffer */
219298 SessionBuffer constraints; /* Deferred constraints are stored here */
219855 ** to the SessionApplyCtx.constraints buffer. */
219858 sessionAppendBlob(&p->constraints, aBlob, nBlob, &rc);
220105 ** Retry the changes accumulated in the pApply->constraints buffer.
220117 while( pApply->constraints.nBuf ){
220119 SessionBuffer cons = pApply->constraints;
220120 memset(&pApply->constraints, 0, sizeof(SessionBuffer));
220143 assert( pApply->bDeferConstraints || pApply->constraints.nBuf==0 );
220147 if( pApply->constraints.nBuf>=cons.nBuf ){
220229 memset(&sApply.constraints, 0, sizeof(SessionBuffer));
220351 sqlite3_free((char*)sApply.constraints.aBuf);
237359 ** constraints also present. As follows:
237361 ** * No other constraints: cost=1000.0
237363 ** * Both rowid range constraints: cost=500.0
237368 ** * No other constraints: cost=1000000.0
237370 ** * Both rowid range constraints: cost=250000.0
238147 ** sqlite3_index_constraint.omit flag clear for range constraints
243719 ** Only constraints of the form:
244554 stmtFilter, /* xFilter - configure scan constraints */