Skip to main content

sweep_statement

Function sweep_statement 

Source
pub fn sweep_statement(
    child: &TableInfo,
    parent: &TableInfo,
    key: &ForeignKeyInfo,
    database: &[u8],
) -> Option<String>
Expand description

Returns the statement that repairs one cyclic key, or None when the key has nothing to repair.

This is the other half of a cyclic action. The trigger takes the first level - the rows that pointed directly at the row that went - and this takes what that leaves: every row whose key now has no parent. Repeating it until nothing changes reaches the leaves, however deep they are, and it terminates because every pass either changes a row or stops.

NO ACTION and RESTRICT are absent on purpose: they refuse rather than repair, and the trigger has already refused.