-
Notifications
You must be signed in to change notification settings - Fork 114
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
[BUG] 'gen_random_uuid()' Constraint Error: Duplicate key #331
Comments
Sounds like a problem on https://github.com/duckdb/duckdb |
Yes, I could reproduce it with a simple SQL statement ok
CREATE TABLE test (id UUID PRIMARY KEY DEFAULT gen_random_uuid());
concurrentloop i 0 20
loop j 0 10000
statement ok
INSERT INTO test DEFAULT VALUES;
endloop
endloop (venv) tania@motorbook duckdb % build/release/test/unittest test/temp.test
Filters: test/temp.test
[0/1] (0%): test/temp.test ================================================================================
Query unexpectedly failed! (test/temp.test:11)!
================================================================================
INSERT INTO test DEFAULT VALUES;
================================================================================
Constraint Error: Duplicate key "id: 7c047142-09fd-4666-8381-5794fc888e23" violates primary key constraint.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
unittest is a Catch v2.13.7 host application.
Run with -? for options
-------------------------------------------------------------------------------
test/temp.test
-------------------------------------------------------------------------------
/Users/tania/DuckDB/duckdb/test/sqlite/test_sqllogictest.cpp:210
...............................................................................
test/temp.test:11: FAILED:
explicitly with message:
0
[1/1] (100%): test/temp.test
===============================================================================
test cases: 1 | 0 passed | 1 failed
assertions: 58757 | 58756 passed | 1 failed |
carlopi
added a commit
to carlopi/duckdb
that referenced
this issue
Dec 27, 2024
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
carlopi
added a commit
to carlopi/duckdb
that referenced
this issue
Dec 27, 2024
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
carlopi
added a commit
to carlopi/duckdb
that referenced
this issue
Dec 27, 2024
This is connected to raising RandomEngine to use 64bit state, see duckdb#13920, but initialization need to be done on full range otherwise entropy is limited when many repeated statement are executed. Note that here we only solve the problem for RandomLocalState. A wider rework of the RandomEngine API migth be also handy. Test case provided by @taniabogatsch Fixes duckdb/duckdb-rs#331 Fixes marcboeker/go-duckdb#339 Note that impe
hannes
added a commit
to duckdb/duckdb
that referenced
this issue
Dec 30, 2024
This is connected to raising RandomEngine to use 64bit state, see #13920, but initialization need to be done on full range otherwise entropy is limited when many repeated statement are executed. Note that here we only solve the problem for RandomLocalState. A wider rework of the RandomEngine API would also be also handy, since currently it takes a int64_t that can be either invalid (-1) or valid (>=0), but out of scope here given interactions with sampling PRs make it a larger change. Test case by @taniabogatsch Fixes duckdb/duckdb-rs#331 Fixes marcboeker/go-duckdb#339
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In fact, I'm not quite sure whether this bug should belong to duckdb-rs, but I'm unfamiliar with C++, and I can't check it further, so I posted it here.
macOS 14.5
select version() -> v0.10.2
The text was updated successfully, but these errors were encountered: