-
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: added inet function to support conversion to inet type #83668
sql: added inet function to support conversion to inet type #83668
Conversation
Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
|
680620c
to
ffcb34f
Compare
Thank you for updating your pull request. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
ffcb34f
to
a073cdd
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
bf41b82
to
970bc9c
Compare
Not sure about the benchmark failures there are no details in the CI logs. I think they might be spurious. Everything passes locally. This is failing on exactly the same tests which were run in the same time window. |
1a68491
to
ddc82fb
Compare
31d9630
to
0f658bb
Compare
0f658bb
to
c719bae
Compare
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.
thank you for your contribution!
i left a few small comments, but this looks good
you will need to run ./dev generate docs
or make buildshort
to make sure the generated docs are up to date
please address the comments, and amend your original commit with the changes. thanks!
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @rafiss and @surahman)
-- commits
line 5 at r1:
nit: please add newlines to the message so it's at most 100 characters wide
pkg/sql/sem/builtins/builtins.go
line 1051 at r1 (raw file):
"inet": makeBuiltin(defProps(), tree.Overload{ Types: tree.ArgTypes{{"val", types.Any}},
to match postgres, we should make this only accept types.String
. (PG actually accepts type cstring
here, but CRDB doesn't have that)
pkg/sql/sem/builtins/builtins.go
line 1057 at r1 (raw file):
if err != nil { return nil, pgerror.Newf( pgcode.InvalidParameterValue, "could not convert to INet: %s", args[0])
to match postgres, let's use pgcode.InvalidTextRepresentation
also, instead of pgerror.Newf
, please use the original error
return nil, pgerror.WithCandidateCode(err, pgcode.InvalidTextRepresentation)
pkg/sql/sem/builtins/builtins.go
line 1061 at r1 (raw file):
return inet, nil }, Info: "If possible, converts input to that of type INet.",
please use "inet" instead of "INet"
Release note (sql change): The inet function has been added to support the conversion of a supplied type to that of the inet type family. If the conversion fails a SQL error will be output.
c719bae
to
a63ecf8
Compare
Thank you @rafiss |
Bazel CI failure appears to be unrelated. [17:02:04][Run unit tests] === RUN TestTenantLogic/3node-tenant/grant_on_all_sequences_in_schema
[17:02:04][Run unit tests] [17:02:02] setting distsql_workmem='34458B';
[17:02:04][Run unit tests] [17:02:02] setting distsql_workmem='34458B';
[17:02:04][Run unit tests] [17:02:03] rng seed: 1456840546540403413
[17:02:04][Run unit tests]
[17:02:04][Run unit tests] -- Test timed out at 2022-07-15 17:02:03 UTC -- |
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.
thanks for your work! this looks good to me
bors r+
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @surahman)
Thank you @rafiss |
Build succeeded: |
Release note (sql change):
The inet function has been added to support the conversion of a supplied type to that of the inet
type family. If the conversion fails a SQL error will be output.
Closes #82052.