[pgjdbc/pgjdbc] 2958cc: fix: function calls without parameters do not requ...

From: Robert Zenz <robert(dot)zenz(at)sibvisions(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [pgjdbc/pgjdbc] 2958cc: fix: function calls without parameters do not requ...
Date: 2017-04-16 16:10:47
Message-ID: 58f397879ce71_b123faac2bd1c24234016@hookshot-fe3-cp1-prd.iad.github.net.mail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: 2958cc22a6a00609bfbb6eb17d4e401dfe433123
https://github.com/pgjdbc/pgjdbc/commit/2958cc22a6a00609bfbb6eb17d4e401dfe433123
Author: Robert Zenz <robert(dot)zenz(at)sibvisions(dot)com>
Date: 2017-04-16 (Sun, 16 Apr 2017)

Changed paths:
M pgjdbc/src/main/java/org/postgresql/core/Parser.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc3/Jdbc3CallableStatementTest.java

Log Message:
-----------
fix: function calls without parameters do not require parentheses

According to the JDBC documentation, the parentheses surrounding
the parameters, of a function call, are optional if there are no
parameters. However, Parser required the parentheses to be present at
all times. The new behavior is that the Parser checks whether there are
parentheses, and if not simply adds them. Also, tests have been added
for both cases, function calls to functions with no parameters with and
without parentheses.

This allows to execute function calls like this:

{?= call somefunction }

Which is line with the JDBC documentation.

The tracking bug is #767.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vladimir Sitnikov 2017-04-17 08:54:08 [pgjdbc/pgjdbc] 28c984: fix: fix last block of stream being ignored if siz...
Previous Message Dave Cramer 2017-04-16 12:42:00 Re: Driver performance improvements - kudos to the maintainers and the contributors