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

Mysql: Function 'Lower' treats string literals as column names #428

Open
TobiasPfeifer opened this issue Apr 9, 2021 · 3 comments
Open
Labels
bug Something isn't working

Comments

@TobiasPfeifer
Copy link
Contributor

As shown at https://www.w3schools.com/sql/trymysql.asp?filename=trysql_func_mysql_lower the Lower function should not treat string literals as column names.

currently select(Lower("LOWER")) from customers limit(1) fails with java.sql.SQLSyntaxErrorException: Unknown column 'LOWER' in 'field list' when executed against the test schema.

  1. It should yield lower (SELECT lower("LOWER") instead of SELECT lower(LOWER))
  2. It should type check the columns used in Lower are available in the table

I encountered this when cleaning up the tests in #427
There is a test case available for this issue: https://github.com/zio/zio-sql/pull/427/files#diff-b69ce48bd3431d7cb54603c42a17ece5658336b82acfb54a29098672c96ee04fR26

@naderghanbari
Copy link
Contributor

I'd like to tackle this if no one else is working on it.

@naderghanbari
Copy link
Contributor

This actually applies not only to mysql but to all dialects.

@sviezypan
Copy link
Collaborator

This is still an open issue

@jczuchnowski jczuchnowski added the bug Something isn't working label Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants