Commit d296477
committed
Fix TPC insert/delete order when principal is abstract (#35978)
When using TPC with an abstract principal type mapped to no table, FK
dependency edges were not created because the code relied on mapped FK
constraints, which don't exist for abstract TPC types.
Fix:
- In the ADD predecessor registration loop, add a guard so that FKs with
no mapped constraints (TPC abstract principal) are not skipped by the
IsStoreGenerated check.
- In the DELETE predecessor registration and edge matching loops, remove
the else gates so the entry-level FK loops run for all commands, not
just those without a table. Add GetMappedConstraints guards to avoid
double-processing FKs that are already handled by the table-level path.
- In CanCreateDependency, skip FKs where the other entity type is mapped
to JSON. JSON-owned entities are stored inline and never have separate
modification commands, so they cannot participate in inter-command
dependency ordering. This prevents false cycles with entity splitting
and JSON ownership.
Fixes #359781 parent a630adf commit d296477
2 files changed
Lines changed: 127 additions & 34 deletions
File tree
- src/EFCore.Relational/Update/Internal
- test/EFCore.Relational.Tests/Update
Lines changed: 41 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | | - | |
| 684 | + | |
| 685 | + | |
685 | 686 | | |
686 | 687 | | |
687 | 688 | | |
| |||
726 | 727 | | |
727 | 728 | | |
728 | 729 | | |
729 | | - | |
| 730 | + | |
| 731 | + | |
730 | 732 | | |
731 | | - | |
| 733 | + | |
732 | 734 | | |
733 | | - | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
734 | 738 | | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
| 739 | + | |
| 740 | + | |
740 | 741 | | |
741 | | - | |
742 | | - | |
| 742 | + | |
| 743 | + | |
743 | 744 | | |
744 | | - | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
745 | 748 | | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
| 749 | + | |
| 750 | + | |
753 | 751 | | |
| 752 | + | |
| 753 | + | |
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
| |||
825 | 825 | | |
826 | 826 | | |
827 | 827 | | |
828 | | - | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
829 | 831 | | |
830 | | - | |
831 | | - | |
| 832 | + | |
| 833 | + | |
832 | 834 | | |
833 | | - | |
834 | | - | |
| 835 | + | |
| 836 | + | |
835 | 837 | | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
| 838 | + | |
846 | 839 | | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
847 | 846 | | |
848 | 847 | | |
849 | 848 | | |
| |||
873 | 872 | | |
874 | 873 | | |
875 | 874 | | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
876 | 883 | | |
877 | 884 | | |
878 | 885 | | |
| |||
Lines changed: 86 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1328 | 1328 | | |
1329 | 1329 | | |
1330 | 1330 | | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
1331 | 1417 | | |
0 commit comments