Commit 316b3e2
committed
fix(db2): _truncate_table — use DELETE FROM instead of TRUNCATE IMMEDIATE
TRUNCATE TABLE ... IMMEDIATE cannot run inside an open unit of work
(SQL0428N). ibm_db_dbi forces AUTOCOMMIT_OFF on all connections, which
means _prepare_helper() inside execute() implicitly opens a unit of
work before the statement runs — making the IMMEDIATE constraint
impossible to satisfy in practice.
DELETE FROM has no such restriction and is rollback-safe, matching
the established pattern in trino.py and risingwave.py.1 parent 275f99c commit 316b3e2
1 file changed
Lines changed: 7 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
749 | 743 | | |
750 | 744 | | |
751 | 745 | | |
| |||
0 commit comments