Skip to content

make ContainsByEnd return true when the key is empty and region's right bound is inf#1052

Merged
disksing merged 8 commits intotikv:masterfrom
YuJuncen:fix-scan-to-inf
Nov 14, 2023
Merged

make ContainsByEnd return true when the key is empty and region's right bound is inf#1052
disksing merged 8 commits intotikv:masterfrom
YuJuncen:fix-scan-to-inf

Conversation

@YuJuncen
Copy link
Contributor

@YuJuncen YuJuncen commented Nov 8, 2023

Signed-off-by: hillium yujuncen@pingcap.com

Ref: #1051

I think the semantic of ContainsByEnd should be: "Please check whether this key is in the range, if the input is empty, treat it as infinity.". But I have noticed there are already some test cases that believes "" shouldn't be in ("", ""]. I'm not sure whether it is by design.

Anyway this will bring unexpected behavior sometimes (say, make infinity loops), I think perhaps we can make it better.

Signed-off-by: hillium <yujuncen@pingcap.com>
@YuJuncen
Copy link
Contributor Author

YuJuncen commented Nov 8, 2023

/cc @disksing

Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
@disksing
Copy link
Collaborator

disksing commented Nov 9, 2023

I think you're right, but I need to check all usages of this function to prevent this modification from accidentally breaking something.

@disksing
Copy link
Collaborator

disksing commented Nov 9, 2023

I think you're right, but I need to check all usages of this function to prevent this modification from accidentally breaking something.

checked, it should be fine.

YuJuncen and others added 3 commits November 9, 2023 12:21
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yujuncen@pingcap.com>
@disksing disksing merged commit 6659170 into tikv:master Nov 14, 2023
you06-pingcap pushed a commit to you06/client-go that referenced this pull request Jun 27, 2025
… right bound is inf (tikv#1052)

Signed-off-by: hillium <yujuncen@pingcap.com>
Co-authored-by: disksing <i@disksing.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.

2 participants