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

add detail desc for String Function SUBSTRING_INDEX () and TO_BASE64 #16112

Merged
merged 7 commits into from
Jan 30, 2024

Conversation

lyssom
Copy link
Contributor

@lyssom lyssom commented Jan 10, 2024

Fix #15950

First-time contributors' checklist

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

  • master (the latest development version)
  • v7.6 (TiDB 7.6 versions)
  • 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 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. labels Jan 10, 2024
Copy link

ti-chi-bot bot commented Jan 10, 2024

Welcome @lyssom!

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

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-cn. 😃

@ti-chi-bot ti-chi-bot bot added 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 10, 2024
@qiancai qiancai added 2024-tidb-docs-dash This issue or PR is included in the 2024 TiDB Docs Dash event. translation/doing This PR’s assignee is translating this PR. labels Jan 10, 2024
@ti-chi-bot ti-chi-bot bot removed the missing-translation-status This PR does not have translation status info. label Jan 10, 2024
@qiancai qiancai changed the title add detail desc for String Function add detail desc for String Function SUBSTRING_INDEX () and TO_BASE64 Jan 10, 2024
@rpaik rpaik requested a review from Oreoxmt January 10, 2024 19:05
@@ -292,11 +292,34 @@ SELECT BIN("123q123");

### [`SUBSTRING_INDEX()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_substring-index)

从一个字符串中返回指定出现次数的定界符之前的子字符串
定义:返回字符串str中出现count次分隔符delim之前的子字符串。如果count为正数,则返回最终分隔符左侧的所有内容(从左侧算起)。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
定义:返回字符串str中出现count次分隔符delim之前的子字符串。如果count为正数,则返回最终分隔符左侧的所有内容(从左侧算起)。
定义: 返回字符串 str 中出现第 count 次分隔符 delim 之前的子字符串。如果 count 为正数,则返回最终分隔符左侧的所有内容(从左侧算起)。

从一个字符串中返回指定出现次数的定界符之前的子字符串
定义:返回字符串str中出现count次分隔符delim之前的子字符串。如果count为正数,则返回最终分隔符左侧的所有内容(从左侧算起)。
如果count为负数,则返回最终分隔符右侧(从右侧计数)的所有内容。
SUBSTRING_INDEX()在搜索delim时执行区分大小写的匹配
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
SUBSTRING_INDEX()在搜索delim时执行区分大小写的匹配
SUBSTRING_INDEX() 在搜索 delim 时执行大小写敏感的匹配

定义:返回字符串str中出现count次分隔符delim之前的子字符串。如果count为正数,则返回最终分隔符左侧的所有内容(从左侧算起)。
如果count为负数,则返回最终分隔符右侧(从右侧计数)的所有内容。
SUBSTRING_INDEX()在搜索delim时执行区分大小写的匹配
语法:SUBSTRING_INDEX(str,delim,count)
Copy link
Contributor

Choose a reason for hiding this comment

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

参数和逗号之间请加空格

Suggested change
语法SUBSTRING_INDEX(str,delim,count)
语法: SUBSTRING_INDEX(str, delim, count)


### [`TO_BASE64()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_to-base64)

返回转化为 base-64 表示的字符串参数
定义:将字符串参数转换为base-64编码形式,并将结果作为具有连接字符集和排序规则的字符串返回。
如果参数不是字符串,则在转换之前将其转换为字符串。
Copy link
Contributor

Choose a reason for hiding this comment

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

定义中无需换行


### [`TO_BASE64()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_to-base64)

返回转化为 base-64 表示的字符串参数
定义:将字符串参数转换为base-64编码形式,并将结果作为具有连接字符集和排序规则的字符串返回。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
定义:将字符串参数转换为base-64编码形式,并将结果作为具有连接字符集和排序规则的字符串返回
定义: 将字符串参数转换为 base-64 编码形式,并将带有连接字符集和 collation 的字符串作为结果返回

collation 无需翻译,直接写 collation 就行

Base-64编码的字符串可以使用FROM_BASE64()函数进行解码。
语法:TO_BASE64(str)
参数: str,必须项。待编码的字符串。
返回值:base-64编码
Copy link
Contributor

Choose a reason for hiding this comment

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

@qiancai 我们的文档中需要写返回值吗?

如果参数为NULL,则结果为NULL。
Base-64编码的字符串可以使用FROM_BASE64()函数进行解码。
语法:TO_BASE64(str)
参数: str,必须项。待编码的字符串。
Copy link
Contributor

Choose a reason for hiding this comment

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

参数后面的格式是否有问题 @qiancai

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 12, 2024
@@ -292,11 +292,40 @@ SELECT BIN("123q123");

### [`SUBSTRING_INDEX()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_substring-index)

从一个字符串中返回指定出现次数的定界符之前的子字符串

定义:返回字符串 str 中出现 count 次分隔符 delim 之前的子字符串。如果 count 为正数,则返回最终分隔符左侧的所有内容(从左侧算起)。如果 count 为负数,则返回最终分隔符右侧(从右侧计数)的所有内容。SUBSTRING_INDEX() 在搜索 delim 时执行区分大小写的匹配
Copy link
Contributor

Choose a reason for hiding this comment

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

冒号后面请添加空格,其它的地方同样。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

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 Jan 19, 2024

@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 self-assigned this Jan 23, 2024
@qiancai qiancai removed the request for review from Oreoxmt January 23, 2024 15:37
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 26, 2024
@qiancai
Copy link
Collaborator

qiancai commented Jan 26, 2024

Hi @lyssom, I've submitted the commit 92ef24f to refine some descriptions and unify the formats. And I updated "www.tidb.com" to "www.tidbcloud.com" because the latter is a valid web address. Would you please check whether the commit is OK? Thanks.

Copy link

ti-chi-bot bot commented Jan 29, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-29 04:04:34.662607958 +0000 UTC m=+1365516.226905648: ☑️ agreed by qiancai.

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

qiancai commented Jan 30, 2024

/test pull-verify

@purelind
Copy link

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Jan 30, 2024
@qiancai
Copy link
Collaborator

qiancai commented Jan 30, 2024

/test pull-verify

@qiancai
Copy link
Collaborator

qiancai commented Jan 30, 2024

/approve

@qiancai qiancai added the lgtm label Jan 30, 2024
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 4fa7522 into pingcap:master Jan 30, 2024
@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 5, 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 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 needs-1-more-lgtm Indicates a PR needs 1 more LGTM. ok-to-test Indicates a PR is ready to be tested. size/L Denotes a PR that changes 100-499 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 Documentation: 完善字符串函数 SUBSTRING_INDEX() 和 TO_BASE64() 的文档说明
4 participants