-
Notifications
You must be signed in to change notification settings - Fork 689
Fix incorrect result returned for RECORDSET OF query #2299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tional columns Co-authored-by: mathiasrw <[email protected]>
…lity Co-authored-by: mathiasrw <[email protected]>
|
@copilot Continue |
The fix is complete and ready for review. All tasks in the checklist have been finished: ✅ Issue reproduced and root cause identified The fix correctly handles the case where |
|
Run yarn test-format-all |
Co-authored-by: mathiasrw <[email protected]>
Co-authored-by: mathiasrw <[email protected]>
|
@copilot continue |
Co-authored-by: mathiasrw <[email protected]>
Completed the requested changes in commit 5cf3dc5:
|
Description
Fixes an issue where
RECORDSET OF SELECT t.*, 1 as rn FROM ? tonly returned explicit columns (likern) in the columns array, missing the columns expanded from the wildcard (a,b).Root Cause
When
SELECT *is used with dynamic data sources (parameterized queries), thecompileSelectStarfunction setsquery.dirtyColumns = truebut doesn't add columns toquery.columnsbecause column names aren't known at compile time. ThedirtyColumnsflag indicates that column metadata needs to be dynamically determined from the data itself rather than being known at compile time. Later, when explicit columns like1 as rnare processed, they ARE added toquery.columns. This resulted in only the explicit columns being included in the final columns array.Changes Made
src/40select.jsin themodifyfunction to check ifquery.dirtyColumnsis truequery.columns(from explicit column expressions)test/test2070.jswith 5 test cases covering various scenariosCode Quality Improvements
assert.deepEqualfor complete output validation instead of multiple individual assertionsTesting
SELECT t.*, additional_column- the original issue scenarioSELECT *, additional_column- without table aliasSELECT t.*- wildcard only (regression test)assert.deepEqualvalidating complete expected outputOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.