fix: close issue 59446 make oct("") same as mysql (#61767)

close pingcap/tidb#59446
This commit is contained in:
yihong
2025-07-15 10:10:51 +08:00
committed by GitHub
parent adbdf3f0c7
commit 2f4f559b83
5 changed files with 36 additions and 4 deletions

View File

@ -2007,6 +2007,21 @@ oct("aaaa") oct("-1.9") oct("-9999999999999999999999999") oct("99999999999999999
select oct(-1.9), oct(1.9), oct(-1), oct(1), oct(-9999999999999999999999999), oct(9999999999999999999999999);
oct(-1.9) oct(1.9) oct(-1) oct(1) oct(-9999999999999999999999999) oct(9999999999999999999999999)
1777777777777777777777 1 1777777777777777777777 1 1777777777777777777777 1777777777777777777777
select oct(""), oct(" "), oct(NULL);
oct("") oct(" ") oct(NULL)
NULL 0 NULL
drop table if exists t_oct;
CREATE TABLE t_oct (a VARCHAR(20));
INSERT INTO t_oct VALUES (''), (' '), (NULL), ('123'), ('abc'), ('0'), ('255');
SELECT oct(CONCAT(a, '')) FROM t_oct;
oct(CONCAT(a, ''))
NULL
0
NULL
173
0
0
377
select find_in_set("", ""), find_in_set("", ","), find_in_set("中文", "字符串,中文"), find_in_set("b,", "a,b,c,d");
find_in_set("", "") find_in_set("", ",") find_in_set("中文", "字符串,中文") find_in_set("b,", "a,b,c,d")
0 1 2 0