Skip to content
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

Literal 'From' in WHERE clause misparsed #275

Open
allanstreib opened this issue Oct 11, 2021 · 4 comments
Open

Literal 'From' in WHERE clause misparsed #275

allanstreib opened this issue Oct 11, 2021 · 4 comments

Comments

@allanstreib
Copy link

echo  "a,b\nTraveling From Abroad,To Home" | q -H -d, "select * from - where a = 'Traveling From Abroad'"

produces the reponse "No files matching 'Abroad'' have been found"

Workaround

echo  "a,b\nTraveling From Abroad,To Home" | q -H -d, "select * from - where a like 'Traveling%Abroad'"

produces the (correct) response "Traveling From Abroad,To Home"

@bitti
Copy link

bitti commented Oct 12, 2021

I think you miss the -e option for echo, but in fact the input doesn't matter so much to reproduce the bug (which it seems to be).

@allanstreib
Copy link
Author

Yes, you may need that. On my platform (OpenBSD/ksh) it is the default behavior.

@Oblomov
Copy link

Oblomov commented Oct 12, 2021

That's why you use printf instead of echo, avoids these ambiguities ;-)

@harelba
Copy link
Owner

harelba commented Oct 16, 2021

Hi, sorry for the late response. I'm focused on packaging in order to release a new major version 3.0.0 with lots of big changes.

I'll dive into this right after the release is done.

Regardless, after this release, the next step would be to finally have a proper AST parsing mechanism for the SQL parsing, that will mitigate such issues.

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

No branches or pull requests

4 participants