Skip to content

fix(result-set): isolate table edits from query execution options - #2877

Merged
openai0229 merged 1 commit into
mainfrom
fix/result-edit-execution-isolation
Sep 7, 2026
Merged

openai0229 merged 1 commit into
mainfrom
fix/result-edit-execution-isolation

Conversation

@openai0229

Copy link
Copy Markdown
Contributor

Related issue

Closes #2876

Summary

Editing multiple rows in a result produced by a current-statement query could inherit single=true, causing the generated updates to be sent as one statement. This fails on MySQL connections with multi-statement execution disabled while the same SQL succeeds when run as a script in the editor.

Build result-edit requests from datasource, database and schema context only, and use the existing table-edit update API for direct submission, matching SQL-preview execution. Preserve pending-request protection and the direct desktop submission's disabled timeout. Add parameter-isolation regression coverage to the existing result-set test command.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

The CI/build change only adds the regression test to an existing package script; no workflow or packaging implementation changes.

Verification

  • Commands and results: yarn test:result-set-ui, yarn lint, yarn run build:web:community --app_version=0.0.0, and git diff --check passed locally. The result-set tests and lint were also run in the isolated PR worktree.
  • Manual verification: Playwright CLI against a disposable Community backend and MySQL with allowMultiQueries=false. Verified current-statement SELECT (single=true), two-row updates, direct and SQL-preview execution, preview cancellation without a write, second-statement failure feedback with edits retained, rapid double-click producing exactly one request, Cmd+S submission, and values after refresh. Inspected request bodies, responses and actual database rows; browser console had no errors. All temporary browser/server/database fixtures were removed.
  • UI evidence: No layout change. Runtime screenshots were inspected during verification and removed with the temporary fixtures. Network evidence showed the update request contained only dataSourceId, databaseName and the generated SQL for the tested schema-less connection; no query execution options were forwarded.

Risk and compatibility

  • Public API or stored data: Reuses the existing /api/rdb/dml/execute_update contract; no schema or stored-data migration.
  • Database or driver compatibility: Shared frontend behavior, with no database-specific branch. MySQL was exercised against a real driver; other database engines were not individually retested. The existing update endpoint executes statements sequentially and may retain earlier successful writes if a later statement fails; this PR does not add a transaction guarantee.
  • Network, privacy, or security: No new external destination or credential handling. Query execution flags and identifiers are not forwarded to result editing.
  • Community / Local / Pro boundary: Shared Community frontend used by Studio. No commercial implementation or runtime-boundary changes; synchronize Studio's Community source lock after merge.
  • Backward compatibility: Uses an API already used by the SQL-preview dialog. Native Windows packaging was not rerun for this frontend change.

Reviewer map

  • Start here: chat2db-community-client/src/blocks/SearchResult/components/SQLPreviewExecute/updateSql.ts for the explicit request boundary, then index.tsx for the dedicated execution API. src/service/executeSql.ts retains the direct desktop submission timeout behavior.
  • Failure condition: Start with a result from single=true, edit at least two rows, and ensure neither SQL generation nor execution inherits single, pagination, explain, errorContinue, console, approval or result identifiers. A later-statement failure must not report success.
  • Rollback or disable path: Revert this PR; no data migration or configuration rollback is required.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: Codex implemented the change and performed source review, automated checks and Playwright CLI verification under maintainer direction.

@openai0229
openai0229 requested review from a team and Aias00 as code owners September 7, 2026 04:44
@openai0229 openai0229 moved this to In Review in Chat2DB Community Sep 7, 2026
@openai0229
openai0229 merged commit ee5a918 into main Sep 7, 2026
14 of 19 checks passed
@openai0229
openai0229 deleted the fix/result-edit-execution-isolation branch September 7, 2026 04:53
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug(result-set): row updates inherit single-statement query options

1 participant