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

expression: make regex binary and rlike binary be case sensitive #11502

Merged
merged 1 commit into from
Jul 29, 2019
Merged

expression: make regex binary and rlike binary be case sensitive #11502

merged 1 commit into from
Jul 29, 2019

Conversation

lysu
Copy link
Contributor

@lysu lysu commented Jul 29, 2019

What problem does this PR solve?

In current TiDB, regexp binary is case insensitive.

mysql> select 'a' regexp 'A', 'a' regexp binary 'A';
+----------------+-----------------------+
| 'a' regexp 'A' | 'a' regexp binary 'A' |
+----------------+-----------------------+
|              1 |                     1 |
+----------------+-----------------------+

but MySQL is case sensitive:

mysql> select 'a' regexp 'A', 'a' regexp binary 'A';
+----------------+-----------------------+
| 'a' regexp 'A' | 'a' regexp binary 'A' |
+----------------+-----------------------+
|              1 |                     0 |
+----------------+-----------------------+

What is changed and how it works?

not only check the first argument('a') but also the second argument(binary 'A') to decide whether using builtinRegexpBinarySig

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • impl

Side effects

  • N/A

Related changes

  • Need to cherry-pick to the release branch

This change is Reviewable

@lysu
Copy link
Contributor Author

lysu commented Jul 29, 2019

/run-all-tests

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Jul 29, 2019

Codecov Report

Merging #11502 into master will decrease coverage by 0.0241%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master     #11502        +/-   ##
================================================
- Coverage   81.3774%   81.3532%   -0.0242%     
================================================
  Files           424        424                
  Lines         90922      90922                
================================================
- Hits          73990      73968        -22     
- Misses        11619      11632        +13     
- Partials       5313       5322         +9

1 similar comment
@codecov
Copy link

codecov bot commented Jul 29, 2019

Codecov Report

Merging #11502 into master will decrease coverage by 0.0241%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master     #11502        +/-   ##
================================================
- Coverage   81.3774%   81.3532%   -0.0242%     
================================================
  Files           424        424                
  Lines         90922      90922                
================================================
- Hits          73990      73968        -22     
- Misses        11619      11632        +13     
- Partials       5313       5322         +9

@lysu lysu added status/all tests passed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 29, 2019
Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sre-bot
Copy link
Contributor

sre-bot commented Jul 29, 2019

cherry pick to release-3.0 in PR #11504

@sre-bot
Copy link
Contributor

sre-bot commented Jul 29, 2019

cherry pick to release-2.1 in PR #11505

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants