groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John N Underwood (JIRA)" <>
Subject [jira] [Commented] (GROOVY-8804) Sql.rows(gstring) fails while Sql.rows(string) works
Date Mon, 24 Sep 2018 18:27:00 GMT


John N Underwood commented on GROOVY-8804:

I certainly appreciate Groovy trying to prevent SQL injection. That said...

In my sample code, the only difference between the two query strings is that one is declared
with `def` (which becomes a `GString`) and the other is declared with `String`. The String
version works one way, while the GString version works quite differently.

I think this difference in behavior is unexpected and I found it difficult and time-consuming
to debug. Is there any *good* way to make the String and GString versions work the same?

> Sql.rows(gstring) fails while Sql.rows(string) works
> ----------------------------------------------------
>                 Key: GROOVY-8804
>                 URL:
>             Project: Groovy
>          Issue Type: Bug
>          Components: SQL processing
>    Affects Versions: 2.4.15, 2.6.0-alpha-4, 3.0.0-alpha-3, 2.5.2
>            Reporter: John N Underwood
>            Priority: Minor
> Calling `sql.rows(string)` works while calling `sql.rows(gstring)` returns an empty result
> This indicates a possible bug in the protected method `groovy.sql.Sql.asSql()`.
> I have created a sample program which demonstrates the behavior at

This message was sent by Atlassian JIRA

View raw message