On 12/24/2013 03:17 AM, David Johnston wrote:
> I need to be convinced that the server should not just silently ignore
> trailing comments. I'd consider an exception if the only text sent is a
> comment ( in such a case we should throw an error ) but if valid commands
> are sent and there is just some comment text at the end it should be ignored
> the same as if the comments were embedded in the middle of the query text.
>
> I've encountered other clients that output phantom results in this situation
> and solving it at the server seems worthwhile so client applications do not
> have to care.
>
> In the example case, I think, putting the comment before the command results
> in only one timing. This inconsistency is a symptom of this situation being
> handled incorrectly.
It is not sent to the server as a trailing comment. The following file
is sent to the server like this.
File:
/**/;
/**/
Commands:
PQexec(..., "/**/;");
PQexec(..., "/**/");
If this has to be fixed it should be in the client. I think people would
complain if we broke the API by starting to throw an exception on PQexec
with a string containing no actual query.
--
Andreas Karlsson