Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2651
modify()insrc/select/select.jsno longer works out the columns of a result itself. It calls the newresultColumns(run, rows)once, and every modifier reads that list. The three branches are now three lines, and the loop over the firstcolumnlookuprows is written once innamesInRows(). It keeps reading the rows from the last to the first, as that decides the order of the names. The function is exported asinternal.resultColumns.Branch 1 returns a new list instead of pushing into
run.columns. The order is the same, and nothing readsrun.columnsaftermodify(), since INTO gets its columns earlier inqueryfn.The new
test/test2651.jspins the column lists of RECORDSET, ALASQL_DETAILS, MATRIX and COLUMN for each case the issue names (A to G), and for PIVOT over?(I). All of them pass on main before the change. Test H pins the one difference and fails on main.Differences
The parity check shows only the two results of test H.
With
*and a named column over?, a key named like a built-in method, such asconstructor,valueOf,toStringorhasOwnProperty, was left out of the columns. RECORDSET, ALASQL_DETAILS and MATRIX change. The merge now uses aSetof the names as strings. Turning them into strings keeps one thing from the old code, as PIVOT gives numbers as column names and the rows have them as strings. Test I pins that PIVOT over?names each column once.Checks
alasql.min.jsgoes down by 111 bytes.