[CP][BUGFIX] fix trim process single outrow lob

This commit is contained in:
skylhd
2024-03-15 11:45:43 +00:00
committed by ob-robot
parent eec6a7d098
commit 1dc1bc30e7
5 changed files with 134 additions and 34 deletions

View File

@ -194,3 +194,63 @@ select TRIM(LEADING 'a' FROM TRIM(SUBSTR(REPEAT(NULL, 4 + 1), 1, LEAST(146, 20))
| NULL |
+-----------------------------------------------------------------------------+
create table t1 (c1 longtext);
insert into t1 values(concat(repeat(' ', 256*1024), 'ad'));
insert into t1 values(concat('ad', repeat(' ', 256*1024)));
insert into t1 values(concat(repeat(' ', 256*1024), 'ad', repeat(' ', 256*1024)));
select length(c1) from t1;
+------------+
| length(c1) |
+------------+
| 262146 |
| 262146 |
| 524290 |
+------------+
select length(trim(c1)), trim(c1) from t1;
+------------------+----------+
| length(trim(c1)) | trim(c1) |
+------------------+----------+
| 2 | ad |
| 2 | ad |
| 2 | ad |
+------------------+----------+
drop table t1;
create table t1 (c1 longtext);
insert into t1 values(concat(repeat('abcd', 600*1024), 'xx'));
insert into t1 values(concat('xx', repeat('abcd', 600*1024)));
insert into t1 values(concat(repeat('abcd', 600*1024), 'xx', repeat('abcd', 600*1024)));
select length(c1) from t1;
+------------+
| length(c1) |
+------------+
| 2457602 |
| 2457602 |
| 4915202 |
+------------+
select length(trim(leading 'abcd' from c1)) from t1;
+--------------------------------------+
| length(trim(leading 'abcd' from c1)) |
+--------------------------------------+
| 2 |
| 2457602 |
| 2457602 |
+--------------------------------------+
select length(trim(trailing 'abcd' from c1)) from t1;
+---------------------------------------+
| length(trim(trailing 'abcd' from c1)) |
+---------------------------------------+
| 2457602 |
| 2 |
| 2457602 |
+---------------------------------------+
select length(trim(both 'abcd' from c1)) from t1;
+-----------------------------------+
| length(trim(both 'abcd' from c1)) |
+-----------------------------------+
| 2 |
| 2 |
| 2 |
+-----------------------------------+
drop table t1;

View File

@ -70,5 +70,23 @@ select collation(TRIM( BOTH _binary'a' FROM _gbk'abc' )) ;
select TRIM(LEADING 'a' FROM TRIM(SUBSTR(REPEAT(NULL, 4 + 1), 1, LEAST(146, 20))));
create table t1 (c1 longtext);
insert into t1 values(concat(repeat(' ', 256*1024), 'ad'));
insert into t1 values(concat('ad', repeat(' ', 256*1024)));
insert into t1 values(concat(repeat(' ', 256*1024), 'ad', repeat(' ', 256*1024)));
select length(c1) from t1;
select length(trim(c1)), trim(c1) from t1;
drop table t1;
create table t1 (c1 longtext);
insert into t1 values(concat(repeat('abcd', 600*1024), 'xx'));
insert into t1 values(concat('xx', repeat('abcd', 600*1024)));
insert into t1 values(concat(repeat('abcd', 600*1024), 'xx', repeat('abcd', 600*1024)));
select length(c1) from t1;
select length(trim(leading 'abcd' from c1)) from t1;
select length(trim(trailing 'abcd' from c1)) from t1;
select length(trim(both 'abcd' from c1)) from t1;
drop table t1;
connection syscon;
--sleep 2