[
https://issues.apache.org/jira/browse/GROOVY-9295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King reassigned GROOVY-9295:
---------------------------------
Assignee: Paul King
> Sql.checkForNamedParams false positives
> ---------------------------------------
>
> Key: GROOVY-9295
> URL: https://issues.apache.org/jira/browse/GROOVY-9295
> Project: Groovy
> Issue Type: Bug
> Components: SQL processing
> Affects Versions: 2.4.15
> Environment: Grails 3.2.4
> Reporter: Andreas
> Assignee: Paul King
> Priority: Major
>
> The public function
> {{checkForNamedParams }}
> (used in getPreparedStatement) detects named parameters with a regex via
> {{ExtractIndexAndSql.hasNamedParameters}}
> {{This regex matches not only named params (:xxx) but also sql casts
> ('xxx'::text) which in turn results in sql errrs when called with}}
> {{sql.eachRow(query, args, closure)}}
>
> {{when }}
> {{a. query includes a cast but no named parameters and }}
> {{b. args contains Map with named parameters}}
> {{Test case:}}
> {{sql.eachRow("select 1,2,3::text", ["a": "b"], {}}{{{ row -> println row as
> String})}}
> {{error when sql points to postgres: no hstore extension installed}}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)