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

sql: fix deterministic ID generation #86276

Merged

Conversation

ajwerner
Copy link
Contributor

The code was fooling itself: we often did not re-initialize the eval context
and thus we were using the old non-transactional generator.

Release justification: Only affects testing code.
Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@ajwerner ajwerner force-pushed the ajwerner/fix-deterministic-id-gen branch 2 times, most recently from d15ed6f to 1f5a7e6 Compare August 17, 2022 02:28
@ajwerner
Copy link
Contributor Author

The numbers go down because there were statements that would fail but would have incremented the ID generator sequence because it was non-transactional.

The code was fooling itself: we often did not re-initialize the eval context
and thus we were using the old non-transactional generator.

Release justification: Only affects testing code.
Release note: None
@ajwerner ajwerner force-pushed the ajwerner/fix-deterministic-id-gen branch from 1f5a7e6 to f323841 Compare August 17, 2022 03:29
@ajwerner
Copy link
Contributor Author

@chengxiong-ruan PTAL, I reworked some of the UDF tests to avoid hard-coded IDs as inputs

Copy link
Contributor

@chengxiong-ruan chengxiong-ruan left a comment

Choose a reason for hiding this comment

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

💯

LANGUAGE SQL
AS $$
SELECT oid::INT8 - 100000
FROM pg_proc
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an excellent idea!!!

@ajwerner
Copy link
Contributor Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 17, 2022

Build succeeded:

@craig craig bot merged commit f292c7a into cockroachdb:master Aug 17, 2022
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.

3 participants