Skip to content

fix: limit unsigned integer range. #1151#1216

Merged
mergify[bot] merged 4 commits intostoneatom:stonedb-5.7-devfrom
hustjieke:fix_limit_unsigned_integer_to_signed_boundary_issue1151
Jan 13, 2023
Merged

fix: limit unsigned integer range. #1151#1216
mergify[bot] merged 4 commits intostoneatom:stonedb-5.7-devfrom
hustjieke:fix_limit_unsigned_integer_to_signed_boundary_issue1151

Conversation

@hustjieke
Copy link
Copy Markdown
Collaborator

@hustjieke hustjieke commented Jan 12, 2023

Summary about this PR

tinyint: signed range is -128 to 127, unsigned range is 0 to 127.

smallint: signed range is -32768 to 32767, unsigned range is 0 to 32767.

mediumint: signed range is -8388608 to 8388607, unsigned range is 0 to 8388607.

int/integer: signed range is -2147483647 to 2147483647, unsigned range is 0 to 2147483647. Note: -2147483648 is not allowed in tianmu engine currently.

bigint: signed range is -9223372036854775806 to 9223372036854775807, unsigned range is 0 to 9223372036854775807.
Note: -9223372036854775807 will be set to null and -9223372036854775808 will ret out of range.
Issue Number: close #1151

Tests Check List

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Changelog

  • New Feature
  • Bug Fix
  • Performance Improvement
  • Build/Testing/CI/CD
  • Documentation
  • Not for changelog (changelog entry is not required)

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jan 12, 2023

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added the PR-bug bug for pull request label Jan 12, 2023
[summary]

tinyint: signed range is -128 to 127, unsigned range is 0 to 127.

smallint: signed range is -32768 to 32767, unsigned range is 0 to 32767.

mediumint: signed range is -8388608 to 8388607, unsigned range is 0 to 8388607.

int/integer: signed range is -2147483647 to 2147483647, unsigned range is 0 to 2147483647.
Note: -2147483648 is not allowed in tianmu engine currently.

bigint: signed range is -9223372036854775806 to 9223372036854775807, unsigned range is 0 to 9223372036854775807.
Note: -9223372036854775807 will be set to null and -9223372036854775808 will ret out of range.
@hustjieke hustjieke force-pushed the fix_limit_unsigned_integer_to_signed_boundary_issue1151 branch from 3a61b96 to d0efcbd Compare January 12, 2023 11:06
@hustjieke hustjieke self-assigned this Jan 12, 2023
…file test unsigned, this will be opened after we completely support unsigned types stoneatom#1151
@hustjieke hustjieke marked this pull request as ready for review January 13, 2023 02:39
@hustjieke
Copy link
Copy Markdown
Collaborator Author

Please make a CR @RingsC @wisehead @lujiashun @isredstar.

@hustjieke hustjieke force-pushed the fix_limit_unsigned_integer_to_signed_boundary_issue1151 branch from 1f753c7 to 5dfe091 Compare January 13, 2023 07:19
@hustjieke hustjieke force-pushed the fix_limit_unsigned_integer_to_signed_boundary_issue1151 branch from 5dfe091 to 7b94e51 Compare January 13, 2023 07:46
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 13, 2023

Codecov Report

Base: 43.30% // Head: 43.34% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (7b94e51) compared to base (74160c0).
Patch coverage: 84.48% of modified lines in pull request are covered.

❗ Current head 7b94e51 differs from pull request most recent head eae52b4. Consider uploading reports for the commit eae52b4 to get more accurate results

Additional details and impacted files
@@                 Coverage Diff                 @@
##           stonedb-5.7-dev    #1216      +/-   ##
===================================================
+ Coverage            43.30%   43.34%   +0.03%     
===================================================
  Files                 1830     1830              
  Lines               396111   396130      +19     
===================================================
+ Hits                171535   171698     +163     
+ Misses              224576   224432     -144     
Impacted Files Coverage Δ
storage/tianmu/common/common_definitions.h 84.21% <ø> (ø)
storage/tianmu/core/engine.h 30.43% <ø> (ø)
storage/tianmu/core/engine.cpp 54.40% <60.00%> (+1.31%) ⬆️
storage/tianmu/core/column_bin_encoder.cpp 47.61% <66.66%> (+2.84%) ⬆️
storage/tianmu/common/common_definitions.cpp 88.23% <86.36%> (+31.09%) ⬆️
storage/tianmu/core/engine_convert.cpp 68.23% <100.00%> (ø)
storage/tianmu/core/tianmu_table.cpp 49.48% <100.00%> (+0.33%) ⬆️
storage/innobase/include/ut0mutex.ic 52.38% <0.00%> (-19.05%) ⬇️
storage/tianmu/core/tianmu_attr.h 75.55% <0.00%> (-7.78%) ⬇️
strings/str2int.c 72.72% <0.00%> (-6.07%) ⬇️
... and 52 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hustjieke
Copy link
Copy Markdown
Collaborator Author

PTAL @lujiashun

Copy link
Copy Markdown

@lujiashun lujiashun left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot merged commit 1fa9d33 into stoneatom:stonedb-5.7-dev Jan 13, 2023
@hustjieke hustjieke deleted the fix_limit_unsigned_integer_to_signed_boundary_issue1151 branch February 13, 2023 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-bug bug for pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: the range of unsigned should be determined

3 participants