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

functions-and-operators: enrich instructions for string functions CHAR_LENGTH() and CHARACTER_LENGTH #15483 #16057

Merged

Conversation

PitifulPete
Copy link
Contributor

@PitifulPete PitifulPete commented Jan 9, 2024

What is changed, added or deleted? (Required)

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v8.0 (TiDB 8.0 versions)
  • v7.6 (TiDB 7.6 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.4 (TiDB 7.4 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • v5.2 (TiDB 5.2 versions)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)

What is the related PR or file link(s)?

pingcap/tiflow#10197
pingcap/tiflow#10307

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Copy link

ti-chi-bot bot commented Jan 9, 2024

Welcome @PitifulPete!

It looks like this is your first PR to pingcap/docs 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to pingcap/docs. 😃

@ti-chi-bot ti-chi-bot bot added contribution This PR is from a community contributor. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. missing-translation-status This PR does not have translation status info. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 9, 2024
@qiancai qiancai self-requested a review January 10, 2024 04:23
@qiancai qiancai self-assigned this Jan 10, 2024
@qiancai qiancai added translation/doing This PR's assignee is translating this PR. 2024-tidb-docs-dash This issue or PR is included in the 2024 TiDB Docs Dash event. and removed missing-translation-status This PR does not have translation status info. labels Jan 10, 2024
functions-and-operators/string-functions.md Outdated Show resolved Hide resolved
| CustomerName|LengthOfName |
|-------------|--------------|
| Albert Einstein | 15 |
| Robert Oppenheimer | 18 |
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe include a name where CHAR_LENGTH() and LENGTH() don't match:

mysql> WITH n AS (
    -> SELECT 'François Englert' AS p
    -> UNION ALL SELECT 'Albert Einstein'
    -> UNION ALL SELECT 'Robert Oppenheimer'
    -> )
    -> SELECT p, CHAR_LENGTH(p), LENGTH(p) FROM n;
+--------------------+----------------+-----------+
| p                  | CHAR_LENGTH(p) | LENGTH(p) |
+--------------------+----------------+-----------+
| François Englert   |             16 |        17 |
| Albert Einstein    |             15 |        15 |
| Robert Oppenheimer |             18 |        18 |
+--------------------+----------------+-----------+
3 rows in set (0.00 sec)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this should be introduced in the LENGTH() subheading where the difference between LENGTH() and CHAR_LENGTH() will be stated and this type of example will be included. Adding it here when LENGTH() is yet to be introduced to the readers can confuse.

functions-and-operators/string-functions.md Outdated Show resolved Hide resolved
@dveeden
Copy link
Contributor

dveeden commented Jan 10, 2024

Note that this PR might have some relation and/or overlap with #16068

@dveeden
Copy link
Contributor

dveeden commented Jan 10, 2024

From the linter:

[2024-01-09T23:31:58.375Z] + markdownlint functions-and-operators/string-functions.md
[2024-01-09T23:31:58.375Z] functions-and-operators/string-functions.md: 139: MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 10, 2024
@qiancai qiancai requested a review from yibin87 January 11, 2024 08:19
Copy link
Contributor

@yibin87 yibin87 left a comment

Choose a reason for hiding this comment

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

Others LGTM

functions-and-operators/string-functions.md Outdated Show resolved Hide resolved
Copy link

ti-chi-bot bot commented Jan 12, 2024

@yibin87: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

Others LGTM

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot added area/develop This PR relates to the area of TiDB App development. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 12, 2024
@PitifulPete
Copy link
Contributor Author

@qiancai, could you merge commits unrelated to this issue with their respective branches?

@dveeden
Copy link
Contributor

dveeden commented Jan 15, 2024

@qiancai, could you merge commits unrelated to this issue with their respective branches?

I think it might be good to do an interactive rebase to pick the right commits.

  1. Make sure you're on the right branch: git checkout enrich/instructions-string-functions
  2. Make sure git is up to date: git fetch --all
  3. Now start the rebase git rebase -i upstream/master
    a. This assumes there is a "remote" with the name upstream. You can check the output of git remote -v to check what removes are available.

The rebase should look like this:
image

For each line you can:

  • Remove the line to remove that commit from the PR
  • Change the word pick into fixup to merge commits together (probably not needed here)
  • More options are in the help text, but probably also not needed.

See also https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History

Once you save and exit the editor there might be conflicts. If this is the case then edit the file to fix the conflict and use git add to mark the file as done and hen do a git rebase --continue. This is also in the help text, for example:

$ git rebase -i upstream/master
Auto-merging functions-and-operators/string-functions.md
CONFLICT (content): Merge conflict in functions-and-operators/string-functions.md
error: could not apply 292a75611f... functions-and-operators: enrich instructions for string functions CHAR_LENGTH() and CHARACTER_LENGTH()
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 292a75611f... functions-and-operators: enrich instructions for string functions CHAR_LENGTH() and CHARACTER_LENGTH()

Once the rebase is done you would have to do a git push --force as you need to overwrite what's on GitHub. You can use tools like git log, git log --oneline upstream/master..HEAD and git diff upstream/master to verify everything is correct before you do this. If you want you can also do a git push -v --dry-run first.

@PitifulPete PitifulPete force-pushed the enrich/instructions-string-functions branch from 6c2831d to 15eb281 Compare January 15, 2024 10:27
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 15, 2024
PitifulPete and others added 3 commits January 19, 2024 12:21
…R_LENGTH() and CHARACTER_LENGTH()

improve content on string functions
Implemented corrections suggested by @dveeden and responded to one comment

Co-authored-by: Daniël van Eeden <[email protected]>
@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 21, 2024
functions-and-operators/string-functions.md Outdated Show resolved Hide resolved
functions-and-operators/string-functions.md Outdated Show resolved Hide resolved
functions-and-operators/string-functions.md Outdated Show resolved Hide resolved
functions-and-operators/string-functions.md Outdated Show resolved Hide resolved
functions-and-operators/string-functions.md Outdated Show resolved Hide resolved
functions-and-operators/string-functions.md Outdated Show resolved Hide resolved
functions-and-operators/string-functions.md Outdated Show resolved Hide resolved
qiancai added a commit to PitifulPete/tidb-docs that referenced this pull request Jan 29, 2024
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 29, 2024
Copy link
Contributor

@yibin87 yibin87 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Jan 29, 2024

@yibin87: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

LGTM

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 30, 2024
Copy link

ti-chi-bot bot commented Jan 30, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-10 09:00:42.159045273 +0000 UTC m=+433831.743298962: ☑️ agreed by dveeden.
  • 2024-01-30 01:48:17.100795781 +0000 UTC m=+1443738.665093486: ☑️ agreed by qiancai.

@qiancai
Copy link
Collaborator

qiancai commented Jan 30, 2024

/retest

@qiancai
Copy link
Collaborator

qiancai commented Jan 30, 2024

/approve

Copy link

ti-chi-bot bot commented Jan 30, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiancai

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Jan 30, 2024
@ti-chi-bot ti-chi-bot bot merged commit ac76707 into pingcap:master Jan 30, 2024
8 of 9 checks passed
@PitifulPete PitifulPete deleted the enrich/instructions-string-functions branch January 30, 2024 08:30
@qiancai qiancai added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR's assignee is translating this PR. labels Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2024-tidb-docs-dash This issue or PR is included in the 2024 TiDB Docs Dash event. approved area/develop This PR relates to the area of TiDB App development. contribution This PR is from a community contributor. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. lgtm size/M Denotes a PR that changes 30-99 lines, ignoring generated files. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR.
Development

Successfully merging this pull request may close these issues.

Enrich instructions for string functions CHAR_LENGTH() and CHARACTER_LENGTH()
5 participants