[jira] [Commented] (GROOVY-8082) Groovy sql.rows returns org.postgresql.util.PSQLException: No hstore extension installed
[ https://issues.apache.org/jira/browse/GROOVY-8082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15860842#comment-15860842 ] Paul King commented on GROOVY-8082: --- You could argue that this isn't a bug but a misuse of the api. However, having said that, the error message when you supply the empty map is quite misleading, so the proposed PR looks for the special case of an empty supplied map when no parameter placeholders are found in the sql. It is then equivalent to calling with the empty list. > Groovy sql.rows returns org.postgresql.util.PSQLException: No hstore > extension installed > > > Key: GROOVY-8082 > URL: https://issues.apache.org/jira/browse/GROOVY-8082 > Project: Groovy > Issue Type: Bug > Components: SQL processing >Affects Versions: 2.4.4 >Reporter: Clessio Cunha Mendes >Priority: Minor > > -> Steps to Reproduce > 1) create a simple sql string with no where clause > 2) pass an empty Map [:] as params to groovySql.rows(sql, params) > PS: (as workargound, passing an empty List, instead of an empty map, as > params behaves like expected) > -> Expected Behaviour > call postgres and run the sql passing no parameters > -> Actual Behaviour > Exception raised: No hstore extension installed.. Stacktrace follows: > org.postgresql.util.PSQLException: No hstore extension installed. > at > org.postgresql.jdbc2.AbstractJdbc2Statement.setMap(AbstractJdbc2Statement.java:1707) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1910) > at > org.postgresql.jdbc3g.AbstractJdbc3gStatement.setObject(AbstractJdbc3gStatement.java:36) > at > org.postgresql.jdbc4.AbstractJdbc4Statement.setObject(AbstractJdbc4Statement.java:47) > -> Environment Information > Operating System: Windows > Grails Version: 2.5.4 > JDK Version: 1.7 > Container Version (If Applicable): N/A > Database: Postgres 9.3.13 > -> Probable fix > Method singletonList(Object item) at groovy.sql.SQL > -> More information > http://stackoverflow.com/q/39245870/1916198 -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (GROOVY-8082) Groovy sql.rows returns org.postgresql.util.PSQLException: No hstore extension installed
[ https://issues.apache.org/jira/browse/GROOVY-8082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15860838#comment-15860838 ] ASF GitHub Bot commented on GROOVY-8082: GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/495 GROOVY-8082: Groovy sql.rows returns org.postgresql.util.PSQLExceptio… …n: No hstore extension installed You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8082 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/495.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #495 commit b34b47623d18372241f0d5242bb780963c0278ab Author: paulk Date: 2017-02-10T06:46:33Z GROOVY-8082: Groovy sql.rows returns org.postgresql.util.PSQLException: No hstore extension installed > Groovy sql.rows returns org.postgresql.util.PSQLException: No hstore > extension installed > > > Key: GROOVY-8082 > URL: https://issues.apache.org/jira/browse/GROOVY-8082 > Project: Groovy > Issue Type: Bug > Components: SQL processing >Affects Versions: 2.4.4 >Reporter: Clessio Cunha Mendes >Priority: Minor > > -> Steps to Reproduce > 1) create a simple sql string with no where clause > 2) pass an empty Map [:] as params to groovySql.rows(sql, params) > PS: (as workargound, passing an empty List, instead of an empty map, as > params behaves like expected) > -> Expected Behaviour > call postgres and run the sql passing no parameters > -> Actual Behaviour > Exception raised: No hstore extension installed.. Stacktrace follows: > org.postgresql.util.PSQLException: No hstore extension installed. > at > org.postgresql.jdbc2.AbstractJdbc2Statement.setMap(AbstractJdbc2Statement.java:1707) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1910) > at > org.postgresql.jdbc3g.AbstractJdbc3gStatement.setObject(AbstractJdbc3gStatement.java:36) > at > org.postgresql.jdbc4.AbstractJdbc4Statement.setObject(AbstractJdbc4Statement.java:47) > -> Environment Information > Operating System: Windows > Grails Version: 2.5.4 > JDK Version: 1.7 > Container Version (If Applicable): N/A > Database: Postgres 9.3.13 > -> Probable fix > Method singletonList(Object item) at groovy.sql.SQL > -> More information > http://stackoverflow.com/q/39245870/1916198 -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[GitHub] groovy pull request #495: GROOVY-8082: Groovy sql.rows returns org.postgresq...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/495 GROOVY-8082: Groovy sql.rows returns org.postgresql.util.PSQLExceptio⦠â¦n: No hstore extension installed You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8082 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/495.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #495 commit b34b47623d18372241f0d5242bb780963c0278ab Author: paulk Date: 2017-02-10T06:46:33Z GROOVY-8082: Groovy sql.rows returns org.postgresql.util.PSQLException: No hstore extension installed --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[jira] [Commented] (GROOVY-8085) Exception in "finally" not caught by outer "try"
[ https://issues.apache.org/jira/browse/GROOVY-8085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15859972#comment-15859972 ] Craig Silverstein commented on GROOVY-8085: --- Hmm, I tried 4 different javas: {code} java-1.7.0-openjdk-amd64 1071 /usr/lib/jvm/java-1.7.0-openjdk-amd64 java-1.8.0-openjdk-amd64 1069 /usr/lib/jvm/java-1.8.0-openjdk-amd64 java-8-oracle 1072 /usr/lib/jvm/java-8-oracle java-gcj-4.8 /usr/lib/jvm/java-gcj-4.8 {code} and they all gave the same output, so it would seem that this is behaving how java wants it to. But it doesn't make any sense. I'm confused. > Exception in "finally" not caught by outer "try" > > > Key: GROOVY-8085 > URL: https://issues.apache.org/jira/browse/GROOVY-8085 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.4.8 > Environment: linux >Reporter: Craig Silverstein > > I would expect the following code to print `caughtt`: > ``` > groovy -e 'try { try { true; } finally { 1 / 0 } } catch (e) { println > "caughtt" }' > ``` > But instead, it prints: > ``` > Caught: java.lang.ArithmeticException: Division by zero > java.lang.ArithmeticException: Division by zero > at script_from_command_line.run(script_from_command_line:1) > ``` > Why is the exception, thrown by the `finally`, not being caught by the outer > try/catch? -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (GROOVY-8085) Exception in "finally" not caught by outer "try"
[ https://issues.apache.org/jira/browse/GROOVY-8085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15859966#comment-15859966 ] Craig Silverstein commented on GROOVY-8085: --- Hmm, that looks right to me. I tried running groovyc and then ran {code} java -cp ".:$GROOVY_HOME/lib/*" bad {code} and got the same output, so possibly the problem is with my version of java? Here is what it says: {code} % java -version java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) {code} > Exception in "finally" not caught by outer "try" > > > Key: GROOVY-8085 > URL: https://issues.apache.org/jira/browse/GROOVY-8085 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.4.8 > Environment: linux >Reporter: Craig Silverstein > > I would expect the following code to print `caughtt`: > ``` > groovy -e 'try { try { true; } finally { 1 / 0 } } catch (e) { println > "caughtt" }' > ``` > But instead, it prints: > ``` > Caught: java.lang.ArithmeticException: Division by zero > java.lang.ArithmeticException: Division by zero > at script_from_command_line.run(script_from_command_line:1) > ``` > Why is the exception, thrown by the `finally`, not being caught by the outer > try/catch? -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[GitHub] groovy pull request #494: Safe number parsing methods for more convenient XM...
GitHub user mortensoby opened a pull request: https://github.com/apache/groovy/pull/494 Safe number parsing methods for more convenient XML parsing with GPat⦠The following results in af NumberFormatException: xml.'**'.find{it.name()` == 'someBigDecimal'}.toBigDecimal() if the element content is empty which means the following construct is necessary: ``` xml.'**'.find{it.name() == 'someEmptyBigDecimal' && it.text()}?.toBigDecimal() ``` This pull request ensures that null is returned if the element is empty for the following methods: ``` toBigInteger() toBigDecimal() toDouble() toBigLong() toBigFloat() ``` You can merge this pull request into a Git repository by running: $ git pull https://github.com/mortensoby/groovy gPathNumberMethods Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/494.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #494 commit 99708c6c7a3c8eb6a2eb6b04343bd17adaeefbe6 Author: Morten Holm Søby Date: 2017-02-09T12:03:55Z Safe number parsing methods for more convenient XML parsing with GPathResult --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] groovy pull request #493: Safe number parsing methods for more convenient XM...
GitHub user mortensoby opened a pull request: https://github.com/apache/groovy/pull/493 Safe number parsing methods for more convenient XML parsing Added ``` toBigInteger() toBigDecimal() toDouble() toBigLong() toBigFloat() ``` To _groovy.util.Node_ If the element content is empty or null the methods will return _null_ This is now possible: ``` xml.'**'.find { it.name() == 'someEmptyBigDecimal' }?.toBigDecimal() ``` You can merge this pull request into a Git repository by running: $ git pull https://github.com/mortensoby/groovy nodeNumberMethods Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/493.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #493 commit fe204042ed76bc8a138ffe1f14c376a055413793 Author: Morten Holm Søby Date: 2017-02-09T11:25:02Z Safe number parsing methods for more convenient XML parsing --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---