-
Notifications
You must be signed in to change notification settings - Fork 409
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
expression: fix substring_index crash tiflash in some case #9137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[LGTM Timeline notifier]Timeline:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd better add assert(count != 0);
after line 5214, or it may cause something wrong when it comes to the following branch with count == 0
tiflash/dbms/src/Functions/FunctionsString.cpp
Lines 5258 to 5263 in fce582b
if (count <= static_cast<Int64>(delim_pos.size())) | |
{ | |
auto delim_count = delim_pos.size(); | |
const UInt8 * match = delim_pos[delim_count - count]; | |
begin = match + delim_size; | |
} |
It is OK for now because count == 0
has some shortcuts in the upper level.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JaySon-Huang, solotzg, windtalker The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
) (pingcap#9140) close pingcap#9116 Fix tiflash crash caused by function `substring_index` in some corner cases Co-authored-by: wshwsh12 <793703860@qq.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
What problem does this PR solve?
Issue Number: close #9116
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note