• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/Heimdal-398.1.2/lib/sqlite/

Lines Matching +defs:cl +defs:key

2092 ** [foreign key constraints].  There should be two additional arguments.
2130 ** integer key called the [ROWID | "rowid"]. ^The rowid is always available
2183 ** triggers or [foreign key actions] are not counted.)^ Use the
2185 ** including changes caused by triggers and foreign key actions.
2236 ** [foreign key actions]. However,
4775 ** Specify the key for an encrypted database. This routine should be
4783 const void *pKey, int nKey /* The key */
4787 ** Change the key on an open database. If the current database is not
4796 const void *pKey, int nKey /* The new key */
4800 ** Specify the activation key for a SEE database. Unless
4810 ** Specify the activation key for a CEROD database. Unless
5173 ** primary key: 1
5603 ** key for writing. ^If [foreign key constraints] are enabled, it is
5604 ** not possible to open a column that is part of a [child key] for writing.
6546 ** 8-byte boundary. The page to be fetched is determined by the key. ^The
6547 ** minimum key value is 1. After it has been retrieved using xFetch, the page
6585 ** The xRekey() method is used to change the key value associated with the
6612 void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
7828 ** directly, we use its constant as a key to lookup the run-time allocated
8021 ** With BTREE_INTKEY, the table key is a 64-bit integer and arbitrary data
8023 ** BTREE_BLOBKEY, the key is an arbitrary BLOB and no content is stored
8024 ** anywhere - the key is the content. (BTREE_BLOBKEY is used for SQL
9586 #define SQLITE_ForeignKeys 0x04000000 /* Enforce foreign key constraints */
9902 ** the column that is that key. Otherwise Table.iPKey is negative. Note
9922 int iPKey; /* If not negative, use aCol[iPKey] as the primary key */
9955 #define TF_HasPrimaryKey 0x04 /* Table has a primary key */
9956 #define TF_Autoincrement 0x08 /* Integer primary key is autoincrement */
9976 ** Each foreign key constraint is an instance of the following structure.
9978 ** A foreign key is associated with two tables. The "from" table is
9980 ** key. The "to" table is the table that is named in the REFERENCES clause.
9988 ** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2".
9996 FKey *pNextFrom; /* Next foreign key in pFrom */
9997 char *zTo; /* Name of table that the key points to (aka: Parent) */
9998 FKey *pNextTo; /* Next foreign key on table named zTo */
9999 FKey *pPrevTo; /* Previous foreign key on table named zTo */
10000 int nCol; /* Number of columns in this key */
10029 ** key is set to NULL. CASCADE means that a DELETE or UPDATE of the
10031 ** foreign key.
10044 #define OE_SetNull 7 /* Set the foreign key value to NULL */
10045 #define OE_SetDflt 8 /* Set the foreign key value to its default */
10061 CollSeq *aColl[1]; /* Collating sequence for each term of the key */
10071 ** the key of an index. A blob encoding of a record is created by
10092 #define UNPACKED_INCRKEY 0x0008 /* Make this key an epsilon larger */
11752 ** key functionality is available. If OMIT_TRIGGER is defined but
12582 ** The cursor can seek to a BTree entry with a particular key, or
12584 ** entries or retrieve the key or data from the entry that the cursor
21933 ** hash table that matches the given key. The hash for this key has
21938 const char *pKey, /* The key we are searching for */
21939 int nKey, /* Bytes in key (not counting zero terminator) */
21940 unsigned int h /* The hash for this key. */
21963 ** element and a hash on the element's key.
21996 /* Attempt to locate an element of the hash table pH with a key
22001 HashElem *elem; /* The element that matches key */
22002 unsigned int h; /* A hash on key */
22016 /* Insert an element into the hash table pH. The key is pKey,nKey
22019 ** If no element exists with a matching key, then a new
22022 ** If another element already exists with the same key, then the
22024 ** The key is not copied in this instance. If a malloc fails, then
22028 ** element corresponding to "key" is removed from the hash table.
22031 unsigned int h; /* the hash of the key modulo hash table size */
25366 struct vxworksFileId *pNew; /* search key and new file ID */
25516 ** An instance of the following structure serves as the key used
25538 struct unixFileId fileId; /* The lookup key */
25708 unixFile *pFile, /* Unix file with file desc used in the key */
25713 struct unixFileId fileId; /* Lookup key for the unixInodeInfo */
35917 PgHdr1 **apHash; /* Hash table for fast lookup by key */
35919 unsigned int iMaxKey; /* Largest key seen since xTruncate() */
36499 ** Discard all pages from cache pCache with a page number (key value)
36646 ** Fetch a page by key value.
45318 int iKey; /* Hash key */
45346 int iKey; /* Hash table key */
45723 ** aLeft[] and aRight[] are arrays of indices. The sort key is
45784 ** Sort the elements in list aList using aContent[] as the sort key.
47375 ** Finding a particular key requires reading O(log(M)) pages from the
47380 ** key and data for any entry are combined to form the "payload". A
47386 ** information such as the size of key and data.
47480 ** only keys and no data. The intkey flag means that the key is a integer
47481 ** which is stored in the key size entry of the cell header rather than in
47529 ** bytes of key and data in a btree cell.
47536 ** var Number of bytes of key. Or the key itself if intkey flag is set.
47791 i64 nKey; /* The key for INTKEY tables, or number of bytes in key */
47834 i64 nKey; /* Size of pKey, or last integer key */
47835 void *pKey; /* Saved key that was cursor's last known position */
48838 ** stores the integer key in pCur->nKey. In this case this value is
48840 ** table, then malloc space for and store the pCur->nKey bytes of key
48910 const void *pKey, /* Packed key if the btree is an index */
48911 i64 nKey, /* Integer key for tables. Size of pKey for indices */
48916 UnpackedRecord *pIdxKey; /* Unpacked index key */
49017 ** This routine updates the pointer map entry for page number 'key'
49024 static void ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent, int *pRC){
49038 if( key==0 ){
49042 iPtrmap = PTRMAP_PAGENO(pBt, key);
49048 offset = PTRMAP_PTROFFSET(iPtrmap, key);
49057 TRACE(("PTRMAP_UPDATE: %d->(%d,%d)\n", key, eType, parent));
49072 ** This routine retrieves the pointer map entry for page 'key', writing
49076 static int ptrmapGet(BtShared *pBt, Pgno key, u8 *pEType, Pgno *pPgno){
49085 iPtrmap = PTRMAP_PAGENO(pBt, key);
49092 offset = PTRMAP_PTROFFSET(iPtrmap, key);
49259 /* pIter now points at the 64-bit integer key value, a variable length
49261 ** past the end of the key value. */
51915 ** the key for the current entry. If the cursor is not pointing
51918 ** For a table with the INTKEY flag set, this routine returns the key
51919 ** itself, not the number of bytes in the key.
52226 ** Read part of the key associated with cursor pCur. Exactly
52277 ** the key if skipKey==0 and it points to the beginning of data if
52278 ** skipKey==1. The number of bytes of available key/data is written
52282 ** This routine is an optimization. It is common for the entire key
52285 ** key and data without making a copy. If the key and/or data spills
52287 ** the key/data and copy it into a preallocated buffer.
52333 ** many bytes of the key or data as are available on the local
52336 ** The pointer returned is ephemeral. The key/data may move
52342 ** These routines is used to get quick access to key and data
52541 ** The left-most leaf is the one with the smallest key - the first
52566 ** The right-most entry is the one with the largest key - the last
52567 ** key in ascending order.
52652 /* Move the cursor so that it points to an entry near the key
52662 ** before or after the key.
52665 ** comparing the key with the entry to which the cursor is
52682 UnpackedRecord *pIdxKey, /* Unpacked index key */
52683 i64 intKey, /* The table key */
53509 const void *pKey, i64 nKey, /* The key */
53939 ** a variable length key value (which must be the same value as the
53940 ** largest key on pPage).
53942 ** To find the largest key value on pPage, first find the right-most
53945 ** and the key value (a variable length integer, may have any value).
53947 ** field. The second while(...) loop copies the key value from the
54279 ** leafData: 1 if pPage holds key+data and pParent holds only keys.
54537 ** cell consists of the integer key for the right-most cell of
54694 u32 key = get4byte(&apNew[i]->aData[8]);
54695 ptrmapPut(pBt, key, PTRMAP_BTREE, apNew[i]->pgno, &rc);
54916 ** Insert a new record into the BTree. The key is given by (pKey,nKey)
54921 ** For an INTKEY table, only the nKey value of the key is used. pKey is
54935 ** the cursor before the new key can be inserted.
54939 const void *pKey, i64 nKey, /* The key of the new record */
54983 ** integer key to use. It then calls this function to actually insert the
55053 ** entry in the table, and the next row inserted has an integer key
55054 ** larger than the largest existing key, it is possible to insert the
55645 /* If this is a leaf page or the tree is not an int-key tree, then
55773 checkAppendMsg(pCheck, zContext, "Failed to read ptrmap key=%d", iChild);
55779 "Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)",
55867 ** NO 3. Make sure no key is less than or equal to zLowerBound.
55868 ** NO 4. Make sure no key is greater than or equal to zUpperBound.
58033 ** Move data out of a btree key or data field and into a Mem structure.
58034 ** The data or key is taken from the entry that pCur is currently pointing
58035 ** to. offset and amt determine what portion of the data or key to retrieve.
58036 ** key is true to get the key or false to get data. The result is written
58049 int key, /* If true, retrieve from the btree key, not data. */
58061 if( key ){
58076 if( key ){
58664 ** * OP_FkCounter with P2==0 (immediate foreign key constraint)
60378 ** committed. If there are outstanding deferred foreign key constraint
60391 sqlite3SetString(&p->zErrMsg, db, "foreign key constraint failed");
60482 /* Check for immediate foreign key violations. */
60508 ** key constraints to hold up the transaction. This means a commit
61223 ** greater than key2. The {nKey1, pKey1} key must be a blob
61225 ** key must be a parsed key such as obtained from
61229 ** The key with fewer fields is usually compares less than the
61230 ** longer key. However if the UNPACKED_INCRKEY flags in pPKey2 is set
61238 ** an index key, and thus ends with a rowid value. The last byte
61246 int nKey1, const void *pKey1, /* Left key */
61247 UnpackedRecord *pPKey2 /* Right key */
61283 /* Read the serial types for the next element in each key. */
61330 ** are considered to be equal. Otherwise, the longer key is the
61424 ** Compare the key of the index entry that cursor pC is pointing to against
61425 ** the key string in pUnpacked. Write into *pRes a number
61432 ** of the keys prior to the final rowid, not the entire key.
61436 UnpackedRecord *pUnpacked, /* Unpacked version of key to compare against */
63118 ** is executed. This is used to test whether or not the foreign key
63871 UnpackedRecord r; /* B-Tree index search key */
63890 Mem *pKey; /* MEM cell holding key for the record */
63891 i64 iKey; /* The integer ROWID or key for the record to be inserted */
64061 } cl;
64628 /* If this statement has violated immediate foreign key constraints, do
65979 ** use as a data record in a database table or as a key
65984 ** field of the index key.
66860 ** use the value in register P3 as the key. If cursor P1 refers
66862 ** that are used as an unpacked index key.
66865 ** is greater than or equal to the key value. If there are no records
66866 ** greater than or equal to the key and P2 is not zero, then jump to P2.
66873 ** use the value in register P3 as a key. If cursor P1 refers
66875 ** that are used as an unpacked index key.
66878 ** is greater than the key value. If there are no records greater than
66879 ** the key and P2 is not zero, then jump to P2.
66886 ** use the value in register P3 as a key. If cursor P1 refers
66888 ** that are used as an unpacked index key.
66891 ** is less than the key value. If there are no records less than
66892 ** the key and P2 is not zero, then jump to P2.
66899 ** use the value in register P3 as a key. If cursor P1 refers
66901 ** that are used as an unpacked index key.
66904 ** is less than or equal to the key value. If there are no records
66905 ** less than or equal to the key and P2 is not zero, then jump to P2.
67182 ** no data and where the key are records generated by OP_MakeRecord with
67188 ** that make up an unpacked index key that can be used with cursor P1.
67212 UnpackedRecord r; /* B-Tree index search key */
67242 /* Populate the index search key. */
67270 ** Use the content of register P3 as an integer key. If a record
67271 ** with that key does not exist in table of P1, then jump to P2.
67276 ** operation assumes the key is an integer and that P1 is a table whereas
67277 ** NotFound assumes key is a blob constructed from MakeRecord and
67340 ** Get a new integer record number (a.k.a "rowid") used as the key to a table.
67341 ** The record number is not previously used as a key in the database
67494 ** number P2. The key is stored in register P3. The key must
67530 ** This works exactly like OP_Insert except that the key is the
67537 Mem *pKey; /* MEM cell holding key for the record */
67538 i64 iKey; /* The integer ROWID or key for the record to be inserted */
67737 ** Write into register P2 the complete row key for cursor P1.
67739 ** The key is copied onto the P3 register exactly as
67812 ** Store in register P2 an integer which is the key of the table entry that
67982 ** Advance cursor P1 so that it points to the next key/data pair in its
67983 ** table or index. If there are no more key/value pairs then fall through
67999 ** Back up cursor P1 so that it points to the previous key/data pair in its
68000 ** table or index. If there is no previous key/value pairs then fall through
68057 ** Register P2 holds an SQL index key made using the
68058 ** MakeRecord instructions. This opcode writes that key
68109 ** an unpacked index key. This opcode removes that entry from the
68147 ** the end of the index key pointed to by cursor P1. This integer should be
68184 ** key that omits the ROWID. Compare this key value against the index
68187 ** If the P1 index entry is greater than or equal to the key value
68190 ** If P5 is non-zero then the key value is increased by an epsilon
68192 ** that if the key from register P3 is a prefix of the key in the cursor,
68198 ** key that omits the ROWID. Compare this key value against the index
68201 ** If the P1 index entry is less than the key value then jump to P2.
68204 ** If P5 is non-zero then the key value is increased by an epsilon prior
68355 ** have a 4-byte integer key and can have arbitrary data. An index
68356 ** has an arbitrary key but no data.
68702 ** is really a trigger, not a foreign key action, and the flag set
68816 ** (deferred foreign key constraints). Otherwise, if P1 is zero, the
68817 ** statement counter is incremented (immediate foreign key constraints).
68830 ** This opcode tests if a foreign key constraint-counter is currently zero.
68837 ** (immediate foreign key constraint violations).
69358 #if 0 /* local variables moved into u.cl */
69370 #endif /* local variables moved into u.cl */
69372 u.cl.pQuery = &aMem[pOp->p3];
69373 u.cl.pArgc = &u.cl.pQuery[1];
69374 u.cl.pCur = p->apCsr[pOp->p1];
69375 assert( memIsValid(u.cl.pQuery) );
69376 REGISTER_TRACE(pOp->p3, u.cl.pQuery);
69377 assert( u.cl.pCur->pVtabCursor );
69378 u.cl.pVtabCursor = u.cl.pCur->pVtabCursor;
69379 u.cl.pVtab = u.cl.pVtabCursor->pVtab;
69380 u.cl.pModule = u.cl.pVtab->pModule;
69383 assert( (u.cl.pQuery->flags&MEM_Int)!=0 && u.cl.pArgc->flags==MEM_Int );
69384 u.cl.nArg = (int)u.cl.pArgc->u.i;
69385 u.cl.iQuery = (int)u.cl.pQuery->u.i;
69389 u.cl.res = 0;
69390 u.cl.apArg = p->apArg;
69391 for(u.cl.i = 0; u.cl.i<u.cl.nArg; u.cl.i++){
69392 u.cl.apArg[u.cl.i] = &u.cl.pArgc[u.cl.i+1];
69393 sqlite3VdbeMemStoreType(u.cl.apArg[u.cl.i]);
69397 rc = u.cl.pModule->xFilter(u.cl.pVtabCursor, u.cl.iQuery, pOp->p4.z, u.cl.nArg, u.cl.apArg);
69399 importVtabErrMsg(p, u.cl.pVtab);
69401 u.cl.res = u.cl.pModule->xEof(u.cl.pVtabCursor);
69404 if( u.cl.res ){
69408 u.cl.pCur->nullRow = 0;
70020 ** column is not indexed, and that it is not part of a foreign key.
70028 /* Check that the column is not part of an FK child key definition. It
70029 ** is not necessary to check if it is part of a parent key, as parent
70030 ** key columns must be indexed. The check below will pick up this
70037 zFault = "foreign key";
70316 ** An aIter[] iterator either points to a valid key or else is at EOF. For
70327 ** comparing aIter[2*i-N] and aIter[2*i-N+1]. Whichever key is smaller, the
70331 ** other key value. If the keys are equal (only possible with two EOF
70337 ** currently points to the smallest key value. aTree[0] is unused.
70352 ** The current element is "Apple" (the value of the key indicated by
70354 ** be advanced to the next key in its segment. Say the next key is
70360 ** 5 key to the current key of iterator 4 (still "Grapefruit"). The iterator
70363 ** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Banana<Durian),
70369 ** key comparison operations are required, where N is the number of segments
70388 ** The following type is an iterator for a PMA. It caches the current key in
70397 int nKey; /* Number of bytes in key */
70398 u8 *aKey; /* Pointer to current key */
70428 ** Advance iterator pIter to the next key in its PMA. Return SQLITE_OK if
70534 ** leaves the iterator pointing to the first key in the PMA (or EOF if the
70823 ** key). The varint is the number of bytes in the blob of data.
71099 ** current key.
71103 int *pnKey /* OUT: Size of current key in bytes */
71119 ** Copy the current sorter key into the memory cell pOut.
71123 void *pKey; int nKey; /* Sorter key to copy into pOut */
71137 ** Compare the key in memory cell pVal with the key that the sorter cursor
71143 ** key in pVal is smaller than, equal to or larger than the current sorter
71144 ** key.
71148 Mem *pVal, /* Value to compare to current sorter key */
71152 void *pKey; int nKey; /* Sorter key to compare pVal with */
74571 ** to some integer key column of a table B-Tree. In this case, use an
74685 ** For each expression, build an index key from the evaluation and
74831 /* Figure out the affinity to use to create a key from the results
76866 ** of any foreign key constraints that use the table being renamed as the
77055 ** tables that have foreign key constraints that refer to table pTab (i.e.
77281 /* If foreign-key support is enabled, rewrite the CREATE TABLE
77282 ** statements corresponding to all child tables of foreign key constraints
78505 zErrDyn = sqlite3DbStrDup(db, "Invalid key value");
78517 /* No key specified. Use the key from the main database */
78635 Expr *pKey /* Database key for encryption extension */
80255 ** of columns that form the primary key. If pList is NULL, then the
80256 ** most recently added column of the table is the primary key.
80258 ** A table can have at most one primary key. If the table already has
80259 ** a primary key (and this is the second primary key) then create an
80268 ** If the key is not an INTEGER PRIMARY KEY, then create a unique
80269 ** index for the key. No index is created for INTEGER PRIMARY KEYs.
80284 "table \"%s\" has more than one primary key", pTab->zName);
81302 ** This routine is called to create a new foreign key on the table
81304 ** in the current table point to the foreign key. If pFromCol==0 then
81305 ** connect the key to the last column inserted. pTo is the name of
81307 ** pTo table that the foreign key points to. flags contains all
81314 ** The foreign key is set for IMMEDIATE processing. A subsequent call
81340 sqlite3ErrorMsg(pParse, "foreign key on %s"
81348 "number of columns in foreign key does not match the number of "
81386 "unknown column \"%s\" in foreign key definition",
81419 /* Link the foreign key to the table as the last step.
81433 ** clause is seen as part of a foreign key definition. The isDeferred
81435 ** The behavior of the most recently created foreign key is adjusted
81469 int regIdxKey; /* Registers containing the index key */
81566 ** be NULL for a primary key or an index that is created to satisfy a
81572 ** is a primary key or unique-constraint on the most recent column added
81577 ** as the tables primary key (Index.autoIndex==2).
81588 int sortOrder, /* Sort order of primary key when pList==NULL */
81693 ** dealing with a primary key or UNIQUE constraint. We have to invent our
81744 ** key out of the last column added to the table under construction.
81955 ** If pTblName==0 it means this index is generated as a primary key
83783 /* Delete every item whose key was written to the list during the
83954 ** handle rows (possibly in other tables) that refer via a foreign key
84003 ** Generate code that will assemble an index key and put it in register
84004 ** regOut. The key with be for index pIdx which is an index on pTab.
84009 ** registers that holds the elements of the index key. The
84015 Index *pIdx, /* The index for which to generate a key */
84017 int regOut, /* Write the new index key to this register */
85672 ** This file contains code used by the compiler to add foreign key
85684 ** If an immediate foreign key constraint is violated, SQLITE_CONSTRAINT
85686 ** deferred foreign key constraint is violated, no action is taken
85693 ** that causes a foreign key violation, the counter is incremented. Each
85699 ** * When a commit fails due to a deferred foreign key constraint,
85703 ** * If the database contains foreign key violations when the
85753 ** INSERT violates a foreign key constraint. This is necessary as such
85779 ** sqlite3FkCheck() - Check for foreign key violations.
85802 ** A foreign key constraint requires that the key columns in the parent
85804 ** Given that pParent is the parent table for foreign key constraint pFKey,
85805 ** search the schema a unique index on the parent key columns.
85807 ** If successful, zero is returned. If the parent key is an INTEGER PRIMARY
85811 ** If the parent key consists of a single column (the foreign key constraint
85812 ** is not a composite foreign key), output variable *paiCol is set to NULL.
85814 ** N is the number of columns in the parent key. The first element of the
85823 ** 1) The named parent key columns do not exist, or
85825 ** 2) The named parent key columns do exist, but are not subject to a
85828 ** 3) No parent key columns were provided explicitly as part of the
85829 ** foreign key definition, and the parent table does not have a
85832 ** 4) No parent key columns were provided explicitly as part of the
85833 ** foreign key definition, and the PRIMARY KEY of the parent table
85834 ** consists of a a different number of columns to the child key in
85837 ** then non-zero is returned, and a "foreign key mismatch" error loaded
85844 FKey *pFKey, /* Foreign key to find index for */
85850 int nCol = pFKey->nCol; /* Number of columns in parent key */
85851 char *zKey = pFKey->aCol[0].zCol; /* Name of left-most parent key column */
85858 /* If this is a non-composite (single column) foreign key, check if it
85862 ** Otherwise, for a composite foreign key (more than one column), allocate
85870 ** mapped to the primary key of table pParent, or
85888 ** of columns. If each indexed column corresponds to a foreign key
85892 /* If zKey is NULL, then this foreign key is implicitly mapped to
85903 /* If zKey is non-NULL, then this foreign key was declared to
85938 sqlite3ErrorMsg(pParse, "foreign key mismatch");
85950 ** child table of foreign key constraint pFKey. If an SQL UPDATE is executed
85978 Index *pIdx, /* Unique index on parent key columns in pTab */
85979 FKey *pFKey, /* Foreign key constraint */
85980 int *aiCol, /* Map from parent key columns to child table columns */
85988 int iOk = sqlite3VdbeMakeLabel(v); /* jump here if parent key found */
85994 ** Check if any of the key columns in the child table row are NULL. If
86007 /* If pIdx is NULL, then the parent key is the INTEGER PRIMARY KEY
86012 /* Invoke MustBeInt to coerce the child key value to an integer (i.e.
86013 ** apply the affinity of the parent key). If this fails, then there
86014 ** is no matching parent key. Before using MustBeInt, make a copy of
86015 ** the value. Otherwise, the value inserted into the child key column
86051 ** If any of the parent-key values are NULL, then the row cannot match
86053 ** of the parent-key values are NULL (at this point it is known that
86054 ** none of the child key values are).
86063 /* The parent key is a composite key that includes the IPK column */
86088 pParse, OE_Abort, "foreign key constraint failed", P4_STATIC
86103 ** from the parent table of foreign key constraint pFKey and, if pFKey is
86116 ** throw a "foreign key constraint failed" exception.
86122 ** throw a "foreign key constraint failed" exception.
86133 Index *pIdx, /* Foreign key index */
86134 FKey *pFKey, /* Foreign key relationship */
86158 ** the parent key columns. The affinity of the parent key column should
86159 ** be applied to each child key value before the comparison takes place.
86171 ** expression to the parent key column defaults. */
86248 ** to the FKey structure representing the foreign key constraint on table
86292 ** DELETE, but foreign key actions are not.
86302 /* Search for a deferred foreign key constraint for which this table
86320 /* If the DELETE has generated immediate foreign key constraint
86326 pParse, OE_Abort, "foreign key constraint failed", P4_STATIC
86337 ** table pTab to generate VDBE code to perform foreign key constraint
86376 /* Loop through all the foreign key constraints for which pTab is the
86377 ** child table (the table that the foreign key definition is part of). */
86379 Table *pTo; /* Parent table of foreign key pFKey */
86380 Index *pIdx = 0; /* Index on key columns in pTo */
86387 /* Find the parent table of this foreign key. Also find a unique index
86388 ** on the parent key columns in the parent table. If either of these
86430 /* Request permission to read the parent key columns. If the
86443 ** a cursor to use to search the unique index on the parent key columns
86451 ** outstanding foreign key constraint violation. */
86463 /* Loop through all the foreign key constraints that refer to this table */
86465 Index *pIdx = 0; /* Foreign key index for pFKey */
86472 ** foreign key violation. So do nothing in this case. */
86483 ** the foreign key that refers to this table is attached to). This
86550 ** If any foreign key processing will be required, this function returns
86551 ** true. If there is no foreign key related processing, this function
86562 /* A DELETE operation. Foreign key processing is required if the
86564 ** foreign key constraint. */
86567 /* This is an UPDATE. Foreign key processing is only required if the
86568 ** operation modifies one or more child or parent key columns. */
86572 /* Check if any child key columns are being modified. */
86581 /* Check if any parent key columns are being modified. */
86602 ** compiled on table pTab, which is the parent table of foreign-key pFKey.
86613 ** For example, if pFKey is the foreign key and pTab is table "p" in
86625 ** The returned pointer is cached as part of the foreign key object. It
86626 ** is eventually freed along with the rest of the foreign key object by
86632 FKey *pFKey, /* Foreign key to get action for */
86647 Index *pIdx = 0; /* Parent key index for this FK */
86648 int *aiCol = 0; /* child table cols -> parent key cols */
86739 pRaise = sqlite3Expr(db, TK_RAISE, "foreign key constraint failed");
86820 /* If foreign-key support is enabled, iterate through all FKs that
86838 ** Free all memory associated with foreign key definitions attached to
86863 /* EV: R-30323-21917 Each foreign key constraint in SQLite is
87586 ** the index into IDLIST of the primary key column. keyColumn is
87587 ** the index of the primary key as it appears in IDLIST, not as
87589 ** key in the original table is pTab->iPKey.)
87619 ** key, the set the keyColumn variable to the primary key column index
87784 ** to generate a unique primary key value.
88111 /* If we have an INTEGER PRIMARY KEY, make sure the primary key
88113 ** is an UPDATE and the primary key is not changing, that is OK.
88200 /* Create a key for accessing the index entry */
88620 ** any foreign key constraints. This is more restrictive than necessary.
88622 ** command, and the VACUUM command disables foreign key constraints. So
88634 ** an integer primary key
90158 /* This flag may only be set if both foreign-key and trigger support
90178 /* Foreign key support may not be enabled or disabled while not
91429 if( sqlite3StrICmp(zLeft, "key")==0 && zRight ){
92887 ExprList *pOrderBy, /* If not NULL, sort results using this key */
92951 /* In this mode, write each query result to the key of the temporary
92965 ** saving that record, use it as a key to delete elements from
92974 /* Store the result as data using a unique key.
94307 /* Store the result as data using a unique key.
96039 ** row of result as the key in table pDest->iParm.
96043 ** SRT_Union Store results as a key in a temporary table pDest->iParm.
98120 ** not a foreign key action, and (b) the flag to enable recursive triggers
98375 int hasFK; /* True if foreign key processing is required */
98767 ** handle rows (possibly in other tables) that refer via a foreign key
99050 ** disable CHECK and foreign key constraints. */
102029 /* If the indexed column is the primary key and everything matches
102032 ** to sort because the primary key is unique and so none of the other
103204 ** selected plan may still take advantage of the built-in rowid primary key
103222 Index sPk; /* A fake index object for the primary key */
103249 ** variable sPk to represent the rowid primary key index. Make this
103338 ** This is always false for the rowid primary key index of a table.
103534 /* For a rowid primary key lookup:
103869 ** key value of the loop. If one or more IN operators appear, then
103885 ** a key to search the index. Hence the first byte in the returned affinity
105352 ** the index is listed as "{}". If the primary key is used the
105595 ** An instance of this structure holds the ATTACH key and the key type.
105597 struct AttachKey { int type; Token key; };
110227 ** this routine will be called automatically by key routines such as
113957 char copyKey; /* True if copy of key made on insert */
113989 ** A copy of the key is made if the copyKey parameter to fts3HashInit is 1.
114883 ** <key> = <value>
114886 ** term may be quoted, but the <key> may not.
115164 /* The results of parsing supported FTS4 key=value options: */
120558 ** determines what kind of key the hash table will use. "copyKey" is
120632 ** Return a pointer to the appropriate hash function given the key class.
120653 ** Return a pointer to the appropriate hash function given the key class.
120720 ** hash table that matches the given key. The hash for this key has
120725 const void *pKey, /* The key we are searching for */
120727 int h /* The hash for this key. */
120749 ** element and a hash on the element's key.
120790 int h; /* A hash on key */
120802 ** Attempt to locate an element of the hash table pH with a key
120807 Fts3HashElem *pElem; /* The element that matches key (if any) */
120813 /* Insert an element into the hash table pH. The key is pKey,nKey
120816 ** If no element exists with a matching key, then a new
120817 ** element is created. A copy of the key is made if the copyKey
120820 ** If another element already exists with the same key, then the
120822 ** The key is not copied in this instance. If a malloc fails, then
120826 ** element corresponding to "key" is removed from the hash table.
120830 const void *pKey, /* The key */
120831 int nKey, /* Number of bytes in the key */
120834 int hraw; /* Raw hash value of the key */
120835 int h; /* the hash of the key modulo hash table size */
121570 ** SELECT <function-name>(<key-name>);
121571 ** SELECT <function-name>(<key-name>, <pointer>);
121578 ** to the string <key-name>. If <pointer> is not specified, then
121579 ** the string <key-name> must already exist in the has table. Otherwise,
121584 ** to string <key-name> (after the hash-table is updated, if applicable).
121748 ** SELECT <function-name>(<key-name>, <input-string>);
121749 ** SELECT <function-name>(<key-name>, <pointer>);
121964 ** of the key when a value is inserted. i.e. by a call similar to:
127425 ** Given a node number iNode, return the corresponding key to use