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: set collation id to negative in tipb if new collations are enabled #14883

Merged
merged 5 commits into from
Feb 26, 2020

Conversation

bb7133
Copy link
Member

@bb7133 bb7133 commented Feb 21, 2020

What problem does this PR solve?

This is a trick for the new collation implementations:

  • When new collations are enabled, we turn the collation id to negative so that other the
    components of the cluster(for example, TiKV) is able to aware of it without any change to
    the protocol definition.
  • When new collations are not enabled, collation id remains the same: all of them should be treated as _bin collations without padding.

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has exported function/method change
  • Has persistent data change

Side effects

  • Increased code complexity

Related changes

  • TiKV need to be updated.

Release note

  • NA

@bb7133 bb7133 added this to the v4.0.0-beta.1 milestone Feb 21, 2020
@bb7133 bb7133 requested a review from a team as a code owner February 21, 2020 02:28
@ghost ghost requested review from SunRunAway and XuHuaiyu and removed request for a team February 21, 2020 02:28
util/collate/collate.go Outdated Show resolved Hide resolved
expression/expr_to_pb_test.go Outdated Show resolved Hide resolved
Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

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

LGTM

@bb7133
Copy link
Member Author

bb7133 commented Feb 25, 2020

/run-all-tests

@codecov
Copy link

codecov bot commented Feb 25, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@a44c601). Click here to learn what that means.
The diff coverage is 58.3333%.

@@             Coverage Diff             @@
##             master     #14883   +/-   ##
===========================================
  Coverage          ?   80.2286%           
===========================================
  Files             ?        503           
  Lines             ?     130957           
  Branches          ?          0           
===========================================
  Hits              ?     105065           
  Misses            ?      17588           
  Partials          ?       8304

@bb7133
Copy link
Member Author

bb7133 commented Feb 25, 2020

/run-check_dev_2

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

@qw4990 qw4990 added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. labels Feb 26, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Feb 26, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Feb 26, 2020

@bb7133 merge failed.

@bb7133 bb7133 merged commit 0daca24 into pingcap:master Feb 26, 2020
@bb7133 bb7133 deleted the bb7133/coll_id_trick branch February 26, 2020 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants