Skip to content

Commit 0caa6bf

Browse files
grooverdanvuvova
authored andcommitted
MDEV-25704 more tests
1 parent 3607da3 commit 0caa6bf

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

mysql-test/main/func_str.result

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5320,6 +5320,63 @@ NULL
53205320
SELECT random_bytes(2056);
53215321
random_bytes(2056)
53225322
NULL
5323+
SELECT length(random_bytes(10.0));
5324+
length(random_bytes(10.0))
5325+
10
5326+
SELECT length(random_bytes(10.1));
5327+
length(random_bytes(10.1))
5328+
10
5329+
SELECT length(random_bytes(+1e1));
5330+
length(random_bytes(+1e1))
5331+
10
5332+
SELECT length(random_bytes(time("00:01")));
5333+
length(random_bytes(time("00:01")))
5334+
100
5335+
SELECT length(random_bytes("10.0"));
5336+
length(random_bytes("10.0"))
5337+
10
5338+
Warnings:
5339+
Warning 1292 Truncated incorrect INTEGER value: '10.0'
5340+
Warning 1292 Truncated incorrect INTEGER value: '10.0'
5341+
SELECT length(random_bytes("10.1"));
5342+
length(random_bytes("10.1"))
5343+
10
5344+
Warnings:
5345+
Warning 1292 Truncated incorrect INTEGER value: '10.1'
5346+
Warning 1292 Truncated incorrect INTEGER value: '10.1'
5347+
SELECT length(random_bytes("+1e1"));
5348+
length(random_bytes("+1e1"))
5349+
1
5350+
Warnings:
5351+
Warning 1292 Truncated incorrect INTEGER value: '+1e1'
5352+
Warning 1292 Truncated incorrect INTEGER value: '+1e1'
5353+
SELECT length(random_bytes("10.0bunnies"));
5354+
length(random_bytes("10.0bunnies"))
5355+
10
5356+
Warnings:
5357+
Warning 1292 Truncated incorrect INTEGER value: '10.0bunnies'
5358+
Warning 1292 Truncated incorrect INTEGER value: '10.0bunnies'
5359+
SELECT length(random_bytes("10.1chickens"));
5360+
length(random_bytes("10.1chickens"))
5361+
10
5362+
Warnings:
5363+
Warning 1292 Truncated incorrect INTEGER value: '10.1chickens'
5364+
Warning 1292 Truncated incorrect INTEGER value: '10.1chickens'
5365+
SELECT length(random_bytes("+1e1rabbits"));
5366+
length(random_bytes("+1e1rabbits"))
5367+
1
5368+
Warnings:
5369+
Warning 1292 Truncated incorrect INTEGER value: '+1e1rabbits'
5370+
Warning 1292 Truncated incorrect INTEGER value: '+1e1rabbits'
5371+
create procedure p1()
5372+
begin
5373+
declare r ROW (c1 INT);
5374+
set r.c1= 10;
5375+
select random_bytes(r);
5376+
end|
5377+
call p1();
5378+
ERROR 21000: Operand should contain 1 column(s)
5379+
drop procedure p1;
53235380
#
53245381
# Test For invalid argument return NULL
53255382
#

mysql-test/main/func_str.test

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,6 +2229,29 @@ SELECT random_bytes(1025);
22292229
SELECT random_bytes(11111);
22302230
SELECT random_bytes(2056);
22312231

2232+
SELECT length(random_bytes(10.0));
2233+
SELECT length(random_bytes(10.1));
2234+
SELECT length(random_bytes(+1e1));
2235+
SELECT length(random_bytes(time("00:01")));
2236+
SELECT length(random_bytes("10.0"));
2237+
SELECT length(random_bytes("10.1"));
2238+
SELECT length(random_bytes("+1e1"));
2239+
SELECT length(random_bytes("10.0bunnies"));
2240+
SELECT length(random_bytes("10.1chickens"));
2241+
SELECT length(random_bytes("+1e1rabbits"));
2242+
2243+
--delimiter |
2244+
create procedure p1()
2245+
begin
2246+
declare r ROW (c1 INT);
2247+
set r.c1= 10;
2248+
select random_bytes(r);
2249+
end|
2250+
--delimiter ;
2251+
--error 1241
2252+
call p1();
2253+
drop procedure p1;
2254+
22322255
--echo #
22332256
--echo # Test For invalid argument return NULL
22342257
--echo #

0 commit comments

Comments
 (0)