pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedJDBC-94: "Multiple resultsets were returned by query" in query end with "; "
12+ messages / 7 participants
[nested] [flat]
* JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
@ 2015-09-29 13:56 Dang Minh Huong <kakalot49@gmail.com>
2015-09-29 14:53 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
2015-10-07 11:51 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Craig Ringer <craig@2ndquadrant.com>
0 siblings, 2 replies; 12+ messages in thread
From: Dang Minh Huong @ 2015-09-29 13:56 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
I'm using postgresql-jdbc94 and have found that,
string in executeQuery() end with "; " (the last character is a space)
is considered as multiple queries and return with
"Multiple resultsets were returned by query" error.
I think it is not a bug, but is there any related change in jdbc94. I could not reproduce in jdbc93.
Best regards,
Bocap=
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
@ 2015-09-29 14:53 ` Dave Cramer <pg@fastcrypt.com>
2015-09-30 14:08 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " bocap <kakalot49@gmail.com>
1 sibling, 1 reply; 12+ messages in thread
From: Dave Cramer @ 2015-09-29 14:53 UTC (permalink / raw)
To: Dang Minh Huong <kakalot49@gmail.com>; +Cc: pgsql-jdbc
Yes, there is a related change. The parser was rewritten. We may want to
fix the parser to ignore trailing ; This seems like an annoyance
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On 29 September 2015 at 09:56, Dang Minh Huong <kakalot49@gmail.com> wrote:
> Hi,
>
> I'm using postgresql-jdbc94 and have found that,
> string in executeQuery() end with "; " (the last character is a space)
> is considered as multiple queries and return with
> "Multiple resultsets were returned by query" error.
> I think it is not a bug, but is there any related change in jdbc94. I
> could not reproduce in jdbc93.
>
> Best regards,
> Bocap
>
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
2015-09-29 14:53 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
@ 2015-09-30 14:08 ` bocap <kakalot49@gmail.com>
0 siblings, 0 replies; 12+ messages in thread
From: bocap @ 2015-09-30 14:08 UTC (permalink / raw)
To: pgsql-jdbc
Thanks for prompt response.
Regards,
Bocap
--
View this message in context: http://postgresql.nabble.com/JDBC-94-Multiple-resultsets-were-returned-by-query-in-query-end-with-tp...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
@ 2015-10-07 11:51 ` Craig Ringer <craig@2ndquadrant.com>
2015-10-07 12:11 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
2015-10-07 22:58 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " bocap <kakalot49@gmail.com>
1 sibling, 2 replies; 12+ messages in thread
From: Craig Ringer @ 2015-10-07 11:51 UTC (permalink / raw)
To: Dang Minh Huong <kakalot49@gmail.com>; +Cc: pgsql-jdbc
On 29 September 2015 at 21:56, Dang Minh Huong <kakalot49@gmail.com> wrote:
> Hi,
>
> I'm using postgresql-jdbc94 and have found that,
> string in executeQuery() end with "; " (the last character is a space)
> is considered as multiple queries and return with
> "Multiple resultsets were returned by query" error.
> I think it is not a bug, but is there any related change in jdbc94. I could
> not reproduce in jdbc93.
This is a follow-up from a Stack Overflow post, right? I'm pretty sure
I saw this but I can't find the post now. If I'm remembering
correctly, got a link so I can cross-reference?
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
2015-10-07 11:51 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Craig Ringer <craig@2ndquadrant.com>
@ 2015-10-07 12:11 ` Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:30 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
1 sibling, 1 reply; 12+ messages in thread
From: Dave Cramer @ 2015-10-07 12:11 UTC (permalink / raw)
To: Craig Ringer <craig@2ndquadrant.com>; +Cc: Dang Minh Huong <kakalot49@gmail.com>; pgsql-jdbc
This is likely a result of the parser getting some more work and not
noticing this is an empty query. I have a personal note to look at this
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On 7 October 2015 at 07:51, Craig Ringer <craig@2ndquadrant.com> wrote:
> On 29 September 2015 at 21:56, Dang Minh Huong <kakalot49@gmail.com>
> wrote:
> > Hi,
> >
> > I'm using postgresql-jdbc94 and have found that,
> > string in executeQuery() end with "; " (the last character is a space)
> > is considered as multiple queries and return with
> > "Multiple resultsets were returned by query" error.
> > I think it is not a bug, but is there any related change in jdbc94. I
> could
> > not reproduce in jdbc93.
>
> This is a follow-up from a Stack Overflow post, right? I'm pretty sure
> I saw this but I can't find the post now. If I'm remembering
> correctly, got a link so I can cross-reference?
>
> --
> Craig Ringer http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
2015-10-07 11:51 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Craig Ringer <craig@2ndquadrant.com>
2015-10-07 12:11 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
@ 2015-10-07 12:30 ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2015-10-07 12:34 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 12+ messages in thread
From: Vladimir Sitnikov @ 2015-10-07 12:30 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: Craig Ringer <craig@2ndquadrant.com>; Dang Minh Huong <kakalot49@gmail.com>; pgsql-jdbc
I wonder why pgjdbc would want to silently ignore that user error?
Is "behavior of previous version" a sole justification?
I've drafted https://github.com/pgjdbc/pgjdbc/pull/386 to cover that.
Vladimir
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
2015-10-07 11:51 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Craig Ringer <craig@2ndquadrant.com>
2015-10-07 12:11 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:30 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
@ 2015-10-07 12:34 ` Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:42 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Christopher BROWN <brown@reflexe.fr>
0 siblings, 1 reply; 12+ messages in thread
From: Dave Cramer @ 2015-10-07 12:34 UTC (permalink / raw)
To: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>; +Cc: Craig Ringer <craig@2ndquadrant.com>; Dang Minh Huong <kakalot49@gmail.com>; pgsql-jdbc
This is a very good question, but lots of people cut and paste SQL into
code ... sometimes the ; gets in there.
Behaviour of previous version is important, but in this case It may not be
justified.
Anyone else have an opinion ?
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On 7 October 2015 at 08:30, Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
wrote:
> I wonder why pgjdbc would want to silently ignore that user error?
> Is "behavior of previous version" a sole justification?
>
> I've drafted https://github.com/pgjdbc/pgjdbc/pull/386 to cover that.
>
> Vladimir
>
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
2015-10-07 11:51 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Craig Ringer <craig@2ndquadrant.com>
2015-10-07 12:11 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:30 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2015-10-07 12:34 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
@ 2015-10-07 12:42 ` Christopher BROWN <brown@reflexe.fr>
2015-10-07 18:42 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Adam Rauch <adam@labkey.com>
0 siblings, 1 reply; 12+ messages in thread
From: Christopher BROWN @ 2015-10-07 12:42 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>; Craig Ringer <craig@2ndquadrant.com>; Dang Minh Huong <kakalot49@gmail.com>; pgsql-jdbc
Hello,
Developers that use the driver via a framework (open-source, in-house)
might not be in a position to change SQL, compared with developers that are
able to modify hand-written SQL, so it's probably best to tolerate it by
discarding any trailing semi-colon (with or without any trailing
whitespace) in the parser.
I've also encountered coding practices (coding-style "standards") where
semi-colons are expected (some people just love terminating all statements,
not just Java, with semi-colons, even when it's not strictly necessary
(e.g.: JavaScript).
So, my preference would be to maintain backwards-compatibility for others,
even if I don't have such an issue myself.
--
Christopher
On 7 October 2015 at 14:34, Dave Cramer <pg@fastcrypt.com> wrote:
> This is a very good question, but lots of people cut and paste SQL into
> code ... sometimes the ; gets in there.
>
> Behaviour of previous version is important, but in this case It may not be
> justified.
>
> Anyone else have an opinion ?
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
> On 7 October 2015 at 08:30, Vladimir Sitnikov <sitnikov.vladimir@gmail.com
> > wrote:
>
>> I wonder why pgjdbc would want to silently ignore that user error?
>> Is "behavior of previous version" a sole justification?
>>
>> I've drafted https://github.com/pgjdbc/pgjdbc/pull/386 to cover that.
>>
>> Vladimir
>>
>
>
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
2015-10-07 11:51 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Craig Ringer <craig@2ndquadrant.com>
2015-10-07 12:11 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:30 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2015-10-07 12:34 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:42 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Christopher BROWN <brown@reflexe.fr>
@ 2015-10-07 18:42 ` Adam Rauch <adam@labkey.com>
2015-10-07 18:46 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 12+ messages in thread
From: Adam Rauch @ 2015-10-07 18:42 UTC (permalink / raw)
To: Christopher BROWN <brown@reflexe.fr>; Dave Cramer <pg@fastcrypt.com>; +Cc: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>; Craig Ringer <craig@2ndquadrant.com>; Dang Minh Huong <kakalot49@gmail.com>; pgsql-jdbc
I agree with Christopher. After upgrading to the latest JDBC driver our
system started throwing these exceptions. It's not hard for us to fix (I
can update our own framework code), but it seems unnecessary and is
likely more difficult for others to address.
Here's a simplified example of SQL-generatation code that runs afoul of
this change: in our system, a logical insert at one layer may map to
multiple database inserts (e.g., to a primary database table plus one or
more property tables). The code generating the insert SQL terminates
each INSERT with ";\n", for convenience and human readability. As a
result, the final INSERT can end with a dangling "\n" that 1202 now
rejects. Of course, we could duplicate a subsequent check and/or special
case the last INSERT to remove the "\n", but the current code is cleaner.
Adam
On 10/7/2015 5:42 AM, Christopher BROWN wrote:
> Hello,
>
> Developers that use the driver via a framework (open-source, in-house)
> might not be in a position to change SQL, compared with developers
> that are able to modify hand-written SQL, so it's probably best to
> tolerate it by discarding any trailing semi-colon (with or without any
> trailing whitespace) in the parser.
>
> I've also encountered coding practices (coding-style "standards")
> where semi-colons are expected (some people just love terminating all
> statements, not just Java, with semi-colons, even when it's not
> strictly necessary (e.g.: JavaScript).
>
> So, my preference would be to maintain backwards-compatibility for
> others, even if I don't have such an issue myself.
>
> --
> Christopher
>
>
> On 7 October 2015 at 14:34, Dave Cramer <pg@fastcrypt.com
> <mailto:pg@fastcrypt.com>> wrote:
>
> This is a very good question, but lots of people cut and paste SQL
> into code ... sometimes the ; gets in there.
>
> Behaviour of previous version is important, but in this case It
> may not be justified.
>
> Anyone else have an opinion ?
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
> On 7 October 2015 at 08:30, Vladimir Sitnikov
> <sitnikov.vladimir@gmail.com <mailto:sitnikov.vladimir@gmail.com>>
> wrote:
>
> I wonder why pgjdbc would want to silently ignore that user error?
> Is "behavior of previous version" a sole justification?
>
> I've drafted https://github.com/pgjdbc/pgjdbc/pull/386 to
> cover that.
>
> Vladimir
>
>
>
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
2015-10-07 11:51 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Craig Ringer <craig@2ndquadrant.com>
2015-10-07 12:11 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:30 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2015-10-07 12:34 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:42 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Christopher BROWN <brown@reflexe.fr>
2015-10-07 18:42 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Adam Rauch <adam@labkey.com>
@ 2015-10-07 18:46 ` Dave Cramer <pg@fastcrypt.com>
2015-10-07 23:05 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " bocap <kakalot49@gmail.com>
0 siblings, 1 reply; 12+ messages in thread
From: Dave Cramer @ 2015-10-07 18:46 UTC (permalink / raw)
To: Adam Rauch <adam@labkey.com>; +Cc: Christopher BROWN <brown@reflexe.fr>; Vladimir Sitnikov <sitnikov.vladimir@gmail.com>; Craig Ringer <craig@2ndquadrant.com>; Dang Minh Huong <kakalot49@gmail.com>; pgsql-jdbc
I've pushed the PR so the next version will not do this
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On 7 October 2015 at 14:42, Adam Rauch <adam@labkey.com> wrote:
> I agree with Christopher. After upgrading to the latest JDBC driver our
> system started throwing these exceptions. It's not hard for us to fix (I
> can update our own framework code), but it seems unnecessary and is likely
> more difficult for others to address.
>
> Here's a simplified example of SQL-generatation code that runs afoul of
> this change: in our system, a logical insert at one layer may map to
> multiple database inserts (e.g., to a primary database table plus one or
> more property tables). The code generating the insert SQL terminates each
> INSERT with ";\n", for convenience and human readability. As a result, the
> final INSERT can end with a dangling "\n" that 1202 now rejects. Of course,
> we could duplicate a subsequent check and/or special case the last INSERT
> to remove the "\n", but the current code is cleaner.
>
> Adam
>
>
> On 10/7/2015 5:42 AM, Christopher BROWN wrote:
>
> Hello,
>
> Developers that use the driver via a framework (open-source, in-house)
> might not be in a position to change SQL, compared with developers that are
> able to modify hand-written SQL, so it's probably best to tolerate it by
> discarding any trailing semi-colon (with or without any trailing
> whitespace) in the parser.
>
> I've also encountered coding practices (coding-style "standards") where
> semi-colons are expected (some people just love terminating all statements,
> not just Java, with semi-colons, even when it's not strictly necessary
> (e.g.: JavaScript).
>
> So, my preference would be to maintain backwards-compatibility for others,
> even if I don't have such an issue myself.
>
> --
> Christopher
>
>
> On 7 October 2015 at 14:34, Dave Cramer <pg@fastcrypt.com> wrote:
>
>> This is a very good question, but lots of people cut and paste SQL into
>> code ... sometimes the ; gets in there.
>>
>> Behaviour of previous version is important, but in this case It may not
>> be justified.
>>
>> Anyone else have an opinion ?
>>
>> Dave Cramer
>>
>> dave.cramer(at)credativ(dot)ca
>> http://www.credativ.ca
>>
>> On 7 October 2015 at 08:30, Vladimir Sitnikov <
>> <sitnikov.vladimir@gmail.com>sitnikov.vladimir@gmail.com> wrote:
>>
>>> I wonder why pgjdbc would want to silently ignore that user error?
>>> Is "behavior of previous version" a sole justification?
>>>
>>> I've drafted https://github.com/pgjdbc/pgjdbc/pull/386 to cover that.
>>>
>>> Vladimir
>>>
>>
>>
>
>
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
2015-10-07 11:51 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Craig Ringer <craig@2ndquadrant.com>
2015-10-07 12:11 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:30 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2015-10-07 12:34 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:42 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Christopher BROWN <brown@reflexe.fr>
2015-10-07 18:42 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Adam Rauch <adam@labkey.com>
2015-10-07 18:46 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dave Cramer <pg@fastcrypt.com>
@ 2015-10-07 23:05 ` bocap <kakalot49@gmail.com>
0 siblings, 0 replies; 12+ messages in thread
From: bocap @ 2015-10-07 23:05 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
Thanks all.
Ngày 08-10-2015, vào lúc 03:47, Dave Cramer-8 [via PostgreSQL] <ml-node+s1045698n5869173h58@n5.nabble.com> viết:
> I've pushed the PR so the next version will not do this
>
I hope i could use it soon
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
>> On 7 October 2015 at 14:42, Adam Rauch <[hidden email]> wrote:
>> I agree with Christopher. After upgrading to the latest JDBC driver our system started throwing these exceptions. It's not hard for us to fix (I can update our own framework code), but it seems unnecessary and is likely more difficult for others to address.
>>
>> Here's a simplified example of SQL-generatation code that runs afoul of this change: in our system, a logical insert at one layer may map to multiple database inserts (e.g., to a primary database table plus one or more property tables). The code generating the insert SQL terminates each INSERT with ";\n", for convenience and human readability. As a result, the final INSERT can end with a dangling "\n" that 1202 now rejects. Of course, we could duplicate a subsequent check and/or special case the last INSERT to remove the "\n", but the current code is cleaner.
>>
>> Adam
>>
>>
>>> On 10/7/2015 5:42 AM, Christopher BROWN wrote:
>>> Hello,
>>>
>>> Developers that use the driver via a framework (open-source, in-house) might not be in a position to change SQL, compared with developers that are able to modify hand-written SQL, so it's probably best to tolerate it by discarding any trailing semi-colon (with or without any trailing whitespace) in the parser.
>>>
>>> I've also encountered coding practices (coding-style "standards") where semi-colons are expected (some people just love terminating all statements, not just Java, with semi-colons, even when it's not strictly necessary (e.g.: JavaScript).
>>>
>>> So, my preference would be to maintain backwards-compatibility for others, even if I don't have such an issue myself.
>>>
>>> --
>>> Christopher
>>>
>>>
>>>> On 7 October 2015 at 14:34, Dave Cramer <[hidden email]> wrote:
>>>> This is a very good question, but lots of people cut and paste SQL into code ... sometimes the ; gets in there.
>>>>
>>>> Behaviour of previous version is important, but in this case It may not be justified.
>>>>
>>>> Anyone else have an opinion ?
>>>>
>>>> Dave Cramer
>>>>
>>>> dave.cramer(at)credativ(dot)ca
>>>> http://www.credativ.ca
>>>>
>>>>> On 7 October 2015 at 08:30, Vladimir Sitnikov <[hidden email][hidden email]> wrote:
>>>>> I wonder why pgjdbc would want to silently ignore that user error?
>>>>> Is "behavior of previous version" a sole justification?
>>>>>
>>>>> I've drafted https://github.com/pgjdbc/pgjdbc/pull/386 to cover that.
>>>>>
>>>>> Vladimir
>
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://postgresql.nabble.com/JDBC-94-Multiple-resultsets-were-returned-by-query-in-query-end-with-tp...
> To unsubscribe from JDBC-94: "Multiple resultsets were returned by query" in query end with "; ", click here.
> NAML
Regards,
Bocap
--
View this message in context: http://postgresql.nabble.com/JDBC-94-Multiple-resultsets-were-returned-by-query-in-query-end-with-tp...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; "
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
2015-10-07 11:51 ` Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Craig Ringer <craig@2ndquadrant.com>
@ 2015-10-07 22:58 ` bocap <kakalot49@gmail.com>
1 sibling, 0 replies; 12+ messages in thread
From: bocap @ 2015-10-07 22:58 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
Ngày 07-10-2015, vào lúc 20:51, Craig Ringer-3 [via PostgreSQL] <ml-node+s1045698n5869083h68@n5.nabble.com> viết:
> On 29 September 2015 at 21:56, Dang Minh Huong <[hidden email]> wrote:
> > Hi,
> >
> > I'm using postgresql-jdbc94 and have found that,
> > string in executeQuery() end with "; " (the last character is a space)
> > is considered as multiple queries and return with
> > "Multiple resultsets were returned by query" error.
> > I think it is not a bug, but is there any related change in jdbc94. I could
> > not reproduce in jdbc93.
>
> This is a follow-up from a Stack Overflow post, right? I'm pretty sure
> I saw this but I can't find the post now. If I'm remembering
> correctly, got a link so I can cross-reference?
>
Sorry sir. I did not post it in Stack Overflow.
> --
> Craig Ringer http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>
>
> --
> Sent via pgsql-jdbc mailing list ([hidden email])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://postgresql.nabble.com/JDBC-94-Multiple-resultsets-were-returned-by-query-in-query-end-with-tp...
> To unsubscribe from JDBC-94: "Multiple resultsets were returned by query" in query end with "; ", click here.
> NAML
Regards,
Bocap.
--
View this message in context: http://postgresql.nabble.com/JDBC-94-Multiple-resultsets-were-returned-by-query-in-query-end-with-tp...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
^ permalink raw reply [nested|flat] 12+ messages in thread
end of thread, other threads:[~2015-10-07 23:05 UTC | newest]
Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-09-29 13:56 JDBC-94: "Multiple resultsets were returned by query" in query end with "; " Dang Minh Huong <kakalot49@gmail.com>
2015-09-29 14:53 ` Dave Cramer <pg@fastcrypt.com>
2015-09-30 14:08 ` bocap <kakalot49@gmail.com>
2015-10-07 11:51 ` Craig Ringer <craig@2ndquadrant.com>
2015-10-07 12:11 ` Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:30 ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2015-10-07 12:34 ` Dave Cramer <pg@fastcrypt.com>
2015-10-07 12:42 ` Christopher BROWN <brown@reflexe.fr>
2015-10-07 18:42 ` Adam Rauch <adam@labkey.com>
2015-10-07 18:46 ` Dave Cramer <pg@fastcrypt.com>
2015-10-07 23:05 ` bocap <kakalot49@gmail.com>
2015-10-07 22:58 ` bocap <kakalot49@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox