Lines Matching full:foreign
2060 ** triggers or [foreign key actions] are not counted.)^ Use the
2062 ** including changes caused by triggers and foreign key actions.
2113 ** [foreign key actions]. However,
5317 ** key for writing. ^If [foreign key constraints] are enabled, it is
8817 Hash fkeyHash; /* All foreign keys by referenced table name */
9061 #define SQLITE_ForeignKeys 0x04000000 /* Enforce foreign key constraints */
9402 FKey *pFKey; /* Linked list of all foreign keys in this table */
9446 ** Each foreign key constraint is an instance of the following structure.
9448 ** A foreign key is associated with two tables. The "from" table is
9449 ** the table that contains the REFERENCES clause that creates the foreign
9458 ** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2".
9466 FKey *pNextFrom; /* Next foreign key in pFrom */
9468 FKey *pNextTo; /* Next foreign key on table named zTo */
9469 FKey *pPrevTo; /* Previous foreign key on table named zTo */
9496 ** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
9497 ** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the
9498 ** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign
9501 ** foreign key.
9514 #define OE_SetNull 7 /* Set the foreign key value to NULL */
9515 #define OE_SetDflt 8 /* Set the foreign key value to its default */
11186 ** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
11189 ** this case foreign keys are parsed, but no other functionality is
55654 ** * OP_FkCounter with P2==0 (immediate foreign key constraint)
57299 ** committed. If there are outstanding deferred foreign key constraint
57312 sqlite3SetString(&p->zErrMsg, db, "foreign key constraint failed");
57403 /* Check for immediate foreign key violations. */
57424 ** or hit an 'OR FAIL' constraint and there are no deferred foreign
60027 ** is executed. This is used to test whether or not the foreign key
61502 /* If this statement has violated immediate foreign key constraints, do
65412 ** is really a trigger, not a foreign key action, and the flag set
65526 ** (deferred foreign key constraints). Otherwise, if P1 is zero, the
65527 ** statement counter is incremented (immediate foreign key constraints).
65540 ** This opcode tests if a foreign key constraint-counter is currently zero.
65547 ** (immediate foreign key constraint violations).
66705 ** column is not indexed, and that it is not part of a foreign key.
66722 zFault = "foreign key";
72644 ** of any foreign key constraints that use the table being renamed as the
72833 ** tables that have foreign key constraints that refer to table pTab (i.e.
73046 /* If foreign-key support is enabled, rewrite the CREATE TABLE
73047 ** statements corresponding to all child tables of foreign key constraints
75328 ** memory structures of the indices and foreign keys associated with
75354 /* Delete any foreign keys attached to this table. */
75374 ** table structure with all its indices and foreign keys.
76960 ** This routine is called to create a new foreign key on the table
76962 ** in the current table point to the foreign key. If pFromCol==0 then
76965 ** pTo table that the foreign key points to. flags contains all
76972 ** The foreign key is set for IMMEDIATE processing. A subsequent call
76998 sqlite3ErrorMsg(pParse, "foreign key on %s"
77006 "number of columns in foreign key does not match the number of "
77044 "unknown column \"%s\" in foreign key definition",
77076 /* Link the foreign key to the table as the last step.
77090 ** clause is seen as part of a foreign key definition. The isDeferred
77092 ** The behavior of the most recently created foreign key is adjusted
79542 ** handle rows (possibly in other tables) that refer via a foreign key
81241 ** This file contains code used by the compiler to add foreign key
81252 ** Foreign keys in SQLite come in two flavours: deferred and immediate.
81253 ** If an immediate foreign key constraint is violated, SQLITE_CONSTRAINT
81255 ** deferred foreign key constraint is violated, no action is taken
81262 ** that causes a foreign key violation, the counter is incremented. Each
81268 ** * When a commit fails due to a deferred foreign key constraint,
81269 ** there is no way to tell which foreign constraint is not satisfied,
81272 ** * If the database contains foreign key violations when the
81322 ** INSERT violates a foreign key constraint. This is necessary as such
81348 ** sqlite3FkCheck() - Check for foreign key violations.
81371 ** A foreign key constraint requires that the key columns in the parent
81373 ** Given that pParent is the parent table for foreign key constraint pFKey,
81380 ** If the parent key consists of a single column (the foreign key constraint
81381 ** is not a composite foreign key), output variable *paiCol is set to NULL.
81398 ** foreign key definition, and the parent table does not have a
81402 ** foreign key definition, and the PRIMARY KEY of the parent table
81406 ** then non-zero is returned, and a "foreign key mismatch" error loaded
81413 FKey *pFKey, /* Foreign key to find index for */
81427 /* If this is a non-composite (single column) foreign key, check if it
81431 ** Otherwise, for a composite foreign key (more than one column), allocate
81433 ** Non-composite foreign keys do not require the aiCol array.
81457 ** of columns. If each indexed column corresponds to a foreign key
81461 /* If zKey is NULL, then this foreign key is implicitly mapped to
81472 /* If zKey is non-NULL, then this foreign key was declared to
81507 sqlite3ErrorMsg(pParse, "foreign key mismatch");
81519 ** child table of foreign key constraint pFKey. If an SQL UPDATE is executed
81548 FKey *pFKey, /* Foreign key constraint */
81645 pParse, OE_Abort, "foreign key constraint failed", P4_STATIC
81660 ** from the parent table of foreign key constraint pFKey and, if pFKey is
81673 ** throw a "foreign key constraint failed" exception.
81679 ** throw a "foreign key constraint failed" exception.
81690 Index *pIdx, /* Foreign key index */
81691 FKey *pFKey, /* Foreign key relationship */
81805 ** to the FKey structure representing the foreign key constraint on table
81849 ** DELETE, but foreign key actions are not.
81859 /* Search for a deferred foreign key constraint for which this table
81877 /* If the DELETE has generated immediate foreign key constraint
81883 pParse, OE_Abort, "foreign key constraint failed", P4_STATIC
81894 ** table pTab to generate VDBE code to perform foreign key constraint
81928 /* If foreign-keys are disabled, this function is a no-op. */
81935 /* Loop through all the foreign key constraints for which pTab is the
81936 ** child table (the table that the foreign key definition is part of). */
81938 foreign key pFKey */
81946 /* Find the parent table of this foreign key. Also find a unique index
81993 ** outstanding foreign key constraint violation. */
82005 /* Loop through all the foreign key constraints that refer to this table */
82007 Index *pIdx = 0; /* Foreign key index for pFKey */
82014 ** foreign key violation. So do nothing in this case. */
82025 ** the foreign key that refers to this table is attached to). This
82092 ** If any foreign key processing will be required, this function returns
82093 ** true. If there is no foreign key related processing, this function
82104 /* A DELETE operation. Foreign key processing is required if the
82106 ** foreign key constraint. */
82109 /* This is an UPDATE. Foreign key processing is only required if the
82144 ** compiled on table pTab, which is the parent table of foreign-key pFKey.
82155 ** For example, if pFKey is the foreign key and pTab is table "p" in
82167 ** The returned pointer is cached as part of the foreign key object. It
82168 ** is eventually freed along with the rest of the foreign key object by
82174 FKey *pFKey, /* Foreign key to get action for */
82281 pRaise = sqlite3Expr(db, TK_RAISE, "foreign key constraint failed");
82362 /* If foreign-key support is enabled, iterate through all FKs that
82380 ** Free all memory associated with foreign key definitions attached to
82381 ** table pTab. Remove the deleted foreign keys from the Schema.fkeyHash
82404 /* EV: R-30323-21917 Each foreign key constraint in SQLite is
85666 /* This flag may only be set if both foreign-key and trigger support
85686 /* Foreign key support may not be enabled or disabled while not
93425 ** not a foreign key action, and (b) the flag to enable recursive triggers
93679 int hasFK; /* True if foreign key processing is required */
94071 ** handle rows (possibly in other tables) that refer via a foreign key
94352 ** disable CHECK and foreign key constraints. */
101137 "SET", "DEFERRABLE", "FOREIGN", "DROP",
101277 /* 97 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
102522 case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
103847 testcase( i==9 ); /* FOREIGN */