refactor(mssql): strip trailing semicolon on unlimited query path for connector consistency - #2566
refactor(mssql): strip trailing semicolon on unlimited query path for connector consistency#2566Bartok9 wants to merge 1 commit into
Conversation
_raw_cursor_sql returned paste SQL unchanged when limit is None, leaving a terminating semicolon that peers (oracle/postgres/clickhouse) already strip. Strip first so unlimited execute matches limited/dry_run.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughMSSQL raw SQL generation now strips trailing semicolons regardless of whether a limit is provided. Unit tests cover single and repeated semicolon terminators on unlimited queries. ChangesMSSQL semicolon normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code reviewThis reverses a decision that WrenAI/core/wren/tests/unit/test_mssql_semicolon.py Lines 23 to 26 in 5d2637c "execute path allows it" is a recorded finding, and this PR rewrites both the assertion and the comment to the opposite conclusion. That may well be the right call, but it needs to be argued rather than swapped: what changed since that test was written? The stated reason — that stripping avoids tripping "pyodbc multi-statement restrictions with a lone terminator" — is the part to substantiate. A single statement with a trailing Rebase before merge — 9 commits behind |
|
To clean my review queue, I changed the PR status to draft. After addressing the review comment, you can request me again. |
|
Thanks @goldmedal — you're right, and this is a fair challenge. I can't produce a case where pyodbc actually rejects a single statement with a lone trailing |
|
Addressed your review @goldmedal:
Requesting your review again now that this is framed correctly. No rush — queue-cleaners appreciated last time. |
|
Follow-up: GitHub would not reopen this PR after the branch was recreated on current Addressed your points on a new PR (refactor title, no pyodbc over-claim, rebased, tests green) and requested your review there. |
Summary
Strip trailing semicolons on the MSSQL unlimited
_raw_cursor_sqlpath so it matches dry_run / limited composition and sibling connectors (e.g. #2595 MySQL).Addressing @goldmedal review
You're right that the earlier
fix(...)framing over-claimed a pyodbc multi-statement failure. I still cannot reproduce pyodbc rejecting a single statement with a lone trailing;.This update is therefore an explicit consistency refactor, not a driver-bug fix:
strip_trailing_semicolon(same as limit rewrite / dry_run / MySQL refactor(mysql): strip trailing semicolon on unlimited query path for connector consistency #2595).main.Motivation
Client-pasted SQL with a trailing
;should not take a different terminator shape solely becauselimit is None. Align MSSQL with the shared connector strip helper.Verification
@goldmedal ready for another look when convenient — thank you again for the careful catch on the original framing.