Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch fkc-missing-parent-tables Excluding Merge-Ins
This is equivalent to a diff from 27001356ed to 8c13a7fd73
2013-10-14
| ||
14:30 | Update the foreign_key_check pragma so that when a parent table is undefined it is treated as an empty table. (check-in: 208b259ad7 user: drh tags: trunk) | |
2013-10-12
| ||
20:22 | Restore the index_list pragma back to its former operation. Create a new PRAGMA stats used to access the table and index widths and heights. (check-in: f0cf8c85dc user: drh tags: trunk) | |
19:06 | In "PRAGMA foreign_key_check", treat missing parent tables as empty (instead of as errors). (Closed-Leaf check-in: 8c13a7fd73 user: dan tags: fkc-missing-parent-tables) | |
15:12 | Fix handling of "DROP TABLE" commands when "PRAGMA defer_foreign_keys=1" is set. (check-in: 27001356ed user: dan tags: trunk) | |
13:16 | Add tests that demonstrate that PRAGMA defer_foreign_keys will reset to off at the conclusion of the next transaction. (check-in: 67e28a11de user: drh tags: trunk) | |
Changes to src/pragma.c.
︙ | |||
1606 1607 1608 1609 1610 1611 1612 | 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 | - - + + + - + - + - - + + + - + - + + - - - - + + + + + | if( pTab==0 || pTab->pFKey==0 ) continue; sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName); if( pTab->nCol+regRow>pParse->nMem ) pParse->nMem = pTab->nCol + regRow; sqlite3OpenTable(pParse, 0, iDb, pTab, OP_OpenRead); sqlite3VdbeAddOp4(v, OP_String8, 0, regResult, 0, pTab->zName, P4_TRANSIENT); for(i=1, pFK=pTab->pFKey; pFK; i++, pFK=pFK->pNextFrom){ |
︙ |
Changes to test/fkey5.test.
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + | # This file tests the PRAGMA foreign_key_check command. # # EVIDENCE-OF: R-05426-18119 PRAGMA foreign_key_check; PRAGMA # foreign_key_check(table-name); set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix fkey5 ifcapable {!foreignkey} { finish_test return } do_test fkey5-1.1 { |
︙ | |||
320 321 322 323 324 325 326 327 | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | db eval { DELETE FROM c22; INSERT INTO c22 VALUES('abc ','ALPHA'); PRAGMA foreign_key_check(c22); } } {} #------------------------------------------------------------------------- # Tests 9.* verify that missing parent tables are handled correctly. |