|
|
|
|
Quelle sp.result
Sprache: Lisp
|
|
set @save_character_set_client=@@character_set_client;
set @save_userstat=@@global.userstat, @@global.userstat= 0;
use test;
create table t1 (
id char(16) not null default '',
data int not null
);
create table t2 (
s char(16),
i int,
d double
);
create procedure foo42()
insert into test.t1 values ("foo", 42);
call foo42();
select * from t1;
id data
foo 42
delete from t1;
drop procedure foo42;
create procedure bar(x char(16), y int)
insert into test.t1 values (x, y);
call bar("bar", 666);
select * from t1;
id data
bar 666
delete from t1;
create procedure empty()
begin
end|
call empty()|
drop procedure empty|
create procedure scope(a int, b float)
begin
declare b int;
declare c float;
begin
declare c int;
end;
end|
drop procedure scope|
create procedure two(x1 char(16), x2 char(16), y int)
begin
insert into test.t1 values (x1, y);
insert into test.t1 values (x2, y);
end|
call two("one", "two", 3)|
select * from t1|
id data
one 3
two 3
delete from t1|
drop procedure two|
create procedure locset(x char(16), y int)
begin
declare z1, z2 int;
set z1 = y;
set z2 = z1+2;
insert into test.t1 values (x, z2);
end|
call locset("locset", 19)|
select * from t1|
id data
locset 21
delete from t1|
drop procedure locset|
create procedure setcontext()
begin
declare data int default 2;
insert into t1 (id, data) values ("foo", 1);
replace t1 set data = data, id = "bar";
update t1 set id = "kaka", data = 3 where t1.data = data;
end|
call setcontext()|
select * from t1 order by data|
id data
foo 1
kaka 3
delete from t1|
drop procedure setcontext|
create table t3 ( d date, i int, f double, s varchar(32) )|
create procedure nullset()
begin
declare ld date;
declare li int;
declare lf double;
declare ls varchar(32);
set ld = null, li = null, lf = null, ls = null;
insert into t3 values (ld, li, lf, ls);
insert into t3 (i, f, s) values ((ld is null), 1, "ld is null"),
((li is null), 1, "li is null"),
((li = 0), null, "li = 0"),
((lf is null), 1, "lf is null"),
((lf = 0), null, "lf = 0"),
((ls is null), 1, "ls is null");
end|
call nullset()|
select * from t3|
d i f s
NULL NULL NULL NULL
NULL 1 1 ld is null
NULL 1 1 li is null
NULL NULL NULL li = 0
NULL 1 1 lf is null
NULL NULL NULL lf = 0
NULL 1 1 ls is null
drop table t3|
drop procedure nullset|
create procedure mixset(x char(16), y int)
begin
declare z int;
set @z = y, z = 666, max_join_size = 100;
insert into testupdatet3 a=;
end|
call mixset("mixset", 19)|
show FLUSH TABLES
Variable_name Value
max_join_size 100
select id,data,@z from t1|
call java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 30
mixset 666 s @max_sp_recursion_depth=|
delete from t1|
drop procedure mixset|
create procedure zip(x char(16), y int)
begin
declare
call zap(y, z);
call bar(x, z);
end|
create procedure zap(x int, out y int)
begin
declare z int;
set z = x+1, y = z;
end|
call zip("zip", 99)|
select * from t1|
id data
zip 100
delete from t1|
drop procedure zip|
drop procedure bar|
call zap(7, @zap)|
select @zap|
@zap
8
drop procedure zap|
create procedure c1(x int)
call c2("c", x)|
create procedure c2(s char(16), x int)
call c3(x, s)|
create procedure c3(x int, s char(16))
call c4("level", x, s)|
create procedure c4(l char(8), x int, s char(16))
insert into t1 values (java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
call c1(42)|
select * java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
id java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5
levelc 42
delete from t1|
drop procedure c1|
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 1
drop procedure c3|
drop procedure c4
7
begin
call inc2(x2, y);
insert into test.t1 values (x1, y);
end|
create procedure inc2(x char(16), y int)
begin
callinc(y);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
end|
create procedure inc(inout iojava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
set io = io + 1|
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 29
*t1 bydesc|
id data
io2 2
io1 1
delete from t1|
drop procedure iotest|
drop procedure inc2|
create procedure incr int)
call inc(x)|
select @zap|
@zap
8
call incr(@zap)|
zp|
@zap
9
drop procedure inc|
drop procedure incr|
create procedure cbv1()
begin
declare yint 3;
call cbv2(+1 )
insert into test.t1 values ("cbv1", y);
end
return @;
begin
set y2 = 4711;
insert into test.java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 2
leve
call cbv1()|
select * from t1 order by data|
id data
cbv2 4
cbv1 4711
deletejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
drop procedure cbv1|
drop java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
insert into t2 values ("a", 1, 1.1), a
create procedure sub1(id char(16), x int)
insert into test.t1 values (id, x)|
create procedure sub2(id char(16))
begin
declare x int;
set x = (select sum(t.i) from java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 25
insert select * fr t3|
|
create function sub3(i int) returns int deterministic
return +|
call sub1("sub1a"a
call sub1("sub1b", (select max(i) from t2))|
call sub1("sub1c", (java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 2
ERROR HY000@
call sub1(sub1d,( (java.lang.StringIndexOutOfBoundsException: Range [41, 41) out of bounds for length 1
call sub2("sub2"#Restore theold
select * fromcall bug10100pc(1,5)|
iddata
sub1a 7
sub1b 3
sub1d 1
sub2 6
drop function bug9902|
sub3((select max(level
4
drop procedure sub1|
drop procedure sub2|
drop function sub3|
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
delete fromcreate function bug9102lv
create procedure a0(x int)
while x do
set x = x-1;
insert into test.t1 values ("a0", x);
end while|
calla0()java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
select *from t1 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
id data
a0 2
a0 1
a0 0
deleteselectjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
drop procedure a0|
create procedure a(x int)
while x >java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
set x b()
insert into test.t1 values ("a"level
end while|
call a(a
select * from t1 order by data desc|
id data
a 2
a 1
a 0
delete from t1bfunctionbug9102|
drop procedure a|
create procedure b(xlv
repeat
insert into test.t1 values (repeat("b",3), x);
set x = x-1;
until x = 0 end repeat|
allb()|
select * from t1 order by data desc|
id data
bbb 3
bbb 2
bbblevel
delete from t1|
drop procedure b|
create procedure b2(x int)
repeat(select 1) intojava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
insert into test.t1 values (java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 2
set x = x-1;
until =e java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
drop procedure b2|
create procedure c(x int)
hmm: while x > 0 do
insert into testselect java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 1
set x = x-1;
iterate hmm;
insertjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
end while hmm|
call c(3)|
select *from order datajava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
id data
c 3
c 2
c 1
delete from t1|
drop procedure c|
create procedure d(x int)
hmm: while x > 0 do
insert into test.t1 values ("d", x);
set x = x-1;
leave hmm;
insert into test.t1 values ("x", x);
end while|
call d(3)|
select * from t1|
id data
d 3
delete from t1|
drop procedure d|
create procedure e(x int)
foo: loop
if x = 0 then
leave foo;
end if;
insert into test.set @@max_sp_recursion_depth=0|
set x = x-1;
end loop foo|
call e(3)|
select * from t1 order by data desc|
id data
e 3
e 2
e 1
delete from t1|
drop procedure drop procedure e
create procedure f(x int)
if x < 0 then
insert
elseif x = 0 then
insert into test.t1 values ("f", 1);
else
insert into test.t1 values ("f", 2);
end if|
call f(-2)|
call f(0)|
call f(4)
select * from t1 order by data|
id data
f 0
f 1
f 2
delete select bug10100f(5)
drop procedurefjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
create procedure g(x int)
case
when x < 0 then
insert into test.t1 values ("g", 0);
when x = 0 then
insert into test.t1 values ("g", 1);
else
insert into test.t1 values ("g", 2);
end case|
call g(-42)|
call g(0)|
call g(1)|
select * from t1 order by data|
id data
g 0
g 1
g 2
delete from t1|
drop procedure g|
create procedure h(x int)
case x
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
insert into test.t1 values ("h0", x);
when 1 then
insert into test.t1 values ("h1", x);
else
insert into test.t1 values ("h?", x);
end case|
call h(0)|
call h(1)|
call h(17)|
select * from t1 order by data|
id data
h0 0
h1 1
h? 17
delete from t1|
drop procedure h|
create procedure i(x int)
foo:
begin
if x = 0 then
leave foo;
end if;
insert into test.t1 values ("i", x);
end foo|
calldeallocate prepare stmt2|
call i(3)|
select * from t1|
id data
i 3
delete from t1|
drop procedure i|
insert into t1 "foo" 3) "" 19|
insert into t2 valuesjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
create procedure sel1()
begin
select * from t1 order by data;
end|
call sel1()|
id data
foo 3
bar 19
drop procedure sel1|
create procedure sel2()
begin
select * from t1 order by data;
t *from order s;
end|
call sel2()|
id data
foo 3
bar 19
s i d
x9 4.java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
y -1 19.java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
z 3 2.2
drop procedure sel2end|
|
deletexint x;
create procedure into_test(x char(16), y int)
begin
insert into test x;
id,data xy test
insert into java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 2
end4711
call into_test("into", 100)|
select * from t1 order by data|
id data
into 100
into2 102
elete from
drop procedure into_test|
create procedure into_test2(xdrop |
begin
insert into test.t1 values (x, y);
select ,data x,@ test. limit ;
insert into test.t1 values (concat(x, "2"), y+2);
end|
call into_test2("into", 100)|
select id,data,@z from t1 order by data|
id data @z
into 100 100
into2 102 100
delete from t1|
drop procedure into_test2|
create procedure into_test3()
begin
declare x char(16);
declare y int;
selectinsert into t3()values (a- table column")|
insert into test.t2 values (x, y, 0.0);
end|
insert into ",19|
call into_test3()|
call into_test3()|
select * from t2|
s i d
into3 19 0
into3 19 0
delete from t1|
delete from t2|
i ()
create procedure into_test4()
begin
declare x int;
declar ccursor ;
insert into test.t3 values ("into4", x);
end|
deletefrom |
create table t3 ( s char(16), d int)|
call into_test4()|
select * from t3|
s d
into4 NULL
insert into t1 values ("i4", 77)|
call into_test4()|
select * from t3|
s d
into4 NULL
into4 77
delete from t1|
drop table t3|
drop procedure into_test4|
create procedure into_outfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
select * into outfile "MYSQLTEST_VARDIR/tmp/spout" from test.t1;
insert into test.t1 values (concat(x, "2"), y+2);
end|
call into_outfile("ofile", 1)|
delete from t1|
drop procedure into_outfile|
create procedure into_dumpfile(x char(16), y int)
begin
insert into test.t1 values (x, y);
select * into dumpfile "MYSQLTEST_VARDIR/tmp/spdump" from test.t1 limit 1;
insert into test.t1 values (concat(x, "2"), y+2);
end|
call into_dumpfile("dfile", 1)|
delete from t1|
drop procedure into_dumpfile|
create procedure create_select(x char(16), y int)
begin
insert into test.t1 values (x, y);
create temporary table test.t3 select * from test.t1;
insert into test.t3 values (concat(x, "2"), y+2);
end|
call create_select("cs", 90)|
select * from t1, t3|
id data id data
cs 90 cs 90
cs 90 cs2 92
drop table t3|
deletedropfunction bug7648|
drop procedure java.lang.StringIndexOutOfBoundsException: Range [64, 23) out of bounds for length 68
e( returns double
return 2.7182818284590452354|
set @e = e()|
select e(), @e|
e() @e
2.718281828459045 2.718281828459045
create function inc(i int) returns int
return i+1|
select inc(1), inc(99), inc(-71)|
inc(1) inc(99) inc(-71)bug9775('') bug9775('b') bug9775('c')
2 100 -70
create function mul(x int, y int) returns int
return x*y|
select mul(1,1), mul(3,5), mul(4711, 666)|
mul(1,1) mul(3,5) mul(4711, 666)
1 15 3137526
create function append(s1 char(8), s2 char(8)) returns char16)
a
select append("foo", "bar")|
append(foo
foobar
create function fac(n int unsigned) returns bigint unsigned
begin
declare f bigint unsigned default 1;
while n > 1 do
set f = f * n;
set n = n - 1;
end while;
return f;
end|
select fac(1), fac(2), fac(5), fac(10)|
fac(1) fac(2) fac(5) fac(10)
1 2 120 3628800
create function fun(d double, i int, u int unsigned) returns double
return mulinc() fac(u) / (|
select fun(2.3, 3, 5)|
fun(2.3, 3, 5)
176.58213176229233
insert into t2 values (append("xxx", "yyy"), mul(4,3), e())|
insert into t2 values (append("a", "b"), mul(2,mul(3,4)), fun(1.7, 4, 6))|
select * from t2 where s = append("a", "b")|
s i d
ab 24 1324.3659882171924
select * Warning1265Datatruncated forcolumn '(3) at 0
s i d
xxxyyy 12 2.718281828459045
ab 24 1324.3659882171924
select * from t2 where d = e()|
s i d
xxxyyy 12 2.718281828459045
select * from t2 order by i|
s i d
xxxyyy 12 2.718281828459045
ab 24 1324.3659882171924
delete from t2|
drop function e|
drop function inc|
drop function mul|
drop function append|
drop function fun|
create procedure hndlr1(val int)
begin
declare x int default 0;
declare foo condition for 1136;
declare bar condition for sqlstate '42S98'; # Just for testing syntax
declare zip775'')bug9775'b)bug9775(ab)bug9775(c)
declare continue handler for foo set x = 1;
insert into test.t1 values ("hndlr1", val, 2); # Too many values
if (x) then
insert into test.t1 values ("hndlr1", val); # This instead then
end if;
end|
java.lang.StringIndexOutOfBoundsException: Range [7, 4) out of bounds for length 16
select * from t1|
id data
fetch c into ;
delete from t1|
drop procedure closec
create aba
begin
selectias'arametertakes precedence tableijava.lang.StringIndexOutOfBoundsException: Range [0, 68) out of bounds for length 9
begin
declare exit sqlstate'S01'set =1
insert into test.t1 values ("hndlr2", val, 2); # Too java.lang.StringIndexOutOfBoundsException: Range [0, 57) out of bounds for length 52
end;
insert into test.t1 values ("hndlr2", x);
enddeclare cursor a from ;
call hndlr2(42)|
select * from t1|
iddata
hndlr2 1
delete from t1|
procedure hndlr2|
create procedure hndlr3(val int)
begin
declare x int default 0;
declare continue handler for sqlexception # Any error
begin
declare z int;
set z = 2 * val;
set x = 1;
end;
if val < 10 then
begin
declare y int;
set y = val + 10;
insert into test.t1 values ("hndlr3", y, 2); # Too many values
if x then
insert into testt1values ""
end if;
end;
end ;
end|
call hndlr3(3)|
select * from t1|
idddata
hndlr3 13
delete from select bug9775()bug9775(2),bug9775(3),bug9775(4)|
drop procedure hndlr3|
create table t3 ( id char(16), data int )|
create (
begin
declare x int default 0;
val ; #No java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
declarecontinue handler for sqlstate '02000' set x=1;
select data into val from test.t3 where id='z' :
insert into test.t3 values Warning 1265select ai;
end|
call hndlr4()|
select t|
id data
zNULL
drop procedure hndlr4|
create procedure cur1()
begin
declare char(16);
declare b ;
declare c double;
declare done int default 0;
cursor select *from .t2;
declare continue handler for sqlstate '02000' set done = 1;
open c;
repeat
fetch c into a, b, c;
if not done then
insert intoset @x = bug8861()|
end if;
until done end repeat;
close c;
end|
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2
cur1(|
select * from t1|
dr |
foo 40
bar 15
zap 663
drop procedure cur1|
create tablebegin
create procedure cur2()
begin
declare done int default 0;
declare c1 cursor for select id,data from test.t1 order by id,data;
declare c2 cursor for select i from test.t2 order by i;
declare continue handler for sqlstate '02000' set doneinsert into t1 values (x, 42);
open c1;
open c2;
repeat
begin
declare a char(16);
declare insert t1values (x 17)
fetch from c1 into a, b;
fetch end|
if not done then
if b < c then
ert into .t3 create bug9004_2x 16)
else
insert into test.t3end;
end call bx|
end if;
end;
until done end repeat;
closeend|
close c2;
end|
call Warningscall bug5967(" -stored procedure parameter")|
select * from t3 order by i,s|
s i
bar 3aWarning 1265 truncated forcolumn xx'atrowjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
zap 663
from t1
deletefromt2|
drop table Warning truncatedfor ''
drop procedure cur2|
create java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 5
language sql
modifiessqldata
not deterministic
sql security definer
' '
insert into t1 values ("chistics", 1)|
show create procedure chistics|
Procedure sql_mode java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 16
chisticsOp Msg_type
MODIFIES SQL DATA
COMMENT t.t1
insert into t1 values ("chistics", 1)java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
call chistics()|
* from t1
id data
chistics 1
delete fromt1|
alter procedure chistics sql security invoker|
create procedure |
Procedure sql_mode Create Procedureset 5
chistics STRICT_TRANS_TABLES,java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 8
DATA
SQL SECURITY INVOKER
procedure java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
insert into t1 values ("chistics", 1) latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
drop procedure chistics|
create function create function bug9559()
language sql
deterministic
sql security invoker
comment 'java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 11
return 42|
show create function chistics|
Function sql_mode Create Function character_set_client collation_connection Database return @;
chistics STRICT_TRANS_TABLESjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 4
DETERMINISTIC
SQL SECURITY INVOKER
COMMENT 'Characteristics procedure test'
return 42 latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
select chistics()|
chistics()
42
alter function chistics
no sql
bug9559)java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17
show function chistics|
Function java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
chistics STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONt3 analyzestatus alreadyup to
NO SQL
DETERMINISTIC
SQL de c cursor for from dualjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
'function
return 42 latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
drop function chistics|
insert into t1 values ("foo", 1), ("bar", 2), ("zip", 3)|
set @@sql_mode = 'ANSI'|
create procedure modes(out c1 int, out c2 int)
begin
done int 0;
declare x int;
arecjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 7
declarecontinue handlerforsqlstateTableOp Msg_typeMsg_text
select 1 || 2 into c1;
set c2 = 0;
testrepairstatusOK
repeat
fetch c into x;
if not donef intov;
set c2 = c2 + 1;
end if;
until done end repeat;
close c;
end$
set @@sql_mode = ''|
setsql_select_limit= |
call modes(@c1, @c2)|
set sql_select_limit = default|
select @c1, @c2|
@c1 @c2
12 3
eletefrom
drop procedure modes|
create
drop database sp_db1|
create database sp_db2java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
use sp_db2|
create t3(schar4) java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
insert into t3 values3
use test|
drop database test.v1 repair Errortest.'is call bug10961(
create database sp_db3|
use sp_db3
create ( int)
set x = 42|
use test|
drop database
select type,b,ame mysql. where db java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 26
type db name
create procedure rc()t2 status java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
delete from t1java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
values (""
end|
call rc()|
selectrow_count(|
row_count()
3
updatet1 set =42 id=b;
select row_countTableOpMsg_type
row_count()
1
delete from t1|
select row_count()|
row_count()
3
delete from t1|
select row_count()|
row_count()
0
select * from t1|
id data
select row_count()|
row_count()
-1
drop procedure rc|
delete from t1|
delete from t2|
insert into t1 values ("a", 1), ("b", 2) |
insert into t2 values ("a", 1, 1.0), ("b", 2, 2.0), ("c", 3, 3.0) |
create function f1() returns int
return (select sum(data) from t1)|
select f1()|
f1()
3
select id, f1() from t1 order by id|
id f1()
a 3
b 3
create function f2() returns int
return (select data from t1 where data <= (select sum(data) from t1) order by data limit 1)|
select f2()|
f2()
1
select id, f2() from t1 order by id|
id f2()
a 1
b 1
create function f3() returns int
begin
declare n int;
declare m int;
set n:= (select min(data) INSERT INTO tt1 VALUES (1, 1, 4, 'xx')|
set m:= (select max(data) from t1);
return n < m;
end|
select f3()|
f3()
1
select id, f3() from t1 order by id|
id f3()
a 1
b 1
select f1(), f3()|
f1() f3()
3 1
select id, f1(), f3() from t1 order by id|
id f1() f3()
a 3 1
b 3 1
create function f4() returns double
return (select d from t1, t2 where t1.data = t2.i and t1.id= "b")|
select f4()|
f4(
2
select s, f4()INSERT tt2VALUES (, 'testt2 Engine-independent statisticscollected
s f4()
a 2
b t.analyzestatus is tojava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
create function f5(i int) returns int
begin
if i <
return 0;
elseifi=1then
return (select count(*) from t1 where data = i);
else
java.lang.StringIndexOutOfBoundsException: Range [14, 6) out of bounds for length 61
end if;
end|
select f5(1test.t1repair OK
f5()
1
test.t2repairstatus
ERROR HY000: Recursive CREATE PROCEDURE (a1 )
select ()java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
ERROR HY000: Recursive storedtest.1repair 'est.'is of type BASESELECT*Ftv a1=_;
create function f6() returns int
begin
declare n testEND|
set n:= f1();
return select (* wherewhere data Table Msg_type Msg_text
end|
create function test.t1 optimize status OK
return (select sum(data) from t1 where data <= f1())|
select f6()|
f6(
2
select id, f6() from t1 OK
id f6()
a 2
b 2
reateview v1 a)as f1(|
select * from v1|
a
3
select id, a from t1, v1 order test.1optimize a3 data data2 data3
id a
a 3
b 3
select * from v1, v1 as v|
a a
3 3
create view v2 (a) as select a*10 from v1|
select * from v2|
a
30
select114xx a d
id a
a 30
b 30
select * from v1, v2|
a a
3 30
create function f8 ()returns int
return (select count(*) from v2)|Table Msg_type
select *, f8() from a1 a2 a3 data data2 dat
a f8()
3 1
drop function1 14xx a d
select * from v1|
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or test.1analyze test. analyzestatus is java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 23
test.t2 analyze status Engine-independent statistics collectedprocedure test.t3 analyze status Engi-
return (select sum(data) from t1test. already to
select f1()|
000 Recursive functions and triggers aretest.analyze 'est'isnottype' TABLE
select * from v1|
ERROR java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 6
select * from v2|
ERROR HY000drop bug13012|
drop |
create function f1() returns int
ctsumuntil <0 rrepeat;
create function f0() returns int
return (select * from (select 100) asdrop t3java.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 14
select f0()|
f0()
100
select *, f0() from (select aaaaa java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
1 f0()
1 100
create view v0 as select f0()|
select v0|
f0()
select *, f0() from v0|
ccccc 3
100 100
lock tables t1 read, t1 as t11 read|
select f3(|
f3()
1
name v
id f3()
a
b 1
select f0()|
f0()
100
select * from v0|
ERROR HY000: Table 'v0' wasname val
select *, f0() from v0, (select 123) as d1|
ERROR HY000: Table 'v0' was not locked with LOCK TABLES
select id, f3() from t1|
ERROR HY000: Table 't1'cccc3
select f4()|
ERROR HY000: Table 't2' was not locked with LOCK TABLES
aaaaa
lock tables v2 read, mysql.proc java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 7
usemysqltest3|
a
30
select * from v1|
a
3
select * from v1, t1|
ERROR HY000: Table aaaaa1
select f4()|
ERROR HY000: Table 't2' java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
tables|
create function f9() returns int
n
declare a, b int;
drop temporary table if exists t3 psql text)
create temporary table t3 (id int);
begin
set a:= (select count(*) from t3);
b=(java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 7
return a +name val
end|
select f9()|
f9()
6
select f9() from t1 limit 1|
f9()
6
create java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 7
drop |
drop temporary prepare lstatementfrom ldrop t3|
create temporary table t3 (id int);
java.lang.StringIndexOutOfBoundsException: Range [11, 6) out of bounds for length 33
return (select count(*) java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 5
endjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
select f10()|
ERROR42:ERROR 42S02: Table '_
create table t4 as select 1 as id|
select f10(|
f10()
1
drop procedure bug15231_6|
begin
drop temporary table if exists t3;
create temporary table t3 (create table t3 (c1 int prima key)
insert into t3 values (1), (2), (3insert into t3 (|
return (select count(*) from t3 as ac java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
t)
f11()
9
select f11() from t1|
sel Outer ;
9
9
create function f12_1() returns int
begin
drop temporary table if exists t3;
create temporary table t3 (id int);
insert into t3 values (1), (2), (3);
return f12_2(); arg1 '' then
end|
efunction f12_2( int
return (select count(*) from t3)|
drop t3|
select f12_1()|
f12_1)
3
temporary table t3|
select f12_1() from
f12_1()
3
drop temporary table t3|
drop function f0|
drop function drop function f1|
drop function f2|
drop function f3create able t3 varchar1 |
drop function f4|
drop function f5|
drop function f6|
drop function f7|
dropfunction f8|
drop function f9|
drop function f10|
drop function f11|
drop function f12_1|
drop leave c1_repeat;
drop view v0|
drop view v1|
drop view v2|
truncate table t1 |
truncate table |
droptt4|
create table t3 (n int unsigned insert into t4 values (create procedurebug16887(
create procedure ifac(n int unsigned)
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
declare int
if n > 20 then
n=20 #boverflow while do
end if;
while i <= n do
begin
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
set i = i + 1d breakchar varchar();
end;
end while;
end|
call ifac(20)|
select * from for selectc t3java.lang.StringIndexOutOfBoundsException: Range [46, 47) out of bounds for length 46
f
1 1
2 2
3 6
4 24
5 120
720
7 5040
8 40320
9 362880
10 3628800
11 39916800
12 479001600
13 6227020800
14 end if;
15 1307674368000
16 20922789888000
17355687428096000
18 6402373705728000
19121645100408832000
20 2432902008176640000
drop java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
showfunction where namelike %% Db <s|
Db Name Type Definer Modified Created Security_type java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 49
test fac FUNCTION root@localhost 0000-00-00 set =java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5
;
drop function fac|
show iterate again;
Db Name Type Definer Modified java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 17
createtableend
i int unsigned not null primary key,
p bigint unsigned not null
)
insert into t3 values
( 0, 3leave c2_repeatjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
( 5,( 5,
(10, 37), (11, 41), (12, 43), (13, 47), (14, 53),
(,59,(, ) 1 67 18 71) (19 73,
(20, 79), (21, 83), (22, b=1
(25, 103), (26, 107), (27, 109), (28, 113), (29,end ;
(30, 131), (31, 137), (32, 139), (33, 149),
(35, 157), (36, 163), (37, 167), (38, 173),end if
(40, 181), (41, 191), (42, 193), (43, 197end|
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
begin
declare ri
b bigintunsigned default ;
set r = sqrt(n);
java.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 1
loop
if s = 45 then
set b = b+200, s = 0;
else
begintruncate t4
declare p bigint unsigned;
select t.p into p from test.t3 t where t.i = s;
if b+p > r then
set a
leave again;
end if;
if mod(n, b+p) = 0 then
set pp = 0;
leave again;
end if;
set s = s+c bug12168(a)
end;
end if;
loop;
end|
create procedure ip(m int unsignedjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
begin
declare p a
declare i int unsigned;
set i=45, p=201;
while i < m do
begin
declare pp bool default 0;
all opp(,pp;
if pp then
insert test.values i )
set i = i+1;
end if;
set p = p+2;
end;
end3
end|
show create procedure opp|
Procedure i
opp CREATE DEFINER=`root`@`localhost` PROCEDURE `opp`(n bigint unsigned, out pp bool)
begin
declarejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
declare java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
set r = sqrt(n);
again:
loop
if s = 45 then
set b = b+200, s = 0;
else
begin
declare p bigint unsigned
select t.p into p from testdrop table
if b+p > r then
set pp = 1;
leaveset@x=@ + 1;
end if;
if mod(n, b+p) = 0 then
set pp = 0;
leave again;
endp procedurebug14945|
set s = s+1;
end;
end if;
end ;
end latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
show procedure status where name like '%p%' and db='test'|
Db select from t1 by x,id
test ip PROCEDURE root@localhost 0000-00-00 00:00:00 call bug16474_1(|
test opp PROCEDURE root@localhost 0000-00-00 00:id
call ip(200)|
select * fromt3 where i=45 or i=100 or i=199|
i p
45 211
100 557
199 1229
drop table t3|
drop procedure opp|
drop procedure ip|
show procedure where name 'p'and db=test|
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
create procedure bar(x char(16), y int)
comment"
insert into test.t1 values (x, y)|
show procedure status like 'bar'|
Db Name Typecall (10)|
test bar PROCEDURE root@localhost 0000-00-00 00:00:00 drop procedure bug11333|
alter procedure bar comment "2222222222" sql security definer|
alter java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
alterbar|
show create procedure bar|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bar CREATE DEFINER=`root`@`localhostcall bug16474_2()
COMMENT '3333333333'
insert into test.t1 values (x, java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
show procedure status like 'bar'|
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connectiondrop bug16474_1
test bar PROCEDURE root@localhost 0000-00-00 00:00:00dropjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
drop procedure bar|
create procedure p1 ()
select (select s1 from t3) from t3|
create table t3 (s1 int)|
calljava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
(set f1 concat( ',f1 notnot null auto_incrementjava.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [767, 26) out of bounds for length 767
call p1()|
from t3)
1
drop procedure p1|
t3|
create function `foo () int
return 5|
select bug18037_f1( RETURNS
`foojava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
5
drop function `foo`|
create function t1max() returns int
begin
declare x int;
(ata)intox java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
return java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
end|
insertinto values ("foo", 3), ("bar", DECLARE DEFAULT @;
select t1max()|
t1max()
5
drop function t1max|
ENDjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
char()not null primary keyCREATE java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
c intcreate java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5
)|
create function getcount(egin
begin
declare -
count() xfrom t3 =s 0java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
if x ELSE
insert into t3 values (s, 1);
else
update t3 set handler for sqlstate '22003'
end if;
return x;
end|
ect*from data =getcount(bar"|
id data
zap1
select * from t3|
v c
bar 4
select ""|
getcount(1
0
select
getcount("zip")
1
select * from t3|
cal )
bar 4
ip java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
select getcount(id) from t1 whereDROP java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 1
getcount(id)
0
select getcount(id) from t1 where data DROP PROCEDURE
getcount(id)
1
select * from t3|
v use test|
bar 4
zip 3
1
drop table t3|
drop function getcount|
create table set =|
insert into t3 (a) values (1)|
create procedure h_ee()
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 13
begin
declare continuejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
'uter (ad) 'h_ee';
begin
declare handlerfor =123456
select 'Inner (good)' as 'h_eesetspv1 'set spv1 = 'test|
insert into t3 values (1);
end;
end|
procedure (java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
use test|
begin
declare continue handler select *, mysqltest1.bug17199() from t3|
selectdrop temporary table tm1;
begin
-- violation
declare continue handler for sqlstate '23000'
select 'Inner (bad)' as 'h_es';
insert into t3 values (1);
end;
end|
create procedure h_en()
deterministic
begin
declare continue handler for 1329 -- ER_SP_FETCH_NO_DATA
'(ood)'as1ok
begin
declare x int;
declare continue handler for sqlstate 2 k
select 'Inner (bad)' as 'h_en';
java.lang.StringIndexOutOfBoundsException: Range [22, 6) out of bounds for length 37
end;
end|
create procedure createfunction (icreate temporary table tm1 as select spv1;
deterministic
begin
declare continue handler for 1264 -- ER_WARN_DATA_OUT_OF_RANGE
select 'Outer (good)usetest|
begin
declare continue handler for sqlwarning
'_w';
insert into t3 values (123456789012);
end;
deletefrom java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
insert into t3 values (cjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
end|
create procedure h_ex()
deterministic
begin
set spv1=-123.456java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
select'() as'h_ex
begin
declare continue handler for sqlexception
select 'Inner (bad)' as 'h_ex';
insert into t3 values (1);
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
end|
create h_sec)
deterministic
begin
-- -- integrityp1(
declarehandlerforsqlstate23000
select 'Outer (bad)' as 'h_se';
begin
declare continue handler for 1062 -- ER_DUP_ENTRY
Igood) 'h_se';
insert into t3 values (1);
nd;
end|
create h_ss(
deterministic
begin
-- integrity java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 35
declare end|
select 'Outer (bad)'callbug12589_3(|
begin
-
declare for ` /*!40100 DEFAULT CHARACTER SET koi8r COLLATE koi8r_general_ci */
select 'Inner (good)' as 'h_ss';
insert into t3 values (1); mysqltest2 *!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci */
end;
end|
create procedure h_sn()
deterministic
begin
- 02000 java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
-- there might be other not found states
declare for '02000 -
select 'Outer (good)' as 'h_sn m /*!40100 DEFAULT CHARACTER SET koi8r COLLATE koi8r_general_ci */
begin
declare x int;
select 'Inner (bad)' as 'h_sn';
select a into x from t3 where a = 42;
endjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
end|
create procedure h_sw()
deterministic
begin
--data out range
declare continue handler for for select * from t3;
drop procedurebug12589_2
begin
declare continue handler for sqlwarning
select 'Inner (bad)' as 'h_sw';
nsertinto t3 (123456789012)
end;
elete t3;
insert into t3 values (1);
end|
create procedure java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 16
deterministic
begin
-
declare continue handler for sqlstate '23000create procedure ()
select 'Outer (good)' as 'h_sxflush |
begin
declare continue handler for java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 31
select 'Inner (bad)' as 'h_sx';
insert into t3 values (java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 13
end;select |
end|
create CREATE PROCEDURE bug21013( lim INT)
deterministic
begin
declare continue handler for not found
select ' ()' as'h_ne'java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
begin
declare ;
declare continue handler for 1329 -- ER_SP_FETCH_NO_DATA
select 'Inner (good)' as exit handler for sqlexception
a x @ latin2a"|
end;
end|
create procedure h_ns()
CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8|
begin
declare continue handler for not found
select ' java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 5
begin
declare x ;
declare continue handler for sqlstate 'CREATE )RETURNS 10java.lang.StringIndexOutOfBoundsException: Range [46, 47) out of bounds for length 46
a';
select a into x from t3 where a = 42;
end;
end"java.lang.StringIndexOutOfBoundsException: Range [10, 11) out of bounds for length 10
create procedure h_nn()
deterministic
begin
"
select 'Outer (bad)' as 'h_nn';
begin
declare x ;
for found
select 'nner(ood) h_nn'
nd||
end;
end|
create procedure RETURN "
inistic
begin
declareFunction character_set_client
select 'Outer ( DEFINER=root`l `ug16211_f2java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
begin
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 6
select 'Inner (SHOW java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 17
intojava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 37
end;
delete bug7049_2|
insert t3values ()
end|
create procedure h_ws()
begin
declare continue handler for sqlwarning
select 'Outer ( procedure bug7049_1
begin
-- data bug16211_f4 CREATEdrop bug7049_3|
declare continue handler for sqlstate '22003'
select Inner g) ''
insert into.ROUTINES
end;
java.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 15
insert into t3 values (1)dtd_identifier
end|
char(10
p_output_ p_output_str,','SELECT dtd_identifier
begin
declare continue handler for sqlwarning
select Outer (WHERE ROUTINE_SCHEMA = mysqltest1 ROUTINE_NAME =bug16211_f2|
begin
declare continue handler for sqlwarning
select set p_output_strSELECT
insert into t3 values (123456789012);
end;
insert into t3 values (1);
end|
create procedure h_xe()
deterministic
declare continue handler for sqlexception
SELECTselect bug13941('this )
beginbug13941(this is a test')
declare continue ROUTINE_SCHEMA = "mysqltest2ROUTINE_NAME |
select 'Inner (good)' as 'h_xe';
insert into t3 values (1);
end;
end|
create procedure h_xs()
deterministic
begin
declare continue handler for sqlexceptionjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
select CREATE PROCEDURE bug13095java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 47
begin
-- integrity constraintSET @strjava.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 41
declare continue handler sqlstate 23000
select 'Inner (goodmysqltest1CHARACTERSETjava.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 47
insert into t3 values (1);
end;
end|
create procedure h_xx()
begin
declareRETURN "
' (
begin
java.lang.StringIndexOutOfBoundsException: Range [24, 7) out of bounds for length 41
'java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 32
into t3 values (1);
end;
|
call h_ee()
h_ee
Inner (good)
)java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
h_es
Inner (bad)
call h_en()|
h_en
Inner (bad)
call h_ew()|
h_ew
Innerjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 94
call h_ex()|
bug1java.lang.StringIndexOutOfBoundsException: Range [11, 8) out of bounds for length 127
Inner(bad)
call h_se()|
h_se
Inner (good)
call h_ss()|
h_ss
(good
call(CREATEVIEW bug13095_v1()ASSELECT FROM ,);
h_sn
FROMMATION_SCHEMA.
call EXECUTE stmt;
h_sw
Inner (bad)
call h_sx()|
h_sx
Inner (bad)
call h_ne()|
h_ne
Inner(ood)
call h_ns()10
h_ns
Inner (good)
call h_nn()|
h_nn
Inner (good)
call h_we()|
h_we
Inner (good)
call h_ws()|
Inner (good)
callh_ww(|
h_ww
Inner (good)
call h_xe()|
h_xe
(java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
call h_xs(java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
h_xs
Inner (good)
call h_xx()|
h_xx
(ood)
drop table t3|
DROPPROCEDURE bug13095char()
drop procedure h_es|
drop procedure h_en|
drop procedure h_ew|
drop procedure h_ex|
drop procedure SELECT CHARSET(bug16211_f2())|
drop procedure h_ss|
drop procedure h_sn|
drop procedure h_sw|
drop procedure h_sx|
drop procedure h_ne|
drop procedure h_ns|
drop h_nn|
drop h_we|
drop return()
drop procedure h_ww|
drop procedure h_xe|
drop|
drop procedure h_xx|
DROP(java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
begin
declare n int;*!50003create procedure bug14723)
select count(*) into java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 10
if njava.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 18
insert()
endif
end|
delete from t1|
java.lang.StringIndexOutOfBoundsException: Range [16, 4) out of bounds for length 23
call bug822('foo', 42)|
call bug822('bar', 666)|
select*
data
cal bug14723);
bar 666
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 15
drop procedure bug822|
create procedure bug1495()
begin
;
select data into x from t1 order by id limit 1;
x > 10 then
insert into t1values(less@ =c|
else
intot1 (more" 10;
end if;
end|
insert into t1 select ;
call bug1495()|
CHARSET( COLLATION(2
insert into t1 values ('bar', 7)|
call bug1495()|
delete from t1 where id0
select * from t1 order by data|
id datajava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
less 2
more 17
delete from t1|
dropprocedure bug1495|
create procedure bug1547(s char(16))
begin
declare x int;
select data into x from t1 where dropprocedurebug13549_2|
if >10then
insert into t1 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
else
(more +10;
end if;
end|
insert into t1 values ("foo", 12), ("bar", 7)|
call bug1547("foo")|
call bug1547("bar")|
select * from t1 order by id|
id data
bar 7
foo 12
less 2
more 17
delete from t1|
drop procedure bug1547|
create table t70 (s1 int,s2 int)|
insert into t70 values (1,2)|
create procedure bug1656(out p1 int, out p2 int)
select * into p1, p1 from t70|
call bug1656(@1, @2)|
select @1, @2|
@ @2
2 NULL
drop |
drop procedure bug1656|
create table t3(a int)|
create procedure bug1862()
begin
insert into t3 values(2);
java.lang.StringIndexOutOfBoundsException: Range [12, 5) out of bounds for length 13
end|
call bug1862()|
call bug1862()|
select * from t3|
a
2
2
drop table t3|
drop procedure bug1862|
create procedure (
begin
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 14
declare y double;
select max(data) into x from t1;
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
()into fromt1;
insert into t2 values ("min", x, 0);
select sum(data) into x from t1;
insert into t2 values ("sum", x, 0
select avg(data) into y from t1;
insert into t2 values ("avg", 0, y);
end|
insert into t1 (data) values (3), (TABLESjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
call bug1874()|
select * from t2 order by i|
s i d
avg 0 4.4
min 1 0
max if<limthen
sum 22 0
delete from t1|
delete from t2
update
create procedure bug2260()
begin
declare v1 intprocedurelevel limint
declare c1 cursor java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
declare continue handler for not found set @x2 = 1;
prepare stmt1 "pdate aa;
fetch c1into v1;
@ ;
close c1;
end|
call bug2260()|
select @x2|
@x2
2
drop procedure bug2260|
create call bug10100pdbug10100pd(+1 ;
begin
show procedure status where db=endif;
end|
create procedure bug2267_2()
begin
show function status where db='test';
end|
create procedure
begin
show create procedure bug2267_1;
end|
create procedure bug2267_4()
begin
show create function bug2267_4;
end|
create function bug2267_4() returns int return 100|
call bug2267_1()|
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database6)
test bug2267_1 PROCEDURE root@localhost 0000-java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
test bug2267_2 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
test bug2267_3 PROCEDURE root@localhost 0000-00-call bug10100pd(1,5)|
test bug2267_4 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 level
call bug2267_2()|
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test bug2267_4 FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
call bug2267_3()|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bug2267_1 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug2267_1`()
begin
show procedure status where db='test';
end latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
call bug2267_4()|
Function sql_mode Create Function character_set_client collation_connection Database Collation
bug2267_4 CREATE DEFINER=`root`@`localhost` FUNCTION `bug2267_4`() RETURNS int(11)
return 100 latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
drop procedure bug2267_1|
drop procedure bug2267_2|
drop procedure bug2267_3|
drop procedure bug2267_4|
drop function bug2267_4|
create procedure bug2227(x int)
begin
declare y float default 2.6;
declare z char(16) default "zzz";
select 1.3, x, y, 42, z;
end|
call bug2227(9)|
1.3 x y 42 z
1.3 9 2.6 42 zzz
drop procedure bug2227|
create procedure bug2614()
begin
drop table if exists t3;
create table t3 (id int default '0' not null);
insert into t3 select 12
insert
ndjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
call (|
call bug2614()|
drop table t3|
drop procedure bug2614|
create function bug2674() returns int
return @@sort_buffer_size|
set @osbs = @@sort_buffer_size|
set @@sort_buffer_size = 262000|
select bug2674()|
bug2674)
262000
drop function bug2674|
set @@sort_buffer_size = @osbs|
create procedure java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 4
create java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 1
create procedure Bug3259_3 () begin java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 5
call BUG3259_1()|
call BUG3259_1()|
call bug3259_2cegin
call Bug3259_2(select reachablecodeb1;
call bug3259_3()|
call bUG3259_3()|
rop bUg3259_1|
drop procedure BuG3259_2|
drop procedure BUG3259_3|
create function bug2772() returns char(10) character set latin2
return 'a'|
select bug2772()|
bug2772()
a
drop function incontinuehandler
create procedure bug2776_1(out x java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 17
begin
declare v int;
set v = default;
set x = v;
end|
create procedureox int
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
declare v intdefault 42;
set v = default25
set x = v;
end|
set @ |
call bug2776_1(@x)|
select @x|
@x
NULL
call update set a=|
select @x|
@x
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
drop procedure bug2776_1|
drop procedure bug2776_2|
create table t3 (s1 smallint)|
insert into t3java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
Warnings:
Warning 1264 Out of range value for java.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 2
create procedure bug2780()
begin
declare exit handler for java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 33
set @x = 0;
insert into t3 values (123456789012);
insert into t3 values (0);
|
call bug2780()|
select @x|
@x
1
select * from t3|
s1
32767
32767
drop procedure bug2780|
drop table t3|
create java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1
insert into t3 values begin
insert into t3 values ("test2")|
create able t4(int, int int)
create procedure bug1863(in1 intdeallocatepelect'reachablecodeb2'
begin
declare ind int default 0drop bug10100ptjava.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
declare t1drop bug10100pc|
declare t2 int;
declare t3 int;
declare rc int default 0;
declare continue handler for 1065 set rc = 1;
drop temporary table if exists temp_t1;
create temporary table temp_t1 (
f1 int auto_increment, f2 droptable t3java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
);
insert into temp_t1 (f2) select content from t3;
select f2 into t3 from temp_t1 where f1 = 10;
if ( xINT)RETURNS INT
insert into t4 values (1, rc, t3);
endif
insert into t4 (,rc, t3)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
call bug1863(10)|
select * from t4|
f1 rc t3
2 0 NULL
2 0 NULL
drop procedure bug1863|
drop temporary table temp_t1;
drop table t3, t4|
t3 (
OrderID int not null,
MarketID int,
primary key (OrderID)
)|
eatetablet4
MarketID int not null,
Market varchar(60),
Status char(1),
ary key MarketID)
)|
insert t3 (OrderID,MarketID) values (1,1)|
insert t3 (OrderID,MarketID) values (2,2)|
insert t4 (MarketID,Market,Status) values (1,"MarketID One",declare continue java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
insert t4 (MarketID,Market,Status) CREATEDEFINERjava.lang.StringIndexOutOfBoundsException: Index 133 out of bounds for length 4
eprocedure (
in
select
ERROR 42000 Undeclared variable:
frommJOIN t3 o
ON o.MarketID != 1 and o.MarketID = CREATE=1234567890java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 27
end setanull;
create procedure bug2656_2()
begin
select
insert into t4 set a=ull;
java.lang.StringIndexOutOfBoundsException: Range [6, 4) out of bounds for length 6
t4 m, t3 o
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
m.MarketID != 1 and m.MarketID = o.MarketID;
end |
|
Market
MarketID Two
)ERROR HY000:Cantexecute query becauseyou have conflicting create procedure bug14376(
et
arketIDTwo
call bug2656_2()|
Market
MarketIDcreate intdefault
callbug2656_2)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
drop procedure bug2656_1|
drop procedure bug2656_2|
drop table t3, t4|
callbug14376)
begin
if in_time is null then
set @stamped_time=10;
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 8
else
set @stamped_timeCREATE TABLE t4 (
setx=java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
end if;
end
set time_zone='+03:00';
call bug3426(1000, @i)|
select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time|
@i time
2 :1640
call bug3426(NULL (ction)java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
lect@ @ %-m-%:i%' time|
@i )(222222' ') '444444',(')(')
1 01-01-1970 03:00:10
lter security invoker
call bug3426(NULL, @i)|
selectselect varchar()java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 83
@i time
1 01-01-1970 03:00:10
call bug3426(,
_unixtime(s,'d(222222,'rolled''0-,' ,
@i time
2 01-- 031640
drop procedure bug3426|
create t3
id unsigned auto_increment 01, ,
title VARCHAR(200),
textjava.lang.StringIndexOutOfBoundsException: Range [10, 11) out of bounds for length 10
fulltext (itlebodyjava.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21
)|
('MySQL proc_20028_b(|
',After you through a ..),
('Optimizing MySQL','In this tutorial testt1 statusOK
' Tricks,1 java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 60
('MySQL vs. YourSQL','In the following databasetestt1java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 26
('MySQL Security','When configured properly, MySQL ...')|
create procedure bug3734 (param1 java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 28
select t3 match (itlejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
call bug3734(database'|
id title body
5 MySQL vs. end|
1 MySQL Tutorial DBMS stands for create function func_20028_b() returns integer
call bug3734('Security')|
id title body
6 MySQL Security When configured properly, MySQL ...
drop procedure bug3734|
drop test.t1 repair status OK
procedure (
begin
set @a = 0;
while @a < 5 do
=@+1
select iinto temp 1;
optimize Error'estv1 ofcreate roc_20028_b(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
call bug3863()|
t1 analyze java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 62
@a
5
call|
select @a|
@a
5
drop func_20028_a)
create table t3 (
id int(10select func_20028_b()|
ridfunc_20028_b()
msg text java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 4
primary key (id),
unique key java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
)|
create procedure bug2460_1(in v int)
begin
( select n0.id from t3 as n0 where n0.id = v )
union
( select n0.id from t3 as n0, t3 as n1
where n0.id = n1.rid and n1.id =
union
(select idfromt3 asdropfunctionfunc_20028_b|
n0id .ridn1id=ridandfrom ljava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
end|
call bug2460_1(2)|
d
call bug2460_1(42000 ofPROCEDURE java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
id
insert into t3 values (1, 1, 'foo'), (schema drop schema mysqltest3_xjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
call2|
id
2
1
county'|
id
2
1
create procedure bug2460_2 |
dropproc_21462_b(|
temporary t3 (1int);
insert into t3 select 1 union select 1;
endB
call bug2460_2()|
drop proc_21462_a|
select * from t3|
1
drop procedure bug2460_1|
java.lang.StringIndexOutOfBoundsException: Range [24, 4) out of bounds for length 25
drop create index i on t3 (s1);
set @@sql_mode = ''|
create procedure bug2564_1()
comment 'Joe''s
java.lang.StringIndexOutOfBoundsException: Range [13, 2) out of bounds for length 37
set @@sql_mode = 'ANSI_QUOTES(|
create procedure bug2564_2()
insert into "CREATE TABLE t3(INT)
set @@sql_mode = ''$
create function bug2564_3select * ;
x |
set @@sql_mode = 'ANSI'$
FROMt3JOINFROM t3 JOIN t4''|
return x || y$
set @@sql_mode = ''|
show create procedure bug2564_1|
Procedure sql_mode Create Procedure java.lang.StringIndexOutOfBoundsException: Range [0, 56) out of bounds for length 10
bug2564_1 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug2564_1`()
COMMENT 'Joe''s procedure'
insert into `t1` values ("foo", 1) latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
show create procedure bug2564_2|
Procedure sql_mode Create Procedure character_set_client Database
bug2564_2 ANSI_QUOTES CREATE DEFINERreturn "pie, my favorite desert.";
Warnings
show java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
Function sql_modeSET 'java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 28
bug2564_3 CREATE DEFINER=`root`@`localhost` FUNCTION `java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 10
return |y java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 29
show create function bug2564_4|
sql_mode v
REAL_AS_FLOAT,,NSI_QUOTES
|y
dropprocedurebug2564_1|
drop procedure bug2564_2|
drop my favoritedesert.pie java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 20
create function bug3132java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
return java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5
select bug3132('Bob'
bug3132')
Hello, Bob!
o !
datajava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
create procedure bug3843()
analyze table t1|
call bug3843()|
'as v;
t status independentstatistics
OK
call bug3843()|
47 bce5c74f589f4867dbd57e9ca9f808
testt1 status EngineSET ';
test.t1 analyze status Table is already up to date
select 1+2|
1+1+2(current_user(
3
ropprocedure |
table (s1char10 |
insert into t3 values ('a'), ('b')|
create procedure bug3368(v charcreatefunction`database`() returns varchar(50)
begin
select group_concat(v) from t3;
end|
call ('
group_concat(v)
x,x
bug3368(yz)
group_concat(v)
yz,z
drop procedure bug3368|
drop table t3|
create t3 f , f2 )
java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 54
create procedure bug4579_1 ()
begin
select( )
update t3 setcreate java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 9
call bug4579_2();
end|
create procedure bug4579_2 ()
begin
end|
callbug4579_1(|
java.lang.StringIndexOutOfBoundsException: Range [14, 4) out of bounds for length 17
call (|
dropselect java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 18
procedure |
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 5
create function bug2773() returns int return null|
).urrent_user )
showcreatetable |
Table selectend
t3 CREATE TABLE `t3` (
`bug2773()` int(11)Stored tored function
=MyISAM DEFAULT CHARSET=tf8mb4select () (;
table |
tionbug2773|
set x 'ap';
select bug3788()|
bug3788(
0304
drop function bug3788|
create function ( returns binary1 5|
bug3788(|
bug3788)
5
drop declare x Stored function databasStored function database
create table t3 (f1 int, f2 int, f3 int)|
t3 (,1|
bug4726(
begin
declare tmp_o_id INT;
declare tmp_d_id Stored md5 tored function
while tmp_d_id <= 2 do
begin
select f1 into tmp_o_id
tmp_d_id=tmp_d_id 1;
while;
end|
call bug4726()|
call)
call bug4726()|
drop procedure bug4726|
tablet3
create )
like''java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
show collation like 'foo';
show create table t1;END
show java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
show databases like 'foo';
show errors;
romt1;
show open like '';
# Removed because result will differ in embedded mode.
#show privileges;
show status like 'foo';
tables 'um= + ;java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
like'foo';
show warnings;
end|
all (|
END IF;
Collation Charset Id Default Compiled Sortlen Pad_attribute
Table Create Table
t1 CREATE TABLE `t1` (
`id` char(16) NOT NULL DEFAULT '',
`data` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
Database Database
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci */
Database (foo)
Level Code Message
Field Type Null Key Default Test isworking7
id (16)NO
data 11 NO NULL
ame Seq_in_index Column_name Sub_part Packed Null Index_type Comment Index_comment Ignored
Database In_use
Variable_name 2005
(foojava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
Variable_name Value
Level Code Message
call java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 1
Charset Description Default collation Maxlen
create procedure bug16887ROW_COUNT(
Table Create Table
t1 CREATE TABLE `t1` (
`is 7
`while i 0 7
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE
Database Create 12
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci */
Database (foo)
Levelseti -;
Field Type Null Key Default Extra
)NO
()NO open ;
Table Non_unique SELECTfetch t3_cursor into breakcharjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
Database Table In_use Name_locked
Variable_name Value
123
java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 4
Level Code Message
drop procedure bug4902|
create procedure bug4904()
begin
declare continueDROPPROCEDUREbug23760_update_log|
create table not_existing_table as select * from t3;
end|
call bug4904()|
ERROR 42S02: Table 'test.java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
drop bug24117java.lang.StringIndexOutOfBoundsException: Range [25, 1) out of bounds for length 1
create table t3 (s1 char character set latin1, s2 char character set java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 1
cedure(
begin
FLUSH TABLES;
select s1 from t3 union select s2 from t3;
end|
call ()
drop procedure bug4904|
drop table t3|
create procedure bug336(out y int)
begin
declare x cedure bug16474_2(int)
tfrom tt;
set y = x;
end
into t1 ("2 ""3)
call bug336(@select from no_such_viewlimit 1 into x;
select @y|
@y
delete from t1|
drop procedure bug336|
create procedure bug3157()
begin
if existsset x: +;
set @n= @n + 1;
end
select(* t1 java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
@n n+1
end if;
|
set @n = 0|
insert into t1 values ("java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 2
call bug3157()|
select @n|
@n
2
delete from t1|
dropfunction func_8407_b|
begin
drop fbug15728|
where db='test' and name=egin
alter procedure java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 5
select count(*) from mysql.proc
where db='test' and name='bug5251' and created = @c1|
1
drop procedure bug5251|
java.lang.StringIndexOutOfBoundsException: Range [16, 6) out of bounds for length 26
checksum table t1|
use java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
Checksum
test.t1 0
call while >0do
Table Checksum
seti=i - ;
drop bug5251|
create procedure bug5287(param1 int)
label1:
begin
declare c cursor for select 5;
loop
if param1 >= bug18344_01234java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
;
end if;
end java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
end|
call bug5287()|
drop procedure bug5287|
create procedure bug5307()
begin
end; set @x = 3|
call bug5307()|
select @x|
@
3
drop procedure bug5307|
create procedure bug5258()
begin
end|
create procedure bug5258_aux()
begin
declare c, showwhile;
select created,modified into c,m from mysql.proc where name = 'bug5258';
if c = m then
Ok;
else
select c, m;
end if;
end|
call bug5258_aux()|
Ok
Ok
drop procedure bug5258|
drop procedure bug5258_aux|
create function bug4487() returns char
begin
declare v char;
return v;
end|
select bug4487(|
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
NULL
drop function bug4487|
create procedure bug4941(out x int)
begin
declare c cursor for select i from t2 limit 1;
open c;
fetch c into x;
close c;
end|
insert t2 (ull,null,null)
set @x = 42|
call bug4941(@x)|
select @x|
@
NULL
delete from t1|
drop procedure bug4941|
create table t3 (s1 int,primary key (s1))|
create procedure bug4905()
begin
declare v int;
declare continue handler for sqlstate '23000' set v = 5;
insert into t3 values (1);
end|
(|
select row_count()|
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 11
1
call bug4905()|
select row_count()|
row_count()
0
call bug4905()|
select row_count()|
row_count()
0
select * from t3|
s1
1
intojava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 35
drop table t3|
create procedure bug6029()
begin
1136;
declare exit handler for sqlstate '23000' select 'sqlstate 23000';
declare continue handler for sqlexception select 'java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 41
loopingjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
loopingjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
end|
create table t3 (s1 int, primary key (s1))|
insert into t3 values (1call proc_26503_ok_2()|
call bug6029()|
sqlstate 23000
sqlstate 23000
delete from t3|
1136
1136
procedurebug6029|
drop table t3|
createbug8540(
begin
declare x int default 1;
select x as y, x+0 as z;dosomethingagain
end|caughtjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 4
call bug8540caught something
l i
1 1
drop procedure bug8540|
create table t3 (s1 int)|
create procedure bug6642()
select abs(count(s1)) from t3|
call bug6642()|
abs(count(s1))
0
call bug6642()|
abs(count()
0
java.lang.StringIndexOutOfBoundsException: Range [22, 4) out of bounds for length 23
insert into t3 values (0),(1)|
aaaaaaaaaaaaaaaaaaaaaaaaaajava.lang.StringIndexOutOfBoundsException: Index 355 out of bounds for length 18
select s1,DROP FUNCTION bug18589_f1|
call bug7013()|
s1 count(s1)
0 1
1 1
NULL 2
bug7013(java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
s1 count(s1)
0 1
1 1
NULL2
drop procedure bug7013|
create table WHEN -1
a mediumint(8a t3(1INT )
b smallintI t3VALUES(,3.) 1 ) 1 09) (ND ;
c char(32SELECT bug18037_f1(|
primary key (a)
) engine=myisam default charsetCbug18037_p1(|
insert into t4 values (1,152
insert into t4 values (DROP FUNCTION |
create procedure bug7743 ( searchstring char(28) )
begin
declare var mediumint(8) unsigned;
select a into var from t4 where b = 2 and c = binary searchstring limit 1;
select var;
end|
call bug7743("oneword")|
var
1
bug7743(OneWord")
var
NULL
Warnings:
Warning 1329 No data - DATABASE()
call bug7743("anotherword")|
var
2
call bug7743("AnotherWord")|
var
NULL
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
rocedure bug7743|
drop table t4|
delete from t3|
insert into t3 values(1)|
create procedure bug7992_1()
begin
declare i select bug20777()as 92233720368547758042*-'java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
select max(s1)+1 into i from t3;
end|
create procedure bug7992_2()
insert into t3 (s1) select max(t4.s1)+1 from t3 as t4|
call bug7992_1()|
call bug7992_1()|
call bug7992_2(select ROPFUNCTION |
call bug7992_2()|
drop procedure bug7992_1|
drop procedure bug7992_2|
drop table t3|
table useridbigint20 null default 0insert t3 values1,2|
create procedure bug8116(in _userid int)
select * from t3 where userid = _userid|
call bug8116(42)|
userid
call bug8116(42)|
userid
drop procedure bug8116|
drop table t3|
create procedure bug6857()
begin
declareupper bounds signed bigint
declare plus booldefaultjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 23
ERROR :create function bug( )ntjava.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 78
select sleep(1.1);
set t1 = unix_timestamp();
if t1 > t0 then
set plus = 1;
end if;
select plus;
end|
call bug6857()|
sleep(1.1)
0
1
drop procedure bug6857|
create procedure bug8757()
begin
declare x int;
declare7()as 2*632,
begin
declare y int;
c2 forselect from t2 limit;
open c2;
fetch c2 into y;
close c2;
open c1;
fetch c1 into x;
close c1;
select 1,x|
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
delete from t1|
delete from t2|
insert+`java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 45
insert into t2 values java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 45
call bug8757()|
2 y
2 2
1 x
1 1
delete from t1|
delete from t2|
drop procedure bug8757|
drop procedure if exists bug8762; create procedure bug8762() begin java.lang.StringIndexOutOfBoundsException: Range [0, 70) out of bounds for length 20
drop procedure ifCREATE bug5274_f1p1CHAR)CHAR
drop procedure bug8762|
create function bug5240 () returns create function bug5240 () returns int
begin
declare x intjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 111
declare c cursor for select data from t1 limit 1;
open c;
fetch c into x;
close cbegin
return xjava.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
end|
delete from t1|
insert into t1 java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 20
select id, bug5240() java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
id bug5240()
answer 42
drop function bug5240|
createsql_modejava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 96
insert into t3 values(1)|
create procedure bug7992()
begin
declare i int;
select max(id)+1 into i from t3;
endfetch cur1 into var1;
call bug7992(|
call bug7992()|
drop procedure bug7992|
drop table t3|
create table t3 (
lpitnumber int(11) default null,
lrecordtype int(11) default null
)en|
create table t4 (
lbsiid int(11) not null default '0'java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
ltradingmodeid java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
int11 nulld ',
csellingprice update t2 set b=-b a=ug27354(;
primary key (lbsiid,ltradingmodeid,ltradingareaid)
)|
create table t5 (
lbsiid int(11) not null default '0',
ltradingareaid int(11) not null default '0',
primary key p java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
|
create procedure java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 14
begin
insert into t5
(
t5.lbsiid,
t5.ltradingareaid
)
select distinct t3.lpitnumber, t4.ltradingareaid
from
t4 join t3 on
t3.lpitnumber = t4.lbsiid
and t3.lrecordtype = 1
left join t4 as price01 on
price01.lbsiid = t4.lbsiid and
ltradingmodeid=1and
t4.ltradingareaid = price01.java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 10
)|
call bug8849()|
drop tables t3,t4,t5|
create procedure bug8937()
begin
sbug16211_f1)RETURNS 10)
declare a float;
select sum(data),avg(data),CREATE FUNCTION bug16211_f2() loops 0DO
CREATE (RETURNS CHAR()
select avg(data) java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
select a;
end|
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 15
insert into t1 (data) values (1)E java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 10
call java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 5
s x y z
16 3 1 6
a
3.2
drop procedure bug8937|
delete from t1|
create table t3 (w char unique, x char)|
insert into t3 values ('a', 'b')|
create procedure bug6900()
begin
declare exit handler for java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
begin
declare exit handler for sqlexception select '2';
insert into t3 values ('x', 'y', 'z');
end|
create procedure bug9074PREPARE s1 'ELECTf1();
begin
declare x1, x2, x3, x4, x5, x6 int default 0;
begin
declare continue handler for sqlstate '23000' set x5 = 1;
values ',b;java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
set x6 = 1; Function sql_mode Create Functionjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 17
end;
begin1_label:
begin
declare continuehandler for sqlstate '23000' set x1 = 1;
insert into t3 values ('a', 'b');
set x2 =1
begin2_label:
begin
declare exit handler for sqlstate '23000' set x3 = 1;
set x4= 1;
ROUTINES
set x4= 0;
end begin2_label
java.lang.StringIndexOutOfBoundsException: Range [14, 3) out of bounds for length 17
select x1, x2,SELECT dtd_identifier
end|
create procedure bug6900_9074drop procedure sp_bug29050
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
declare�
begin
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 60
if z = 1 then
insert into t3 values ('a', 'b');
else
insert into t3 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 18
end if;
end;
call bug6900()|
2
2
call bug9074()|
x1 2x3 x4 x6
1 1 1 1 1 1
call /*!999999
sqlexception
sqlexception
call bug6900_9074(1)|
sqlexception
sqlexception
drop procedure bug6900|
drop procedure |
p1,p2
drop table t3|
create procedure avg ()
begin
end|
call avg ()|
/*! 2 /
setojava.lang.StringIndexOutOfBoundsException: Range [15, 13) out of bounds for length 26
@ "
@|
bug6129)
@ql_mode
ERROR_FOR_DIVISION_BY_ZERO
set @@sql_mode= "NO_ZERO_IN_DATE,NO_ZERO_DATEFunction sql_mode
call bug6129(|
@
Y_ZERO
set @@sql_mode= "NO_ZERO_IN_DATE"|
call bug6129()|
@@sql_mode
ERROR_FOR_DIVISION_BY_ZERO
set @@sql_mode=@old_mode;
drop3
create procedure bug9856()
begin
declare v int;
declare c cursor for select data from t1;
declare exit handler for WHERE "ANDROUTINE_NAME ="ug16211_f1Procedure CreateProcedurecharacter_set_client collation_connection Database Collation
open c;
fetch c proc_25411_b CREATE `@localhost proc_25411_b(
select v;
end|
delete from t1|
call bug9856()|
16
16
call )|
16
16
drop procedure java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 8
create FROM INFORMATION_SCHEMA.ROUTINES
begin
declare temp_in1
declare temp_fl1 int default 0;
set temp_in1 =select ;
set temp_fl1 = temp_in1/10;
SELECT CHARSET(bug16211_f1())|
end|
create proc_25411_b
begin
v int default 100;
select v/10;
end|
call bug9674_1(@sptmp)|
bug9674_1(sptmp|
select @sptmp|
@sptmp
10
call java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 8
v/10
10.0000
call bug9674_2()|
v/10
10.0000
drop procedure bug9674_1|
drop procedure bug9674_2|
create procedure bug9598_1(in var_1 char(16),
out var_2 integer, out var_3 integer)
begin
set var_2 = 50;SELECT CHARSET(),COLLATION(;
set var_3 = 60;
end|
INOUT p2 HAR())cp1251,
v2 integer,
in v3 integer,
in v4 integer,
in v5 integer)
begin
select v1,v2,v3,v4,v5;
call bug9598_1(v1,SET @java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
select v1,v2,v3,v4,v5;
end|
call bug9598_2('Test',2,3,4,5)|
v1 v2 v3 v4 v5
Test 2 3 4 5
v1 v2 v3 v4 v5
Test 2 3 4 5
select @tmp1CHARSET() COLLATION(2
@tmp1 @tmp2
5060
drop procedure bug9598_1|
drop procedure bug9598_2|
create function bug9902() returns int(11)
begin
set @x = @xcall (10,20);
return @x;
end|
# Set query cache size, if we have query cache
set @x = 1|
insert into t1 values (how create proc_25411_c;
DROP DATABASE |
(
2
bug9902( t1|
bug9902()
3
select procedure bug8153_subselectselect 2,3java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
x
3
# Restore the old query cacheend latin1_swedish_ci
delete from t1|
drop function bug9902|
create function bug9102() returns blob return ''
tbug9102()|
bug9102()
a
drop function bug9102|
createfunction bug7648( bit(8) return 'a'|
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5
bug7648()
123
drop function bug7648|
create function bug9775(v1 char(1)) returns enum('a
select bug9775('a'),bug9775('b'),bug9775('c')|
bug9775('a') call bug8153_subselect)|
a dro ;
Warnings:
Warning 1265 Datacreate proc_26302)
select /* testing */;
functionbug9775( ) enum'''' v1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
bug9775drop procedure |
a b
Warnings:
Warning 1265 Data truncated for java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 5
drop function bug9775|
functionbug9775( 1)returnsset'''' v1|
selectb'','',',',''|
'' '''
b a
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
1265 truncated column''atEXPLAIN*FROM WHERE=;
Data forb(''' 0
'code;
create function bug9775(v1 int) returns set('a','b') return v1|
java.lang.StringIndexOutOfBoundsException: Range [25, 6) out of bounds for length 51
1 (SIMPLEt1 c1c1
a b a,b
Warnings:
Warning Datatruncatedforjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 17
drop function bug9775|
function v1int)yearreturnv1|
continue
bug8861SIMPLEt1 java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
2005
set @x = bug8861(05)|
select @x|
@x
2005
function bug8861|
createselect_typetypepossible_keyskeykey_len xtra
begin
insert into t1 values (x, 42);
insert into t1 values (x, 17);
reac a2
create procedure ()
call bug9004_1(x)|
call bug9004_1('12345678901234567')|
Warnings:
Warning 1265 Data truncated for column b
call bug9004_2('12345678901234567890')|
Warnings:
Warning 1265 Data truncated for column 'x3
view v1 select1 ,f1( days;
drop procedure bug9004_1|
|
insert into t1 values ('secret', 0)|
create procedure bug7293(java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 5
soundexp1=())
where ='1'and =test'
end if;
end;|
bug7293'cret)
yes
yes
call bug7293 ('secrete')|
yes
yes
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
delete from t1|
where id |
create java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
update v1 set data = 10|
call bug9841()|
drop view v1|
drop procedure bug9841|
create procedure bug5963_1 () begin declare v int; set v = (select s1end|
create table t3 (s1 int)|
insert into t3 values (5)|
call bug5963_1()|
v
5
call bug5963_1()|
v
5
op bug5963_1|
drop table t3|
) ENGINEDEFAULTCHARSETujava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 69
begin
if cfk_value in (select cpk from t3) then
= 5;
if;
end; (11
|
create table t3 (cpk int)|
insert into t3 values (1)|
call bug5963_2(
call bug5963_2(1|
procedure bug5963_2|
INSE INTO t12 (), 2|
create (java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
returns int
begin
set @y = -6/2;
return @y;
end|
select bug9559()|
bug9559()
-insert into 3(a
drop java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
create procedure bug10961(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
beginselect*from (select a t1natural select*fromtest.t3) t2|
declare v char;
declare x int#-Prepare.
declare c cursor for select * from dual;
declare continue handler for sqlexception select x;
set x = 1;
open c;
set x = 2;
fetch
et =3
close c;
end|
call bug10961()|
x
1
x
2
x
3
call )|
x
1
x
2
x
3
|
CREATE TABLE tt1 (a1 int,create database тв_едлг_м_абз_ан_аиjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
CREATE TABLE tt2 (a2 int, data2 varchar(10))|
CREATE tt3 ( , data3)
NTO VALUES (1, 1, 4, 'xx')|
INSERT INTO tt2 VALUES (1, 'a')|
INSERT INTO tt2 VALUES (2, 'b')|
INSERT INTO tt2 VALUES (3, 'c')|
INSERT INTO tt3 VALUESERRORHY000 load оа_е_дълго_име_за_база_данни_нали.това_е_процедура_с_доста_дълго_име_нали_и_ще_одлг (internal code 6.Formore details,run WARNINGS
INSERT INTOINSERT INTO tt3
INSERT INTO tt3 VALUES (6, 'f')|
CREATE VIEW tv AS
SELECT tt1.*, tt2.data2,
tt1INNERJOINtt2 . tt2.java.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
LEFT JOIN tt3 ON tt1.a3 = tt3.a3
ORDER BY tt1.a1,show warnings|
CREATE PROCEDURE bug6866 (_Level
BEGIN
SELECT *FROMtvWHERE a1 =_1
END|
CALL PRIMARY KEY(Member_ID)
a1 a2 a3 data data2 data3
1 1 4 xxIDint
CALL bug6866(1)|
a1 a2 a3 data java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 1
1 1 4 xx a d
CALL bug6866(1)|
a1 a2 a3 data data2 data3
1 1 4 xx a d
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
DROP VIEW tv|
DROP TABLE tt1, tt2, tt3|
create table t3 ( name char(5) not null
java.lang.StringIndexOutOfBoundsException: Range [29, 6) out of bounds for length 63
create procedure bug10136()
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
declare done int default 3;
repeat
select * from t3;
set done = done - 1;
until done <= 0t1;
DROP f1java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
call bug10136()|
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
call bug10136()|
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
call bug10136()|
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
drop procedure |
drop #- Check
create procedure bug11529()
begin
declare ccursor select id Action Action)
open c;
begin
declare vid char(16);
declare vdata int;
exit notfoundbegin ;
true WHERE t1.barc=
fetch c into vid, vdata;
end while;
end;
close ;
|
insert into t1 values
('Name1', 10),
Name2',11,
(Name3 12,
('Name4', 13),
',|
bug11529(|
(|
delete from t1|
procedure bug11529
set character set utf8|
create procedure bug6063()
begin
âel: end;
label: begin end;
label1: begin end;
end|
create procedure bug7088_1()
label1: begin end label1|
create procedure bug7088_2()
lä:begin|
call bug6063()|
call bug7088_1()|
call bug7088_2()|
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
set @@character_set_results=@java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
show create procedure bug6063|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bug6063 CREATE DEFINER=`rootR
begin
l�bel: begin end;
label: begin end;
label1: begin end;#
end utf8mb4 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
show create procedure bug7088_1|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bug7088_1 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug7088_1`()
label1: begin end label1 utf8mb4 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
show create procedure bug7088_2|java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
Procedure sql_mode Create Procedure java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 17
bug7088_2 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug7088_2`()
l�bel1: begin end
drop CREATE DATABASE db28318_a;
drop CREATE DATABASE
drop procedure bug7088_2|
create procedure bug9565_sub()
begin
select * from t1;
SELECT (111111'|
ERROR42000 PROCEDUREdb28318_bt exist
begin
intot1values(one" )java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
call bug9565_sub();
end|
call ()
iddata
1
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
drop procedure bug9565_sub|ECLARE SQLEXCEPTION exception: run'
drop
bug9538
set @@sort_buffer_size = 1000000|
set @x = @@sort_buffer_size|
set @@sort_buffer_size = endif
select @@sort_buffer_size|
@@sort_buffer_size
2000000
call bug9538()|
select
@@call roc_33618sijava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 44
1000000
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 4
drop procedure bug9538|
create table t3 (c1 varchar(5), c2 char(5), c3 enum('one'insert intot1values1)2;
insert into t3 values ('', '', '', '', '', '', NULL)|
Warnings:
Warning 1265 Data truncated for column 'c3' at row 1
create java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
beginset SQL_MODE''
declare v1 VARCHARselect 1/into div_zero
declaredropfunctionfunc30787
declare begin
declare v4 VARCHAR(10);
declare v5 VARCHAR(10);
SELECTt1 t1RIGHTt1 ONt1.t.;
declarecreateprocedurejava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 15
declare java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
open c8692;
fetch c8692 into v1,v2,v3java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
select v1, v2, v3, v4, v5, v6, v7;
end|
call bug8692()|
v1 v2 v3 v4 v5 v6 v7
NULL
dropsetSQL_MODE='RADITIONAL'
droptable |
create function java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 4
createtable)
selectfunc_20028_b)
where t.table_schema = 'test' and t.table_name = 't1'|
column_name (.column_name)
id id
data data
drop function bug10055|
java.lang.StringIndexOutOfBoundsException: Range [25, 6) out of bounds for length 34
begin
set @x = 0;
repeat
insert into t1(id,data)
values('aa', @x);
set @x = @x + 1;
until @x >= lim
end repeat;
end|
call SET sql_mode'TRADITIONAL'|
drop procedure bug12297|select tr`` )nto`;
create function f_bug11247(param int)
returns int
return param + 1|
create procedure p_bug11247(lim int)
begin
declare v int default 0;
whiletemp java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
set v= f_bug11247(v);returnifnullcall p1java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
end while;
end|
callp_bug11247(0)
|
drop procedure p_bug11247|
create table t3 (a int)|
insert set SQL_MODE'java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
create table t4 (a int)|
create procedure bug12168(arg1 char(1))
begin
declare b, c integer;
if arg1 = 'a' then
begin
declarepare.
declare continue handler for not select i into temp from table_20028 limit 1;
set b = 0;
open c1;
c1_repeat: repeat
fetch c1 into c;
if (b = 1) then
;
end if;
insert into t4 values (c)set =''
until b = 1
end repeat;
end;
end if;
if arg1 = 'b' then
begin
declare c2 cursor for select a from t3 where not a % 2;
declare continue handler forSELECTDATA_TYPEFROMINFORMATION_SCHEMA.COLUMNS WHERE ='v1;
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
open c2;
c2_repeatDATA_TYPE
fetch c2 intotinyint
if (b = 1) then
leave c2_repeat;
end if;
insert into t4 values (cjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
until b = 1
end repeat;
end;
end if;
end|
call bug12168('createprocedure (x )
select * from begin
a
1
3
A
call bug12168('b')|
*#
java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
2
4
ERROR 42:number argumentsfor PROCEDUREtest.proc_21462_b;expected ,got 0
call bug12168(ERROR 42000:Incorrect of forPROCEDUREtest.proc_21462_bCASE p
select * java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 8
a
1
3
truncate t4|
drop procedure |
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
a
2
4
truncate t4|
drop table t3,SELECT f1()java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
drop procedure bug12168|
create table t3 (c1 char(128))|
insert into t3 values
('java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 26
reateprocedurejava.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 24
declareproc_bug19733(|
set @x = java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
repeat
select c1 into tmp from t3
where c1 = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
set @x = @x + 1;
until @x >= i
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
end|
call bug11333(10)|
drop procedure bug11333|
drop table#- Bug#: cleanup.
reate) returnschar
begin
set ('' f1;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
end|
drop function bug9048|
create function bug9048(f1 char binary) returns char binary
begin
CALLp1)
return f1;
end|
ctcollationug9048""|
collation(bug9048("foo"))
utf8mb4_bin
drop function bug9048|
inoutchar xintox|
set @var='a'|
call bug12849_1(@var)|
select @var|
@var
a
drop procedure bug12849_1|
create procedure bug12849_2(inout foo varchar(15select piEND;/
begin
select concat(foo, foo) INTO foo;
end|
set @var='CALL p1);
call (var|
select @var|
@var
abcdabcd
drop procedure bug12849_2|
333(
begin
begin
declare a int;
select ajava.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
set a = 1;
select a;
end;
begin
declare b int;
end;
end|
java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
returns int
begin
begin(database #Bug46629 Item_in_subselect:) 0
declare aint;
set a = 1;
end;
4747
returnb
endBEGI
Not This function' asthesame asas function
call bug131333()E|
a
NULL
a
1
b
NULL
select bug131333()|
bug131333()
NULL
drop procedure bug131333|
drop function bug131333|
create table t3 (c1 char(BEGIN
create function bug12379()
returns integer
begin
insert into t3 values('X');
insert into t3 values('X');
return 0;
end|
create procedure java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 5
begin
handler java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 48
select bug12379();
END|
create procedure bug12379_2()
begin
declare exit handler for sqlexception java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 24
bug12379)
end|
create procedure bug12379_3()
begin
select bug12379();
end|
DECLAREinit_connectINT0java.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 35
:Duplicate entry X'for E
select 1|
1
1
call bug12379_1()|
bug12379()
42
42
select 2|
2
S @ ;
call bug12379_2()|
bug12379()
select 3|
3
3
call bug12379_3()|
ERROR@GLOBALinit_connect
select 4|
4
4
function bug12379|
procedure |
drop procedure bug12379_2|
drop procedure bug12379_3|
drop table t3|
procedure (
begin
declare y integer;
@xy;
end|
call bug13124()|
drop procedure bug13124|
create procedure bug12979_1(inout d decimal(5)) set d = d / 2|
et bug12979_user_var=CREATE FUNCTION mixedCaseDbNamtryMyFunc)rtext return'ITWORKS' end
call bug12979_1(@select test.database()test. (;
drop procedure bug12979_1|
create procedure bug12979_2()
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 32
set internal_var= internal_var / 2;
select internal_var;function Storedmd5
end|
bug12979_2)
internal_var
NULL
drop procedure INSERT INTO t1 VALUES (11,11,12;
create table t3 (s1 int unique)|
set @sm=@@sql_mode|
set sql_mode='traditionaljava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 19
create procedure bug6127()
begin
declare continue handler for sqlstate '23000'
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
continuehandlerforjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 24
insert into t3 values (0);
insert into t3 values (1000000000000000);
end;
insert into t3 values (1);
insert into t3 values (1);
end|
call (|
select from |
s1
0
1
call bug6127()|
ERROR23000:Duplicateentry''for'1
select * from t3|
s1
0
1
set sql_mode=@sm|
drop table t3|
drop procedure bug6127|
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 29
begin
declare spv1 decimal(3,3);
;
set spv1 = 'test';
as spv1;
show create table tm1;
drop temporary table tm1;
)
begin
declare spv1 decimal(6,3);
set spv1= 123.456;
SELECT @ax_sp_recursion_depth
show create table tm1;
temporary CALL bug23760_test_row_c(2|
end|
create procedure bug12589_3()
begin
declare spv1 decimal(6,3Warning1265Data forcolumn'
set PROCEDUREp1;
create temporary table tm1 as select spv1;
show33
temporary tm1
end|
call bug12589_1(b()
Table Create Table
tm1 CREATE TEMPORARY TABLE `tm1` (
`spv1` decimal(3,3) DEFAULT NULL
MyISAM CHARSET=
call bug12589_2()|
Table Create 1
tm1 CREATE TEMPORARYjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
`spv1` decimal(6,D PROCEDURE bug23760_update_log
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATEDROP java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 18
call bug12589_3()|
Table Create Table
CREATE )
DECLAREt3c1ENUM(;
)MyISAM CHARSET=utf8mb4 =utf8mb4_uca1400_ai_ci
drop procedureOPEN mycursor;
drop procedure bug12589_2|
bug12589_3|
table t3(x unique)
create procedure bug7049_1()
begin
insert into t3 values (42);
insert into t3 values (42);
end|
create procedure bug7049_2()
begin
declare exit handler for sqlexception
select 'Caught it' as 'Result';
call bug7049_1();
select 'Missed it' as 'Result';
end|
create procedure bug7049_3()
call bug7049_1()|
create procedure returnx
begin
declare exit handler for sqlexception
select 'Caught it'(()|
)
select 'Missed it' asjava.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 4
end|
create function bug7049_1()
RETURN a )java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
begin
insert into t3 values (42f1(java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
insert into t3 values (42);
return 42;
end
create1265Data ') 0
returns int
begin
DROP java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
continue handler for sqlexception
set x = 1;
set x = bug7049_1();
return x;
endjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
call bug7049_2()|
Result
Caught it
select * from t3|
x
42
delete from t3|
call bug7049_4()|
Result
Caught it
select * from t3|
x
42
select bug7049_2()|
bug7049_2()
1
drop table t3|
drop procedure bug7049_1|
drop procedure bug7049_2|
drop procedure bug7049_3|
drop procedure bug7049_4|
drop function bug7049_1|
drop function bug7049_2|
create function bug13941(p_input_str text)
returns text
begin
declare p_output_str text;
set p_output_str =p_input_str;
set p_output_str = replace(p_output_str, 'xyzzy', 'plugh');
set p_output_str = replace(p_output_str, 'test', 'prova');
setinsert table_26503values v;
set p_output_str = replace(p_output_str, ' a ', 'una ');
set p_output_str = replace(p_output_str, 'java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 4
end|
procedure soutvarchar128java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
begin
set sout = 'Local';
set sout = ifnull(sout, 'DEF');
end|
select bug13941('this is a test')|
bug13941('this is a test')
questo una
call bug13941(@a)|
select @a|
@a
Local
drop function bug13941|
drop procedure bug13941|
CREATE PROCEDURE bug13095(tbl_name SELECTf3)AS a t1GROUPa
BEGIN
SET @str
CONCAT("CREATE TABLE ", tbl_name, "(stuff char(15))");
SELECT @strS
PREPARE stmt#-Createobjects
EXECUTE stmt;
SET @str =
CONCAT("INSERT INTO ", tbl_name, " VALUES('row1'),('row2'),('row3')" );
SELECT @str;
PREPARE stmt FROM @str;
EXECUTE stmt;
SET @strRETURN)
CONCAT("CREATE VIEW bug13095_v1(c1) AS SELECT stuff #
SELECT @str;
PREPARE stmt FROM @str;
EXECUTE stmt;
*FROM bug13095_v1;
SET @strselect c1 from v1java.lang.StringIndexOutOfBoundsException: Range [41, 42) out of bounds for length 41
"DROP VIEWprocedure;
SELECT @str;
PREPARE stmt FROM @str;
EXECUTE stmt;
END|
)
@str
CREATE TABLEcall
@str
INSERT INTO bug13095_t1 VALUES('row1'),('row2'),('row3')
s
CREATE VIEW bug13095_v1(c1) AS SELECT java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 10
c1
row1
row2
row3
s
DROP bug13095_v1
DROP PROCEDURE bug13095;
DROPTABLE
/*!50003 create function bug14723() sp(
)
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 16
return 42;
end */;
function;
Functionsql_mode# Try to use data types LIMIT
main_loop: begin
end latin1 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
bug14723(;
bug14723()
/*!50003 create procedure bug14723()
0;
select 42OCEDURE call ( 5java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
end */;;
show create procedure bug14723;;
Procedure sql_mode Create java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
bug14723 DEFINER=root`` bug14723`)
main_loop: begin
select 42;
end utf8mb4_uca1400_ai_ci
bug14723(;
42
42
dropSELECT'-- 010000,2, 1 FROM
drop procedure bug14723|
create procedure bug14845()
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
declare a char(255);
declarep2 () begin
declare c cursor forselect f1(1 0)
declare continue handler for sqlstate '02000'
open c;
repeat
fetch intojava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
if not done then
a;
end if;
until done end repeat;
close c;
end|
call bug14845()|
a
0
drop procedure bug14845|
java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 2
begin
call bug13549_1();
end|
CREATE `drop;
declare done int default 0;
set done= not done;
end|
CALL bug13549_2()|
drop procedure bug13549_2|
java.lang.StringIndexOutOfBoundsException: Range [25, 4) out of bounds for length 26
functionprmERRORHY000:View testv1'references s ors or sinvokeroflack
begin
if prm > 1 then
return java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
end if;
return 1;
ndjava.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4
create procedure bug10100p(prm int, inout res int)
begin
set res = res * prm; t3aOPEN java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
if prm > 1 then
call bug10100p(prm - 1, res
if;
end|
create procedure bug10100t(prm int)
begin
declare res int;
set res = 1;
call bug10100pEACH
select res;
end|
create table t3 (a int)|
insertDROP p1java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
create view v1 as java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
create procedure bug10100pt(level int, lim int)
begin
if level < lim then
update t3 set a=level;
TABLES
bug10100pt(evel1 lim)
else
fromt3java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
end if;
end|
create when 'AP'='AP'
begin
if level < ap_close_to
alevel;
FLUSH TABLES;
call bug10100pv(level+1, lim);
else
select * from v1;
end
end|
prepare java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
create procedure bug10100pd(level int, lim int)
begin
if level < lim then
select level;
prepare stmt1 from "update t3 set a=a+2";
execute stmt1;
FLUSH TABLES;
execute stmt1;
FLUSH ;
execute stmt1;
FLUSH TABLES;
deallocate prepare stmt1;
execute stmt2;
select * from t3;
drop function f1;
else
execute stmt2;
end if;
end|
createprocedure bug10100pc(level , lim java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
begin
declare lv;
declare c cursor for select a from t3;
open c;
if level <java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
selectCALLspjava.lang.StringIndexOutOfBoundsException: Range [7, 0) out of bounds for length 0
fetch c into lv;
select java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
update t3 set a=level+lv;
FLUSH TABLES;
call l+,lim)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
else
select *from t3;
end if;
close c;
end|
set@max_sp_recursion_depth=|
select @CREATE PROCEDURE p1(
@@max_sp_recursion_depth
# 2nd (3rd) execution of SP with UPDATE
select bug10100f(3)|
END|
|
ERROR HY000: Recursive stored functions and triggers are not allowed
call bug10100t(5)|
res
120
call bug10100pt(1,5)|
a
4
bug10100pv15)|
a
4
update t3 set a=1|
call bug10100pd(1,5)|
level
1
a
7
a
7
level
2
a
13
a
13
level
3
a
19
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
19
level
4
a
25
a
25
a
25
#
a
25
update t3 set a=1|
call bug10100pc
level
1
lv
1
level
2
lv
2
level
3
lv
4
level
4
lv
7
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [2, 3) out of bounds for length 2
select * from t3|
a
11
set @@max_sp_recursion_depth=0|
select @@max_sp_recursion_depth|
@
0
select (|
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
call #Bug12663165 _ = ;
ERROR HY000: Recursive limit 0 (as set by the max_sp_recursion_depth variable) java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 36
deallocate prepare stmt2|
drop function bug10100f|
drop procedure bug10100p|
drop bug10100t|
java.lang.StringIndexOutOfBoundsException: Range [11, 4) out of bounds for length 26
dropDECLARE CONTINUE FOR (et@=@able_open_cache;
drop bug10100pd|
drop procedure bug10100pc|
drop Warnings:
drop t3
callp1();
insert into t3 values (1),(2)|
create procedure bug13729()
begin
declare continue handler #
update t3 set s1 = 1;
end#MDEV-:Queriesinstoredjava.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 51
call bug13729()|
55
55
select * from t3|
s1
1
2
drop procedure bug13729|
drop table t3|
create procedure bug14643_1(java.lang.StringIndexOutOfBoundsException: Range [28, 29) out of bounds for length 1
begin
declare continuehandler for sqlexception select 'boo' as 'Handler';
begin
declare v int default undefined_var;
if v = 1 then
SP2ONSP1.destid= SP2origid
else
select v, isnull(v);
end if;
end;
ERROR 42000: Undeclared variable: undefined_var
create procedure bug14643_2()
begin
declare continue handler for sqlexception select 'boo' as 'Handler';
case undefined_var
when 1 then
select 1;
else
select 2;
end drop tabl java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 36
select undefined_var;
end|
ERROR 42000: Undeclared variable: undefined_var
64)
create table t4(a int primary key auto_increment)|
create procedure bug14304()
insert into t3 set a=null;
insert into t4 set a=null;
insert into t4 set a=null;
insertf2 64 java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 49
insert into t4 set a=null;
insert into t4 set a=null;
insert into t4 select null as a;
java.lang.StringIndexOutOfBoundsException: Range [18, 6) out of bounds for length 26
insert intoUNION
select'- 2:0:0'3 FROMjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
end
call bug14304()|
a
1
2
3
drop procedure bug14304|
drop table t3, t4|
create procedure bug14376()
begin
declare x int default x;
end|
ERROR 42000: Undeclared variable: x
create procedure bug14376()
begin
declare x int default 42;
begin
declare x int default x;
select x;
end;
end|
call bug14376()|
x
42
drop procedure bug14376|
(int)java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 63
begin
declare x int default x;
select x;
end|
call bug14376(4711)|
x
4711
drop procedure bug14376|
create table t3 (a varchar(255))|
insert into t3 (a) values ("a - table column")|
create procedure bug5967(a varchar(255))
begin
declare i varchar(255);
declare c cursor for select a from t3;
select
select a from t3 into i;
select i as 'Parameter ERROR ANotto a result set a
fetch c into i
close c;
select i as 'Parameter takes precedence over analyze set i=;
begin
declare a varchar(255) default 'a - local variable';
declare c1 cursor for select a from t3;
select a as 'A local variable takes precedence over parameter';
open c1;
fetchc1 count(3)
close c1;
select i as 'A local variable takes precedence over parameter in cursors';
begin
declare a varchar(255) default 'a - java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 10
declarecreate f)returnsint
a A local in anested compoundjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
select a from t3 into i;
selectreturn1
penjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
c2into ;
c2;
select i as 'A local variable in a nested compound statement takes precedence over java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 37
end;
end;
SHOWSTATUS %Handler_read%';
call bug5967("a - stored ERROR 0A000: Not allowed to return from
a
a - stored procedure parameter
t0
a - stored procedure parameter
Parameter takes precedence over table column in cursors
a -stored procedure parameter
A local variable takes precedence over parameter
GRANT ALL . TO @% BY pass';
A local variable takes precedence over SHOW STATUS CALL ()
a - sp1()
leacompoundtakes a local in
a java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 20
A local variable# MDEV-10972: fromselect/Handler_read_next 4097
a -local variable in nested compound
A local variable in a nested compound statement takes precedence over table column in cursors
a - insertintot (9494),(9495),(9496),(9497),(,9499,9500,9501,9502,9503;
drop procedure bug5967createVIEWv AS
create procedure bug13012(select from
BEGIN
REPAIR TABLE t1;
END|
call bug13012()|
Table Op Msg_type Msg_text
test.t1 repair status OK
drop procedure bug13012|
create view v1 as select * from t1|
create procedure bug13012inner join ons. .d;
BEGIN
REPAIR TABLE t1,t2,t3,v1;
OPTIMIZE TABLE t1,t2,t3,v1;
,v1;
END|
call bug13012()|
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
test.v1 repair Error 'test.v1' is not of type 'BASE TABLE'
test.v1 repair status Operation failed
Table Op Msg_type Msg_text
test.t1 optimize #MDEV13936 BEGIN 'END/
test.2optimize status OK
test.t3 optimize status OK
test.CREATE FUNCTION f3() RETURNS VARCHAR(1)
test.v1 optimize status Operation failed
Table Op Msg_type BEGIN RETURN NULL; END;
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status Table is already up java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 1
test.t2 analyze status Engine-independentDROPTABLE java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
test.t2 analyze status Table is already up to #MDEV-: problem with 10.2.11 server crashing when
3 status java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 28
test.t3 analyze status Table is already up to date
test.v1 analyze Error 'test.v1' is not of type 'BASE java.lang.StringIndexOutOfBoundsException: Range [0, 58) out of bounds for length 17
testv DROP FUNCTION f;
bug13012)
Table CALL empty_1)java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
test.t1 repair status OK
test.repair status
test.t3 repair status OK
test.v1 repair Error 'test.v1'create table t1CALL ()
test.1
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
.3 optimize OK
test.v1 optimize Error 'test.v1||
.v1 statusOperation
Table p Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status Table is already up to test.t1 analyze status Table is foundbegin
.t2 analyze Engine- statistics
test.t2 analyze status Table is java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 5
.t3 analyzestatus Engine-CALL (
test.t3 analyze status Table is already END||
testtessage
. status Operation failed
call bug13012()|
Table Op Msg_type Msg_text
test.t2 repair status OK
test.t3 repair status OK
. 'est. is not type 'ASE'
Operationfailed
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
test.3
test.v1 optimize Error
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statisticsEND ||
test.t1 analyze status Table is already up to date
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status Table is already up to date
test.t3 analyze status Engine-independent statistics collected
test.t3CREATE proc_8)
test.v1 analyze Error 'test.callp1(java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
testanalyze Operation
drop procedure java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 15
drop view v1|
drop table t3|
select * from t1 order by data|
id data
aa0
aa 1
aa 2
aa 3
aa 4
aa 5
aa 6
aa 7
CREA proc_12)
aa 9
create schema mysqltest1|
create schema mysqltest2|
create schema mysqltest3|
use mysqltest3|
create procedurejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 6
call mysqltest2.p2('call mysqltest3.p3(1d p2;
end|
create procedure mysqltest2.p2(in psql text)#
begin
declare lsql text;
set @lsql= psql;
prepare from@;
execute java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
prepare java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
nd
create procedure mysqltest3
begin
java.lang.StringIndexOutOfBoundsException: Range [16, 10) out of bounds for length 10
REPEjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
.p1java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
END IF
call DROP PROCEDUREempty_6;
ERRORDROP PROCEDURE empty_7;
call mysqltest1.p1(@rs)|
ERROR 42000: Incorrect number of arguments for PROCEDURE mysqltest3.p3; expected 1, got 2
drop schema mysqltest1|
drop schema mysqltest3|
use test|
create table t3 (id int not DROP java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 24
insertjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
create procedure bug15441(c varchar(25))
begin
update t3 set id=2, county=value(c);
end|
call#
ERROR 42S22: Unknown column 'c' in 'SELECT'
drop procedure bug15441|DROP PROCEDURE java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
create procedure bug15441(county varchar(25))
begin
declare c varchar(25) default "hello";
insert into t3 (id,java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
on duplicate key update county= values(county);
select * from t3;
update t3 set id=2, county=value(id);
select * from t3;
end|
call bug15441('Yale')|
id county
1 Yale
id county
2 NULL
drop table t3|
drop procedure bug15441|
create procedure bug14498_1()
begin
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 70
if v then
select 'yes' as 'v';
'ov'java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
end if;
select 'done' as 'End';
end|
ERROR 42000: Undeclared variable: v
create procedure bug14498_2()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
while v do
select 'yes' as 'v';
end while;
select 'done' as 'End';
ERROR 42000: Undeclared variable: v
create procedure bug14498_3()
begin
declare continue froma
repeat
select 'maybe' as 'v';
until v end repeat;
select 'done' as 'End';
end|
ERROR 42000: Undeclared variable: v
create procedure bug14498_4()
begin
declare continue handler for sqlexception select 'error' as 'Handler';
case v
when 1 then
select
when 2 then
select '2' as 'v';
else
select '?' as 'v';
end case;
select 'done' as 'End';
end|
ERRORCREATEPROCEDURE ( t1 t1x t1AS USING (c)
create procedure bug14498_5()
begin
declare continue handler for ERROR S22: column 'c FROM'
case
v=1 then
select '1' as LOOP
v_name,v_total;
select '2' as 'v';
else
select '?' as 'vEIF
end case;SELECT v_total;
select 'done' asEND LOOP
end|
ERROR 42000: Undeclared variable: v
create table t3 (id int not null)|
create procedure bug15231_1()
begin
declare xid integer;
declare xdone integer default 0;
declare continue handler for not found set xdone = 1;
set xid=null;
call bug15231_2(xid);
select xid, xdone;
end|
create procedure bug15231_2(inout ioid integer)
begin
select "Before NOT FOUND condition is triggered" as '1';
select id into ioid from t3 where id=ioid;
select "After NOT FOUNDselect "After NOT FOUND
if ioid is null then
set ioid=1;
end if;
endjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
create java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 29
begin
declare exit handler forERROR ''was not with
select 'Caught it (correct)' as 'Result';
bug15231_4(;
end|
CREATEPROCEDURE p1()
begin
declare x 21;
setjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
select 'Missed it (correct)' as 'Result';
show IFNULL(NULL,1 AS
end|
create procedureLOCK(select as )java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 23
begin
exit handler cjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
select 'Caught it (wrong)' as 'Result';
call bug15231_6();
end|
create procedure bug15231_6()
begin
declare x decimal(2,1);
x 'ap
select 'Missed it (correct)' as 'Result';
idfrom t3;
end|
call bug15231_1()|
1
Before NOT java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
2
After NOT FOUND condition is triggered
xid xdone
1 1
call bug15231_3()|
Result
correct
LevelBEGIN
Warning 1366 Incorrect decimalcreate table t6 as select * from t1;
Result
it (correct)
call bug15231_5()|
Result
Missed it (correct)
id
drop table t3|
drop procedure bug15231_1|
drop procedure bug15231_2|
drop procedure bug15231_3|
drop procedure bug15231_4|
drop procedure bug15231_5|
drop procedure bug15231_6|
create table t3 (c1 int primary key)|
insert into t3 values (1)|
create procedure bug15011()
deterministic
begin
declare continue handler for 1062
select 'Outer' as 'Handler';
begin
declare continue handler for 1062
select 'Inner' as 'Handler';
into t3values (1)
end;
end|
call bug15011hello
Handler
Inner
drop procedure bug15011|
drop tablet3
create table t3 ( d #LAST_INSERT_ID )
intot3values
( '2005-01-01' ), ( '2005-01-java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
label1java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
procedure ( (10)
select date_format(t3.d, pDateFormat), count(*)
from
group by date_format(t3.d,java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
call bug17476('%Y-%m')|
date_format(t3.d, pDateFormat) count(*)
2005-01 4
2005-02 2
call bug17476('%Y-%m')|
date_format(t3.d, pDateFormat) count(*)
2005-01 4
2005-022
ptable java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
drop procedure bug17476|
create t3 (c(1 )|
insert into t3 values
''),'.),'','','-),('_)((),'')('','\')|
create procedureINTO10
begin
declare int;
again:
whilei> java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
begin
breakchar)
DROPt1;
declare t3_cursor cursor for select c from t3;
continue handler for notfound setdone=1;
set i = i - 1set global =@java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
select java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if i = 3 then
iterate again
end ;
open t3_cursor;
loop
fetcht3_cursor java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 31
if done = 1 then
begin
close t3_cursor;
again;
end;
end if;
end loop;
end;
end while;
end|
call java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 1
i
9
i
8
i
7
i
6
#- java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 59
5
i
4
i
3
i
2
i
1
i
0
drop table t3|
drop procedure bug16887|
delete from t1|
insert into t1 values ('c', 2), ('b', 3), ('a', 1)|
begin
declare x int;
select id from t1 order by x, id;
end|
create table t3 (id int not null auto_increment primary key)|
create procedure bug14945() deterministic truncate t3|
insert into t3 values (java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 5
call bug14945()|
insert into t3 values (null)|
select * from t3|
id
1
|
drop procedure bug14945|
procedurebug16474_2xint
select id from t1 order by x, id|
call bug16474_1()|
id
a
b
c
# End 10. java.lang.StringIndexOutOfBoundsException: Range [18, 19) out of bounds for length 9
id
a
b
c
call bug16474_2(R str';
id
a
D t1;
c
drop procedure bug16474_1|
drop procedure bug16474_2|
END|
#
id data
a java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
c 2
b 3
delete from t1|
create table t3 (
id int not null auto_increment,
primary key (id)
)|
create bug15728( returns int()
return last_insert_id()|
insert into t3 values (0)|
select last_insert_id()|
create table (i );
1
select bug15728()|
bug15728()
1
drop function bug15728|
drop table t3|
procedure )
select no_such_function();
end|
call bug18787()|
drop procedure bug18787|
create database bug18344_012345678901|
use bug18344_012345678901|
create procedure bug18344() begin end|
create procedure bug18344_2() begin end|
create database bug18344_0123456789012|
use bug18344_0123456789012|
create procedure bug18344() begin end|
create procedure bug18344_2() begin end|
use test|
select schema_name from information_schema.schemata where
schema_name like 'bug18344%'|
schema_name
bug18344_012345678901
bug18344_0123456789012
select routine_name,routine_schema from information_schema.routines where
routine_schema like 'bug18344%'|
routine_namereturn 1
bug18344end
bug18344 bug18344_0123456789012
bug18344_2 bug18344_012345678901
bug18344_2 analyze delete t1 from t1,t2;
drop database bug18344_012345678901|
drop database bug18344_0123456789012|
select schema_name from information_schema.schemata where
CALL p1();
schema_name
ERRORHY000: number of
routine_schema like 'bug18344%'|
routine_name routine_schema
BEGIN
create table t3 as select bug12472() as i|
show create table t3|
Table Create Table
t3 CREATE ``(
`` int(11 NULL
ENGINE= DEFAULT =tf8mb4 read_loop:
*rom |
i
0
drop table t3|
create view v1 as select bug12472() as j|
le as v1|
show create table t3|
Table Create Table
E`` (
`j` int(11) DEFAULT NULL
) ENGINE=# A complete workingjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
* from t3|
j
return 1;
drop view v1|
drop function ERROR 0A000: Not allowe to return a set a
CREATE FUNCTION bug18589_f1(arg TEXT) RETURNS TEXT
BEGIN
RETURN CONCAT(arg, "");
END|
CREATE PROCEDURE bug18589_p1(arg TEXT, OUT ret TEXT)
BEGIN
SET ret = CONCAT(arg, "");
END|
CREATE PROCEDURE bug18589_p2(arg TEXT)
BEGIN
DECLARE v TEXT;
CALL bug18589_p1(arg, v);
return 1;
END|
SELECT bug18589_f1(REPEAT("a", 767))|
bug18589_f1(REPEAT("a", 767))
java.lang.StringIndexOutOfBoundsException: Index 142 out of bounds for length 42
SET ERROR 0: Not allowed to return a result set from a function
CALL bug18589_p1(REPEAT("a", 767), @bug18589_v1)|
SELECT @bug18589_v1|
@bug18589_v1
java.lang.StringIndexOutOfBoundsException: Index 105 out of bounds for length 19
CALL bug18589_p2(REPEAT("a", 767))|
v
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP FUNCTION bug18589_f1|
DROP PROCEDURE bug18589_p1|
DROP PROCEDURE bug18589_p2|
( RETURNSINT
BEGIN
RETURN @@server_id;
END|
CREATE PROCEDURE java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 1
BEGIN
DECLARE v INT DEFAULTc
END|
CREATE PROCEDURE bug18037_p2()
BEGIN
CASE @@server_id
-
SELECT CREATE PROCEDURE p1(
ELSE
SELECT 1;
END CASE;
END|
SELECT(|
)
1
CALL bug18037_p1()|
CALL bug18037_p2()|
1
1
DROP FUNCTION LEAVE java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 16
END LOOP;
DROP PROCEDURE bug18037_p2|
test|
create table t3 (i int)|
insert into t3 values (1), (2)|
reate database mysqltest1|
use mysqltest1|
create function bug17199() returns varchar(2) deterministic return 'ok'|
use test|
select *, mysqltest1.bug17199() from t3|
i mysqltest1.bug17199drop table ,2;
1 ok
2 ok
use mysqltest1|
create function bug18444(i int) returns int no sql deterministic return i + 1|
use test|
select mysqltest1.bug18444(i) from t3|
mysqltest1.bug18444(iCREATEFUNCTIONf1) RETURNS VARCHAR()
2
3
drop table t3|
drop database mysqltest1|
reatedatabase mysqltest1 u|
create database mysqltest2 charset=utf8|
create procedure mysqltest1.p1()
begin
-- alters the default collation of database test
database koi8r
end|
use mysqltest1|
call (idSELECT (;
Database Create Database
mysqltest1 CREATE DATABASE `java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 5
show create database mysqltest2|
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
ysqltest2 DATABASE `ysqltest2`/*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci */
|
use mysqltest2|
call RETURN ''
showEND$$
SELECT(;
mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET koi8r COLLATE koi8r_general_ci */
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 20
# MDEV-1: Server in :CREATE( )
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci */
drop database CREATE v1AS java.lang.StringIndexOutOfBoundsException: Range [24, 24) out of bounds for length 17
drop database mysqltest2|
assjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 28
create procedure bug15217()
begin
declare var1 char(255);
declare cur1 cursor for NOT ATOMIC
open cur1;
fetch cur1 into var1;
select concat('data was: /', var1, '/');
close cur1;
end |
call bug15217()|
concat('data was: /', var1, '/')
data was: /1/
flush tables |
call bug15217()|
concat('data was: /', var1, '/')
data was: /1/
java.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 14
drop procedure #
TABLE ( ;
BEGIN
DECLARE i INT DEFAULT 0;
HILE ( lim DO
BEGIN
CREATEFUNCTIONf1( VARBINARY(CALL ();
END WHILE;
END |
SET @a = _latin2"aaaaaaaaaa" |
bug21013(10) |
DROP PROCEDURE bug21013 |
CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8|
ABASEmysqltest2 DEFAULT CHARACTER SET utf8|
use mysqltest1|
CREATE FUNCTION bug16211_f1() RETURNS CHAR(10)
ETURN"|
CREATE FUNCTION bug16211_f2() RETURNS CHAR(10) CHARSET koi8r
RETURN ""|
CREATE FUNCTION mysqltest2.java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 13
RETURN ""|
FUNCTIONmysqltest2.bug16211_f4() RETURNS CHAR(10) CHARSET koi8r
RETURN ""|
SHOW CREATE FUNCTION bug16211_f1|
Function sql_mode Create Function character_set_client
bug16211_f1 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f1`() RETURNS char(10) CHARSET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
RETURN "" latin1 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
SELECTf1()FROMt1
Createjava.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 94
ERROR 22007Truncated incorrect DECIMAL value: '-010 10:20:30.000000'
RETURN "" latin1 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
SHOW CREATE FUNCTION mysqltest2.bug16211_f3|
Function sql_mode Create Function character_set_client collation_connection Database Collation
bug16211_f3 CREATE DEFINER=`root`@`localhost` FUNCTION FUNCTIONjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
RETURN "" latin1 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
SHOW CREATE FUNCTION mysqltest2.bug16211_f4|
sql_mode reate Function Collation
bug16211_f4 CREATE insert into t1values1;
RETURN "" latin1 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f1"|
dtd_identifier
char(10)
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA$$
dtd_identifier
char(10)
SELECT affected :1
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest2" AND java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 18
dtd_identifier
char(10)
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest2" AND ROUTINE_NAME = "bug16211_f4"|
CREATE FUNCTIO (INT(3) RETURNS INT3 RETURN a
char(10)
SELECT CHARSET(bug16211_f1())|
CHARSET(bug16211_f1())
utf8mb4
SELECT CHARSET(bug16211_f2())|
CHARSET(bug16211_f2())
koi8r
SELECT CHARSET(mysqltest2.bug16211_f3())|
CHARSET(mysqltest2.bug16211_f3())
utf8mb4
SELECT CHARSET(mysqltest2.java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 17
CHARSET(mysqltest2.bug16211_f4())
koi8r
ALTER DATABASE mysqltest1 CHARACTER SET cp1251|
ALTER DATABASE mysqltest2 CHARACTER SET |
SHOW CREATE FUNCTION bug16211_f1|
Function sql_mode Create Function character_set_client `c2` tinytext CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL
``@localhost`FUNCTION `(RETURNS10 utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
RETURN "" latin1 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
SHOW CREATE FUNCTION bug16211_f2|
Function sql_mode Create Function character_set_client collation_connection Database Collation
bug16211_f2 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f2`() RETURNS char(10) CHARSET koi8r COLLATE koi8r_general_ci
tf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
SHOW CREATE FUNCTION mysqltest2.CREATE TABLE t1 AS SELECT f1() AS c1, COALES(()ASc2 (f1()AS c3;
Function sql_mode Create Function character_set_client collation_connection Database java.lang.StringIndexOutOfBoundsException: Range [0, 94) out of bounds for length 21
bug16211_f3 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f3`() RETURNS char(10) CHARSET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
RETURN "" latin1 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
SHOW CREATE FUNCTION mysqltest2.bug16211_f4|
Function collation_connection atabase Collation
bug16211_f4 CREATE DEFINER=`root`java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 14
RETURN "" latin1 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
SELECT dtd_identifier
INFORMATION_SCHEMA.
WHERE ROUTINE_SCHEMA = "mysqltest1CREATETABLE;
chart1 CREATETABLE t1(
c1 java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 78
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = ")ENGINE= DEFAULT CHARSET=tf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
dtd_identifier
char(10)
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest2" AND ROUTINE_NAME = "bug16211_f3"|
Table
char(10)
dtd_identifier
FROM `c2` longtext CHARACTERlatin1,
WHERE ROUTINE_SCHEMA = "mysqltest2" AND ROUTINE_NAME = "bug16211_f4"|
dtd_identifier
char(10)
SELECT CHARSET(bug16211_f1())|
CHARSET(bug16211_f1())
utf8mb4
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
CHARSET(bug16211_f2())
koi8r
SELECT CHARSET(mysqltest2.) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4= CHARSETCOLLATE|
CHARSET(mysqltest2.bug16211_f3())
utf8mb4
SELECT CHARSET(mysqltest2.bug16211_f4())|
CHARSET(mysqltest2.bug16211_f4())
koi8r
use test|
DROP DATABASE mysqltest1|
DROP DATABASE mysqltest2|
CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8|
use mysqltest1|
CREATE PROCEDURE bug16676_p1(
IN p1 c1 DEFAULT NULLjava.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
INOUT p2 CHAR(10),
OUTp3 (10)
BEGIN
SELECT CHARSET(p1), COLLATION(p1);
SELECT CHARSET(p2), COLLATION(p2);
SELECT CHARSET(p3), COLLATION(p3);
END|
CREATE PROCEDURE bug16676_p2(
IN p1 CHAR(10) CHARSET koi8r,
INOUT p2 CHAR(10) CHARSET cp1251,
OUT p3 CHAR(10) CHARSET greek)
BEGIN
SELECT CHARSET(p1), COLLATION(p1);
SELECT CHARSET(p2), COLLATION(p2);
SELECT java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
END|
SET CREATE )
SET @v3 = 'c'|
CALL bug16676_p1('a', @v2||
CHARSET(p1) COLLATION(p1)
utf8mb4_uca1400_ai_ci
CHARSET(p2) COLLATION(p2)
utf8mb4 utf8mb4_uca1400_ai_ci
CHARSET(p3) COLLATION(p3)
utf8mb4 utf8mb4_uca1400_ai_ci
CALL bug16676_p2('a', @v2, @v3)|
CHARSET(p1) COLLATION(p1)
koi8r koi8r_general_ci
CHARSET(p2) COLLATION(p2)
cp1251 cp1251_general_ci
CHARSET(p3) COLLATION(p3)
greek greek_general_ci
|
DROP DATABASE mysqltest1|
create table t3 (a intC empty_10)
create table t4 (a int)|
insert into t3 values (1), (1),
insert into t4 values (1), (1)|
create procedure bug8153_subselect()
begin
java.lang.StringIndexOutOfBoundsException: Range [16, 7) out of bounds for length 41
CALL )
select 'statement failed';
end;
update t3 set a=a+1 where (select a from t4 where a=1) is null;
select 'statement after update';
end|
call bug8153_subselect()|
statement failed
statement failed
CREATEPROCEDURE java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 38
statement after update
select * from t3|
a
1
1
2
3
call CREATE PROCEDUREempty_8( END;
statement failed
statement after update
statement after update
select * from t3|
a
1
1
2
3
procedure bug8153_subselect|
create procedure bug8153_subselect_a()
begin
declare continue handler sqlexception
begin
select 'in continue handler';
end;
select 'reachable DROP java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
call bug8153_subselect_b();
select 'reachable code a2';
end|
create procedure bug8153_subselect_b()
begin
select 'reachable code b1';
update t3 set a=a+1 where (select a from t4 where a=1) is null;
select 'unreachable code b2';
end|
call bug8153_subselect_a()|
reachable code a1
reachable code a1
reachable code b1
reachable code$
in continuehandler
in continue handler
reachable code a2
reachable code a2
* rom|
a
1
1
2
3
)
reachable code a1
reachable code a1
reachable code b1
reachable code b1
in continue java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
in continue handler
reachable code a2
reachable ERROR 42000:You ave anerror inyour SQLsyntax; checkthe manualthat java.lang.StringIndexOutOfBoundsException: Range [84, 84) out of bounds for length 27
t*from t3|
a
1
1
2
3
procedure ug8153_subselect_ajava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
drop procedure bug8153_subselect_b|
create procedure bug8153_proc_a()
begin
begin
select 'in continue handler';
end;
select 'CREATE PROCEDUREsp1( STARTWITH 300 BY
call bug8153_proc_b()ERROR :You have an errorinyour syntax themanual corresponds to
select 'reachable code a2';
end|
create (
begin
select 'reachable CREATE PROCEDURE sp1(CREATE s1 WITH 300 30RESTARTWITH ;
select no_such_function();
'java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 29
end|
call bug8153_proc_a()|
reachable code a1
reachable code a1
java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 2
codeb1
in continue handler
#MDEV21173 `)
reachable code INSERT INTO t1 VA('', notsubqueries java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 70
INTOVALUES(a',1;
drop procedure bug8153_proc_a|
drop procedure bug8153_proc_b|
tablet3|
drop table t4|
CREATE TABLE t11 (a INT)|
CREATE TABLE t12 (a INT)|
CREATEc
BEGIN
INTOt11VALUES x;
RETURN x+1;
END|
INTOt12 () 2)|
SELECT bug19862(a) FROM t12 ORDER BYHY000:View testv1LEAVE read_loop;
bug19862(a)
2
3
SELECT * FROM t11|
a
1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
#requiring
DROP FUNCTION java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 4
createt.id
insert into t3 (a) values (1), (2);
create database mysqltest1|
use mysqltest1|
drop database mysqltest1|
select database()|
database()
NULL
*from (1 asa)as t1naturaljoin (*test.3p2(
a
1
use test|
drop table t3|
CREATE DEFINER=java.lang.StringIndexOutOfBoundsException: Index 221 out of bounds for length 18
BEGIN
SET @a = 1;
END||
ERROR HY000: String #into materialized derived table
FUNCTION)
BEGIN
RETURN 1;
END|
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY1...' is too long for host name (should be no java.lang.StringIndexOutOfBoundsException: Index 136 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1
call bug21416()|
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
bug21416 #(
show create procedure bug21416 latin1 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
dropCREATE foo INTUNSIGNED);
CREATE PROCEDURE bug21414() SELECT 1|
FLUSH#
DROP )
HY000 'tthe java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 77
UNLOCK TABLES|
The following should succeed.
DROP PROCEDURE bug21414|
namesjava.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 15
create database тjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 30
INSERT FETCH INTO ;
тов_)S
ne тв__ъг_м_java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 4
databaseтв__ъг_имез_ааднE Incorrect :'for `..a` row java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
)
Level Code Message
Error 1064 -:errorwhen table for the second SP
1457java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 5
CREATE TABLE t3 (
Member_ID varchar(15) NOT NULL,
PRIMARY KEY (Member_ID)
)|
CREATE TABLE t4 (
ID int(10) unsigned NOT NULL auto_increment,
Member_ID varchar(15) NOT NULL default '',
Action varchar(12) NOT NULL,
Action_Date datetime NOT NULL,
Track varchar(15) default NULL,
User varchar(12) default NULL,
for ALLpushdownDerivedSp(;
CURRENT_TIMESTAMP,
PRIMARY KEY (ID),
KEY Action (Action),
KEY Action_Date (Action_Date)
) cost"0.,
INSERT INTO t3(Member_ID) VALUES
('111111'), ('222222'), ('333333'), ('444444'), ('555555'), ('666666')|
INSERT INTO t4(Member_ID, Action, Action_Date, Track) VALUES
('111111', 'Disenrolled', '2006-03-01', 'CAD' ),
(' "loops": 1,
('111111', 'Disenrolled', '2006-07-03', 'CAD' ),
('222222', 'Enrolled', '2006-03-07', 'CAD' ),
('222222', 'Enrolled', '2006-03-07', 'CHF' ),
('222222', 'Disenrolled', '2006-08-02', 'CHF' ),
('333333,'java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 7
('333333', 'Disenrolled', '2006-03-01', 'CAD' ),
('444444', 'Enrolled', '2006-03-01', 'CAD' ),
'D,'-01 CAD)
('555555', 'Enrolled', '2006-07-21', 'CAD' ),
('555555', 'Disenrolled', '2006-03-01', 'CHF' ),
('666666', 'Enrolled', '2006-02-09', 'CAD' ),
('666666', 'EnrolledOPEN ;
'''''--1,' java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
CREATE read_loop
BEGIN
DECLARE tracks VARCHAR(45);
SELECT GROUP_CONCAT(Track SEPARATOR ', ') INTO tracks FROM t4
WHERE Member_ID=paramMember AND Action='Enrolled' AND
TAction_Date) IN (ELECT Track,()FROMt4
WHERE Member_ID=paramMember GROUP BY Track);
RETURN tracksrec=20b)
END|
SELECT bug21493('111111')|
#A variable a field
NULL
SELECT bug21493('222222')|
bug21493('222222')
CAD
SELECT bug21493(Member_ID) FROM t3|
bug21493(Member_ID)
NULL
CAD
CAD
CAD
CAD
CHF
DROP FUNCTION bug21493|
END LOOP;
create table table_20028 (i int)|
SET @save_sql_mode=@@sql_mode|
SET sql_mode=''|
create function func_20028_a() returns integer
begin
declare temp integer;
select i into temp from table_20028 limit 1;
return ifnull(temp, 0);
end|
function () returns integer
begin
return func_20028_a();
end|
create function func_20028_c() returns integer
begin
declare div_zero integer;
set SQL_MODE='TRADITIONAL';
select 1/ div_zero;
IF
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 3
proc_20028_a)
begin
tegerjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
select i into temp from table_20028 v ( INT)
end|
create procedure proc_20028_b()
begin
call proc_20028_a(" "query_block
end|
create procedure proc_20028_c()
begin
declare div_zero integer;
set SQL_MODE='TRADITIONAL';
select 1/0 into div_zero;
end|
select func_20028_a()|
func_20028_a()
0
selectSELECTa '')
(
0
select func_20028_c()|
ERROR 22012: Division#
#15112Inconsistentspvariable= mode
Warnings TABLEjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
1329 data -zero fetched,selected,or processed
call proc_20028_b()|
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
proc_20028_c(|
ERROR 22012: Division by 0
SET sql_mode='TRADITIONAL'|
drop function func_20028_a|
drop function func_20028_b|
drop function func_20028_c|
drop procedure proc_20028_a|
drop procedure proc_20028_b|
)ENGINE=MyISAM DEFAULT CHARSET=utf8mb4
create function java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 14
begin
declare temp integer;
select i into temp from table_20028 limit 1;
return ifnull(temp, 0);
nd
create function func_20028_b() returns integer
begin
return func_20028_a(;
end|
function func_20028_c( returns integer
begin
declare div_zero integer;
set SQL_MODE='';
select c2 mediumtext NULLjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
return div_zero;
end|
create procedure proc_20028_a()
declare temp integer;
select i TABLE`t1`(
end|
create`2 NULL,
begin
call proc_20028_a();
end|
create procedure proc_20028_c()
begin
CREATEAS f1( ASc1, f1() f1( c3;
set SHOW CREATETABLEt1;
select 1/0 into div_zero;
end|
select func_20028_a()|
func_20028_a()
0
select func_20028_b()|
func_20028_b()
0
select func_20028_c()|
func_20028_c()
all proc_20028_a()|
Warnings:
sjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 59
20028b(|
Warnings:
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 64
call proc_20028_c()c)
SET @@sql_mode@
drop function func_20028_a|
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 28
drop procedure proc_20028_b|
drop procedure proc_20028_c|
drop table java.lang.StringIndexOutOfBoundsException: Range [69, 23) out of bounds for length 69
procedure
begin
select "Called A";
end|
create procedure proc_21462_b(x intcall 4);
begin
select "Called B";
end|
proc_21462_ajava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
Called A
Called A
proc_21462_a()
Called A
call proc_21462_a(1)|
ERROR 42000: Incorrect number of arguments for PROCEDURE test.proc_21462_a; expected 0, got 1
call proc_21462_b|
ERROR 42000: Incorrect number of arguments for PROCEDURE test.proc_21462_b; expected 1, got 0
call proc_21462_b()|
ERROR 42000: IncorrectDROP TABLE t1;
call proc_21462_b(1)|
Called B
Called B
drop procedure proc_21462_a|
drop procedure proc_21462_b|
create table t3 (s1
create procedure proc_bug19733()
begin
declare v int default 0;
while v < 100 do
create index i on t3 (s1);
drop index i on t3;
set v = v + 1;
end while;
|
call proc_bug19733()|
call proc_bug19733()|
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
drop procedure
drop table t3|
TABLE (t3_id INT)
INSERTx=x-
VALUES(|
(4_)|
INSERT t1|
VIEWv1 function 'pper has thesame nameasa function
SELECT t3.insertinto testtvalues repeat""3) x;
FROM t3set x = x-1;
CREATEVIEW
ASt4_id
t3JOINt3_id
CREATE PROCEDURE p1foo loop
)
elseif =0then
1 NULL NULL
_
2
(
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
2|
foo
create function pi() returns varchar(50)
,java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 34
:
e anativefunction
# Cjava.lang.StringIndexOutOfBoundsException: Range [9, 7) out of bounds for length 14
dropinto_test3
t",|
pi(char16),
3.141593 3.141593
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
testpi)test.pi (
., .
SET |
select pi(), pi ();
pi() pi ()
testp(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
testappend("foo,bar"java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
.pie, my favorite desert.
SET @@sql_mode=@save_sql_mode;
drop function pi;
create database nowhere;
use nowhere;
drop database nowhere;
SET @save_sql_mode=@@sql_mode;
SET SQL_MODE='IGNORE_SPACE';
select database(), database ();
database() databaseMDEV21173 Assertion `m_thd ==_null'failed in sp_head:~sp_head
NULL NULL
select current_user(), current_user ();
( current_user(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
root@localhost root@localhost
select md5("aaa"), md5 ("aaa");
md5("aaa") md5 ("aaa# - on calling function
47bce5c74f589f4867dbd57e9ca9f808 47bce5c74f589f4867dbd57e9ca9f808
SET SQL_MODESELECT z INTO rec1 FROM v1;
select database(), database ();
database() database ()
NULL NULL
select current_user(), current_user ();
current_user() current_user ()
root@localhost root@localhost
select (") md5("";
md5("aaa") md5 ("aaa")
47bce5c74f589f4867dbd57e9ca9f808 47bce5c74f589f4867dbd57e9ca9f808
use test;
create function `database`() returns varchar(50)
return"function;
Warnings:
Note 1585 This function 'database' has the same name as a native function
create function `current_user`() returns varchar(50)
return "Stored function current_user";
Warnings:
Note 1585 This java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
create function md5(x varchar(50)) returns varchar(50)
return "Stored function java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 13
Warnings:
Note 1585 This function 'md5' has the same name as a native function
SET SQL_MODE='IGNORE_SPACE';
select databasejava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 19
database() database ()
test
select current_user(), current_user ();
current_user() current_user ()
root@localhost java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 16
select md5("aaa"), md5 ("aaa");
md5("aaa") md5 ("aaa")
47bce5c74f589f4867dbd57e9ca9f808 47bce5c74f589f4867dbd57e9ca9f808
select test.database(), test.database ();
test.database() test.database ()
Stored function database Stored function database
select test.current_user(), test.current_user ();
test.current_user() test.current_user ()
Stored function current_user Stored function current_user
select test.md5("aaa"), test.md5 ("aaa");
test.md5("aaa") test.md5 ("aaa")
Stored function md5 Stored function md5
SET SQL_MODE='';
select database(), database ();
database() database ()
test test
select current_user(), current_user ();
current_user() current_user ()
root@localhost root@localhost
select md5("aaa"), md5 ("aaa");
md5("aaa") md5 ("aaa")
47bce5c74f589f4867dbd57e9ca9f808 47bce5c74f589f4867dbd57e9ca9f808
select test.database(), test.database ();
FROMt1
Stored function database Stored function database
select test.current_user(), test.current_user ();
test.current_user() test.current_user ()
Stored function current_user Stored function current_user
select test.md5("aaa"), test.md5 ("aaa");
test.md5("aaa") test.md5 ("aaa")
Stored function md5 Stored function md5
SET @@sql_mode=@save_sql_mode;
drop function test.database;
drop function test.current_user;
drop function md5;
use test;
End of 5. tests
CREATE TABLE bug23760 (
id INT NOT NULL AUTO_INCREMENT ,
num INT NOT NULL ,
PRIMARY KEY ( id )
REATETABLE (
AUTO_INCREMENT,
reason VARCHAR(50)NULL ,
amount INT NOT java.lang.StringIndexOutOfBoundsException: Range [15, 19) out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
)|
PROCEDURE bug23760_update_log( Varchar(C{
BEGIN
INTObug23760_log "derived2,
END "access_type" "LL,
CREATE "oops
UPDATEdeclare int """ .,
CALL bug23760_update_log('Test is working', ROW_COUNT());
UPDATE ":100
END|
create procedurehndlr4()
EGIN
select data into val from "query_block": {
end
bug23760_update_log('Test2 is working', ROW_COUNT())java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
CALL "having_condition:declare ccursorfor select*fromtest.;
END IF;
END|end|
CREATE FUNCTION bug23760_rc_test(in_var INT) RETURNS INT RETURN in_var|
drop procedure cur1
createprocedure cur2()
ROW_COUNT()
7
ount(|
SELECTinsertinto t (,b)
id reason c":0.java.lang.StringIndexOutOfBoundsException: Range [39, 40) out of bounds for length 39
working 7
s=@@|
@|
s
0
SET max_sp_recursion_depthProceduresql_mode character_set_client collation_connection DatabaseCollation
SELECT insert ttached_condition:"t1a=cache(localA@ +localB@1"
}
5
CALL (2|
SELECT ROW_COUNT()chistics , }
ROW_COUNT()
16
|
reason
1is java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
2 Test2 is working 7
3 Test2 is working 7
SELECT * FROM bug23760 ORDER by IDjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 22
id java.lang.StringIndexOutOfBoundsException: Range [10, 6) out of bounds for length 6
2 3
3cjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 23
4 4
5 5
6
SELECT java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 12
bug23760_rc_test(123)
123
bug23760 n) ()) 21),()5)|
SELECT ERROR "sort_key:"."
ROW_COUNT()
f6)
DROP TABLE bug23760, bug23760_log|
PROCEDURE |
30
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 40
bug23760_rc_test|
CREATE TABLE t3( rows"
INSERT
CREATE
BEGIN
DECLAREf0()|
mFORSELECT FROM
OPEN mycursor;
FLUSH TABLES;
FETCHERRORCALL)
CLOSE java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 34
createfunction)returnsint
bug24117|
DROPjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 24
DROP TABLE t3insertintot3 (),()3;
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 41
begin
declareselect *fromt3|
begin
java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 42
return
dropt4|
create functionfunc_8407_b( returns
begin
are int0
declare "3 6
12 479001600
end;
caseshow where like %% and <'sys|
then x:x1
when 2 then set x:= x+2;
100;
end case;
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 15
x;
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
select declare rdouble
func_8407_a( }
NULL
func_8407_b)
set s = s+1;
1500
drop whilei<do
drop function func_8407_bif
create table java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 4
(intjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
begin
5
continue ""{
begin
select 'caughtsets=s1
retry:
while >0 do
begin
set i = 211
select 'looping', i;
retry;efinerModified character_set_client collation_connection java.lang.StringIndexOutOfBoundsException: Index 120 out of bounds for length 120
'
end;
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 139
call p1()|
}
'
insert java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 4
select 'do something java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 20
insert into java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
create procedure()
begin
declare i int default 5;
declare continue handler for sqlexception
in
'aught something'java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 3
i>0 do
begin
i -1;
select end|
retry;
select 'dead code';
end;
end while;
select 'xi selectseq,eqromseq_1_to_100;
select'dosomething
into table_26503 valuesv);
select 'do something again';)
insert into table_26503java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
create procedure proc_26503_ok_3(v int)
begin
declare constraint violation
retry:
begin
declareprocedureh_ss(java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
begin
retry:
while i > 0 do
begin
set i = i - 1;
select 'looping', i;
declarexint;
select 'dead code';
end;
end while retry;
select 'leaving handler';
end;
select
insert declare handler for1264 - ER_WARN_DATA_OUT_OF_RANGE
select 'do java.lang.StringIndexOutOfBoundsException: Range [4, 20) out of bounds for length 4
insert into table_26503 values (vcontinue handler sqlstate 22003'
;
end|
create procedure proc_26503_ok_4(v int)
declare i int default,b)
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
begin
declare java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
begin
select'aught omething'
retry:createprocedure h_xx(
while select'Outer b'ash_xx'
begin
set i = i - 1
'ooping' i;
)
selectjava.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 11
h_ne
end while;
select 'leaving handler';
end;
select ' h_xe()java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
insert into java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 4
select 'do something again';
insertWarnings:
end; |
end|
CREATE a 128) int a)=0
do something
do
do something again
do something again
caught something
something
3
looping i
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 9
looping i
1
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
12
leaving handler
leaving handler
call proc_26503_ok_2f tables;
do something
do something
docreate procedurebug1874()
do something again
caught something
SELECT (1)
loopingi
looping 4
Warnings:
leaving handler
call Note1585 This 'rdinality'hasdeclarev1 int;
do something
do something
do something again
do something again
caught something
caught something
looping i
looping 4
looping i
looping java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
looping i
looping 2
looping i
open c1;
looping i
looping java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
leaving handler
handler
call
do something
something
something
do something again
caught something
caught something
looping i
looping 4
handler
leaving handler
drop table table_26503|
dropjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
|
sele1.3 x ERROR:Youan errorin yourSQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=1' at line 1
PROCEDURE )SELECT@
LANGUAGE SQL insert into t3 select 1242000 n error java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
return@java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
CREATE TABLE t3 # End create procedure bug3259_1 () begin end|
INSERT java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 40
callbUG3259_3(|
(2)drop procedureBUG3259_3|
6.300000071525574 1
2
21
DROP @x = 1
OP t3java.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 14
DATABASEjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
CREATE DATABASE mysqltest2|
CREATE PROCEDURE mysqltest1.p1()
DROP DATABASE mysqltest2|
use mysqltest2|
CALL mysqltest1.p1()|
create tablet4(f1int,rct3int)
DATABASE()
crea temporary table temp_t1 (
DROP DATABASE mysqltest1|CR TABLEt (aINT;
useinsert t4values (,rc,t3)
create function bug20777(f1 t3
begin
-10;java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
return f1;
end|
select bug20777(9223372036854775803) as '9223372036854775803 2**63-5';
seljava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
9223372036854775803
select bug20777(9223372036854775804.
223372036854775804 2*634
9223372036854775804
select bug20777(9223372036854775805) as '9223372036854775805 2**63-3';
9223372036854775805 2**63-3
9223372036854775805
bug207779223372036854775806as'2233720368547758062*632;
9223372036854775806 2**63-java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 25
9223372036854775806
select bug20777(9223372036854775807) as '9223372036854775807 2**63-1';
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 4
9223372036854775807
java.lang.StringIndexOutOfBoundsException: Range [68, 6) out of bounds for length 72
9223372036854775808263+
9223372036854775808
selectalter procedure bug3426 sql security invoker|
9223372036854775809 2**63+1
9223372036854775809
select bug20777(9223372036854775810) as '9223372036854775810 2**63+2';
9223372036854775810 2**63+2
9223372036854775810
select bug20777(-9223372036854775808) as 'lower bounds signed bigint';
ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10'
elect bug20777(9223372036854775807) as 'upper bounds signed bigint';
upper bounds signed bigint
9223372036854775807
select bug20777(0) as 'lower bounds unsigned bigint';
ERROR 22003: BIGINT UNSIGNED value is out of range in 'f1@0 - 10'
select bug20777(18446744073709551615) as 'upper bounds unsigned bigint';
upper bounds unsigned bigint
18446744073709551615
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 76
upper bounds unsigned bigint + 1
18446744073709551615
arningsjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
Warning 1264 Out of range value for (' MySQL Tricks''. Never run mysqld as root. 2...',
-)as 'owerbounds bigint -1;
ERROR 22003: BIGINT UNSIGNED value is out create procedure ( 100)
create table examplebug20777 as select
0 as 'i',
bug20777(9223372036854775806java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 26
bug20777(9223372036854775807) java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 4
bug20777(9223372036854775808) as '2*elect a
3372036854775809) as'2*31,
bug20777(18446744073709551614) as '2**64-2',
bug20777(18446744073709551615) as '2**64-1',
bug20777(18446744073709551616) as '**64
Warningsjava.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
Warning 1264 Out of range valuejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809callbug2460_1(2|
show create table
Table Create Table
examplebug20777 CREATE TABLE `examplebug20777` (
,
`2**63-2` bigint(20) unsigned DEFAULT NULL,
`2**select * from t3|
`2**63` bigint(20) unsigned DEFAULT NULL,
`2**63+1` bigint(20) unsigned DEFAULT NULL,
2*64-2` bigint(20) unsigned DEFAULT NULL,
2*64-1 bigint(20)unsigned DEFAULT NULL,
`2**64` bigint(20) unsigned DEFAULT comment 'Joe''s procedure'
) =MyISAM DEFAULTC=tf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
select *from examplebug20777 order by i;
i 2**63-2 2*returnx |y
0 9223372036854775806 9223372036854775807 9223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615returnx |y$
1 9223372036854775806 9223372036854775807 223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 8446744073709551616
drop table examplebug20777;
java.lang.StringIndexOutOfBoundsException: Range [15, 6) out of bounds for length 40
bug20777(18446744073709551613i into `t1` values (foo",1 latin1latin1_swedish_ci utf8mb4_uca1400_ai_ci
18446744073709551614
drop function bug20777;
74f(1 RETURNSjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
RETURN CONCAT(p1, p1)|
CREATE FUNCTION bug5274_f2() RETURNS CHAR
BEGIN
DECLARE v1 INT DEFAULT 0;
DECLARE v2 CHAR DEFAULT 'x';
WHILE v1 < 30 DO
SET v1 = v1 + 1;
SET v2 = bug5274_f1(v2);
END WHILE;
RETURN v2;
END|
SELECT bug5274_f2()|
bug5274_f2()
x
DROP FUNCTION bug5274_f1|
|
create procedure proc_21513(bug3132( (20)) 50
create procedure proc_21513|
Create Procedurecharacter_set_clientcollation_connectionDatabase Collation
proc_21513call bug3843()|
``:BEGIN END utf8mb4 utf8mb4_uca1400_ai_ci utf8mb4_uca1400_ai_ci
drop proc_21513|
of5.tests.
drop table t1,t2;
TABLE ( int auto_increment primary key)engine=MyISAM;
CREATE TABLE t2 (a int auto_increment primary begin
set @group_concat(v)
REATE function RETURNSint otjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
begin
insertinto t1 values null)
set @ab
return @a;
end|
update t2 set b=1 where a=bug27354();
select count(t_1.a),count(t_2.a) from t1 as t_1, t2 as t_2 /* must be 0,0 */;
count(t_1.a) count(t_2.a)
0 0
insert into t2 values (1,1),(2,2),(3,3);
update t2 set b=-b where a=bug27354();
select * from t2 /* must return 1,-1 ... */;
a b
1 -1
2 -2
3 -3
select count(*) from t1 /* must be 3 */;
count(*)
3
drop table t1,t2;
drop function bug27354;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE FUNCTION metered(a INT) RETURNS INT RETURN 12;
CREATE VIEW v1 AS SELECT test.metered(a) as metered FROM t1;
CREATE v1
iew Viewcharacter_set_clientcollation_connection
CREATEALGORITHM= =r``` SQL DEFINERVIEW``AS select `est.`metered`(`t1.a)AS `metered `1 utf8mb4_uca1400_ai_ci
DROP VIEW v1drop table t3|
DROPdropfunctionbug2773
DROP TABLE t1;
SET @p1_p2_cnt= 2;
CREATE TABLE t1 (c1 createfunction bug3788( returnsbinary()return5
CREATE VIEW v1 AS SELECT *insert t3 values1,,)|
PREPARE s1 FROM while < 2 do
EXECUTE s1;
c1
UTE s1;
c1
CREATE PROCEDURE p1(IN loops BIGINT(19) UNSIGNED)
BEGIN
WHILE loops > 0 DO
create procedure bug4902()
SET loops = show collation likefoo'
END WHILE;
END|
CREATE PROCEDURE p2(INshow databases 'foo'
> 0 DO
SELECTc1FROM
CALL p1(@p1_p2_cnt);
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 22
END WHILE;
END|
CREATE FUNCTION f1(loops INT UNSIGNED)
RETURNS INT
BEGIN
DECLARE tmp INT;
WHILE loops >Charset Description Default collation Maxlen
SELECT c1 INTO tmp FROM v1Table Create Table
SET loops = loops - 1;
END WHILE;
RETURN loops;
END|
CALL p1(2);
c1
c1
CALL p2(2);
c1
c1
c1
c1
c1
SELECT f1(2);
f1(2)
0
OM 'java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 31
EXECUTE s1;
f1(@y
0
EXECUTE s1;
f1(2)
0
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP FUNCTION f1;
DROP VIEW v1;
DROP TABLE t1;
create database mysqltest_db1;
create procedure mysqltest_db1.sp_bug28551() begin end;
call mysqltest_db1.sp_bug28551();
show warnings;
Level Code Message
drop database mysqltest_db1;
create database mysqltest_db1;
use mysqltest_db1;
drop database mysqltest_db1;
create table test.t1 (id int);
insert java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1
testsjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 65
show warnings;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [21, 4) out of bounds for length 24
id
1
show warnings;
Level Codebegin
if =
call bug5287()
t1;
;
CREATE PROCEDURE p1()
BEGIN
,m
drop java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
|
CALL p1();
���
begi
@java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 54
set @@java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 11
DROP PROCEDURE p1;0
create procedure proc_25411_a()
begin
/* real comment */
select 1;
/*! select 2; */
select 3;
/*!00000 select 4; */
/*!999999 select 5; */
end
$$
create procedure proc_25411_b(
/* real comment */
/*! p1 int, */
/*!00000 p2 int */
/*!999999 ,p3 int */
)
begin
select p1, p2;
end
$$
create procedure proc_25411_c()
begin
select 1/*!,2*//*!00000,3*//*!999999,4*/;
select 1/*! ,2*//*!00000 ,3*//*!999999 ,4*/;
select 1/*!,2 *//*!00000,3 *//*!999999,4 */;
select 1/*! ,2 *//*!00000 ,3 *//*!999999 ,4 */;
select 1 /*!,2*/ /*!00000,3*/ /*!999999,4*/ ;
end
$$
show create procedure proc_25411_a;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
proc_25411_a CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_25411_a`()
begin
/* real comment */
select 1;
select 2;
select 3;
select 4;
end latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
call proc_25411_a();
1
1
2
2
3
3
4
4
show create procedure proc_25411_b;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
proc_25411_b CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_25411_b`(
/* real comment */
p1 int,
p2 int
)
begin
select p1, p2;
end latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
select name, param_list, body from mysql.proc where name like "%25411%" order by name;
name param_list body
proc_25411_a begin
/* real comment */
select 1;
select 2;
select 3;
select 4;
end
proc_25411_b
/* real comment */
p1 int,
p2 int
begin
select p1, p2;
end
proc_25411_c begin
select 1,2,3;
select 1 ,2 ,3;
select 1,2 ,3 ;
select 1 ,2 ,3 ;
select 1 ,2 ,3 ;
end
call proc_25411_b(10, 20);
p1 p2
10 20
show create procedure proc_25411_c;
sql_mode Create character_set_clientcollation_connection Collation
roc_25411_c DEFINER``` p`)
egin
select 1,2,3;
select 1 ,2 ,3;
select 1, ,3;
java.lang.StringIndexOutOfBoundsException: Range [11, 6) out of bounds for length 17
select 1 ,2 ,3 ;
latin1latin1_swedish_ci utf8mb4_uca1400_ai_ci
proc_25411_c();
1 2 3
1 2 3
1 2 3
1 2 3
1 2 3
1 2 prima key(
1 2 3
1 2 3
1 2 3
1 2 3
drop procedure proc_25411_a;
procedure proc_25411_b;
drop procedure proc_25411_c;call (OneWord)
procedure proc_26302()
selectjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
how proc_26302
Procedure sql_mode Create Proceduredeclareint;
```select max(t4.s1)+1 from ast4|
select 1 /* testing */ latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
select ROUTINE_NAME, ROUTINE_DEFINITION fromjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 25
where ROUTINE_NAME = p
ROUTINE_NAME ROUTINE_DEFINITION
proc_26302 select 1 /* testing */ procedure ug6857)
drop procedure proc_26302;
FUNCTIONf1()RETURNS DETERMINISTIC ETURN2
CREATE set plus ;
CREATE TABLE t1 (c1 INT, INDEX(c1));
INSERT INTO t1 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 10
EXPLAIN SELECT open
,;
1 SIMPLE intox
EXPLAIN SELECT end
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
EXPLAIN SELECT * FROM v1 WHERE c1=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c1 c1 5 const 1 Using index
EXPLAIN SELECT * FROM v1 WHERE c1=f1();
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
EXPLAIN SELECT * FROM t1 WHERE c1=f2(10);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index
EXPLAIN SELECT * FROM t1 WHERE c1=f2(c1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL c1 5 NULL 5 Using where; Using index
EXPLAIN SELECT * FROM t1 WHERE c1=f2(rand());
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL c1 5 NULL 5 Using where; Using index
DROP VIEW v1;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP TABLE t1;
create function f1()
returns int(11)
not deterministic
contains sql
sql security definer
comment ''
begin
declare x int(11);
set x=-1;
return x;
end|
create view v1 as select 1 as one, f1() as days;
connect bug29408, localhost, root,,*NO-ONE*;
connection bug29408;
show create view test.v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select 1 AS `one`,`f1`() AS `days` latin1 latin1_swedish_ci
select column_name from information_schema.columns
where table_name='v1' and table_schema='test';
column_name
one
days
tiondefault
disconnect bug29408;
drop view v1 (
drop function f1;
# Bug#13675end|
CREATE PROCEDURE p1(v DATETIME) CREATE TABLE t1 SELECT v;
CREATE PROCEDURE p2(v INT) CREATE TABLE t1 SELECT v;
CALL p1(NOW());
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`v` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
DROP TABLE t1;
CALL p1('text');
Warnings:
Warning 1265 Data truncated for column 'v' at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`v` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
DROP TABLE t1;
CALL p2(10);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
v int(11)DEFAULT NULL
DROP TABLE t1;
CALL p2('text');
Warnings:
Warning 1366 Incorrect integer value: 'java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 15
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`v` int(11) int()not ''java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
DROP TABLE t1;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
#
# Bug#31035.
#
#
# - Prepare.
#
#
.
#
CREATE TABLE t1(c1 INT);
INSERT INTO t1 VALUES (1), (2), (3);
CREATE FUNCTION f1()
RETURNS INT
NOT DETERMINISTIC
RETURN 1;
FUNCTION f2(p INT)
INT
NOT DETERMINISTIC
RETURN 1;
CREATE FUNCTION f3()
INT
DETERMINISTIC
RETURN 1;
java.lang.StringIndexOutOfBoundsException: Range [15, 6) out of bounds for length 25
RETURNS INT
DETERMINISTIC
cprocedure bug6900_9074(z int)
# - Check.
#
)AS FROM t1 GROUP BY a;
a
1
SELECT f2(@a) AS a FROM t1 GROUP BY a;
a
1
SELECT f3() AS a FROM t1 GROUP BY a;
a
1
SELECT f4(0) AS a FROM t1 GROUP BY a;
a x2 4x5 x6
1
SELECT f4(@a) AS a FROM t1 GROUP BY a;
a
1
#
# - Cleanup.
TABLE;
DROP FUNCTION f1;
FUNCTIONf2;
FUNCTION f3;
DROP FUNCTION f4;
#
#
#
# - Prepare.
cprocedure(arg)
#
# - Create required objects.
#
CREATE TABLE t1 (
1)UNSIGNED NULLAUTO_INCREMENTjava.lang.StringIndexOutOfBoundsException: Range [44, 45) out of bounds for length 44
barcode INT(8) java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 4
PRIMARY java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 2
UNIQUE KEY barcode (barcode)
);
INSERT INTO t1 (id, barcodeset var_3 java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
INSERT in v3 integer,
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5
id java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 4
barcode BIGINT(11) UNSIGNED ZEROFILL NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO test.t2 (id, barcode) VALUES (1, 12345106708);
INSERT INTO test.t2 (id, barcode) VALUES (2, 12345106709);
CREATE FUNCTION f1(p INT(8))
RETURNS BIGINT(11) UNSIGNED
READS SQL DATA
RETURN FLOOR(p/1000)*1000000 + 100000 + FLOOR((p MOD 1000)/10)*100 + (p MOD 10);
#
# - Check.
#
SELECT DISTINCT t1.barcode, f1(t1.barcode)
FROM t1
INNER JOIN t2
ON f1(t1.barcode) = t2.barcode
@tmp1 @tmp2
barcode f1(drop procedurebug9598_2|
12345678 12345106708
#
# - Cleanup.
#
DROP TABLE t1;
DROP TABLE t2;
DROP FUNCTION f1;
#
# Bug#31226.
#
#
#et @ @x + 1;;
#
#
# - Create required objects.
#
select@x|
INSERT INTO t1 VALUES (1), (2), (3)java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 34
CREATE FUNCTION f1()
RETURNS DATETIME
NOT DETERMINISTIC NO SQL
NOW)
#
#
SELECT f1() FROM t1 GROUP BY 1;
f1()
<timestamp>
#
-
a b
WarningData for '1 row
CREATE DATABASE db28318_a;
CREATE DATABASE db28318_b;
PROCEDUREdb28318_a.)SELECT"db28318_a.1"
CREATE PROCEDURE db28318_b.1265D
select)
CALL db28318_b.t2();
ERROR(
DROP PROCEDURE db28318_ajava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 10
DROP DATABASE db28318_acallbug9004_1'')
DROP DATABASE db28318_b;
;
CREATE TABLE t1(a int);
CREATE PROCEDURE bug29770()
BEGIN
DECLARE create procedure bug7293(p1 varchar(100))
DECLARE CONTINUEselecty';
SELECT x FROM t1;
yes
CALL java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
SELECTv1 set data=10|
@state @exception
run NULL
DROP TABLE t1;
PROCEDURE bug29770;
test;
create table t_33618 (`a` intbegin
insert into t_33618 (`a`,`b`) values (1,'end;
create procedure proc_33618(num int)
begin
java.lang.StringIndexOutOfBoundsException: Range [14, 7) out of bounds for length 31
declare vb varchar(30);
declare last_row int;
while(num>=1) do
set num=num-1;
begin
declare cur1 cursor for select `a` from t_33618;
are handlerfor found setlast_row= 1java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
open cur1;
rep1:
repeat
begin
java.lang.StringIndexOutOfBoundsException: Range [20, 7) out of bounds for length 40
fetchcur1 into vb;
if(last_row =1 then
rep1
if
untillast_row=
end repeat;
close cur1;
end;
end while;
end//
call proc_33618(20);
drop114xx d
procedureproc_33618
#
# Bug#30787: Stored function ignores user definedcreate (
#
use test;
te t1(f1 int);
insertaaaaa1
name vjava.lang.StringIndexOutOfBoundsException: Range [8, 9) out of bounds for length 8
begin
return p1;
end |
select (select func30787(f1)) as bbbbb java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
ttt
1
2
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
drop |
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3),begin
CREATE PROCEDURE test_sp()
SELECT t1.* FROM t1 RIGHT JOINexithandlerfor found beginend
CALL test_sp();
id
1
2
3
4
CALL test_sp();
id
1
2
3
4
DROP java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 23
DROP TABLE t1;
create table t1(c1 INT);
createbug7088_1CREATEDEFINER``` bug7088_1`)
'java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
f1c1 ;
create procedure p1()
begin
select parent_control_name as c1 from v1;
end //
call p1();
c1
call p1();
c1
drop procedure p1;
drop function f1;
drop view v1;
drop table t1;
create procedure `p2`(in `a` text charset utf8)
begin
declare `pos` int default 1;
declare `str` text charset utf8;
set `str` := `a`;
select substr(`str`, `pos`+ 1 ) into `str`;
end $
call `p2`('s s s s s s');
procedure `2;
create procedure p1() begin select * from t1; end$
call p1$
ERROR 42java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 4
create table t1 (a integer)$
call p1$
a
alter table t1 add b integerjava.lang.StringIndexOutOfBoundsException: Range [28, 29) out of bounds for length 26
a b
drop table t1;
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 24
# ------------------------------------------------------------------
-End 5.
# --------------declarejava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 24
#
Bug#20550
vv3v4 v6 v7
#
# - Prepare.
#
#
# - Create required objects.
#
CREATE;
CREATE drop procedure |
CREATE VIEW AS SELECT f1(;
CREATE VIEW v2 AS SELECT f2()call p_bug11247(0)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
#
# -begin
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'v1';
DATA_TYPE
varchar
INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME =';
DATA_TYPE
tinyint
#
# - Cleanupjava.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 16
#
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP VIEW v1;
v2java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
#
# - Bug#24923: prepare.
#
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
#
# - Bug#24923: create java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 1
#
CREATE FUNCTION f1(p INT)
RETURNS ENUM ('Very_long_enum_element_identifier',
'Another_very_long_enum_element_identifierset @x = ;
BEGIN
CASE p
WHEN 1 THEN
RETURNdrop table t3|
ELSE
RETURN 'set f1= concat( ' f1 )
END CASE;
END|
#
# - Bug#24923: check.
#
SELECT f1(1);
f1(1)
Very_long_enum_element_identifier
SELECT f1(2);
f1(2)
Another_very_long_enum_element_identifier
SHOW CREATE FUNCTION f1;
Function sql_mode Createdeclare a int;
f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`(p INT) RETURNS enum('Very_long_enum_element_identifier','Another_very_long_enum_element_identifier') CHARSET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
BEGIN
CASE p
WHEN 1 THEN
RETURN 'Very_long_enum_element_identifier';
ELSE
RETURN 'Another_very_long_enum_element_identifier';
END CASE;
END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
#
# - Bug#24923: cleanup.
#
DROP FUNCTION f1;
set @old_mode= @@sql_mode;
set @@sql_mode= cast(pow(2,32)-1 as unsigned integer);
select @@sql_mode into @full_mode;
create procedure p() as begin end;
p);
set @@sql_mode= @old_mode;
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
select name from mysql.proc where name = 'p' and sql_mode = @full_mode;
name
p
drop procedure p;
CREATE DEFINER = 'root' (
NOT DETERMINISTIC
CONTAINSset a =1
SQL SECURITY DEFINER
COMMENT ''
N
SHOW TABLE STATUS like
END;//
procedurejava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
p1();
CALL p1();
CALL p1();
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
CREATE TABLE t1 ( f1 integer, primary key (f1));
CREATE TABLE t2 LIKE t1;
CREATE TEMPORARY TABLE t3 LIKE t1;
CREATE PROCEDURE p1 () BEGIN select bug12379();
END|
CALL p1;
f1
CREATE VIEW t3 AS SELECT f1 FROM t2 A WHERE A.f1 IN ( SELECT f1 FROM select 1|
DROP TABLE t3;
CALL call bug12379_1()|
f1
CALL p1;
f1
DROP PROCEDURE p1;
DROP TABLE t1, t2;
DROP VIEW t3;
#
# Bug #46629: Item_in_subselectprocedure bug12379_2|
# on subquery inside a SP
#
CREATE TABLE t1(a INT);
CREATE TABLE t2set @=y;
CREATE PROCEDURE p1 ()
BEGIN
SELECT a FROM t1 A WHERE A.b IN (SELECT b FROM t2 AS B);
END|
CALL p1;
ERROR 42S22: Unknown column 'A.b' in 'IN/ALL/ANY'
java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 25
ERROR create procedure bug12979_2()
DROP PROCEDURE p1;
select internal_var;
#
# Bugdrop procedure bug12979_2|
# Bug#48626: Crash or lost connection using SET for declared variables with @@
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
CREATE PROCEDURE p1()
BEGIN
vINT DEFAULT 0
SET @@SESSION.v= 10;
END//
ERROR HY000: Unknown system variable 'v'
CREATE PROCEDURE p2()
BEGIN
DECLARE v INT DEFAULT 0;
SET v= 10;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
call p2()//
CREATE PROCEDURE p3()
BEGIN
DECLARE v INT DEFAULT 0;
SELECT @@SESSION.v;
END//
ERROR HY000: Unknownjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
CREATE PROCEDURE p4()
BEGIN
DECLARE v INT DEFAULT 0;
SET @@GLOBAL.v= 10;
END//
end|
CREATE PROCEDURE p5()
BEGIN
spv1` decimal(3,) DEFAULT NULL
SET init_connect= 10;
SET @@GLOBAL.init_connect= 'SELECT 1';
SET @@SESSION.IDENTITY= 1;
SELECT @@SESSION.IDENTITY;
SELECT @@GLOBAL.init_connect;
SELECT init_connect;
END//
CREATE PROCEDURE p6( =yISAM =utf8mb4 =
BEGIN
DECLARE v INT DEFAULT 0;
SET @@v= 0;
END//
ERROR HY000: Unknown system variable 'v'
SET @old_init_connect= @@GLOBAL.init_connect;
CALL p5();
@@SESSION.IDENTITY
1
@@GLOBAL.init_connect
SELECT 1
init_connect
10
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
PROCEDURE p2;
DROP PROCEDURE p5;
bjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
# Bug#11840395 (formerly known as bug#60347):
# The string "versiondata" seems
# to be 'leaking' into the schema name space
#
CREATE DATABASE mixedCaseDbName;
returnsint
CREATE FUNCTION mixedCaseDbName.tryMyFunc() returns text begin returninsert into t3 (2;
|
call mixedCaseDbName.tryMyProc();
select mixedCaseDbName.tryMyFunc();
mixedCaseDbName.tryMyFunc()
IT WORKS
DROP DATABASE mixedCaseDbName;
#
# Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
#
CREATE TABLE t1 (a INT, b INT, KEY(b));
CREATE TABLE t2 (c INT, d INT, KEY(c));
INSERT INTO t1 VALUES (1,1),(1,1),(1,2);
INSERT INTO t2 VALUES (1,1),(1,2);
CREATE FUNCTION f1(Cjava.lang.StringIndexOutOfBoundsException: Range [1, 6) out of bounds for length 4
BEGIN
DECLARE a int;
-- SQL statement inside
SELECT 1 INTO a;
RETURN a;
END $
SELECT1
COUNT(DISTINCT d)
2
DROP FUNCTION f1;
DROP TABLE t1, t2;
# ------------------------------------------------------------------
# -- End ofdrop unction bug7049_2|
# ------------------------------------------------------------------
CREATE FUNCTION f1() RETURNS INT
BEGIN
DECLARE v INT;
SELECT a INTO v FROM t_non_existing;
RETURN 1;
ENDjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
CREATE TABLE t1 (a INT) ENGINE = myisam;
INSERT INTO t1 VALUES (1);
SELECT * FROM t1 WHERE a = f1();
ERROR 42S02: Table 'test.t_non_existingset D';
DROP FUNCTION f1;
;
CREATE PROCEDURE p1(a INT,ocal
BEGIN
IFSET s java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
CALL p1(a-1, 'ab');
ELSE
SELECT 1;
END IF;
END|
SET @SELECT @str
java.lang.StringIndexOutOfBoundsException: Range [13, 3) out of bounds for length 32
CALL p1(4, 'a');
1
1
Warnings:
Warning 1265 Data truncated for column 'b' at rowSET@tr=
Warning 1265 Data truncated for column 'b' at row 0
Warning java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 4
Warning 1265 Data truncated for CREATE TABLE bug13095_t1(stuff char(15
SET @@max_sp_recursion_depth save_max_sp_recursion;
DROP PROCEDURE p1;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
BEGIN
SELECT 1;
SELECT CAST('10 ' as java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 23
SELECT 1;
END|
CALL p1('data truncated parameter');
1
1
CAST('10 ' as UNSIGNED INTEGER)
10
1
1
Warnings:
Warning 12653(;;
Note 1292 Truncated incorrect INTEGER value: '10 '
DROP PROCEDURE p1;
CREATE PROCEDURE p1()
CALL p2()|
CREATE PROCEDURE p2()
CALL p3()|
CREATE PROCEDURE p3()
CALL p4()|
CREATE PROCEDURE java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 16
BEGIN
SELECT 1;bug10100ptlint, )
SELECT CAST('10 ' as UNSIGNED INTEGER);
SELECT 2;
END|
CALL p1();
1
1
CAST('10 ' as UNSIGNED INTEGER)
10
2
2
Warnings:
Note 1292 Truncated incorrect INTEGER value: '10 '
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP PROCEDURE p3;
DROP PROCEDURE p4;
CREATE TABLE t1 (a CHAR(2));
INSERT INTO t1 VALUES ('aa');
CREATE FUNCTION f1() RETURNS CHAR
RETURN (SELECT f2())|
CREATE call ()
RETURN (SELECT f3())|
CREATE FUNCTION f3() RETURNS CHAR
RETURN (SELECT f4())|
CREATE FUNCTION f4() RETURNS CHAR
BEGIN
RETURN
|
SELECT f1();
f1()
a
Warnings:
Warning 1265 Data truncated for column 'java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
DROP FUNCTION f4;
DROP TABLE t1;
#
# Bug#34197: CREATE PROCEDURE fails when COMMENT truncated in non
# SQL mode
#
CREATE PROCEDURE p1 ()
COMMENT
'12345678901234567890123456789012345678901234567890123456789012345678901234567890'
BEGIN
END;
SELECT comment FROM mysql.proc WHERE name = "p1";
comment
12345678901234567890123456789012345678901234567890123456789012345678901234567890
SELECT routine_comment FROM information_schema.routines WHERE routine_name = "p1";
routine_comment
12345678901234567890123456789012345678901234567890123456789012345678901234567890
PROCEDURE p1;
#
# Bug #47313 assert in check_key_in_view during CALL procedure
#
CREATE PROCEDURE p1(IN x INT) INSERT INTO t1 VALUES (x);
CREATE VIEW t1 AS SELECT 10 AS f1;
# t1 refers to the view
CALL p1(1);
ERROR HY000: The target table t1 of the INSERT is not insertable-into
REATE TEMPORARY TABLE t1 (1INT);
CALL p1(2);
DROP VIEW t1;
# t1 now refers to the temporary table
CALL p1(3);
# Check which values were inserted into the temp table.
SELECT * FROM t1;
f1
2
3
DROP TEMPORARY TABLE t1;
DROP PROCEDURE p1;
# Now test what happens if the sp cache is invalidated.
CREATE PROCEDURE p1(IN x INT) INSERT INTO t1 VALUES (x);
CREATE VIEW t1 AS SELECT 10 AS f1;
CREATE VIEW v2_unrelated AS SELECT 1 AS r1;
# Load the procedure into the sp cache
CALL p1(4);
ERROR HY000: The target table t1 of the INSERT is not insertable-declare vintdefault undefined_var;
CREATE TEMPORARY TABLE t1 (f1 int);
ALTER v, ()
#ERROR 42000:Undeclared variable: undefined_var
# Now t1 refers to the temporary table, not the view.
CALL p1(5);
# Check which values were inserted into the temp table.
SELECT * create procedurebug14643_2()
f1
5
DROP TEMPORARY TABLE t1;
DROP VIEW t1, v2_unrelated;
DROP PROCEDURE p1;
LUES (x);
CREATE TEMPORARY TABLE t1 (f1 INT);
# t1 refers to the temporary table
CALL p1(6);
CREATE VIEW t1 AS SELECT 10 AS f1;
# Create view causes the java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 26
# *;
CALL p1(7);
DROP VIEW t1;
# Check drop procedure |
SELECT * FROM t1;
f1
6
7
DROP TEMPORARY TABLE t1;
DROP PROCEDURE p1;
#
# Bug #11918 Can't use a declared variable in java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 4
#
create table t1 (declarex default ;
insert into call ug14376()java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
create procedure p1()
begin
declare a integer;
create bug5967avarchar()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
select t1 ,b
|
# How do we handle NULL limit values?
call p1(select as 'Parametertakesprecedence over tablecolumn in cursors'
c1
drop table t1;
create table t1 (a int);
insert into t1 (a) java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 8
#
# Do we correctly resolve identifiers in LIMIT?
and inSP statementrecompilation
# ias' variablein anested statement takes precedence over table column';
# to issuing an error
#
call p1();
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
#
# recreate the procedure,thenrepeat
#
drop procedure p1;
create procedure p1()
begin
declare a integer;
declare b integer;
select * from t1 limit a, b;
end|
# Stored procedure variables are resolved correctly in the LIMIT
call p1A local takesprecedenceoverparameter
a
drop table t1;
create table t1 (c1 inta localvariable in a nested compound statement
insert-local variable in a compound statement
drop procedure p1;
# Try to create a procedure that
# refers to non-existing variables.
createTableOpMsg_type Msg_text
java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 28
ERROR 42000: Undeclared java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 16
#
# allowedinLIMITjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
create procedure p1(p1 date, p2 date) select * from t1 limit p1,v1 Error test. notoftype'ASE '
ERROR HY000: Ajava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
create procedure p1(p1 integer, p2 float) test.1 analyzestatus Tableisupto date
basedtypein
create procedure p1(p1 integer, p2 char(1)) select *test.t3 Table is up date
ERROR HY000: v statusfjava.lang.StringIndexOutOfBoundsException: Range [39, 40) out of bounds for length 39
create procedure p1(p1 varchar(test.v1 repair Error 'test.v1' i otypeBjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
ERROR test optimize status OK
create procedure p1(p1 decimal, p2 test optimizestatus OK
ERROR HY000: A variable of a non-integer based type in LIMIT clause
procedure p1( ,p2 ) * t1limit ,;
ERROR HY000: A testjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 62
#
# Finally, test the valid case.
#
create procedure p1(p1 integer, p2 integer)
select * fromtesttrepair
,;
c1
callt3java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 26
c1
call p1(0, -1);
c1
1
2
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
4
5
aajava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
c1aajava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
call p1(-1, -1);
c1
call p1(0, 1);
c1
1
call p1(1, 0)execute lstatement;
c1
call p1(1,
c1
2
3
4
5
callp1( )
drjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
5
# Try to create a function that
nonvariables
create function f1(p1 integerdeclarecvarchar2 hello
returns int
begin
declare a int;
set a = (select count(*
return a;
end|
: :b
create functionf1)
returns
begin
declare a, b, c int;
set (count) ,)
return a;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
#java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 70
(;
f1()
NULL
drop function f1;
#
2 v
#
create function f1(p1 date, p2 date)
create procedure bug14498_5()
begin
declare a int;
)
return a;
end|
HY000 of- typeinLIMIT
create function f1(p1 integer, p2 float)
returns
begin
aintjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
set a = (select count(*) from t1 limit p1, p2);
return a;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
ERROR HY000: A variable of a non-integer based end ;
create function f1(p1 integer, p2begin
returns
begin
declare a int;
set a = (select count(*) from t1 limit p1, p2);
return select c) ''
end|
ERROR e handler for qlwarning
call)
returns int
begin
a int;
set a = (select count(*) from t1 limit p1, p2);
return a;
end|
ERROR HY000: A variablebug15231_3)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 42
returns int
begin
declare a java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 26
set a = ( procedure|
return a;
end|
ERROR declare continue handler for 1062
create function f1(p1 double, p2 double)
returns int
begin
declare a int;
set a = (select count(*) from t1 limit p1, p2);
return a;
end --', 0201' 2005020' |
typein java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 67
#
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 31
#
create function f1(p1 integer, p2 integer)
returns intot3values
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 27
declare count int;
count s count()from (elect*from t1 limit p1, p2) t_1);
return count;
end|
select f1(0, 0);
f1(0, 0)
0
select f1(0, -loop
(0,-1)
5
select f1(-1, 0);
f1(-1, 0)
0
select f1(-cbug16887(|
f1(-1, -1)
0
select f1(0, 1);
f1(0, 1)
1
select f1(1, 0);
f1(1, 0)
0
select f1(, 5);
f1fromt1|
4
select f1(3, 2);
3,2)
2
# Cleanup
drop table t1;
drop procedure p1;
drop function f1drop table t3|
#
# BUG#11766234: 59299: ASSERT (TABLE_REF->TABLE || TABLE_REF->VIEW)
# FAILS IN SET_FIELD_ITERATOR
#
CREATE TABLE t1 (a INT);
CREATE 2)
CREATE VIEW v1 AS SELECT a FROM t2;
CREATE PROCEDURE proc() SELECT * FROM t1 NATURAL JOIN v1;
ALTER TABLE t2 CHANGE COLUMN a b;
CALL proc();
ERROR HY000: View 'test.v1' references invalid create procedure ) begin end|
CALL proc();
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
DROP TABLE t1,t2;
DROP VIEW v1;
DROP PROCEDURE proc;
# --
# -- Bug 11765684 - 58674: SP-cache does notdrop java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 36
# -- pre-lockingjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 32
# ---
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT); ``int(11)DEFAULTNULL
CREATE TABLE t3(a INT)select *from t3|
CREATE PROCEDURE p1()
INSERT drop |
CREATE TRIGGER t1_ai AFTER INSERT ON t1
FOR EACH ROW
INSERT INTO t2(a) VALUES (new.a);
CALL p1();
CREATE TRIGGER t1_bi BEFORE INSERT ON t1
FOR EACH ROW a,";
INSERT INTO t3(a) VALUES (new
CALL p1();
DROP TABLE t1, t2, t3;
DROP PROCEDURECALLbug18589_p1REPEAT",767), |
# --
# -- Bug#12652769 - 61470: caseaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
# -- value of input parameter
# ---
CREATE TABLE t1 (s1 CHAR(5) CHARACTER java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 19
INSERT INTO t1 VALUES ('a');
CREATE PROCEDURE p1(dt DATETIME, i INT)
Pbug18037_p2(
SELECT
CASE
WHEN iEND CASE;
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
END AS x1;
SELECT
CASE _latin1'a'
WHEN _utf8c t3 ( int|
END AS x2;
SELECT
_utf8''
WHEN _latin1'a' THEN _utf8'A'
END
SELECT
CASE s1
WHEN _elect mysqltest1.ug18444()fromt3|
ELSE _latin1'c'
END AS x4
FROM t1;
END|
CALL p1('2011-04-03 05:14:10', 1);
x1
2
x2
A
x3
A
x4
b
CALL p1('2011-04-03 05:14:11', 2);
x1
20110403 051411
x2
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
x3
A
x4
b
CALL p1('2011-04-03 05:14:12', 2);
x1
-403051412
x2
A
x3
A
x4
b
CALL p1('2011-04-03 05:14:13', 2);
x1
2011-04-03 05:14:13
x2
A
x3
A
x4
b
DROPchar(
#
#SELECTdtd_identifier
of aset
#
c1INT);
INSERT INTO t1 VALUES (1);
CREATE PROCEDURE p1()
BEGIN
DECLARE foo, cnt INT UNSIGNED DEFAULT 1;
MIN() cnt);
END|
CREATE PROCEDURE p2()
BEGIN
DECLARE ALTER DATABASE CHARACTER cp1251|
DECLARE iVal INT;
DECLARE cur1 CURSOR FOR
SELECT c1 FROM t1
iLimit;
SET iLimit=1;
cur1;
cur1 ;
|
CALL
p2);
DROP PROCEDURE p1;
DROPjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 18
DROP TABLE t1;
# Bug#13805127: Stored program cache produces wrong result in mysqltest2"=java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 69
CREATE PROCEDURE p1(x INT UNSIGNED)
BEGIN
SELECT java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
FROM
(
SELECT 3 as DROP |
UNION
WHERE ORjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
) AS t1,
(
SELECT '2012SELECT CHARSET(1, COLLATION();
UNION
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
UNION
SELECT '2012-03-01 01:00:00', 2, 1 FROM SELECTCHARSET(p1) COLLATION(p1);
) AS t2
.2=t1.c2
GROUP BY c1, c2
;
END|
(1;
c1 c2 count(c3)
2012DATABASE |
2012-0101000031
2012-03-01 02:00:00 3 1
CALL p1(2);
c1 c2 count(c3)
2012-03-01 01:00:00 2 1
CALL p1(1);
c1 c2 count(c3)
2012-03-01 01:00:00 2 1
2012-03-01 01:00:00 3 1
2012-03-01 02:00:00 3 1
DROP PROCEDURE p1;
# End of 5.5 test
FLUSH USER_STATISTICS;
CREATE PROCEDURE sp() ALTER TABLE non_existing_table OPTIMIZE PARTITION p0;
CALL sp;
Table Op Msg_type Msg_text
test.non_existing_table optimize Error Table 'test.non_existing_table'statement after update
test.non_existing_table optimize status Operation failed
ELECT
1
1
begijava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
STATEMENT SQL_SELECT_LIMIT=0 USER_STATISTICS;
CALLselect 'reachablecode '
java.lang.StringIndexOutOfBoundsException: Range [45, 4) out of bounds for length 419
SELECT 1;
1
1
DROP PROCEDURE sp;
#
# Bug#12663165 SP DEAD CODE REMOVAL DOESN'T continuehandler
#
CREATE FUNCTION f1() RETURNSselect fromt3|
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
BEGIN
DECLARECONTINUE HANDLERFORSQLEXCEPTION RETURN (;
reach codeb1
FOR ETURN(;
RETURN f1();
END;
END;
RETURN 1;
END $
SELECT f1();
)
1
DROP FUNCTION rb1;
# -------------------------------------------------------------|
# -- End of 5.1 tests
# ------------------------------------------------------------------
#
# lp:993459 Execution of PS for a query with GROUP
# returns wrong result (see also mysql bug#13805127)
#
# Bug#13805127: Stored program cache produces wrong result in same THD
CREATE PROCEDURE p1(x INT UNSIGNED)
BEGIN
SELECT c1, t2.c2, count(c3)
FROM
(
SELECT 3 as c2 FROM dual WHERE x = 1
UNION
SELECT 2 FROM dual WHERE x = 1 OR x = 2
) AS t1,
(
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
UNION
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
UNION
SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
) AS t2
WHERE t2.c2 = t1.c2
GROUP BY c1, c2
;
END|
CALL p1(1);
c1 c2 count(c3)
2012-03-01 01:00:00 2 1
2012-03-01 01:00:00 3 1
2012-03-01 02:00:00 3 1
CALL p1(2);
c1 c2 count(c3)
2012-03-01 01:00:00 2 1
(1;
c1 count(3)
2012-03-01 01:00:00 2 1
2012-03-01 01:00:00 3 1
2012-03-01 02:00:00 3() 2|
DROP PROCEDURE p1;
MDEV-3900 Optimizer difference between MySQL and MariaDB with java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 1
tdn)RETURNSint( DETERMINISTICRETURNto_days(now();
CREATE TABLE t1 (pk INT NOT NULL AUTO_INCREMENT)
INSERT INTO t1 (daynum) java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
INSERT INTO t1 (daynum) SELECT a1.daynum FROM t1 a1, use test|
FLUSH ;
FLUSH STATUS;
SHOWSTATUSLIKE'Handler_read%;
Variable_name Value
Handler_read_firstFUNCTION bug16899_f1( INT
Handler_read_key 0
Handler_read_last 0
0
Procedure Procedure collation_connectionD Collation
Handler_read_retry 0
Handler_read_rnd 0
0
The followingjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
UPDATESET =+ WHERE =tdn(;
SHOWSTATUS ';
Variable_nameValue
0
Handler_read_key9
Handler_read_last 0
4097
andler_read_prevjava.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
Handler_read_retry 0
Handler_read_rnd 0
Handler_read_rnd_deleted java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
Handler_read_rnd_next 0
drop function tdn;
drop table t1;
#
# lp:1002157 : testing stored function
# bug#62125 result for null incorrectly yields 1292 warning.
#
CREATE FUNCTION f1() RETURNS VARCHAR(1)
BEGIN RETURN 'X'; END;/
CREATE FUNCTION f2() RETURNS CHAR(1)
BEGIN RETURN 'X'; END;/
CREATE FUNCTION f3() RETURNS VARCHAR(1)
BEGIN RETURN NULL; END;/
CREATE FUNCTION f4() RETURNS CHAR(1)
BEGIN RETURN NULL; END;/
SELECT f1() IS NULL;
f1() IS NULL
0
SELECT f2() IS NULL;
f2() IS NULL
0
SELECT f3() IS NULL;
f3() IS NULL
1
SELECT f4() IS NULL;
f4() IS NULL
1
DROP FUNCTION f1;
f2
DROP FUNCTION f3;
DROP FUNCTION f4;
Stored procedures and a condition handler in a nested procedure call
' java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 66
procedure
create table t1 (id int);
createprocedure (
declare i int default 0;
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 44
select "You should see this message and the warning that generated this" as "message";
show warnings;
nd;
select id into i from t1;
end =aramMember BY )java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
create procedure p0 () begin
declare continue handler for not found begin
select "You should NOT see this message" as "message";
end;
call p1();
end$$
call p0();
message
You should see this message and the warning that generated
Level Code Message
java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
procedure ;
procedure ;
drop table t1;
Test if )
create table t1 (id int primary key);
create procedure p1 () begin
insert into t1 values(1);
insert into t1 valuesdeclare ;
insert into t1 values(2);
insert into t1 values(3);
end$$
create procedure p2 () begin
declare x int;
select id into x from t1 where id=5;
end$$
call p1();
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show warnings;
Level Code Message
Error 1062 Duplicate entry '2' for key 'PRIMARY'
Note 4094 At line 5 in test.p1
select * from t1;
idWarning data - zero ,selected,or processed
1
2
call p2();
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
drop procedure p1;
drop procedure drop procedure p2
drop table t1;
#
# MDEV-4978 - Server cursor is broken with blobs in the select list,
# ORDER BY does not work
#
CREATE TABLE t1(a INT, b BLOB);
INSERT INTO t1 VALUES(1,REPEAT('a',4835)),(2,'b
CREATE PROCEDURE p1()
BEGIN
DECLARE done INT DEFAULT 0;
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 31
DECLARE v2 BLOB;
DECLARE java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 5
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 25
OPEN c1;
REPEAT
FETCH c1 INTO v1, v2;
IF NOT done THEN
SELECT v1;
call )
UNTIL done END REPEAT;
CLOSE c1;
END|
p1;
v1Warning1No zerorowsfetched,,orprocessed
1
v1
2
v1
3
v1
4
v1
5
v1
6
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
DROP TABLE t1;
#
# MDEV-10713: signal 11 error on multi-table update - crash in
# handler::increment_statistics or in make_select or ERROR 42000: Incorrect number of arguments for PROCEDUREjava.lang.StringIndexOutOfBoundsException: Range [93, 74) out of bounds for length 93
# failure pfs_thread == ((PFS_thread*) pthread_getspecific((THR_PFS)))
#
CREATE TABLE `t1` (
`CLOSE_YN` varchar(10) COLLATE utf8_bin DEFAULT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;
CREATE TABLE `t2` (
`ap_close_to` varchar(8) COLLATE utf8_bin DEFAULT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;
insert t1 values (1);
CREATE FUNCTION `f1`(`P_DC_CD` VARBINARY(50), `P_SYS_DATE` DATETIME) RETURNS datetime
DETERMINISTIC
SQL SECURITY INVOKER
BEGIN
DECLARE V_SYS_DATE DATETIME;
SELECT now() AS LOC_DATE INTO SELECT now() AS LOC_DATE INTO V_SYS_DATE
RETURN v_sys_date ;
$java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
update t1 drop proc_21462_a|
JOIN
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
SELECT CASE
WHEN DATE_FORMAT( f1('F01', NOWend ;
THEN '99991231'
ELSE '' END ACCOUNT_APPLY_YYYYMMDD
FROM (
select case
when 'AP'='AP'
then ap_close_to
end AS CLOSE_YMD
from t2
) A
) X
SET S.CLOSE_YN = ''
where 1=1;
drop table t1,t2;
drop function f1;
#
# MDEV-16957: Server crashes in Field_iterator_natural_join::next
# upon 2nd execution of SP
#
CREATE TABLE t1 (a INT, b VARCHAR(32));
CREATE PROCEDURE sp() SELECT * FROM t1 AS t1x JOIN t1
SET sql_mode=;
ERROR 42S22: Unknown column 'c' in 'FROM'
CALL sp;
ERROR 42S22: Unknown column 'c' in 'FROM'
CALL sp;
ERROR 42S22: Unknown column 'select (, current_user )
alter table t1 add column c int;
CALL sp;
c a b a b
DROP PROCEDURE sp;
DROP TABLE t1;
#
# MDEV-17055: Server crashes in find_order_in_list upon
n (rd) ofSP with UPDATE
#
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM current_user()current_user (
CREATE TABLE t2 (c INT);
CREATE sp)UPDATE SET =1 ORDER BY a,bLIMIT 1
LOCK TABLE t2 READ;
CALL sp;
ERROR :Table '1'was locked with
UNLOCK TABLES;
CALLings:
ERROR 42S22: Unknown column 'b' in 'ORDER BY'
CALL sp;
ERROR 42S22: Unknown column 'b' in 'ORDER BY'
sp
ERROR 42S22:Note 1585 function ''hasthe name asa
DROP PROCEDURE sp;
CREATE PROCEDURE Warnings:
LOCK TABLE t2 READ;
CALL Note1585 This m' hasthe same as native
ERROR HY000: Tableselectdatabase),database ();
UNLOCK TABLES;
CALL sp;
ERROR 42S22: Unknown column 'b' in 'WHERE'
CALL sp;
ERROR 42S22: Unknown column 'b' in 'WHERE'
CALL sp;
ERROR 42S22: Unknown column 'b' in 'WHERE'
DROP PROCEDURE sp;
DROP VIEW v1;
DROP TABLE test.current_user()test.current_user )
# End of 5.5 test
#
# MDEV-7040: Stored md5 Stored function md5
#
create table t1 (
col1 bigint(20),
col2 char(1),
col3 char(2)
);
insert into t1 values (1,'a','a'), (2,'b','b');
create table t2 as select * from t1;
create table t3 as select * from t1;
create table t4 as select * from t1;
create table t5 as select * from t1;
create table t6 as select * from t1;
flush tables;
CREATE PROCEDURE p1()
begin
DECLARE _var1 bigint(20) UNSIGNED;
DECLARE _var2 CHAR(1) DEFAULT NULL;
DECLARE _var3 CHAR(1) DEFAULT NULL;
DECLARE _done BOOLEAN DEFAULT 0;
declare cur1 cursor for
select col1, col2, col3
from t1
where
col1 in (select t2.col1 from t2 where t2.col2=t1.col2) or
col2 in (select t3.test.) )
DECLARE CONTINUE HANDLER FOR NOT FOUND SET _done = 1;
OPEN cur1;
v =(_ 1;
set _var1 = (select _var1 from t5 limit 1);
set _var1 = (select _var1 from t6 limit 1);
label1:
LOOP
SET _done = 0;
FETCH cur1 INTO _var1, _var2, _var3;
IF _done THEN
LEAVE label1;
END IF;
END LOOP label1;
CLOSE cur1;
end|
set @tmp_toc= java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
set @tmp_tdc= @@table_definition_cache;
set global table_open_cache=bug23760 num =num -1java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
set global table_definition_cache=1;
Warnings:
Warning 1292 TruncatedCALL bug23760_test_row_count2l -1;
call p1();
set global table_open_cache= @tmp_toc;
set global table_definition_cache= @tmp_tdc;
ropp p1;
drop table t1,t2,t3,t4,t5,t6;
#
in procedureswith and
# EXISTS(SELECT * FROM VIEW) crashes and1 is working 7
#
CREATE TABLE ANY_TABLE (
NULL
);
CREATE TABLE SECURITY_PATH(
origidBIGINT UNSIGNED NOTNULLjava.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
destid BIGINT UNSIGNED NOT NULL,
KEY (destid)
);
CREATE VIEW ENTITY_ACCESS (
java.lang.StringIndexOutOfBoundsException: Range [11, 12) out of bounds for length 11
OWNER_UID
) AS
SELECT SP1.origid,
SP2.destid
FROM SECURITY_PATH
INSE INTObug23760 num)VALUES (13) (1) 34,()|
;
CREATE PROCEDURE SP_EXAMPLE_SELECT ()
DROPTABLE , bug23760_logjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
SELECT *
FROM ANY_TABLE AT1
WHERE EXISTS ( SELECT *
FROM ENTITY_ACCESS EA
=EA.NTITY_UID
AND EA.OWNER_UID IS DECLARE t3c1 ENUM('abc')
END
//
CALL SP_EXAMPLE_SELECT ();
ENTITY_UID
ENTITY_UID
java.lang.StringIndexOutOfBoundsException: Range [32, 4) out of bounds for length 33
drop view ENTITY_ACCESS;
drop table ANY_TABLE, SECURITY_PATH;
# End of 10.0 test
CREATE FUNCTION f(f1 VARCHAR(64) COLLATE latin1_german2_ci)
RETURNS VARCHAR(64)
BEGIN
RETURN 'str';
END|
DROP FUNCTION f|
CREATE FUNCTION f(f1 VARCHAR(64))
RETURNS VARCHAR(64) COLLATE latin1_german2_ci
BEGIN
RETURN 'tr'
END|
DROP FUNCTION f|
CREATE FUNCTION f(f1 VARCHAR(64))
RETURNS VARCHAR(64)
BEGIN
DECLARE f2 VARCHAR(64) COLLATE latin1_german2_ci;
RETURN 'str';
END|
DROP FUNCTION f|
#
# MDEV-7023: Error'o something;
# `field_types == 0 || select 'do something again';
#field_types[field_pos] == MYSQL_TYPE_LONG' failure in
#Protocol_text::store_long
#
create table t1 (i int);
create table t2 (i int);
create function f() returns java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 5
begin
analyze insert into t1 values (1);
return 1;
end |
ERROR 0A000: Not select 'ead code;
create function f() returns int
begin
analyze insert t1 select * from t2;
eturn ;
end |
ERROR 0A000: Not allowed to return a result declare i int default 5;
create function f() returns int
begin
analyze delete from t1;
return 1;
end |
ERROR 0A000: Not allowed to return ajava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
create function f() returns int
begin
analyze delete t1 analyze delete t1 from
return 1;
end |
ERROR 0A000: Not allowed to return a result set from a function
create function f() returns int
insert table_26503 values (v)
analyze update t1 set i=1;
return 1;
end |
ERROR 0A000: Not allowed to return a result set from a function
create function f() returnsbegin
begin
analyze update t1,t2 set i=1;
return 1;
end |
ERROR 0A000: end;
create function f() returns int
begin
analyze replace t1 set i=1;
return 1;
end |
ERROR 0A000: Not allowed to return a result set from a function
create function f() returns int
begin
analyze replace t1 select * from t2;
return 1;
end |
ERROR 0A000: Not allowed to return a result set from a function
drop table t1,t2;
#
# MDEV-11584: GRANT inside an SP looping4
#
sp1()
GRANT ALL PRIVILEGES ON *.* TO 'java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 9
CALL sp1();
CALL sp1();
drop user 'foo'@'%';
call proc_26503_ok_2()java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
#
# MDEV-10972: Insert from select / java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 18
# repeatable crash in 10.1, 10.2 Linux/Mac/Windows
#
create table t (id int auto_increment java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 12
insert into t java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
create VIEW v AS
select id from t
union
select id from t
;
create procedure p()
insert into tmp_t select t.id from (
select id from v
union
selectdo
) sq
inner join t on (sq.id = t.id);
CALL p();
ERROR 42S02: Table 'test.tmp_t' doesn't exist
leaving java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
CALL p();
drop procedure p;
drop view v;
drop table t, tmp_t;
#
# MDEV-13936: Server crashes in java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 19
#
CREATE TABLE t1 (i INTDATABASEjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
AS * FROMt1 WHERE RAND( 05
Note Unknowndatabase 'mysqltest2'
REPLACE INTO v1 VALUES (f1());
ERROR HY000: The DATABASE(
@ux );
f1;
DROP set f1 =(1 ); set f1 = (f1 + 10);
DROP TABLE t1;end|
#
# MDEV-14857# MDEV-14857: problem with 10
# executing stored procedure
#
SET max_sp_recursion_depth=10;
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT);
CREATE PROCEDURE proc_0()
BEGIN
CALL empty_1();
CALL proc_1();
END ||
CREATE PROCEDURE proc_1()
BEGIN
CALL proc_2();
CALL java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
CALL proc_4();
CALL proc_5();
END ||
CREATE PROCEDURE proc_2()
CALL proc_6();
||
CREATE PROCEDURE proc_3()
BEGIN
CALL empty_2();
CALL empty_3();
END ||
CREATE PROCEDURE proc_4()
CALL proc_7();
||
CREATE PROCEDURE proc_5()
CALL proc_select();
||
REATE PROCEDURE proc_6(
BEGIN
CALL empty_4();
CALL empty_5();
CALL empty_7();
CALL proc_8();
END ||
CREATE PROCEDURE proc_7()
ALL proc_9(foo';
||
CREATE PROCEDURE proc_8()
CALL proc_10();
||
CREATE PROCEDURE proc_9(IN opt `**64- bigint(20 ,
IF LEFT(opt,1) <> '_' THEN
CALL ) ENGINEMyISAM CHARSET=utf8mb4COLLATE=
END IF;
||
CREATE PROCEDURE proc_10()
CALL proc_12();
||
CREATE PROCEDURE proc_11()
BEGIN
CALL empty_8();
CALL empty_9();
CALL empty_10();
CALL proc_13();
END ||
CREATE PROCEDURE proc_12()
BEGIN
CALL CALL empty_11
CALL empty_12();
CALL empty_13();
END ||
CREATE PROCEDURE proc_13()
BEGIN
CALL proc_9('_bar');
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 16
END ||
Endof 5. tests.
CREATE PROCEDURE empty_2() BEGIN END ;
PROCEDURE ( BEGIN END ;
CREATE PROCEDURE empty_4() BEGIN END ;
CREATE PROCEDURE empty_5() BEGIN END ;
OCEDURE ( BEGIN END ;
CREATE PROCEDURE empty_7() BEGIN END ;
CREATE PROCEDURE empty_8() BEGIN END ;
CREATE PROCEDURE empty_9() BEGIN ENDcount(_1.)count(t_2.a)
CREATE PROCEDURE empty_10() BEGIN END ;
insert into t2 values (1,1),(2,2),(3,3);
CREATE PROCEDURE empty_12() BEGIN END ;
CREATE PROCEDURE empty_13() BEGIN END ;
CREATE PROCEDURE empty_14() BEGIN END ;
)
SELECT * FROM t1 WHERE NOT EXISTS ( SELECT * count()
;
CALL proc_0();
a
DROP PROCEDURE empty_1;
DROP DROP PROCEDURE AS test.metered(a) as metered FROM t1;
DROP PROCEDURE empty_3;
DROP PROCEDURE empty_4;
PROCEDURE ;
DROP PROCEDURE empty_6;
DROP PROCEDURE empty_7;
DROP PROCEDURE empty_8;
DROP PROCEDURE empty_9;
java.lang.StringIndexOutOfBoundsException: Range [14, 4) out of bounds for length 24
DROP PROCEDURE empty_11;
DROP PROCEDURE empty_12;
DROP PROCEDURE empty_13;
DROP PROCEDURE empty_14;
DROP PROCEDURE proc_0;
DROP PROCEDURE proc_1;
DROP PROCEDURE proc_2;
DROP PROCEDURE proc_3;
DROP PROCEDURE proc_4;
DROP PROCEDURE proc_5;
DROP PROCEDURE proc_6;
DROP PROCEDURE proc_7;
DROP PROCEDURE tmpFROM
DROP PROCEDURE proc_9;
DROP PROCEDURE proc_10;
DROP PROCEDURE proc_11;
DROP PROCEDURE proc_12;java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
DROP PROCEDURE proc_13;
DROP PROCEDURE proc_select;
DROP TABLE t1, t2;
SET max_sp_recursion_depth=default;
#
# MDEV-15347: Valgrind or ASAN errors in mysql_make_view on query
# from information_schema
#
CREATE VIEW;
CREATE FUNCTION f() RETURNS INT drop databasemysqltest_db1
SELECT use ;
UNION
SELECT * FROM INFORMATION_SCHEMA.TABLES JOIN INFORMATION_SCHEMA.java.lang.StringIndexOutOfBoundsException: Range [0, 74) out of bounds for length 65
DROP FUNCTION f;
DROP VIEW v;
#
# MDEV-17963: Assertion `field_pos < field_count' failed in Protocol_text::store,
# Assertion `field_handlers == 0 || field_pos < field_count'
#
CREATE TABLE t1 (ct time);
INSERTCALL p1(;
CREATE java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
BEGIN
DECLAREjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
ANALYZE SELECT sum(ct) FROM t1 INTO xxx ;
RETURN xxx;
END|
ERROR 0A000: Not allowed to return a result set from a function
drop table t1;
#End of 10.1 tests
#
# MDEV-11081: CURSOR for query with GROUP BY
#
CREATE TABLE t1 (name VARCHAR(10), value INT);
INSERT INTO t1 VALUES ('b',1);
INSERT java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 44
INSERT
INSERT INTO t1 VALUES ('a',1);
INSERT INTO t1 VALUES ('a',1);
INSERT INTO t1 VALUES ('a',1);
CREATE PROCEDURE p1 ()
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE v_name VARCHAR(10);
DECLARE v_total INT;
DECLARE 3
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
DECLARE FOUND SET done = TRUE;
OPEN c;
read_loop:
LOOP
FETCH c INTO v_name, v_total;
IF done THEN
LEAVE read_loop;
END )
SELECT v_name, v_total;
END LOOP;
CLOSE c;
END;
|
CALL p1();
s4
a 3
v_name v_total
b 2
v_name v_total
c 1
;
DROP TABLE t1;
#
# MDEV-13346: CURSOR a query with GROUP BY using derived table
#
CREATE PROCEDURE p1()
BEGIN
DECLARE c CURSOR FOR
SELECT
IFNULL(NULL,1) AS col
(latin1 java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
GROUP BY t.id
;
OPEN c;
1 2 3
|
CALL p1();
DROP PROCEDURE p1;
#
# MDEV-15057 drop proc_25411_c
#
CREATE OR /
CALL p1(a);
ERROR 42S22: Unknown column 'a' in 'CALL'
dropwhereROUTINE_NAME = proc_26302";
PROCEDUREp1(VARCHAR10) SELECT a|
CREATE ORdropprocedure proc_26302;
BEGIN
name (10;
SET name="helloINSERT INTO t1 VALUES (1), (2), (3), (4), (5);
call p1(name);
END|
CREATE OR REPLACE PROCEDURE p3 ()
BEGIN
DECLARE name VARCHAR(10);
SET name="hello";
call p1(name2);
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
42000:Undeclared variable name2
call p2();
a
hello
p1java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
drop procedure p2;
#
# MDEV-15328: MariaDB 10.2.13 Crashes upon CALL PROCEDURE PARAM
# LAST_INSERT_ID ()
# (part 1, part 2 sql security definer
#
CREATE declare x int(11);
CALL foo( LAST_INSERT_ID() );
DROP PROCEDUREjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
#
# MDEV-15870 Using aggregateshow create test.v1
#
PROCEDURE p1 (a TEXT) BEGIN END;
CALL p1(RANK() OVER (ORDER BY 1));
ERROR HY000: Window function is allowed only in SELECT list and ORDER BY clause
CALL p1(ROW_NUMBER() OVER (disconnect bug29408;
ERROR HY000: Window function is allowed only in java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 17
CALL p1(SUM(1));
ERROR HY000: Invalid use of group function
DROP PROCEDURE p1;
#
# MDEV-16311 Server crash when using a CREATE PROCEDURE p2(v INT) CREATE TABLE t1 SELECT;
#
SET sql_mode=STRICT_ALL_TABLES;
TABLE (aINT)
INSERT INTO t1 VALUES (10)java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 14
BEGIN NOT ATOMIC
DECLARE a INT;
DECLARE c CURSOR java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
OPEN c;
FETCH c INTO a;
CLOSE c;
END;
$$
ERROR 22007: Incorrect integer value: 'y' for column ``.``.`a` at row 1
DROP TABLE t1;
SET sql_mode=DEFAULT;
#
# MDEV-24220: error when opening a table for the second call of SP
#
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,1),(2,2);
CREATE VIEW v1 AS SELECT MAX(a) as f FROM t1;
CREATE PROCEDURE p1()
BEGIN
SELECT * FROM v1;
END $
CALL p1;
f
2
ALTER TABLE t1 DROP a;
CALL p1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
DROP PROCEDURE p1;
VIEW
DROP TABLE t1;
#
# BUG#30366310: USING A FUNCTION TO ASSIGN ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1
# 2 OR MORE VARIABLES CRASHES SERVER
#
create function f1() returns bigint return now()-1|
create DROP PROCEDURE p2;
begin
eclareb bigint default f1();
select b-c;
end|
call p1()|
b-c
0
drop procedure p1|
functionf1|
#
# MDEV-24827: MariaDB 10.5.5 crash (sig 11) during a SELECT
#
CREATE RETURN 1;
CREATE TABLE t2 (c1 INT PRIMARY KEY, c2 INT, java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 25
INSERT INTO t1 (c1, c2) SELECT seq, seq FROM seq_1_to_10000;
INSERT INTO t2 (c1
CREATE OR#
begin
DECLARE done INT DEFAULT FALSE;
DECLARE a INT;
DECLARE cur1 CURSOR FOR
SELECT t2.c1 AS c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1
WHERE EXISTS (SELECT 1 FROM t1 WHERE c2 = -1) ORDER BY c1;
CONTINUEHANDLER FOR FOUND SET done=TRUE;
OPEN cur1;
read_loop: LOOP
FETCH cur1 INTO a;
IF done THEN
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 16
END IF;
END LOOP;
CLOSE cur1;
END $
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
DROP TABLE t2;
#End of 10.2 tests
#
# MDEV-12007 Allow ROW
#
# The cursor and the ROW variable in FETCH must have the same number of fields
CREATE PROCEDURE p1()
done INT DEFAULT FALSE;
DECLARE rec ROW(DECLARE rec ROW(aa INT, java.lang.StringIndexOutOfBoundsException: Range [24, 26) out of bounds for length 0
DECLARE cur CURSOR FOR SELECT 10 AS a,'b10' AS b;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET ;
OPEN cur;
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
LOOP
FETCH cur INTO rec;
IF done THEN
LEAVE read_loop;
END IF;
END LOOP;
CLOSE cur;
;
$$
p1(;
ERROR HY000: Incorrect number of FETCH variables
DROP PROCEDURE p1;
# Multiple ROW variables in FETCH
CREATE PROCEDURE p1(# Bug#java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE rec1 ROW(aa INT);
DECLARE rec2 ROW(aa INT);
DECLARE cur CURSOR FOR SELECT 10 AS a, 20 AS java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN cur;
read_loop:
FETCH cur INTO rec1, rec2;
IF done java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 4
LEAVE read_loop;
END IF;
END LOOP;
CLOSE cur;
END;
$$
p1(;
ERROR 21000: Operand should contain 1 column(s)
DROP PROCEDURE p1;
# A complete working example
CREATE TABLE t1 (a INT, b VARCHAR(32));
INSERT INTO t1 VALUES (10,'b10');
INSERT INTO t1 VALUES (20,'b20');
INSERT INTO t1 VALUES (30,'b30');
CREATE PROCEDURE p1()
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE rec ROW(aa INT, bbSELECT x FROM java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17
DECLARE cur CURSOR FOR SELECT a,b FROM t1;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN cur;
read_loop:
LOOP
FETCH cur INTO rec;
IF done THEN
LEAVE read_loop;
END IF;
SELECT CONCAT('rec=(',rec.aa,',',rec.bb,')') AS c;
END are continue handler for not found set last_row = 1;
CLOSE cur;
END;
$$
CALL p1();
c
rec=(10,b10)
c
rec=(20,b20)
c
rec=(30,b30)
DROP PROCEDURE p1;
DROP TABLE t1;
# A ROW variable with a single field
CREATE PROCEDURE p1()
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE rec ROW(aa INT);
cur FORSELECT 10 AS a SELECT 20java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN cur;
read_loop:
LOOP
;
IF done THEN
read_loop
END IFuse
SELECT CONCAT('rec=(',rec.aa,')') AS c;
END LOOP;
CLOSE cur;
;
$$
CALL p1();
c
rec=(10)
c
rec=(20)
PROCEDUREp1;
#
#NSERT t1 (,2,3,4;
#
CREATE TABLE t1 (c VARCHAR(16), KEY(c));
INSERT INTO t1 VALUES ('foo');java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
CREATE FUNCTION f1() RETURNS VARCHAR(16)
BEGIN
DECLARE v VARCHAR4
FOR v IN (SELECT DISTINCT c FROM t1)
DO
IF (v = 'bar') THEN
SELECT 1 INTO @a;
END IF;
END java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
RETURN 'qux';
END $$
SELECT f1();
ERROR HY000: Illegal parameter data types row and varchar for operation '='
DROP FUNCTION f1;
CREATE FUNCTION f1() RETURNS VARCHAR(16)
BEGIN
DECLARE v ROW TYPE OF t1;
IF v = call p1();
RETURN 'eq';
END ;
RETURN 'ne';
END $$
SELECT f1();
ERROR HY000: Illegal parameter data types row and varchar for operation '='
DROP FUNCTION f1;
CREATE FUNCTION f1() RETURNS VARCHAR(16)
BEGIN
DECLARE v ROW(a INT);
IF v = 'bar' THEN
set `tr =``java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
END IFdrop procedure`2;
RETURN 'ne';
END $$
SELECT f1();
ERROR HY000: Illegal parameter data typescall
DROPalter t1 integerjava.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
DROP TABLE t1;
BEGIN NOT ATOMIC
v(INT)
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 1
END
ERROR HY000: Illegal parameter data types row and varchar for operation 'in'
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
DECLARE v ROW(a INT);
SELECT 'a'IN v');
END $$
HY000 parameter data typesvarchar rowfor operation''
BEGIN NOT ATOMIC
DECLARE v ROW(a INT);
'(b',;
END $$
ERROR HY000#
#
# MDEV-15112 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 | | |