-
Notifications
You must be signed in to change notification settings - Fork 664
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
Parse() then AST.toString() doesn't restore square brackets on column name #1740
Comments
I'm interested in working on this. Thanks! |
Any pointer, where should I start? Spend some time on but kind of tricky to find where the '[' is strip off. |
If the issue is not resolved can i work on this? If yes pls tell me how can i run/test it in local machine. |
As a beginner in open source, after editing line 357 as mentioned, how can I identify the other locations that require changes? Please help. |
@Saurabhmahto Nice work getting into the flow. Are the tests passing? Use |
Lovely. The test is in https://github.com/AlaSQL/alasql/blob/develop/test/test046.js#L33 It is probably the [...] part that is not working. I propose you look for the most simple thing you can write that breaks it. It might be something like There are many ways to do this, but one way could be to step though alasql while it is running:
Note that when you are debugging it is faster / easier to edit directly in the dist/alasql.fs.js file to insert breaks and "run" to them. But the changes are reset when you build again next time. ping me if you get stuck... |
Hello @mathiasrw |
If a column name requires square brackets, e.g. due to a space or a period in the column name, toString() on the AST loses the brackets resulting in incorrect SQL.
For example
gives
SELECT Foo Bar FROM tbl
instead ofSELECT [Foo Bar] FROM tbl
Similarly:
gives
SELECT Foo.Bar FROM tbl
instead ofSELECT [Foo.Bar] FROM tbl
The text was updated successfully, but these errors were encountered: