Skip to content

MOD-6501, MOD-4551, MOD-4856, MOD-5714: fix integers over i64max to be promoted to f64 - #1190

Closed
ephraimfeldblum wants to merge 11 commits into
masterfrom
ephraim_promote-u64-to-f64
Closed

ephraimfeldblum wants to merge 11 commits into
masterfrom
ephraim_promote-u64-to-f64

Conversation

@ephraimfeldblum

@ephraimfeldblum ephraimfeldblum commented Feb 28, 2024 •

Copy link
Copy Markdown
Contributor

Description

Indexing NUMERIC fields has unchanged behavior.

  • A NUMERIC field with value greater than i64::min (-2^63), but less than i64::max (2^63 - 1) is indexed as i64. It does not lose precision. Its type is integer.
  • A NUMERIC field with value greater than i64::max (2^63 - 1), but less than u64::max (2^64 - 1) is indexed as u64. It does not lose precision. Its type is integer.
  • A NUMERIC field with value greater than u64::max (2^64 - 1), or lower than i64::min (-2^63), or containing a decimal point, is indexed as f64. Its type is number. This may implicate losing precision, but this is not a breaking change.

NUMINCRBY behavior changed to prevent crash.

  • i64 + i64 whose result is between i64::min and i64::max has unchanged behavior. Its result is stored as i64, its type is integer.
  • i64 + i64 whose result is greater than i64::max or less than i64::min explicitly wraps instead of invoking undefined behavior. Its result is stored as i64, its type is integer.
  • i64 + u64 and u64 + u64 behavior is unchanged. Its result is stored as f64, its type is number. This may implicate losing precision, but this is not a breaking change.
  • u64 + i64 used to crash. Now it behaves consistently with the prior case.
  • If either argument is f64, the result is stored as f64, with type number.

DROP of integers stored as u64 no longer crashes.

This PR only affects NUMERIC fields using vanilla JSON, not those using CRDT.

Which issues this PR fixes

  1. MOD-6501
  2. MOD-4551
  3. MOD-4856
  4. MOD-5714
  5. #875
  6. #3726 (Search)

Main objects this PR modified

  1. IValue Manager

@codecov

codecov Bot commented Feb 28, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 79.31034% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 78.02%. Comparing base (92b14cb) to head (d820c34).

Files Patch % Lines
json_path/src/json_node.rs 68.75% 5 Missing ⚠️
redis_json/src/key_value.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1190      +/-   ##
==========================================
- Coverage   78.07%   78.02%   -0.06%     
==========================================
  Files          15       15              
  Lines        3914     3922       +8     
==========================================
+ Hits         3056     3060       +4     
- Misses        858      862       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ephraimfeldblum ephraimfeldblum changed the title MOD-6501, MOD-4551, MOD-4856: fix integers over i64max to be promoted to f64 MOD-6501, MOD-4551, MOD-4856, MOD-5714: fix integers over i64max to be promoted to f64 Feb 28, 2024
Comment thread tests/pytest/test.py Resolved
Comment thread .gitignore Resolved
Comment thread .gitignore
.settings/

wordlist.dic
config.txt

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.

What's this config.txt about? :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

An automation file for RLTest. @MeirShpilraien can explain more in detail.

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.

Got you. The name is too generic. I think RLTest should have a different configuration name.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@iddm We can deprecate this name and come up with another one more specific to RLTest. maybe rltest_config.txt? Personally I think maybe RLTest should also look for this configuration file under some user directory (maybe something like ~/.rltest/rltest_config.txt) and not just under the current directory.

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.

Yes, indeed, much better than just config.txt :-) But even better, just as you said, a config directory, I think. However, we should use something like XDG_CONFIG_DIR or something if it is available; if not, then just use $HOME/.config/rltest for it.

@ephraimfeldblum
ephraimfeldblum changed the base branch from master to 2.6 March 6, 2024 10:23
@ephraimfeldblum
ephraimfeldblum changed the base branch from 2.6 to master March 6, 2024 10:23
@ephraimfeldblum

Copy link
Copy Markdown
Contributor Author

replaced by #1192

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.

4 participants