-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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 painc on substring_index #7806
Changes from 3 commits
14eb73f
7a2bba2
3390d2d
028df83
e585207
6c8a611
f706ceb
cf78602
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1208,6 +1208,9 @@ func (b *builtinSubstringIndexSig) evalString(row chunk.Row) (d string, isNull b | |
end = count | ||
} | ||
} else { | ||
if count <= -int64(math.Pow(2, 63)) { | ||
return "", false, nil | ||
} | ||
// If count is negative, everything to the right of the final delimiter (counting from the right) is returned. | ||
count = -count | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we just check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we don't need to check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. Comment addressed, PTAL again |
||
if count < end { | ||
|
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.