Skip to content
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

builtins: add gen_random_bytes builtin function #110107

Merged
merged 1 commit into from Sep 7, 2023

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Sep 6, 2023

fixes #21001

Release note (sql change): Added the gen_random_bytes builtin function, which generates cryptographically secure random bytes.

@rafiss rafiss requested a review from a team as a code owner September 6, 2023 14:57
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@andyyang890 andyyang890 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh heh you beat me to it. LGTM, just had one small comment!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rafiss)


pkg/sql/logictest/testdata/logic_test/pgcrypto_builtins line 321 at r1 (raw file):


query I
SELECT length(gen_random_bytes(10))

Do we maybe also want to run this query twice, store the results, and then check that they are not identical as a proxy for testing randomness?

Release note (sql change): Added the gen_random_bytes builtin function,
which generates cryptographically secure random bytes.
Copy link
Collaborator Author

@rafiss rafiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tftr!

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andyyang890)


pkg/sql/logictest/testdata/logic_test/pgcrypto_builtins line 321 at r1 (raw file):

Previously, andyyang890 (Andy Yang) wrote…

Do we maybe also want to run this query twice, store the results, and then check that they are not identical as a proxy for testing randomness?

done

@craig
Copy link
Contributor

craig bot commented Sep 7, 2023

👎 Rejected by too few approved reviews

Copy link
Collaborator

@andyyang890 andyyang890 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@rafiss
Copy link
Collaborator Author

rafiss commented Sep 7, 2023

tftr!

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 7, 2023

Build succeeded:

@craig craig bot merged commit cd2e060 into cockroachdb:master Sep 7, 2023
8 checks passed
@rafiss rafiss deleted the gen_random_bytes branch September 11, 2023 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: support more functions from pgcrypto module
3 participants