Skip to content

Keep the elements of ARRAY[...] in its text - #2691

Merged
mathiasrw merged 1 commit into
developfrom
fix/array-tostring
Oct 20, 2026
Merged

mathiasrw merged 1 commit into
developfrom
fix/array-tostring

Conversation

@mathiasrw

Copy link
Copy Markdown
Member

toString() of ARRAY[1, 2] was the fixed text ARRAY[] (from #744). An unnamed column is named by that text, so two arrays in one SELECT became one column and the first was lost:

alasql('SELECT ARRAY[1, 2], ARRAY[3, 4] FROM ?', [[{x: 1}]]);
// was [{'ARRAY[]': [3, 4]}]; now [{'ARRAY[1, 2]': [1, 2], 'ARRAY[3, 4]': [3, 4]}]

ArrayValue.toString() now writes its elements, so the text parses back to the same expression. Test: test/test744.js. Same class as #2674 (ESCAPE) and #2675.

Found while reviewing #744.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant