-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql/pgwire: send empty query response instead of command complete on empty query #3852
Comments
I guess one question is whether this is pgwire-specific or not: should we detect empty queries in pgwire and kill them early, or leave it up to the sql executor and add an "empty" value to the driver response? |
Fixing this as pg-specific seems fine to me. |
Hm, this example has me second guessing that:
Some combination of |
That's interesting; what if you do |
That one is |
Weird. Off-topic now but what does Anyway, yes, leave it to the parser. |
|
I'm pretty sure the parser already handles stripping out empty statements. |
Right, I think the missing piece is communicating back to the pgwire code, that after parsing, all queries were empty. |
Would be easier to do that if we weren't going through the |
also explicitly send EmptyQuery than execute empty query strings. Fixes cockroachdb#3849 Starts to address cockroachdb#3852 but, as noted in TODO and on the issue, correctly handling more complex empty queries (e.g. "; ; ;") is better left to the actual parser, which will require plumbing that through the driver too.
also explicitly send EmptyQuery than execute empty query strings. Fixes cockroachdb#3849 Starts to address cockroachdb#3852 but, as noted in TODO and on the issue, correctly handling more complex empty queries (e.g. "; ; ;") is better left to the actual parser, which will require plumbing that through the driver too.
also explicitly send EmptyQuery than execute empty query strings. Fixes cockroachdb#3849 Starts to address cockroachdb#3852 but, as noted in TODO and on the issue, correctly handling more complex empty queries (e.g. "; ; ;") is better left to the actual parser, which will require plumbing that through the driver too.
also explicitly send EmptyQuery than execute empty query strings. Fixes cockroachdb#3849 Starts to address cockroachdb#3852 but, as noted in TODO and on the issue, correctly handling more complex empty queries (e.g. "; ; ;") is better left to the actual parser, which will require plumbing that through the driver too.
This is likely addressed by #4081. |
When sending an empty query, we respond with command complete (C), real Postgres responds with empty query (I).
The text was updated successfully, but these errors were encountered: