From 16bc3c4bd84ef86b431d970f035354d9e382b580 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 20 Feb 2024 16:50:14 +0800 Subject: [PATCH 1/9] Add temp.md --- temp.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 temp.md diff --git a/temp.md b/temp.md new file mode 100644 index 0000000000000..af27ff4986a7b --- /dev/null +++ b/temp.md @@ -0,0 +1 @@ +This is a test file. \ No newline at end of file From dc19b1e653a4486f9d0de6dbcef5dc8ed1f57529 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 20 Feb 2024 16:50:18 +0800 Subject: [PATCH 2/9] Delete temp.md --- temp.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 temp.md diff --git a/temp.md b/temp.md deleted file mode 100644 index af27ff4986a7b..0000000000000 --- a/temp.md +++ /dev/null @@ -1 +0,0 @@ -This is a test file. \ No newline at end of file From 477629906dbf773bac1a19339e0b955d900a4dc1 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Mon, 26 Feb 2024 14:17:56 +0800 Subject: [PATCH 3/9] Update descriptions for UCASE() and UNHEX() --- functions-and-operators/string-functions.md | 44 ++++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/functions-and-operators/string-functions.md b/functions-and-operators/string-functions.md index 7c3762a95d949..d70b8a5f0ae8c 100644 --- a/functions-and-operators/string-functions.md +++ b/functions-and-operators/string-functions.md @@ -1388,11 +1388,51 @@ Remove leading and trailing spaces. ### [`UCASE()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_ucase) -Synonym for `UPPER()`. +The `UCASE()` function is used to convert a string to uppercase letters. This function is equivalent to the `UPPER()` function. + +> **Note:** +> +> When the string is `NULL`, the `UCASE()` function returns `NULL`. + +Example: + +```sql +SELECT upper('bigdata') AS result_upper, upper('null') AS result_null; +``` + +Result: + +```sql ++--------------+-------------+ +| result_upper | result_null | ++--------------+-------------+ +| BIGDATA | NULL | ++--------------+-------------+ +``` ### [`UNHEX()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_unhex) -Return a string containing hex representation of a number. +The `UNHEX()` function performs the reverse operation of the `HEX()` function. It treats each pair of characters in the argument as a hexadecimal number and converts it to the character represented by that number, returning the result as a binary string. + +> **Note:** +> +> The argument string must be a valid hexadecimal value that contains `0`~`9`, `A`~`F`, `a`~`f`. If the argument string is `NULL` or falls outside this range, it returns `NULL`. + +Example: + +```sql +SELECT UNHEX('54694442'); +``` + +Result: + +```sql ++--------------------------------------+ +| UNHEX('54694442') | ++--------------------------------------+ +| 0x54694442 | ++--------------------------------------+ +``` ### [`UPPER()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_upper) From 63b2bb689b78f432d3ac8d9ce27d5ffdf54edf72 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Mon, 26 Feb 2024 14:35:03 +0800 Subject: [PATCH 4/9] Update wording --- functions-and-operators/string-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions-and-operators/string-functions.md b/functions-and-operators/string-functions.md index d70b8a5f0ae8c..3c1cbdb6d4fb8 100644 --- a/functions-and-operators/string-functions.md +++ b/functions-and-operators/string-functions.md @@ -1400,7 +1400,7 @@ Example: SELECT upper('bigdata') AS result_upper, upper('null') AS result_null; ``` -Result: +Output: ```sql +--------------+-------------+ @@ -1424,7 +1424,7 @@ Example: SELECT UNHEX('54694442'); ``` -Result: +Output: ```sql +--------------------------------------+ From 15d2e4cac556684b93687d844b2245a87289a840 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 27 Feb 2024 11:30:57 +0800 Subject: [PATCH 5/9] Apply suggestions from code review Co-authored-by: Grace Cai --- functions-and-operators/string-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-and-operators/string-functions.md b/functions-and-operators/string-functions.md index 3c1cbdb6d4fb8..353039d681a07 100644 --- a/functions-and-operators/string-functions.md +++ b/functions-and-operators/string-functions.md @@ -1416,7 +1416,7 @@ The `UNHEX()` function performs the reverse operation of the `HEX()` function. I > **Note:** > -> The argument string must be a valid hexadecimal value that contains `0`~`9`, `A`~`F`, `a`~`f`. If the argument string is `NULL` or falls outside this range, it returns `NULL`. +> The argument must be a valid hexadecimal value that contains `0`~`9`, `A`~`F`, or `a`~`f`. If the argument is `NULL` or falls outside this range, the function returns `NULL`. Example: From bf42534c16b2bf9f76c866c148b2ba58e8c50f90 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 27 Feb 2024 11:33:26 +0800 Subject: [PATCH 6/9] Try another format --- functions-and-operators/string-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-and-operators/string-functions.md b/functions-and-operators/string-functions.md index 353039d681a07..0d5e5e290c64c 100644 --- a/functions-and-operators/string-functions.md +++ b/functions-and-operators/string-functions.md @@ -1416,7 +1416,7 @@ The `UNHEX()` function performs the reverse operation of the `HEX()` function. I > **Note:** > -> The argument must be a valid hexadecimal value that contains `0`~`9`, `A`~`F`, or `a`~`f`. If the argument is `NULL` or falls outside this range, the function returns `NULL`. +> The argument must be a valid hexadecimal value that contains `0`-`9`, `A`-`F`, or `a`-`f`. If the argument is `NULL` or falls outside this range, the function returns `NULL`. Example: From a9a6bb034963f5c1866941d0ba8ebd9f5dd4fb3d Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 27 Feb 2024 11:38:45 +0800 Subject: [PATCH 7/9] Use en dash to represent the range --- functions-and-operators/string-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-and-operators/string-functions.md b/functions-and-operators/string-functions.md index 0d5e5e290c64c..26b9707ba6877 100644 --- a/functions-and-operators/string-functions.md +++ b/functions-and-operators/string-functions.md @@ -1416,7 +1416,7 @@ The `UNHEX()` function performs the reverse operation of the `HEX()` function. I > **Note:** > -> The argument must be a valid hexadecimal value that contains `0`-`9`, `A`-`F`, or `a`-`f`. If the argument is `NULL` or falls outside this range, the function returns `NULL`. +> The argument must be a valid hexadecimal value that contains `0`–`9`, `A`–`F`, or `a`–`f`. If the argument is `NULL` or falls outside this range, the function returns `NULL`. Example: From 7878a9b5dd374650abf72c0aadc2ff37fad85fc4 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 27 Feb 2024 14:38:16 +0800 Subject: [PATCH 8/9] Update function example --- functions-and-operators/string-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-and-operators/string-functions.md b/functions-and-operators/string-functions.md index 26b9707ba6877..d5102357e1951 100644 --- a/functions-and-operators/string-functions.md +++ b/functions-and-operators/string-functions.md @@ -1397,7 +1397,7 @@ The `UCASE()` function is used to convert a string to uppercase letters. This fu Example: ```sql -SELECT upper('bigdata') AS result_upper, upper('null') AS result_null; +SELECT UCASE('bigdata') AS result_upper, UCASE('null') AS result_null; ``` Output: From 0b983cc4c6816de3041e5ccf17479918675651b5 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 27 Feb 2024 14:45:17 +0800 Subject: [PATCH 9/9] Update "null" to null in the example --- functions-and-operators/string-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions-and-operators/string-functions.md b/functions-and-operators/string-functions.md index d5102357e1951..e0eb9058ff087 100644 --- a/functions-and-operators/string-functions.md +++ b/functions-and-operators/string-functions.md @@ -1392,12 +1392,12 @@ The `UCASE()` function is used to convert a string to uppercase letters. This fu > **Note:** > -> When the string is `NULL`, the `UCASE()` function returns `NULL`. +> When the string is null, the `UCASE()` function returns `NULL`. Example: ```sql -SELECT UCASE('bigdata') AS result_upper, UCASE('null') AS result_null; +SELECT UCASE('bigdata') AS result_upper, UCASE(null) AS result_null; ``` Output: