Skip to content

sql: fix deterministic ID generation#86276

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/fix-deterministic-id-gen
Aug 17, 2022
Merged

sql: fix deterministic ID generation#86276
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/fix-deterministic-id-gen

Conversation

@ajwerner
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

TFTR!

bors r+

@craig
Copy link
Copy Markdown
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