Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants