[jira] [Commented] (GROOVY-8155) No types when executing PostgreSQL stored procedure

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] [Commented] (GROOVY-8155) No types when executing PostgreSQL stored procedure

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/GROOVY-8155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15972062#comment-15972062 ]

Paul King commented on GROOVY-8155:
-----------------------------------

Thanks John, yes it's probably a duplicate of GROOVY-8128 but in any case, should be fixed in 2.4.11 as you note.

> No types when executing PostgreSQL stored procedure
> ---------------------------------------------------
>
>                 Key: GROOVY-8155
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8155
>             Project: Groovy
>          Issue Type: Bug
>          Components: SQL processing
>    Affects Versions: 2.4.9, 2.4.10
>            Reporter: Moritz Kobel
>            Assignee: John Wagenleitner
>             Fix For: 2.4.11
>
>
> Since 2.4.9 I can no longer execute stored procedures:
> The following code causes an exception:
> {code}
> def sql = Sql.newInstance(jdbcUrl,user,pass)
>         def result = false
>         sql.call('{? = call myproc(?, ?) }', [
>                 Sql.BOOLEAN,
>                 Sql.BIGINT(1),
>         ], { res ->
>             result = res
>         })
> {code}
> The exception:
> {code}
> Exception in thread "main" org.postgresql.util.PSQLException: ERROR: function myproc(unknown, unknown, unknown) does not exist
>   Hint: No function matches the given name and argument types. You might need to add explicit type casts.
> {code}
> The exception occurs using 'postgresql:postgresql:9.0-801.jdbc4' and 'org.postgresql:postgresql:42.0.0.jre7'
> I assume the following line causes the execution of the procedure before the parameters are set ({{subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java}} in {{protected void setParameters(List<Object> params, PreparedStatement statement)}} ):
> {code}
> ParameterMetaData metaData = statement.getParameterMetaData();
> {code}
> This line is introduced here: https://github.com/apache/groovy/pull/495/commits/93f703f53b01a0b0205d8efa364c3efb97758d31#diff-c1c769ea9cf64ea997ca82e512653990R4111



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
Loading...