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

lpad/rpad return wrong result if it need return null for not null input #9465

Closed
windtalker opened this issue Sep 23, 2024 · 1 comment · Fixed by #9610
Closed

lpad/rpad return wrong result if it need return null for not null input #9465

windtalker opened this issue Sep 23, 2024 · 1 comment · Fixed by #9610
Assignees
Labels
affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.0 affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.2 affects-6.3 affects-6.4 affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-6.6 affects-7.0 affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.2 affects-7.3 affects-7.4 affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.0 affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.2 affects-8.3 affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/compute severity/major type/bug The issue is confirmed as a bug.

Comments

@windtalker
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

In

if (target_len < 0 || (data_len < static_cast<ColumnString::Offset>(target_len) && pad_len == 0))
{
return true;
}

And
if (target_len < 0 || (data_len < static_cast<ColumnString::Offset>(target_len) && pad_len == 0))
{
return true;
}

It returns true(which means the result is null) without adding the tailing \0

1. Minimal reproduce step (Required)

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiFlash version? (Required)

@xzhangxian1008
Copy link
Contributor

/assign

@guo-shaoge guo-shaoge added affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.2 affects-7.3 affects-7.4 affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.0 affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.2 affects-8.3 affects-8.4 labels Nov 13, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in 99ab3c5 Nov 18, 2024
ti-chi-bot bot added a commit that referenced this issue Nov 18, 2024
close #9465

Signed-off-by: guo-shaoge <shaoge1994@163.com>

Co-authored-by: guo-shaoge <shaoge1994@163.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot pushed a commit that referenced this issue Nov 20, 2024
close #9465

Signed-off-by: guo-shaoge <shaoge1994@163.com>

Co-authored-by: guo-shaoge <shaoge1994@163.com>
ti-chi-bot bot pushed a commit that referenced this issue Nov 20, 2024
close #9465

Signed-off-by: guo-shaoge <shaoge1994@163.com>

Co-authored-by: guo-shaoge <shaoge1994@163.com>
ti-chi-bot bot pushed a commit that referenced this issue Nov 21, 2024
close #9465

Signed-off-by: guo-shaoge <shaoge1994@163.com>

Co-authored-by: guo-shaoge <shaoge1994@163.com>
ti-chi-bot bot added a commit that referenced this issue Dec 2, 2024
close #9465

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.0 affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.2 affects-6.3 affects-6.4 affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-6.6 affects-7.0 affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.2 affects-7.3 affects-7.4 affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.0 affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.2 affects-8.3 affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/compute severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants