forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the seed of RandomLocalState to be 64bit instead of 32bits
This is connected to raising RandomEngine to use 64bit state, but initialization need to be done on full range otherwise entropy is limited when many repeated statement are executed. Test case provided by @taniabogatsch Fixes duckdb/duckdb-rs#331 Fixes marcboeker/go-duckdb#339
- Loading branch information
Showing
4 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# name: test/sql/function/numeric/test_random_loop.test_slow | ||
# description: Test random via repeated inserts | ||
# group: [numeric] | ||
|
||
statement ok | ||
CREATE TABLE test (id UUID DEFAULT gen_random_uuid()); | ||
|
||
concurrentloop i 0 20 | ||
|
||
loop j 0 10000 | ||
|
||
statement ok | ||
INSERT INTO test DEFAULT VALUES; | ||
|
||
endloop | ||
|
||
endloop | ||
|
||
query I | ||
SELECT COUNT(DISTINCT id) FROM test; | ||
---- | ||
200000 | ||
|
||
statement ok | ||
CREATE TABLE test_pk (id UUID PRIMARY KEY DEFAULT gen_random_uuid()); | ||
|
||
concurrentloop i 0 20 | ||
|
||
loop j 0 10000 | ||
|
||
statement ok | ||
INSERT INTO test_pk DEFAULT VALUES; | ||
|
||
endloop | ||
|
||
endloop | ||
|
||
|