mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-06-20 05:29:40 +08:00
🐛 fix(query-editor): 修正 SQL 编辑器 DML 事务识别
- 统一前后端 DML 与数据修改 CTE 的受管事务判断 - 保留数据修改 CTE 返回行并补充事务回归测试 - 明确 SQL 编辑器事务提交策略文案
This commit is contained in:
@@ -27,6 +27,12 @@ describe('sqlEditorTransaction', () => {
|
||||
])).toBe(false);
|
||||
});
|
||||
|
||||
it('uses managed transactions for data-changing CTEs even when the top-level operation is SELECT', () => {
|
||||
const sql = 'WITH moved AS (DELETE FROM audit_logs WHERE created_at < NOW() RETURNING id) SELECT * FROM moved';
|
||||
expect(resolveSqlEditorOperationKeyword(sql)).toBe('select');
|
||||
expect(shouldUseSqlEditorManagedTransaction([sql])).toBe(true);
|
||||
});
|
||||
|
||||
it('does not wrap user-authored explicit transactions', () => {
|
||||
expect(shouldUseSqlEditorManagedTransaction([
|
||||
'BEGIN',
|
||||
|
||||
Reference in New Issue
Block a user