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

CONVERT() - data type is wrongfully parsed as a column #644

Closed
wheredevel opened this issue Jul 15, 2018 · 3 comments · Fixed by #1778
Closed

CONVERT() - data type is wrongfully parsed as a column #644

wheredevel opened this issue Jul 15, 2018 · 3 comments · Fixed by #1778

Comments

@wheredevel
Copy link

wheredevel commented Jul 15, 2018

SELECT CONVERT(int, a) FROM A

Actual Behavior

int - Column

Expected Behavior

int - ColDataType

Steps to Reproduce the Problem

Specifications

Note

This is fixed and PR pending.

@wumpz
Copy link
Member

wumpz commented Jul 15, 2018

I would say it's by design. Jsqlparser is only a parser and cannot differ between column, identifier, typename, ... Why not leave it like it is and do the semantics later. Maybe we should rename Column to DBidentifier.

@wumpz
Copy link
Member

wumpz commented Jul 15, 2018

It is the special definition of the convert function that could be very different on other dB systems.

@wheredevel
Copy link
Author

wheredevel commented Jul 16, 2018

Well, if we had a way to indicate the dialect the parser ahead - that would solve it.
For now, we just need it to parse this MSSQL dialect properly. (MySQL's is similar.)
So, we implemented this.

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 a pull request may close this issue.

2 participants