-
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 CommandComplete for DDLs #3853
Conversation
@@ -677,6 +672,7 @@ func (c *v3Conn) sendResponse(resp driver.Response, formatCodes []formatCode, se | |||
|
|||
// Ack messages do not have a corresponding protobuf field, so handle those | |||
// with a default. | |||
// This also includes DDLs which want CommandComcplete as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
Sigh, CI fails because |
7a926fe
to
7e0f5f4
Compare
As discussed on #3852, a "real" fix three is going go involve plumbing the parser's opinion on emptiness though sql/driver. Once that's done the naive check added here might go, or stay around as it avoid work in the simple case. Review status: 0 of 1 files reviewed at latest revision, all discussions resolved. sql/pgwire/v3.go, line 675 [r1] (raw file): Comments from the review on Reviewable.io |
Reviewed 1 of 1 files at r2. sql/pgwire/v3.go, line 548 [r2] (raw file): sql/pgwire/v3.go, line 550 [r2] (raw file): sql/pgwire/v3.go, line 680 [r2] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 2 unresolved discussions. sql/pgwire/v3.go, line 548 [r2] (raw file): sql/pgwire/v3.go, line 550 [r2] (raw file): sql/pgwire/v3.go, line 680 [r2] (raw file): Comments from the review on Reviewable.io |
Reviewed 1 of 1 files at r3. Comments from the review on Reviewable.io |
This needs a test, if that's feasible. Review status: Comments from the review on Reviewable.io |
I'll take another look at Review status: Comments from the review on Reviewable.io |
After digging through lib/pq and database/sql, figured out a test but it is gross. Review status: 1 of 2 files reviewed at latest revision, all discussions resolved. Comments from the review on Reviewable.io |
Reviewed 1 of 1 files at r4. sql/pgwire_test.go, line 333 [r4] (raw file): sql/pgwire_test.go, line 346 [r4] (raw file): also, why is creating the table necessary? seems like the Comments from the review on Reviewable.io |
Review status: 1 of 2 files reviewed at latest revision, 1 unresolved discussion. sql/pgwire_test.go, line 333 [r4] (raw file): sql/pgwire_test.go, line 346 [r4] (raw file): Comments from the review on Reviewable.io |
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.
Reviewed 1 of 1 files at r5. sql/pgwire_test.go, line 365 [r5] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 1 unresolved discussion. sql/pgwire_test.go, line 365 [r5] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, all discussions resolved. sql/pgwire_test.go, line 365 [r5] (raw file): Comments from the review on Reviewable.io |
sql/pgwire: send CommandComplete for DDLs
Fixes #3849