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: explicitly handle 0, 1 or n format codes #5783
Conversation
We can't easily test this from go but we should still be able to add it to |
agree we need an acceptance test that tickles this. Reviewed 1 of 1 files at r1. sql/pgwire/v3.go, line 496 [r1] (raw file): also, do we use multiline comments like this anywhere else? sql/pgwire/v3.go, line 509 [r1] (raw file): sql/pgwire/v3.go, line 563 [r1] (raw file): sql/pgwire/v3.go, line 577 [r1] (raw file): Comments from the review on Reviewable.io |
Thanks for fixing this so quickly! cc @jseldess |
Hm, maybe we should make all the examples acceptance tests. Review status: all files reviewed at latest revision, 4 unresolved discussions, all commit checks successful. sql/pgwire/v3.go, line 496 [r1] (raw file): sql/pgwire/v3.go, line 509 [r1] (raw file): sql/pgwire/v3.go, line 563 [r1] (raw file): sql/pgwire/v3.go, line 577 [r1] (raw file): Comments from the review on Reviewable.io |
We need to find some solution for testing the examples; adding them to the acceptance tests would be one way to do it. See cockroachdb/docs#182 |
LGTM with the test Reviewed 1 of 1 files at r2. sql/pgwire/v3.go, line 565 [r2] (raw file): "From the docs on number of result-column format codes to bind:" Comments from the review on Reviewable.io |
Reviewed 2 of 2 files at r3. acceptance/php_test.go, line 41 [r3] (raw file): Comments from the review on Reviewable.io |
refactored slightly to explicitly handle the cases allowed by the spec and check for a few invalid cases that we were previously allowing (eg 0 < format codes < params). Fixes cockroachdb#5758.
refactored slightly to explicitly handle the cases allowed by the spec and check for a few
invalid cases that we were previously allowing (eg 0 < format codes < params).
Unfortunately hard to write a test with current setup because of
lib/pq
, but verified by using the failing php example.Fixes #5758.
This change is