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

string-functions: add instructions for using ASCII() and BIN() #15481

Merged

Conversation

qiancai
Copy link
Collaborator

@qiancai qiancai commented Nov 22, 2023

What is changed, added or deleted? (Required)

Fix pingcap/docs#15418

This PR adds instructions for the string functions ASCII() and BIN().

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 (in Chinese).

  • master (the latest development version)
  • v7.5 (TiDB 7.5 versions)
  • v7.4 (TiDB 7.4 versions)
  • v7.3 (TiDB 7.3 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)?

  • 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

@ti-chi-bot ti-chi-bot bot added missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 22, 2023
@qiancai qiancai added the translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. label Nov 22, 2023
@ti-chi-bot ti-chi-bot bot removed the missing-translation-status This PR does not have translation status info. label Nov 22, 2023
@qiancai qiancai changed the title string-functions: add instructions for using ASCII() string-functions: add instructions for using ASCII() and BIN() Nov 23, 2023
@qiancai qiancai added type/enhancement The issue or PR belongs to an enhancement. translation/doing This PR’s assignee is translating this PR. and removed translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. labels Nov 23, 2023
@qiancai qiancai changed the title string-functions: add instructions for using ASCII() and BIN() string-functions: add instructions for using ASCII() and BIN() Nov 23, 2023
@qiancai qiancai self-assigned this Nov 24, 2023
@xzhangxian1008
Copy link
Contributor

/assign

Copy link
Contributor

@xzhangxian1008 xzhangxian1008 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 Dec 25, 2023

@xzhangxian1008: 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.

@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 Jan 5, 2024
Copy link
Member

@lilin90 lilin90 left a comment

Choose a reason for hiding this comment

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

/lgtm

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 5, 2024
Copy link

ti-chi-bot bot commented Jan 5, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-05 08:42:57.153372551 +0000 UTC m=+766.737626238: ☑️ agreed by lilin90.

@lilin90 lilin90 added the lgtm label Jan 5, 2024
@qiancai
Copy link
Collaborator Author

qiancai commented Jan 5, 2024

/approve

Copy link

ti-chi-bot bot commented Jan 5, 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 5, 2024
@ti-chi-bot ti-chi-bot bot merged commit c1f2426 into pingcap:master Jan 5, 2024
5 of 6 checks passed
@qiancai qiancai added the 2024-tidb-docs-dash This issue or PR is included in the 2024 TiDB Docs Dash event. label Jan 10, 2024
`ASCII()` 函数用于获取输入的参数中最左字符的 ASCII 值。该参数可以为字符串或数字。

- 如果输入参数不为空,该函数返回参数中最左字符的 ASCII 值。
- 如果输入参数为空,该函数返回 `0`。
Copy link
Contributor

Choose a reason for hiding this comment

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

如果输入参数为空,该函数返回 0

这里的空,其实是指空字符串。

- 如果输入参数为负数,该函数会将该参数的绝对值转换为其二进制值,然后对二进制值的每位取反(`0` 变为 `1`,`1` 变为 `0`),最后加上 `1`。
- 如果输入参数为字符串,且该字符串中只包含数字,该函数将按照该数字返回结果。例如,`"123"` 与 `123` 的返回结果相同。
- 如果输入参数为字符串,且该字符串第一个字符不是数字(如 `"q123"`),该函数返回 `0`。
- 如果输入参数为字符串,且该字符串由数字和非数字组成,该函数将按照该参数中最前面连续的数字返回结果。例如,`“123q123”` 与 `123` 的返回结果相同。
Copy link
Contributor

Choose a reason for hiding this comment

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

“123q123”

这是中文引号,需要更新一下 "123q123"

Copy link
Contributor

Choose a reason for hiding this comment

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

benmaoer pushed a commit to benmaoer/docs-cn that referenced this pull request Jan 22, 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 lgtm needs-1-more-lgtm Indicates a PR needs 1 more 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. type/enhancement The issue or PR belongs to an enhancement.
Development

Successfully merging this pull request may close these issues.

Enrich instructions for string functions ASCII() and BIN()
4 participants