expr repeat/space/lrpad opt for text type

This commit is contained in:
skylhd
2023-06-13 02:12:20 +00:00
committed by ob-robot
parent 48544979bf
commit 05295dd0f6
7 changed files with 149 additions and 36 deletions

View File

@ -82,3 +82,17 @@ select repeat(1.414, 2);
select repeat("abc", 200000000);
ERROR HY000: Result of repeat() was larger than max_allowed_packet (4194304) - truncated
drop table t2;
create table t2 as select repeat('a', 512),repeat('a', 513),repeat('a',32767),repeat('a',32768),repeat('a',65535),repeat('a',65536) from dual;
desc t2;
+-------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+--------------+------+-----+---------+-------+
| repeat('a', 512) | varchar(512) | YES | | NULL | |
| repeat('a', 513) | text | YES | | NULL | |
| repeat('a',32767) | text | YES | | NULL | |
| repeat('a',32768) | text | YES | | NULL | |
| repeat('a',65535) | text | YES | | NULL | |
| repeat('a',65536) | longtext | YES | | NULL | |
+-------------------+--------------+------+-----+---------+-------+
drop table t2;

View File

@ -33,6 +33,12 @@ select repeat(1.414, 2);
--error 1301
select repeat("abc", 200000000);
--error 0,1051
drop table t2;
create table t2 as select repeat('a', 512),repeat('a', 513),repeat('a',32767),repeat('a',32768),repeat('a',65535),repeat('a',65536) from dual;
desc t2;
drop table t2;
--enable_warnings
connection syscon;