Skip to content

Conversation

@Centril
Copy link
Contributor

@Centril Centril commented Apr 14, 2025

Description of Changes

Fixes #2601.

This fixes two bugs, where if you:

  1. define a table with struct T { #[unique] x: u32 }
  2. insert T { x: 42 } twice => bug 1, will panic but shouldn't.
  3. find row for 42 => empty iterator => bug 2

API and ABI breaking changes

There was a bug where inserting twice caused a unique constraint violation, but again, it's a bug.

Expected complexity level and risk

4 - the datastore is getting messy.

Testing

  • The test test_set_semantics was buggy and is now fixed.
  • A regression test add_twice_and_find_issue_2601 is added for bug 2.

@Centril Centril force-pushed the centril/issue-2601 branch 2 times, most recently from 5b52b3d to 0a37c7d Compare April 14, 2025 20:05
@Centril Centril requested a review from gefjon April 14, 2025 20:05
@Centril Centril force-pushed the centril/issue-2601 branch 4 times, most recently from 97f5caf to 1389240 Compare April 16, 2025 10:05
Copy link
Contributor

@gefjon gefjon left a comment

Choose a reason for hiding this comment

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

Logic appears correct and tests look good. One style change that, actually, I think rises above the level of a nit, plus a couple minor requests for expanded docstrings.

@Centril Centril force-pushed the centril/issue-2601 branch from 94b631e to 85b4619 Compare April 17, 2025 13:12
@Centril Centril requested a review from gefjon April 17, 2025 13:12
@Centril Centril enabled auto-merge April 17, 2025 18:52
@Centril Centril added this pull request to the merge queue Apr 17, 2025
Merged via the queue into master with commit 65e12b9 Apr 17, 2025
14 checks passed
@Centril Centril deleted the centril/issue-2601 branch April 22, 2025 13:53
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.

Investigate reports of ill-behaved unique indexes

3 participants