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

Single quote not escaped when comparing List[String] #473

Closed
datalchemist opened this issue Feb 10, 2020 · 1 comment
Closed

Single quote not escaped when comparing List[String] #473

datalchemist opened this issue Feb 10, 2020 · 1 comment

Comments

@datalchemist
Copy link

Consider the following code:

    println("Test1:" + 
      almaUsers
          .filter(_.id === (List("test'") : Rep[List[String]]).any)
          .result.statements
    )
    println("Test2:" + 
      almaUsers
          .filter(_.id === "test'")
          .result.statements
    )

which yield:

Test1:List(select "id", "zone" from "alma_user" where "id" = any('{test'}'))
Test2:List(select "id", "zone" from "alma_user" where "id" = 'test''')

As you can see, in Test1, the single quote at the end of the value is not doubled (like in Test2) and thus it produces an invalid SQL statement.

@tminglei
Copy link
Owner

@datalchemist thanks for pointing it out. I'll check it ASAP.

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

2 participants