Skip to content
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

[BugFix] Fix primary key alter sort key bug #30531

Merged
merged 4 commits into from
Sep 7, 2023

Conversation

LiShuMing
Copy link
Contributor

@LiShuMing LiShuMing commented Sep 7, 2023

Fixes #30534

std::mismatch is not safe in the old cpp version.

std::mismatch :

1737   template<typename _InputIterator1, typename _InputIterator2,
1738            typename _BinaryPredicate>
1739     _GLIBCXX20_CONSTEXPR
1740     pair<_InputIterator1, _InputIterator2>
1741     __mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1742                _InputIterator2 __first2, _BinaryPredicate __binary_pred)
1743     {
1744       while (__first1 != __last1 && __binary_pred(__first1, __first2))
1745         {
1746           ++__first1;
1747           ++__first2;
1748         }
1749       return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
1750     }
1751

new version: std::mismatch

1815 #if __cplusplus > 201103L
1816
1817   template<typename _InputIterator1, typename _InputIterator2,
1818            typename _BinaryPredicate>
1819     _GLIBCXX20_CONSTEXPR
1820     pair<_InputIterator1, _InputIterator2>
1821     __mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1822                _InputIterator2 __first2, _InputIterator2 __last2,
1823                _BinaryPredicate __binary_pred)
1824     {
1825       while (__first1 != __last1 && __first2 != __last2
1826              && __binary_pred(__first1, __first2))
1827         {
1828           ++__first1;
1829           ++__first2;
1830         }
1831       return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
1832     }

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.1
    • 3.0
    • 2.5
    • 2.4

Signed-off-by: shuming.li <ming.moriarty@gmail.com>
Signed-off-by: shuming.li <ming.moriarty@gmail.com>
Signed-off-by: shuming.li <ming.moriarty@gmail.com>
Signed-off-by: shuming.li <ming.moriarty@gmail.com>
@wanpengfei-git
Copy link
Collaborator

[FE Incremental Coverage Report]

😍 pass : 0 / 0 (0%)

@wanpengfei-git
Copy link
Collaborator

[BE Incremental Coverage Report]

😞 fail : 7 / 11 (63.64%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 src/storage/schema_change.cpp 7 11 63.64% [776, 777, 787, 788]

@kangkaisen kangkaisen merged commit 2b5191a into StarRocks:main Sep 7, 2023
@wanpengfei-git
Copy link
Collaborator

@Mergifyio backport branch-3.1

@github-actions github-actions bot removed the 3.1 label Sep 7, 2023
@wanpengfei-git
Copy link
Collaborator

@Mergifyio backport branch-3.0

@github-actions github-actions bot removed the 3.0 label Sep 7, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 7, 2023

backport branch-3.1

✅ Backports have been created

@mergify
Copy link
Contributor

mergify bot commented Sep 7, 2023

backport branch-3.0

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Sep 7, 2023
---------

Signed-off-by: shuming.li <ming.moriarty@gmail.com>
(cherry picked from commit 2b5191a)
mergify bot pushed a commit that referenced this pull request Sep 7, 2023
---------

Signed-off-by: shuming.li <ming.moriarty@gmail.com>
(cherry picked from commit 2b5191a)

# Conflicts:
#	test/sql/test_ddl/R/alter_table
#	test/sql/test_ddl/T/alter_table
LiShuMing added a commit to LiShuMing/starrocks that referenced this pull request Sep 8, 2023
---------

Signed-off-by: shuming.li <ming.moriarty@gmail.com>
LiShuMing added a commit to LiShuMing/starrocks that referenced this pull request Sep 8, 2023
---------

Signed-off-by: shuming.li <ming.moriarty@gmail.com>
murphyatwork pushed a commit that referenced this pull request Sep 8, 2023
Co-authored-by: shuming.li <ming.moriarty@gmail.com>
murphyatwork pushed a commit that referenced this pull request Sep 8, 2023
#30367) (#30531) (#30616)

Signed-off-by: shuming.li <ming.moriarty@gmail.com>
sevev pushed a commit to sevev/starrocks that referenced this pull request Dec 14, 2023
---------

Signed-off-by: shuming.li <ming.moriarty@gmail.com>
Signed-off-by: zhangqiang <qiangzh95@gmail.com>
LiShuMing added a commit to LiShuMing/starrocks that referenced this pull request Dec 14, 2023
wanpengfei-git pushed a commit that referenced this pull request Dec 14, 2023
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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.

primary key schema change: AddressSanitizer: heap-buffer-overflow
4 participants