github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/function/func_string_length.result (about) 1 CREATE TABLE t1 (s CHAR(8)); 2 INSERT INTO t1 VALUES ('test'); 3 SELECT LENGTH(s) FROM t1; 4 length(s) 5 4 6 CREATE TABLE t2 (s CHAR(10)); 7 INSERT INTO t2 VALUES ('1234589002'); 8 SELECT LENGTH(s) FROM t2; 9 length(s) 10 10 11 drop table t1; 12 drop table t2; 13 CREATE TABLE t1 (s char(8), b CHAR(100), c VARCHAR(255), d int, e float, f datetime); 14 INSERT INTO t1 VALUES ('test', "hhhhhhh", "12jknfjniosdjcoijcpowef", 1234, 0.14123123, "2012-02-08 12:03:23"); 15 SELECT LENGTH(s), length(b), length(c), length(d), length(e), length(f) FROM t1; 16 length(s) length(b) length(c) length(d) length(e) length(f) 17 4 7 23 4 10 19 18 DROP TABLE t1; 19 CREATE TABLE t1 (t1_fld1 int, b varchar(255)); 20 CREATE TABLE t2 (t2_fld1 int, b varchar(255)); 21 CREATE TABLE t3 (t3_fld1 int, b varchar(255)); 22 INSERT INTO t1 select LENGTH(space(300)), "abcdefg"; 23 INSERT INTO t1 select LENGTH(space(300)), "123124141"; 24 INSERT INTO t2 select LENGTH(space(65680)), "abcdefg"; 25 invalid input: the space count is greater than max allowed value 8000 26 INSERT INTO t2 select LENGTH(space(65680)), "1238193"; 27 invalid input: the space count is greater than max allowed value 8000 28 INSERT INTO t3 select LENGTH(space(65680)), "1238193"; 29 invalid input: the space count is greater than max allowed value 8000 30 INSERT INTO t3 select LENGTH(space(16777300)),"123124141"; 31 invalid input: the space count is greater than max allowed value 8000 32 INSERT INTO t3 select LENGTH(space(16777300)),"123asdq"; 33 invalid input: the space count is greater than max allowed value 8000 34 SELECT DISTINCT * from t1; 35 t1_fld1 b 36 300 abcdefg 37 300 123124141 38 SELECT t1.t1_fld1, t2.t2_fld1, t3.t3_fld1 FROM t1 JOIN t2 JOIN t3 ON (length(t1.b) = length(t2.b)); 39 t1_fld1 t2_fld1 t3_fld1 40 drop table t1; 41 drop table t2; 42 drop table t3; 43 select length('\n\t\r\b\0\_\%\\'); 44 length(\n\t\r\b\0\_\%\\) 45 10 46 select length(12314124); 47 length(12314124) 48 8 49 select length(0.14123124124); 50 length(0.14123124124) 51 13 52 select length('1039214-#**$&#@*#(*($*'); 53 length(1039214-#**$&#@*#(*($*) 54 22 55 select length(NULL); 56 length(null) 57 null 58 select length("中文"); 59 length(中文) 60 6 61 CREATE TABLE t1 (a varchar(10)); 62 INSERT INTO t1 VALUES ('abc'), ('xyz'); 63 SELECT a, CONCAT_WS(",",a,' ',a) AS c FROM t1 64 HAVING LENGTH(REVERSE(c)) >0; 65 SQL syntax error: column "t1.a" must appear in the GROUP BY clause or be used in an aggregate function 66 DROP TABLE t1; 67 select length(space(1)) as a; 68 a 69 1 70 select length(space(1024*1024*1024)) as a; 71 invalid input: the space count is greater than max allowed value 8000 72 select length(space(1024*1024)) as a; 73 invalid input: the space count is greater than max allowed value 8000 74 select length(space(1024*1024*1024)) as a; 75 invalid input: the space count is greater than max allowed value 8000 76 drop table if exists t1; 77 create table t1(a INT, b date); 78 insert into t1 values(1, "2012-10-12"),(2, "2004-04-24"),(3, "2008-12-04"),(4, "2012-03-23"); 79 select * from t1 where length(b)-8>0; 80 a b 81 1 2012-10-12 82 2 2004-04-24 83 3 2008-12-04 84 4 2012-03-23 85 drop table t1; 86 DROP table if exists t1; 87 CREATE TABLE t1 (s BLOB); 88 INSERT INTO t1 VALUES ('test'); 89 SELECT LENGTH(s) FROM t1; 90 length(s) 91 4 92 CREATE TABLE t2 (s BLOB); 93 INSERT INTO t2 VALUES ('1234589002'); 94 SELECT LENGTH(s) FROM t2; 95 length(s) 96 10 97 drop table t1; 98 drop table t2;