zio-sql
zio-sql copied to clipboard
Mysql: Function 'Lower' treats string literals as column names
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.
- It should yield
lower
(SELECT lower("LOWER") instead ofSELECT lower(LOWER)
) - 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
I'd like to tackle this if no one else is working on it.
This actually applies not only to mysql
but to all dialects.
This is still an open issue