Skip to content

fix(sql): warn when dolt_checkout used as single -q statement#11045

Open
superShen0916 wants to merge 1 commit into
dolthub:mainfrom
superShen0916:fix/warn-dolt-checkout-single-statement
Open

fix(sql): warn when dolt_checkout used as single -q statement#11045
superShen0916 wants to merge 1 commit into
dolthub:mainfrom
superShen0916:fix/warn-dolt-checkout-single-statement

Conversation

@superShen0916
Copy link
Copy Markdown

@superShen0916 superShen0916 commented May 14, 2026

Summary

Fixes #6876 - When dolt sql -q "call dolt_checkout('branch');" is run as a single statement, the branch change does not persist because each -q invocation uses its own session. This PR adds a warning to help users understand this behavior.

Changes

  • go/cmd/dolt/commands/sql.go: Added warning in queryMode() when query contains dolt_checkout

When 'dolt sql -q "call dolt_checkout(...)"' is run as a single
statement, the branch change does not persist because each -q
invocation uses its own session.

Print a warning to help users understand this behavior.

Fixes dolthub#6876

Signed-off-by: shenpeng.sp0916 <shenpeng.sp0916@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn users about running dolt sql -q "call dolt_checkout(...);"

2 participants