Fix some default column value bugs - #5630
Merged
Merged
Conversation
…olidate-default-tests' into bfops/fix-defaults
This was
linked to
issues
Jul 30, 2026
bfops
commented
Jul 30, 2026
gefjon
reviewed
Jul 30, 2026
Comment on lines
5
to
34
| const EXPECTED_DEFAULTS: &[(&str, &str)] = &[ | ||
| ("bool_value", "true"), | ||
| ("u8_value", "8"), | ||
| // TODO: uncomment this once negative defaults are fixed in Rust | ||
| // https://github.com/clockworklabs/SpacetimeDB/issues/5622 | ||
| //("i8_value", "-8"), | ||
| ("u16_value", "16"), | ||
| // TODO: uncomment this once negative defaults are fixed in Rust | ||
| // https://github.com/clockworklabs/SpacetimeDB/issues/5622 | ||
| //("i16_value", "-16"), | ||
| ("u32_value", "32"), | ||
| // TODO: uncomment this once negative defaults are fixed in Rust | ||
| // https://github.com/clockworklabs/SpacetimeDB/issues/5622 | ||
| //("i32_value", "-32"), | ||
|
|
||
| // TODO: uncomment once u64s are fixed. | ||
| // https://github.com/clockworklabs/SpacetimeDB/issues/5623 | ||
| //("u64_value", "64"), | ||
|
|
||
| ("u64_value", "64"), | ||
| // TODO: uncomment this once negative defaults are fixed in Rust | ||
| // https://github.com/clockworklabs/SpacetimeDB/issues/5622 | ||
| //("i64_value", "-64"), | ||
|
|
||
| // TODO: uncomment once floats are fixed in C# and f32s are fixed in Rust | ||
| // https://github.com/clockworklabs/SpacetimeDB/issues/5624 | ||
| // https://github.com/clockworklabs/SpacetimeDB/issues/5627 | ||
| //("f32_positive_value", "32.5"), | ||
|
|
||
| // TODO: uncomment once floats are fixed in C#, f32s are fixed in Rust, and negative defaults are fixed in Rust | ||
| // https://github.com/clockworklabs/SpacetimeDB/issues/5624 | ||
| // https://github.com/clockworklabs/SpacetimeDB/issues/5627 | ||
| ("f32_positive_value", "32.5"), | ||
| // TODO: uncomment once negative defaults are fixed in Rust | ||
| // https://github.com/clockworklabs/SpacetimeDB/issues/5622 | ||
| //("f32_negative_value", "-32.5"), | ||
| ("f64_positive_value", "64.25"), | ||
| // TODO: uncomment once negative defaults are fixed in Rust | ||
| // https://github.com/clockworklabs/SpacetimeDB/issues/5622 | ||
| //("f64_negative_value", "-64.25"), | ||
|
|
||
| // TODO: uncomment this once string default values are fixed in Rust | ||
| //("string_value", r#""default string""#), | ||
| ]; |
Contributor
There was a problem hiding this comment.
I uncommented the negative value tests and ran locally and they passed. I believe the problem with negative values was:
#val.serialize(...)expanded to e.g.-32.serialize(...).- After macroexpansion, that parsed as
- (32.serialize(...)).
You change makes it so that the macro now correctly constructs the negation operator to the integer first, and then converts it into AlgebraicValue, instead of trying to apply the negation operator afterwards.
Collaborator
Author
There was a problem hiding this comment.
oh fantastic! thank you
2 tasks
bfops
merged commit Jul 31, 2026
4c982b0
into
bfops/consolidate-default-tests
35 of 38 checks passed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
Fixes #5623
Fixes #5624
Fixes #5627
Fixes #5622
API and ABI breaking changes
No. Fixes bugs with things that won't working (two build failures, one publish failure, and one incorrect default value)
Expected complexity level and risk
2
Testing