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

Copy rough set index Data in a wrong way #8301

Closed
Lloyd-Pottiger opened this issue Nov 2, 2023 · 1 comment
Closed

Copy rough set index Data in a wrong way #8301

Lloyd-Pottiger opened this issue Nov 2, 2023 · 1 comment
Assignees
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. component/storage severity/minor type/bug The issue is confirmed as a bug.

Comments

@Lloyd-Pottiger
Copy link
Contributor

Lloyd-Pottiger commented Nov 2, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

// todo use StringRef instead of String
auto min = String(chars[prev_offset], offsets[pos] - prev_offset - 1);
pos = i * 2 + 1;
prev_offset = offsets[pos - 1];
auto max = String(chars[prev_offset], offsets[pos] - prev_offset - 1);

When using String, we should use reinterpret_cast<const char *>(&chars[prev_offset]) instead of chars[prev_offset], so that it will call constructor constexpr basic_string( const CharT* s, const Allocator& alloc = Allocator()) rather than constexpr basic_string( size_type count, CharT ch, const Allocator& alloc = Allocator() );

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)

@Lloyd-Pottiger Lloyd-Pottiger added the type/bug The issue is confirmed as a bug. label Nov 2, 2023
@Lloyd-Pottiger Lloyd-Pottiger self-assigned this Nov 2, 2023
@Lloyd-Pottiger Lloyd-Pottiger added affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. severity/minor labels Nov 2, 2023
ti-chi-bot bot pushed a commit that referenced this issue Nov 3, 2023
@JaySon-Huang
Copy link
Contributor

the issue is fixed in the master branch by #8298

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. component/storage severity/minor type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants