Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/MariaDB/mysql-test/main/     Datei vom 1.9.2026 mit Größe 96 kB image not shown  

SSL group_by.result   Sprache: Lisp

 

SELECT 1 FROM (SELECT 1) as a  GROUP BY SUM(1);
ERROR HY000: Invalid use of group function
CREATE TABLE t1 (
spID int(10) unsigned,
userID int(10) unsigned,
score smallint(5) unsigned,
lsg char(40),
date date
);
INSERT INTO t1 VALUES (1,1,1,'','0000-00-00');
INSERT INTO t1 VALUES (2,2,2,'','0000-00-00');
INSERT INTO t1 VALUES (2,1,1,'','0000-00-00');
INSERT INTO t1 VALUES (3,3,3,'','0000-00-00');
CREATE TABLE t2 (
userID int(10) unsigned NOT NULL auto_increment,
niName char(15),
passwd char(8),
mail char(50),
isAukt enum('N','Y') DEFAULT 'N',
vName char(30),
nName char(40),
adr char(60),
plz char(5),
ort char(35),
land char(20),
PRIMARY KEY (userID)
);
INSERT INTO t2 VALUES (1,'name','pass','mail','Y','v','n','adr','1','1','1');
INSERT INTO t2 VALUES (2,'name','pass','mail','Y','v','n','adr','1','1','1');
INSERT INTO t2 VALUES (3,'name','pass','mail','Y','v','n','adr','1','1','1');
INSERT INTO t2 VALUES (4,'name','pass','mail','Y','v','n','adr','1','1','1');
INSERT INTO t2 VALUES (5,'name','pass','mail','Y','v','n','adr','1','1','1');
SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid;
userid MIN(t1.score)
1 1
2 2
3 3
SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid ORDER BY NULL;
userid MIN(t1.score)
1 1
2 2
3 3
SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2  GROUP BY t2.userid;
userid MIN(t1.score)
1 1
2 2
SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2  GROUP BY t2.userid;
userid MIN(t1.score+0.0)
1 1.0
2 2.0
SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2  GROUP BY t2.userid ORDER BY NULL;
userid MIN(t1.score+0.0)
2 2.0
1 1.0
EXPLAIN SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2  GROUP BY t2.userid ORDER BY NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where; Using temporary
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.userID 1 Using index
drop table t1,t2;
CREATE TABLE t1 (
PID int(10) unsigned NOT NULL auto_increment,
payDate date DEFAULT '0000-00-00' NOT NULL,
recDate datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
URID int(10) unsigned DEFAULT '0' NOT NULL,
CRID int(10) unsigned DEFAULT '0' NOT NULL,
amount int(10) unsigned DEFAULT '0' NOT NULL,
operator int(10) unsigned,
method enum('unknown','cash','dealer','check','card','lazy','delayed','test') DEFAULT 'unknown' NOT NULL,
DIID int(10) unsigned,
reason char(1) binary DEFAULT '' NOT NULL,
code_id int(10) unsigned,
qty mediumint(8) unsigned DEFAULT '0' NOT NULL,
PRIMARY KEY (PID),
KEY URID (URID),
KEY reason (reason),
KEY method (method),
KEY payDate (payDate)
);
INSERT INTO t1 VALUES (1,'1970-01-01','1997-10-17 00:00:00',2529,1,21000,11886,'check',0,'F',16200,6);
SELECT COUNT(P.URID),SUM(P.amount),P.method, MIN(PP.recdate+0) > 19980501000000   AS IsNew FROM t1 AS P JOIN t1 as PP WHERE P.URID = PP.URID GROUP BY method,IsNew;
ERROR 42000: Can't group on 'IsNew'
drop table t1;
CREATE TABLE t1 (
cid mediumint(9) NOT NULL auto_increment,
firstname varchar(32) DEFAULT '
' NOT NULL,
surname varchar(32) DEFAULT '
' NOT NULL,
PRIMARY KEY (cid)
);
INSERT INTO t1 VALUES (1,'
That','Guy');
INSERT INTO t1 VALUES (2,'
Another','Gent');
CREATE TABLE t2 (
call_id mediumint(8) NOT NULL auto_increment,
contact_id mediumint(8) DEFAULT '
0' NOT NULL,
PRIMARY KEY (call_id),
KEY contact_id (contact_id)
);
lock tables t1 read,t2 write;
INSERT INTO t2 VALUES (10,2);
INSERT INTO t2 VALUES (18,2);
INSERT INTO t2 VALUES (62,2);
INSERT INTO t2 VALUES (91,2);
INSERT INTO t2 VALUES (92,2);
SELECT cid, CONCAT(firstname, '
 ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid;
cid CONCAT(firstname, '
 ', surname) COUNT(call_id)
SELECT cid, CONCAT(firstname, '
 ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY NULL;
cid CONCAT(firstname, '
 ', surname) COUNT(call_id)
SELECT HIGH_PRIORITY cid, CONCAT(firstname, '
 ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY surname, firstname;
cid CONCAT(firstname, '
 ', surname) COUNT(call_id)
drop table t2;
unlock tables;
drop table t1;
CREATE TABLE t1 (
bug_id mediumint(9) NOT NULL auto_increment,
groupset bigint(20) DEFAULT '
0' NOT NULL,
assigned_to mediumint(9) DEFAULT '
0' NOT NULL,
bug_file_loc text,
bug_severity enum('
blocker','critical','major','normal','minor','trivial','enhancement') DEFAULT 'blocker' NOT NULL,
bug_status enum('
','NEW','ASSIGNED','REOPENED','RESOLVED','VERIFIED','CLOSED') DEFAULT 'NEW' NOT NULL,
creation_ts datetime DEFAULT '
0000-00-00 00:00:00' NOT NULL,
delta_ts timestamp,
short_desc mediumtext,
long_desc mediumtext,
op_sys enum('
All','Windows 3.1','Windows 95','Windows 98','Windows NT','Windows 2000','Linux','other') DEFAULT 'All' NOT NULL,
priority enum('
P1','P2','P3','P4','P5') DEFAULT 'P1' NOT NULL,
product varchar(64) DEFAULT '
' NOT NULL,
rep_platform enum('
All','PC','VTD-8','Other'),
reporter mediumint(9) DEFAULT '
0' NOT NULL,
version varchar(16) DEFAULT '
' NOT NULL,
component varchar(50) DEFAULT '
' NOT NULL,
resolution enum('
','FIXED','INVALID','WONTFIX','LATER','REMIND','DUPLICATE','WORKSFORME') DEFAULT '' NOT NULL,
target_milestone varchar(20) DEFAULT '
' NOT NULL,
qa_contact mediumint(9) DEFAULT '
0' NOT NULL,
status_whiteboard mediumtext NOT NULL,
votes mediumint(9) DEFAULT '
0' NOT NULL,
PRIMARY KEY (bug_id),
KEY assigned_to (assigned_to),
KEY creation_ts (creation_ts),
KEY delta_ts (delta_ts),
KEY bug_severity (bug_severity),
KEY bug_status (bug_status),
KEY op_sys (op_sys),
KEY priority (priority),
KEY product (product),
KEY reporter (reporter),
KEY version (version),
KEY component (component),
KEY resolution (resolution),
KEY target_milestone (target_milestone),
KEY qa_contact (qa_contact),
KEY votes (votes)
);
INSERT INTO t1 VALUES (1,0,0,'
','normal','','2000-02-10 09:25:12',20000321114747,'','','Linux','P1','TestProduct','PC',3,'other','TestComponent','','M1',0,'',0);
INSERT INTO t1 VALUES (9,0,0,'
','enhancement','','2000-03-10 11:49:36',20000321114747,'','','All','P5','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - conversion','','',0,'',0);
INSERT INTO t1 VALUES (10,0,0,'
','enhancement','','2000-03-10 18:10:16',20000321114747,'','','All','P4','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - conversion','','',0,'',0);
INSERT INTO t1 VALUES (7,0,0,'
','critical','','2000-03-09 10:50:21',20000321114747,'','','All','P1','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - generic','','',0,'',0);
INSERT INTO t1 VALUES (6,0,0,'
','normal','','2000-03-09 10:42:44',20000321114747,'','','All','P2','AAAAA','PC',3,'2.00 CD - Pre','kkkkkkkkkkk lllllllllll','','',0,'',0);
INSERT INTO t1 VALUES (8,0,0,'
','major','','2000-03-09 11:32:14',20000321114747,'','','All','P3','AAAAA','PC',3,'2.00 CD - Pre','kkkkkkkkkkk lllllllllll','','',0,'',0);
INSERT INTO t1 VALUES (5,0,0,'
','enhancement','','2000-03-09 10:38:59',20000321114747,'','','All','P5','CCC/CCCCCC','PC',5,'7.00','Administration','','',0,'',0);
INSERT INTO t1 VALUES (4,0,0,'
','normal','','2000-03-08 18:32:14',20000321114747,'','','other','P2','TestProduct','Other',3,'other','TestComponent2','','',0,'',0);
INSERT INTO t1 VALUES (3,0,0,'
','normal','','2000-03-08 18:30:52',20000321114747,'','','other','P2','TestProduct','Other',3,'other','TestComponent','','',0,'',0);
INSERT INTO t1 VALUES (2,0,0,'
','enhancement','','2000-03-08 18:24:51',20000321114747,'','','All','P2','TestProduct','Other',4,'other','TestComponent2','','',0,'',0);
INSERT INTO t1 VALUES (11,0,0,'
','blocker','','2000-03-13 09:43:41',20000321114747,'','','All','P2','CCC/CCCCCC','PC',5,'7.00','DDDDDDDDD','','',0,'',0);
INSERT INTO t1 VALUES (12,0,0,'
','normal','','2000-03-13 16:14:31',20000321114747,'','','All','P2','AAAAA','PC',3,'2.00 CD - Pre','kkkkkkkkkkk lllllllllll','','',0,'',0);
INSERT INTO t1 VALUES (13,0,0,'
','normal','','2000-03-15 16:20:44',20000321114747,'','','other','P2','TestProduct','Other',3,'other','TestComponent','','',0,'',0);
INSERT INTO t1 VALUES (14,0,0,'
','blocker','','2000-03-15 18:13:47',20000321114747,'','','All','P1','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - generic','','',0,'',0);
INSERT INTO t1 VALUES (15,0,0,'
','minor','','2000-03-16 18:03:28',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','DDDDDDDDD','','',0,'',0);
INSERT INTO t1 VALUES (16,0,0,'
','normal','','2000-03-16 18:33:41',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
INSERT INTO t1 VALUES (17,0,0,'
','normal','','2000-03-16 18:34:18',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
INSERT INTO t1 VALUES (18,0,0,'
','normal','','2000-03-16 18:34:56',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
INSERT INTO t1 VALUES (19,0,0,'
','enhancement','','2000-03-16 18:35:34',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
INSERT INTO t1 VALUES (20,0,0,'
','enhancement','','2000-03-16 18:36:23',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
INSERT INTO t1 VALUES (21,0,0,'
','enhancement','','2000-03-16 18:37:23',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
INSERT INTO t1 VALUES (22,0,0,'
','enhancement','','2000-03-16 18:38:16',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0);
INSERT INTO t1 VALUES (23,0,0,'
','normal','','2000-03-16 18:58:12',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','DDDDDDDDD','','',0,'',0);
INSERT INTO t1 VALUES (24,0,0,'
','normal','','2000-03-17 11:08:10',20000321114747,'','','All','P2','AAAAAAAA-AAA','PC',3,'2.8','Web Interface','','',0,'',0);
INSERT INTO t1 VALUES (25,0,0,'
','normal','','2000-03-17 11:10:45',20000321114747,'','','All','P2','AAAAAAAA-AAA','PC',3,'2.8','Web Interface','','',0,'',0);
INSERT INTO t1 VALUES (26,0,0,'
','normal','','2000-03-17 11:15:47',20000321114747,'','','Allset @save_character_set_client=@@character_set_client;
INSERT test;
 INTO  VALUES(,,0',',''-03-0951,',''Windows '''',PC,,other','TestComponent,'',0'',)
select * from ;
TABLE t2 (
value tinytext,
program varchar(64),
initialowner tinytext NOT NULL,
initialqacontact tinytext NOT NULL,
description mediumtext NOT NULL
);
INSERT INTO t2 VALUES ('
TestComponent','TestProduct','id0001','','');
INSERT INTO t2 VALUES ('
BBBBBBBBBBBBB - conversion','AAAAA','id0001','','');
INSERT INTO t2 VALUES ('
BBBBBBBBBBBBB - generic','AAAAA','id0001','','');
INSERT INTO t2 VALUES ('
TestComponent2','TestProduct','id0001','','');
INSERT INTO t2 VALUES ('
BBBBBBBBBBBBB - eeeeeeeee','AAAAA','id0001','','');
666
 INTO t2 (Test Procedures'
,'AAAAA',id0001'',';
 VALUES '
,AAAAA',''',')
 INTO  t2 VALUES (DDDDDDDDD'
,'CCC/CCCCCC','id0002','','');
INSERT INTO t2 VALUES ('Eeeeeeee Lite','CCC/CCCCCC',begin
INSERTINTO t2 (Eeeeeeee Full','CCC/CCCCCC','id0002','','');
INSERT INTO t2  (Administration'
'CCC/CCCCCC','id0002','','');
INSERT INTO t2 VALUES ('Distribution','CCC/CCCCCC','id0002','','');
INSERT INTO t2 VALUES ('Setup','CCC/CCCCCC','id0002','','');
INSERT INTO t2 VALUES ('Unspecified','CCC/CCCCCC','id0002','','');
INSERT INTO t2 VALUES ('Web Interface,'AAAAAAAA-',i',',';
 INTO t2 VALUES ' communication','',''')java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
,description,bug_id from 2left join  on t2.=t1.andt2.t.where =AAAAA"

  bug_id
declare data int default ;
BBBBBBBBBBBBB - conversion  10
BBBBBBBBBBBBB - generic  7
BBBBBBBBBBBBB - generic  14
BBBBBBBBBBBBB - eeeeeeeee  NULL
kkkkkkkkkkkinsert t1(d  (f,1;
kkkkkkkkkkk  8
   java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
est  NULL
 NULL
Host  NULL
scriptionCOUNT(bug_id t2 joint1 on t2.=t1. and.alue=1.omponent where program="" by value;
declare varchar(2;
BBBBBBBBBBBBB   java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  0
  2
  0
Host  java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
  
Test Procedures0
select value,description,COUNT(bug_id) from t2 left join t1 on t2.program=t1.product and t2.value=t1.component where java.lang.StringIndexOutOfBoundsException: Index 121 out of bounds for length 17
  COUNT(ug_id)
BBBBBBBBBBBBB - conversion  2
 - eeeeeeeee 0
BBBBBBBBBBBBB - generic  2
Documentation  0
Host communication  0
java.lang.StringIndexOutOfBoundsException: Range [15, 4) out of bounds for length 18
drop
reatetable java.lang.StringIndexOutOfBoundsException: Range [38, 16) out of bounds for length 39
 (1);
select 1end|
11a count()
2 a 0
insert into t1 values (1);
select 1+1,"a",count(*) from t1 where foo in (2);
1+1 a count(*)
2 a 0
drop table t1;
CREATE TABLE t1 (
spID int(10) unsigned,
userID int(10) unsigned,
score smallint(5) unsigned,
key (spid),
key (score)
);
INSERT INTO t1 VALUES (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3),(6,3,3),(7,3,3);
explain select userid,count(*) from t1 group by userid desc;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort
explain select userid,count(*) from t1 group by userid desc order by null;
id select_type table type possible_keys key key_len ref rows Extraselect * from t1|
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using temporary
select userid,count(*) from t1 group by useridid 
userid delete from t1
3 5
2 1
1 2
select userid,count(*) fromcall zap(7, @zap|
userid count(*)
1 2
select userid,count(*) from t1 group create procedure c1(x int)
userid count(*)
explain select spid,count(*) from t1 where spid between 1 and 2 group by spid desc;
idcall c3x s|
1 SIMPLE t1 range spID spID 5 create procedure c3(x int, s char)
explain select spid,count(*) from t1 where spid between 1 and 2 group by spid;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range spID spID 5 NULL 3 Using where; Using index
explain select spid,count(*) from t1 where spid between 1 and 2 group by spid order by null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range spID spID 5 NULL 3 Using where; Using index
select spid,(*) fromt1where  between 1 and 2groupbyspid;
spid count(*)
1 1
2 2
select spid,elect *from t1|
spid count(*)
2 2
1 1
explain extended select java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 15
id end
NULL NULL NULL 8 100.  filesort
Warnings:
Note 1003 select sql_big_result `test`.`t1`.`spID` AS `java.lang.StringIndexOutOfBoundsException: Range [0, 59) out of bounds for length 34
explain select sql_big_result spid,(userid)from t1group byspid desc order by null;
id select_type call iotest("io1", "io2", 1)|
1 select * from t1 order by data desc|
select sql_big_result spid,sum(userid) from t1group by spid desc;
spid sum(userid)
7 3
6 3
5 3
4drop procedure inc2|
3 3
2 3
1 1
explaincall inc()|
id java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 4
1MPLEt1index NULL score3NULL8 index
explainprocedure inc|
id select_type table type java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 20
1ccbv2(+1 y);
selectsql_big_result score,ount* fromt1group by score ;
score countinsert into test. values (cbv2"
 )
3 5
2
1 2
drop table t1;
create table t1 (a java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 15
insert  values ('--''20000110) ('997-01-1','-10-';
a,in()ccount( rand()from t1 group by a having c<a + interval 1 day;
a c insert into test.t1 values (id, x)|
dropcreate  sub2(dchar())
TABLEt1(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
ERT t1VALUES '
',('B',')(B','A',('',NULL)(a)(b)(NULL),(A)('',N)
flush status;
SELECT  FROM t1 GROUP  ;
a
NULL
A
B
SELECT a,count(*) FROM t1 GROUPcall sub1("
sub1c" ( i from t2 limit1)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
a call sub2"
)
NULL java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
A sub 6
B 5
SELECT a FROM t1 GROUP BY binary a;
a
NULL
A
B
a
b
function java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
a count*
 3
A 4
B 4
sel   t1 order  data desc|
b 1
SELECT  a  GROUP Y1;
binary java.lang.StringIndexOutOfBoundsException: Range [8, 9) out of bounds for length 8
NULL
A
B
a
b
SELECT binary a,count(*) FROM t1 GROUP BY end java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  count()
NULL java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
A 4
B 4
a 1
b 1
show status like 'Createdtables'
Variable_name 
 0
tmp_tables6
et=;
 a FROMt1 GROUP BY  BY ;
a
NULL
A
B
*)FROM    ;
t*
NULL 3
A 5
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 3
 FROM   BY binarya
a
NULL
A
B
a
b
SELECT a,( t1 GROUP   a;
select *  t1  d desc|
NULL 3
A 4
B 4
a 1
b 1
SELECT  a  t1 GROUP  1
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
NULL
A
B
a
bprocedured|
SELECT binary c() t1GROUP  ;
binary  ()
NULL 3
A 4
B 4
a 1
bif
show status like 'Created%tables';
Variable_name Value
Created_tmp_disk_tables 6
Created_tmp_tables 12
set tmp_memory_table_size=default;
drop table t1;
CREATE TABLE t1 (
`a` char(193) default NULL,
`b` char(63) default NULL
);
INSERT INTO t1 VALUES ('abc','def'),('hij','klm');
SELECT CONCAT(a, b) FROM t1 GROUP BY 1;
CONCAT(a, b)
abcdef
hijklm
SELECT CONCAT(a, b),count(*) FROM t1 GROUP BY 1;
CONCAT(a, b) count(*)
abcdef 1
hijklm 1
SELECT CONCAT(a, b),count(distinct a) FROM t1 GROUP BY 1;
CONCAT(a, b) count(distinct a)
abcdef 1
hijklm 1
SELECT 1 FROM t1 GROUP BY CONCAT(a, b);
1
1
1
INSERT INTO t1 values ('hij','klm');
SELECT CONCAT(a, b),count(*) FROM t1 GROUP BY 1;
CONCAT(a, b) count(*)
abcdef 1
hijklm 2
DROP TABLE t1;
create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned);
insert into t1 values (1,2,1,4),(1,2,2,4),(1,2,3,4),(1,2,4,4),(1,1,1,4),(1,1,2,4),(1,1,3,4),(1,1,4,4),(1,3,1,4),(1,3,2,4),(1,3,3,4),(1,3,4,4);
select One, Two, sum(Four) from t1 group by One,Two;
One Two sum(Four)
1 1 16
1 2 16
set x = -1;
roptablet1;
reatetable t1 (id integer primary key not null auto_increment, gender char(1));
select *from orderbydata java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
createtable t2 uinteger notnull,datedate)
insertinsert intot1 (f" )
select .as ,count(u.d) as,(count(distinct .id)*)as percentage from t1 u,t2l  luser_id = u.id group u.;
dist_count percentage
F 3 60.0000
M 1 20.0000
select u.gender as  gender, count(distinct  u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender  order by percentage;
gender select * from t1 order by data|
M 1 20.0000
F 3 60.1
drop t1,2
CREATE  (xint)
);
insertinto values(,,NULL),(2,243,NULL),(134,223,NULL),(185,186,NULL);
@ave_optimizer_switch@@optimizer_switch;
SET optimizer_switch='outer_join_with_cache=off';
selectinto test.1 (,2)
xID xID1
1 1
2call g(1|
2 2
3 134
3 134
3 134
4 185
4 185
4 185
4 185
select S.ID as xID, create procedure h(x int)
xID java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
1 1 *
2 2 **
3 134 ***
4  ***
optimizer_switch=@save_optimizer_switch;
droptablet1;
CREATE TABLE t1 (
pid intselect *from t1 order by data|
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
drop procedureh|
value int(11)unsignedNOT NULL default 0'java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
UNIQUEleavefjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
UNIQUE KEY pid (pid,end |
) ENGINE=MyISAM;
INSERT java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 10
CREATE TABLE java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 7
idinsert  t1  "
,3), "",|
active enum('Yes','No' NOTNULL default Yes,
java.lang.StringIndexOutOfBoundsException: Range [16, 7) out of bounds for length 17
)
INSERTiddata
CREATE TABLE t319
id int(11)begin
T NULL default',
select * from t2 order by s;
);
INSERT INTO t3end|
select * from t1 AS m LEFT JOIN t2 AS c1 ON m.c1id call sel2(|
c1 AND c1. ='
' LEFTLEFT JOIN AS c2  m.c2id = c2.idAND
c2x941
pid c1id c2id value id active id java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
1 1  fromt2|
1 NULL 3 3 NULL NULL 3 Yes
1 4 NULL 4 4 Yes NULL NULL
select maxinsert into test.values x, );
.c1id = c1.id AND c1. ='
 LEFT JOIN t3 AS c2ON . = 
'Yes'WHERE m.pid=1  AND (c1.id IS NOT NULL OR c2.id IS 
NOT NULL);
max(value)
4
drop table t1,t2,t3;
create table t1 (a blob null);
insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(""),(""),(""),("b");
select a,count(*) from t1 group by a;
a count(*)
NULL 9
 3
b 1
set tmp_memory_table_size=0;
select a,count(*) from t1 group by a;
a count(*)
NULL 9
 3
b 1
drop table t1;
set tmp_memory_table_size=default;
SET @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity,@save_optimizer_switch=@@optimizer_switch;
SET optimizer_switch='outer_join_with_cache=off',@@optimizer_use_condition_selectivity=4;
create table t1 (a int not null, b int not null);
insert into t1 values (1,1),(1,2),(3,1),(3,2),(2,2),(2,1);
create table t2 (a int not null, b int not null, key(a));
insert into t2 values (1,3),(3,1),(2,2),(1,1);
select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b;
a b
1 1
1 3
2 2
3 1
select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL;
a b
1 1
1 3
2 2
3 1
explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
1 SIMPLE t2 ref a a 4 test.t1.a 1 
explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary
1 SIMPLE t2 ref a a 4 test.t1.a 1 
drop table t1,t2;
SET @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity,@@optimizer_switch=@save_optimizer_switch;
create table t1 (a int, b int);
insert into t1 values (1, 4),(10, 40),(1, 4),(10, 43),(1, 4),(10, 41),(1, 4),(10, 43),(1, 4);
select a, MAX(b), INTERVAL (MAX(b), 1,3,10,30,39,40,50,60,100,1000) from t1 group by a;
a MAX(b) INTERVAL,10,30,94050601001000
1 4 2
10 43 6
select a, MAX(b), CASE MAX(b) when 4 then 4 when 43 then 43 else 0 end select *t1 order by datajava.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
a into_test2",100|
1  4
10id data @z
select a, MAX(b), java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 13
aMAX( ((b) 43,'
' 5)
1 4 begin
10 43 1
select a, MAX(b,CONCAT_WS(MAX(b,'
','4' 5) from t1 group by a;
aMAXb CONCAT_WS(MAX(b) '
43' '4,''java.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
14434445
10 43 43434435
select19 
a delete fromt1|
1 4 d
10 43 NULL
select a, MAX(b), MAKE_SET(MAX(b), 'a'java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 17
1 4 c
10 43 a,b,create procedure into_outfile(x char(16), y int)
dropintotest.values ( ;
create table t1insertinto test.t1 values (oncat(x, 2) +)
insertintot1 values (,),,)(2,)(,;
( sqty countqty)as  fromt1 groupby id havingsum(qty)> and1
id
1 5 2
selec*into dumpfile"YSQLTEST_VARDIR/tmp/spdump"from test.1limit1
select id,from java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
id sqty
1 5
29
select id, sum(insert into test.t3 values (concat(x, "2"), y+2);
select   t1 |
1 5cs 90  java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
2  2
select , sum() as sqty,count)as  from t1 groupby idhaving sum(qty)2 and(qty)>;
id  
1 5 2
2 
select (*)  (ty,,,4,,,78  -  0""when 1 then "ne   java.lang.StringIndexOutOfBoundsException: Range [117, 116) out of bounds for length 165
countfunction inc(i int)  
2NULL
one
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 *)interval(qty2345678 category from t1 group by category;
count(*) category
1 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
2
1 3
1 4
dropt1;
CREATE TABLE t1 (
java.lang.StringIndexOutOfBoundsException: Range [15, 6) out of bounds for length 24
score smallint(java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 14
key java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4
);
INSERT INTO t1 12120 java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
SELECT returnmul(inc() fac()  |
userid count(java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 22
3ins t2values (append"
, yyy",mul(,3) e()java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60

1* from t2 s  "
a,""|
EXPLAIN userid,* t1 GROUPBY  DESC;
java.lang.StringIndexOutOfBoundsException: Range [25, 2) out of bounds for length 66
1 t1 NULL NULL 8 Using 
DROP TABLE t1;
CREATE  2
i sid
j int(11) default NULL
)
INTO VALUES (,)(,),(45)(,),(1,5),(23,5)
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 18
iCOUNT(java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 20

1
4 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
n  i,COUNTDjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 70
id t java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 65
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 4
DROP id
createdeletet1
create  ( )
select min) isnullfrom
a)is null
1
select min(a) is null or null from t1;
min(a) is null or null
1
lect min)is  
1 and min(createjava.lang.StringIndexOutOfBoundsException: Range [32, 23) out of bounds for length 32
1
drop table t1;
java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4
insert java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 22
select group_concat( distinct createprocedure hndlr4()
group by col2 having alias like 'b
alias
1,2
1,2
1
java.lang.StringIndexOutOfBoundsException: Range [10, 4) out of bounds for length 14
create * from t3|
insert into t1 (a,b) java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 7
elect ,0.*+  1   where a = 1 group  by a having r1>1 and r2=1;
a r2 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
1cdouble;
select declare ccursor select*from test.java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
a open 
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
select a, round(declare cursor for select i from test.t2 order by i;
a r2 r1
1 2 2
ct a,um() t1  a= group by c;
a sum(b)
1 5
select a*sum(b) from java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
a*sum()
5
select a*sum(b) as f1 from t1 where a=1 group by c having f1 <= 10;
f1
5
 c1;
ajava.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 9
1 5
select sum(a)*sum(b) from t1 where a=1 group s 
sum(a)*sum(b)
10
select a,sum(b) from t1 where a=1 group by c having a=1;
a sum(b)
1 5
select a as d,sum(b) from t1 where a=1 group by c having d=1;
d sum(b)
1 5
select sum(a)*sum(b) as d from t1 where a=1 group by c having d > 0;
d
10
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 14
create comment '
haracteristics procedure test'
insert into t1  insert into tinto values (",1|
 java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 17
a chisti STRICT_TRANS_TABLES,,,O_ENGINE_SUBSTITUTION DEFINER=root`` java.lang.StringIndexOutOfBoundsException: Range [143, 142) out of bounds for length 155
b insert java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 84
c varchar50 NULL,
d varchar(100) NOT NULL,
imary (,(132,d,
key a (a,bchistics1
) charsetdt1|
insert java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 31
x3STRICT_TRANS_TABLES,,NO_AUTO_CREATE_USERNO_ENGINE_SUBSTITUTION CREATE DEFINER=root`@`localhost PROCEDURE`histics`)
concat('val-', x3.a + 3*x4.a), - MODIFIES SQL DATA
concat('SQL SECURITY INVOKER
-' a + 120D.)
from t1 x3, t1 x4, t1 C, t1 D whereinsert t1values ("
chistics"1 latin1ljava.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 84
delete from t2  where a = 2 and b = 'val-2' order by a,bcreate function chistics() returns int
explain selectlanguage 
sql java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 20
1 SIMPLEjava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 94
select  from t2 where  =2and b = 'val-2' group by c;
c
val-74
val-98
drop tablejava.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 10
create table t1bint4 not;
insert into t1 values(3000000000);
 t1
b
3000000000
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 22
min(b)
3000000000
drop table t1;
CREATE drop functio chistics|
INSERT INTO t1java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 57
(set @sql_mode = 'ANSI'|
(2, 3, 'what.ever.com'),
(3, 7, 'cache-dtc-af05.proxy.aol.com'),
(4, 7, 'cache-dtc-af05.proxy.aol.com');
SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
WHERE hostname LIKE '%aol%'
    GROUP BY hostname;
hostname no
roxya.1
DROPdone int default 0;
CREATE TABLE t1 (a  int, b int);
INSERT INTO t1 VALUES (1,2), (1,3);
SELECT a, b FROM t1 GROUP BY 'const';
a b
1 2
SELECT DISTINCT a, FROMt1GROUP BY 'onst'java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
a b
1 2
DROP TABLE t1;
CREATE TABLE t1 (id INT, dt DATETIME);
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
SELECT dt DIV 1 AS f,open c;
f idfetch  into ;
20050501123000c2 =+1;
DROPuntil done end java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
CREATE TABLEcall modes(@c1, @c2)|
INSERT INTO t1 VALUES ('trans1'), ('java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 31
CREATE3
dropjava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 11
FROMt1  java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 53
COUNTjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 23
1NULL
  
TABLEt1 ;
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 21
nsert intot1(--6
java.lang.StringIndexOutOfBoundsException: Range [11, 6) out of bounds for length 36
update t1set 42where id ="
"
date()
2005-06-06
dropdeletefrom|
CREATE()
INSERT from java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
SELECTselect  from |
n
r(
java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
  ''in GROUPBY is ambiguous
DROP TABLEt1;
create table t1(f1return select (data) java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
insert into t1 values (1),(2);
select  maxf1)is  fromt1
maxf1)is null
0
select  id, f2() from java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 36
maxf1+
3
drop
a ;
INSERT INTO t1 VALUES (1),(2);
SELECT a FROM t1java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 13
a
1
ajava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
f( )
1
SELECT a FROM t1 GROUP BY `a`;
a
1
2
set sql_mode=ANSI_QUOTES;
SELECT FROM t1 GROUP BY "a"
a
1
2
SELECT a FROM t1 GROUP BY 'a's f4(
a
1
SELECT a FROMcreate  f5(i)returns 
i i <  then
1
2
set sql_mode='';
SELECT java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
a
Warningsjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Range [3, 1) out of bounds for length 3
SELECT a FROM t1select*v2
a
Warnings:
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 4
SELECT 30
a
2
SELECT a FROM t1 ORDER BY 'a' DESC;
a
1
2
SELECT a FROM t1 ORDER BY "a" DESCf8()
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
1
2
SELECT a FROM t1 ORDER BY `a` DESC;
a
2
1
DROP TABLEERROR  functionsand are nota
CREATE:stored functions  triggersare notallowed
 (10)NOTNULL primarykey,
varchar()NOT NULLdefault'
);
CREATE TABLE t2 (
f1 varchar(10) NOT return ssum( java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 34
f2 char(3) java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 12
KEY  `1)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
`1 `f2``f1`)
);
SERT INTO t1 valuesN '
);
`t2`VALUES('486878,WDT','',WDT)
SELECTSQL_BUFFER_RESULT(.)FROM ,t2wheret2f2  SIR   f;
avg(t2.f1)
SELECT t2. t1, t2where .f2= SIR'GROUPBY f1;
avg(t2()
TABLE ,t2;
create table a 1
table  c (3,c4 (3))
insert
insert into ERROR :Table'
v0 notlocked 
java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
groupc2;
c2
aaa
aaa
Warningsjava.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
Warning 1052 Column 'c2' in java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 12
show warnings;
Level Code Message
Warning 1052 Column unlock tables|
select t1.c1 as java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
group by t1.c1;
c2
aaa
show warnings;
Level Code Message
drop table t1, t2;
CREATE TABLE t1 (a tinyintsetb:= (* t3java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 43
INSERT INTO java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 4
(25,f9)
(, ) (,Noland";
temporary  if exists t3;
INSERT INTO t2 VALUES (1,1(d )java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
(17,25)return (elect count()from );
CREATE VIEW v1 ERROR 42S02 java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 8
SELECT straight_joinjava.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
where t2return(elect count()from asa  b);
ype t java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 66
1 SIMPLE  java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 49
drop temporarytableifexists java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
where t2.b=v1returnf12_2)java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
breal_b
1 -f12_1)|
6 Allemagne Allemagne
f12(
25 Belgique
54 Danemark)
62
68 France France
DROP VIEW v1;
DROP TABLE t1, java.lang.StringIndexOutOfBoundsException: Range [16, 13) out of bounds for length 17
CREATETABLEt1(aINT RIMARYKEY   key b);
INTOt1VALUES(,     1);
INSERT INTO t1 SELECT  a + 1 ,java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 55
INSERT INTO t1 SELECT  java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 14
INSERT INTO t1 SELECT  a + 8 , MODnintjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

t1SELECTa+32 (a+32 )FROM t1
INSERT INTO t1 SELECT  a + 64, MOD(a + 64, 20) FROM t1;
SELECT MINb,MAX(b)t1
MIN(b) MAX(b 1307674368
0 19
EXPLAINSELECT b ()t1 java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 44
idDb Type   Created Security_type Comment character_set_client collation_connectionDatabase Collation
1  t1indexNULLb  128Using
EXPLAIN SELECT SQL_BIG_RESULT java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 18
idtabletype java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 66
1 SIMPLE t1 index NULL b 5java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 36
SELECT b, insert t3 values
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 8
java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 3
1 7
2 7
3 7
4 7
57
6 7
7 7
8 7
9 6
1035 ) (36 163,(,167) (,,(39, )java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
11 6
12 
d bs  ;
146
15
16 6
17 6
java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 4
19set pp =1
 java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 7
bsum1)
0 end
java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
d  intunsigned;
3 7
4 7
5 7
6 7
7 7
8 7
96
10 6
11 6
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 4
13 6
14 java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
15 6
16 6
17 6
18 6
 ;
DROP ;
CREATETABLE (aINTPRIMARY KEY  bINT);
INTOt1 VALUES(,)(21)(,),(,)(,3)(,);
SET SQL_MODE = '
ONLY_FULL_GROUP_BY';
MAXa-a FROMt1 ROUP  ;
MAX(a)MINajava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
1
1
1
SELECT1991229
ING(MIN())
1
3
5
SELECT CASE WHEN AVG(a)>=0 THEN '
DbType Definer Modified Created Security_typeComment character_set_clientcollation_connectionDatabase Collation
GROUPcreate procedurebar(char(16,  )
java.lang.StringIndexOutOfBoundsException: Range [34, 4) out of bounds for length 55

Positive

SELECT a + 1 FROM t1java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 41
a + 1
2
3
4
5
6
7
SELECT  like 'bar|
 42000:'
..'isnt  BY
 t1AS java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 66
t1  java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
(call p1(|
1
2
3
4
5
6
SELECT 1 FROM `foo`|
HAVING (SELECT t1_outercreatefunctiont1max)returnsint
1
1
|
java.lang.StringIndexOutOfBoundsException: Range [39, 1) out of bounds for length 1
1
1
1
SELECT (SELECT t1_outer.a FROM t1 AS t1_inner LIMIT 1) 
FROM t1 AS t1_outer GROUP BY t1_outer.b;
ERROR 42000: '
test.t1_outer.a' isn't in GROUP BY
SELECT 1 FROM t1 as t1_outer GROUP BY a 
HAVING (SELECT t1_outer.b FROM t1 AS t1_inner LIMIT 1);
ERROR 42S22: Unknown column 'test.t1_outer.b' in 'SELECT'
SELECT (SELECT SUM(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
t1 GROUPBYb;
(SELECT  functionjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 48
21
21
21
SELECT (SELECT SUM(t1_inner.a) FROM t1 AS t1_inner java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
AS m
FROM t1 AS t1_outer;
m
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
3
3
3
3
3
SELECT (java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
FROMt1 t1_outerGROUPBY;
(bar
3
7
11
SELECTi)
WHERE (SELECT t1_outer.b FROM t1 AS t1_inner GROUP BY* fromt3java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
c table(a java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 41
1
1
1
1
1
1
SELECT b FROM t1 GROUP BY b HAVING CEILING(b) > 0;
b
1
2
3
SELECT 1 FROM java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 32
1
1
1
 java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 57
1
1
SELECT 1 FROM t1 GROUP BY bdeclarexint
ERRORERROR Inner('as 'h_en';
SELECT  intoxfrom java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 37
ERROR  procedure h_ew(java.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23
bFROM  AS BYa HAVINGt1_outer. IN 
S SUM(t1_inner.b)t1_outerbFROM ASt1_inner BY java.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 74
select '
Inner (bad)' as 'h_ew';
ERROR 42000: '
test.t1_outer.b' java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 4
DROP TABLE t1;
SET SQL_MODE =create procedure h_ex)
SET SQL_MODE = '
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 5
t1( int, f2 int);
select * from t1 group by f1;
ERRORcontinue for sqlexception
select * from t1  byf2;
RROR 2000:'est.f1 'in  
select * from t1 group by f1,java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 4
declacontinuesqlstate 23000'java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
select t1.f1,t.* from t1, java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 42000:'
estt.f1 ' GROUP
drop insertjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 26
SQL_MODE ='
;
CREATE-theremight be not found states 
id INT AUTO_INCREMENT PRIMARY select'() '_;
c1 INT NOTbegin
c2 INT NOT NULL,
UNIQUE KEY (c2,c1));
INSERT INTO t1(c1,c2) VALUES (5,1), (4,1), (3,5), (2,3), (1,a  x fromt3 a=42
SELECT * FROM t1java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 23
id c1 c2
5 1 3
4 2 3
3 3 5
2 4 1
1 5 1
 BY id ORDER BY c1;
id c1 c2
5 1 3
4 2 3
3 35
241
1 5 1
SELECT * FROM t1 GROUPjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 38
declare x int;
5 1 3
4 2 3
3 3 5
2 4 1
1 5 1
SELECT
id c1 c2
2 4 1
 1
5java.lang.StringIndexOutOfBoundsException: Range [13, 5) out of bounds for length 13
4 2 3
3 3 5
SELECT * FROM t1 select' good) '_'
c1 java.lang.StringIndexOutOfBoundsException: Range [8, 9) out of bounds for length 8
cprocedureh_we)
5 1 3
4 2 3
2 4 1
1 5 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
SELECT * FROM t1 GROUP BY c2,' (good) as''
idc1c2
3 3 5
4 2 3
5 1 3
1 5 1
2 4 1
SELECTcontinuehandler for sqlwarning
id c1 c2
1 5 1
4 2 3
3 3 5
SELECT * FROM t1 GROUP BY c2  ORDER BY c2 DESCbegin
id c1 c2
3 3 5
4 2 3
1 5 1
SELECT * FROM t1 GROUP BY c2  ORDER BY c2 DESC, c1 DESC;
id c1 c2
3 3 inser into t3  (23456789012);
4 2 3
1 5 1
DROP TABLE t1;
#
# Bug#27219: Aggregate functions java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 13
#
SET @save_sql_mode=@@sql_mode;
SET @@sql_mode='
ONLY_FULL_GROUP_BY';
CREATE TABLE t1 (a INT, b INT, c INT DEFAULT 0);
INSERT INTO t1 (a, b) VALUES (3,3), (2,2), (3,3), (2,2), (3,3), (4,4);
CREATE TABLE t2 SELECT * FROM t1;
SELECT 1 FROM t1 ORDER BY COUNT(*);
1
1
SELECT 1 FROM t1 ORDER BY COUNT(*) + 1;
1
1
SELECT 1 FROM t1 ORDER BY COUNT(*) + a;
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT()begin
SELECT 1 FROM t1 ORDER BY COUNT(*), 1;select '
Outerbad)'_ww';
1
1
SELECT 1 FROM t1 ORDER BY COUNT(*), a;
ERROR42000:MixingofGROUP columns(MIN(),)COUNT(,.)with GROUP columns illegal there no BY clause
SELECT1FROM  ORDER BY SUM(a)
1
1
SELECT 1 java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 4
1

SELECT 1 FROM
1
1
SELECT 1 FROM t1 ORDER BY SUM(aselect 'nner g)'as''
ERRORjava.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 4
SELECTa t1 ORDER COUNT(b);
 ofGROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
java.lang.StringIndexOutOfBoundsException: Range [25, 6) out of bounds for length 56
a
3
2
3
2
3
4
SELECT java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
select Outer('as'_x'
SELECT declare  handlerfor sqlexception
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 32
end;
ERROR 42000:endjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
SELECT t1.a FROM t1
WHERE t1.a = (SELECT t2.a Inner (ood)
ERROR 42000: Mixing of GROUPh_es
SELECT .FROMt1 GROUP BY a
HAVING t1.a = (SELECTjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
ERROR 42000: Mixing of GROUP columns (java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
SELECT t1.a FROM t1 GROUP BY t1.a
HAVING t1.a(t2.a FROM ORDER t.;
a
2
3
4
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 12
HAVING t1.a IN h_sw
ERROR c h_sx)|
SELECT Inner (ba)
HAVING t1.a >java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
ERROR java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
SELECT t1.a FROM t1
WHERE t1.a = (SELECT t2.a FROM t2 ORDER BY SUM(t1.b));
ERROR 42000: Mixing of GROUP columns (call h_nn)|
SELECT 1 FROM Inner (good)
AVING( AVG(SUM(1b +) FROM t2 ORDER BY SUM(.a)LIMIT 1;
1
1
1
1
SELECT 1 FROM t1 GROUP BY t1.a
HAVING (SELECT AVG(SUM(t1.b) + t2.b) FROM t2 ORDER BY SUM(t2.a) LIMIT 1);
1
1
1
1
SELECT 1 FROM t1 GROUP BY t1.a
HAVING (SELECT AVG(t1.b + t2.b) FROM t2 ORDER BY SUM(t2.a) LIMIT 1);
1
1
1
1
SELECT 1 FROM t1 GROUP BY t1.a
HAVING (SELECT AVG(SUM(t1.b) + 1) FROM t2 ORDER BY t2.a LIMIT 1);
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
SELECT 1 FROM t1 GROUP BY t1.a
HAVING (SELECT AVG(SUM(t1.b) + t2.b) FROM t2 ORDER BY t2.a LIMIT 1);
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
SELECT 1 FROM t1 GROUP BY t1.a
HAVING (SELECT AVG(t1.b + t2.b) FROM t2 ORDER BY t2.a LIMIT 1);
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
SELECT t1.a FROM t1 
WHERE t1.a = (SELECT t2.a FROM t2 GROUP BY t2.a
ORDER BY SUM(t2.b), SUM(t1.b) LIMIT 1);
a
4
SELECT t1.a, SUM(t1.b) FROM t1 
WHERE t1.a = (SELECT SUM(t2.b) FROM t2 GROUP BY t2.a
ORDER BY SUM(t2.b), SUM(t1.b) LIMIT 1)
GROUP BY t1.a;
a SUM(t1.b)
4 4
SELECT t1.a, SUM(t1.b) FROM t1 
WHERE t1.a = (SELECT SUM(t2.b) FROM t2
ORDER BY SUM(t2.b) + SUM(t1.b) LIMIT 1)
GROUP BY t1.a;
a SUM(t1.b)
SELECT t1.a, SUM(t1.b) FROM t1 
WHERE t1.a = (SELECT SUM(t2.b) FROM t2
ORDER BY SUM(t2.b + t1.a) LIMIT 1)
GROUP BY t1.a;
a SUM(t1.b)
SELECT t1.a FROM t1 GROUP BY t1.a
HAVING (1, 1) = (SELECT SUM(t1.a), t1.a FROM t2 LIMIT 1);
a
select avg (
(select
(select sum(outr.a + innr.a) from t1 as innr limit 1) as tt
from t1 as outr order by outr.a limit 1)) as m
from t1 as most_outer;
m
29.0000
select avg (
(select (
(select sum(outr.a + innr.a) from t1 as innr limit 1)) as tt
from t1 as outr order by count(outr.a) limit 1)) as tt
from t1 as most_outer;
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
select (select sum(outr.a + t1.a) from t1 limit 1) as tt from t1 as outr order by outr.a;
tt
29
29
35
35
35
41
SET sql_mode=@save_sql_mode;
DROP TABLE t1, t2;
# 
# BUG#38072: Wrong result: HAVING not observed in a query with aggregate
# 
CREATE TABLE t1 (
pk int(11) NOT NULL AUTO_INCREMENT,
int_nokey int(11) NOT NULL,
int_key int(11) NOT NULL,
varchar_key varchar(1) NOT NULL,
varchar_nokey varchar(1) NOT NULL,
PRIMARY KEY (pk),
KEY int_key (int_key),
KEY varchar_key (varchar_key)
);
INSERT INTO t1 VALUES 
(1,5,5, '
h','h'),
(2,1,1, '
{','{'),
(3,1,1, '
z','z'),
(4,8,8, '
x','x'),
(5,7,7, '
o','o'),
(6,3,3, '
p','p'),
(7,9,9, '
c','c'),
(8,0,0, '
k','k'),
(9,6,6, '
t','t'),
(10,0,0,'
c','c');
explain SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having '
foo'='bar';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having '
foo'='bar';
X
drop table t1;
End of 5.0 tests
CREATE TABLE t1 (a INT, b INT,
PRIMARY KEY (a),
KEY i2(a,b));
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
INSERT INTO t1 SELECT a + 8,b FROM t1;
INSERT INTO t1 SELECT a + 16,b FROM t1;
INSERT INTO t1 SELECT a + 32,b FROM t1;
INSERT INTO t1 SELECT a + 64,b FROM t1;
INSERT INTO t1 SELECT a + 128,b FROM t1 limit 16;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
EXPLAIN SELECT a FROM t1 WHERE a < 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 1 Using where; Using index
EXPLAIN SELECT a FROM t1 WHERE a < 2 ORDER BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 1 Using where; Using index
EXPLAIN SELECT a FROM t1 WHERE a < 2 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY,i2 i2 4 NULL 1 Using where; Using index for group-by
EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY,i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144 
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR JOIN (PRIMARY,i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144 
#
#  For this explain, the query plan is weird: if we are using 
#  the primary key for reasons other than doing grouping, can'
t
#  GROUP BY code take advantage of this?  Well, currently it doesnt:
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (PRIMARY,i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 144 Using index; Using filesort
#  Here's a proof it is really doing sorting:
flush status;
SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (PRIMARY,i2) GROUP BY a;
show status like '
Sort_%';
Variable_name Value
Sort_merge_passes 0
Sort_priority_queue_sorts 0
Sort_range 0
Sort_rows 144
Sort_scan 1
# Proof ends.
# 
#  For this explain, the query plan is weird: if we are using 
#  the primary key for reasons other than doing sorting, can'
t
#  ORDER BY code take advantage of this?  Well, currently it doesnt:
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2h_we
Inner (ood)
1 SIMPLE t1 index NULL PRIMARY 4 java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 4
#  Here'call h_xx()|
flush status;
SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a;
show status like '
Sort_%';
Variable_name Value
Sort_merge_passes 0
Sort_priority_queue_sorts 0
Sort_range 0
Sort_rows 144
Sort_scan 1
# Proof ends.
# 
SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a;
a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91 ()into from t1 where id = a_id  data = data
92
93
94
95
96
97
98
99
100
101
102
103
104
foo 
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY)
IGNORE INDEX java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 144 Using index
EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY) IGNORE INDEX FOR ORDER BY (i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1 FORCE INDEX (i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1 USE INDEX ();
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1ALLNULL  NULL NULL 144 
EXPLAIN SELECT a FROM t1 USE INDEX () USE INDEX (i2);
id select_type table type possible_keys begin
1 SIMPLE t1 ALL NULL NULL NULL NULL 144 
EXPLAIN SELECT a FROM t1if x  10 
FORCE INDEX (PRIMARY) 
INDEX FOR BY (java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
tablejava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15
USE INDEX (i2);
  usage USE and FORCEINDEX
EXPLAIN SELECT a FROM t1 call )
id select_type table types  from t3|
1 SIMPLE t1 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
EXPLAIN java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
EXPLAIN SELECT a FROM t1 IGNORE INDEX ();
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
EXPLAIN SELECT a FROM t1 USE INDEX FOR JOIN (i2) 
USE INDEX FOR GROUP BY (i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 # NULL i2 # NULL # #
EXPLAIN SELECT a FROM t1 FORCE INDEX FOR JOIN (i2) 
FORCE INDEX FOR GROUP BY (i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1 USE INDEX () IGNORE INDEX (i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144 
EXPLAIN SELECT a FROM t1 IGNORE INDEX (i2) USE INDEX ();
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144 
EXPLAIN SELECT a FROM t1 
USE INDEX FOR GROUP BY (i2) 
USE INDEX FOR ORDER BY (i2)
USE INDEX FOR JOIN (i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
 SELECT a FROM t1 
USE INDEX FOR JOIN (i2) 
USE INDEX FOR JOIN (i2) 
USE INDEX FOR JOIN (i2,i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
SET @save_optimizer_switch=@@optimizer_switch;
SET optimizer_switch='
semijoin_with_cache=off';
EXPLAIN SELECT 1 FROM t1 WHERE a IN
(SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index PRIMARY,i2 PRIMARY 4 NULL 144 Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 144 
SET optimizer_switch=@save_optimizer_switch;
CREATE TABLE t2 (a INT, b INT, KEY(a));
INSERT INTO t2 VALUES (1, 1), (2, 2), (3,3), (4,4);
EXPLAIN SELECT a, SUM(b) FROM t2 GROUP BY a LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL a 5 NULL 2 
EXPLAIN SELECT a, SUM(b) FROM t2 IGNORE INDEX (a) GROUP BY a LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
SET @save_optimizer_switch=@@optimizer_switch;
SET optimizer_switch='
semijoin_with_cache=off';
EXPLAIN SELECT 1 FROM t2 WHERE a IN
(SELECT a FROM t1 USE INDEX (i2) IGNORE INDEX (i2));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index a a 5 NULL 4 Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 144 
SET optimizer_switch=@save_optimizer_switch;
DROP TABLE t1, t2;
CREATE TABLE t1(
a INT, 
b INT NOT NULL, 
c INT NOT NULL, 
d INT, 
UNIQUE KEY (c,b)
);
INSERT INTO t1 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
CREATE TABLE t2(
a INT,
b INT,
UNIQUE KEY(a,b)
);
INSERT INTO t2 VALUES (java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
EXPLAIN2 java.lang.StringIndexOutOfBoundsException: Range [8, 9) out of bounds for length 8
id select_type table type java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 26
1 SIMPLE t1 ALL NULL NULLdeclare   select data fromt1;
SELECTc,,d FROM t1 GROUP BY c,b,d;
c b d
1 1 50
3 1 4
3 2 40
EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
id select_type table type possible_keysfetch c1 into v1;
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 
SELECTclose c1;
c b d
1 1 50
3 2 40
3 1 4
EXPLAIN SELECT c,b,d java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
id select_type table type possible_keys key key_len refshow procedure status where db='
test';
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
SELECT create procedure bug2267_2()
c b d
1 1 50show  statuswhere db=test'
;
3 1 create procedure bug2267_3()
3 2 40
EXPLAIN SELECTc,,d t1 GROUP BY ,;
id select_type tableprocedure bug2267_4()
1 SIMPLE t1 ALL NULL NULL NULL NULL b
SELECT c,,d FROM  GROUP BY c,b;
c b d
1 1 50
3 14
3 2 40
java.lang.StringIndexOutOfBoundsException: Range [25, 7) out of bounds for length 42
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL c 8 NULL 3 Using index
SELECT c,b   FROM t1 GROUP BY c,b;
c b
1 1
3 1
3 2
EXPLAIN SELECT a,b from t2 ORDER BY a,b;
 Name Type ModifiedCreatedSecurity_type Comment  collation_connection Database Collation
1 SIMPLE test bug2267_4 FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 17
SELECT a,b from t2 ORDER BY a,b;
a b
NULL NULL
NULL NULL
NULL 1
1 NULL
1 1
1 2
EXPLAIN SELECT a,b from t2 GROUP BY a,b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL a 10 NULL 6 Using index
SELECT a,b from t2 GROUP BY a,b;
a b
NULL NULL
NULL 1
1 NULL
1 1
1 2
EXPLAIN SELECT a from t2 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range NULL a 5 NULL 6 Using index for group-by
SELECT a from t2 GROUP BY a;
a
NULL
1
EXPLAIN SELECT b from t2 GROUP BY b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL a 10 NULL 6 Using index; Using temporary; Using filesort
SELECT b from t2 GROUP BY b;
b
NULL
1
2
insert into t2 SELECT NULL, NULL from seq_1_to_10;
EXPLAIN SELECT b from t2 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range NULL a 5 NULL 9 Using index for group-by
# Expect: Using index for group-by
 ;
Table Op Msg_type create procedure bug2614()
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
EXPLAIN SELECT b from t2 GROUP BY drop  if t3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range NULL a 5 NULL 6  into select * fromt3
DROP call bug2614()|
DROP TABLE t2;
CREATE TABLE t1 ( a INT, b INT );
SELECT b c, (SELECT a FROM t1 drop  bug2614|
FROM t1;
c (SELECT a FROM t1 WHERE b = c)
SELECTb,(SELECT a FROM t1 WHERE  =)
FROM t1 
HAVING b  10;
c (SELECT a FROM t1 WHERE b =)
SELECT MAX(drop  bug2674|
FROM t1 
HAVING b = 10;
ERROR42S22Reference'' java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 70
SET @old_sql_mode = @@sql_mode;
SET @@sql_mode='ONLY_FULL_GROUP_BY';
SELECT b c, (SELECT a FROM t1 WHERE b = c)
FROM t1;
c (SELECT a title VARCHAR(200),
SELECT b c, (SELECT a FROM t1 WHERE b = c)
FROM t1 
HAVING b = 10;
 : Non-field ''is in 
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
FROM t1 
 =;
42S22 'c supported r  group function)
INSERT INTO t1 VALUES (1, 1);
SELECT b c, (SELECT a FROM t1 WHERE b = c)
t1;
c t1 b  c)
1 1
INSERT INTO t1 VALUES (2, 1);
SELECT b c, (SELECT a FROM t1 WHERE b = c)
FROM t1;
ERROR 21000: Subquery returns more than 1 row
ROP TABLE t1;
SET @@sql_mode = @old_sql_mode;
SET @old_sql_mode = @@sql_mode;
SET @sql_mode='
ONLY_FULL_GROUP_BY';
CREATE TABLE t1(i INT);
INSERT INTO t1 VALUES (1), (10);
CT COUNT(i) FROM t1;
COUNT()
2
SELECT COUNT(i) FROM t1 WHERE i > 1;
COUNT(i)
1
DROP
java.lang.StringIndexOutOfBoundsException: Range [8, 3) out of bounds for length 31
a
# call java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 15
#
CREATE TABLE t1 (a drop procedure bug3863|
INSERT INTO t1 VALUES (4, 40),primary key (id)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
# should java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
SELECT (SELECT t1.a( select ifromt3 as n0,t3 as 
 COUNT(DISTINCT b)
1 1
21
3 1
4 1
SELECT S (ELECT .)aa ( b) FROM t1  BYaa;
aa COUNT(DISTINCT b)
1 1
2 1
3 1
4 1
java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 81
 (java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 20
1 1
2 1
3 1
4 1
# should the same in  reverse java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
SELECT (SELECT t1.a) bug2564_4 REAL_AS_FLOATPIPES_AS_CONCATANSI_QUOTES,ANSI "@localhost" FUNCTION b"int,y  int(1)
 |y   utf8mb4_uca1400_ai_ci
4 1
3 1
2 1
1 1
 planshouldnot java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 48
select'
'allbug3132''|
SELECT (SELECT t1.a) Hello,B!
id select_type table type possible_keysfunction
1 PRIMARY t1 ALL NULL NULL NULL java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 17
2 SUBQUERYNULLNULLNULLNULL  NULL Notables java.lang.StringIndexOutOfBoundsException: Range [75, 76) out of bounds for length 75
Warnings:
Note. Engineindependent  collected
Note 1003 /* select#1 */ select <expr_cache><`test`.`t1`.`a`>((/* select#2 */ select `test`.`t1`.`a`)) AS `aa`,count(distinct `test`.`t1`.`b`) AS `COUNT(DISTINCT b)` from `test`.`t1` group by <expr_cache><`test`.`t1`.`a`>((/* select#2 */ select `test`.`t1`.`a`)) + 0
EXPLAIN EXTENDED
SELECT (SELECT t1.a intot3 values (a) (''|
id select_type table type possible_keys key key_len ref rows filtered Extra
t1   NULLNULL 5 100.0  
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULLselectgroup_concat(v from ;
Warnings:
Note 1276 Field or reference 'testx,java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
Notedrop procedure bug3368|
# should return only one record
SELECT (SELECT tt.insert into values (1,1)|
GROUP BY aa;
aa COUNT(DISTINCT b)
4 4
CREATE TABLE t2 SELECT DISTINCT a FROM t1;
# originally reported queries (1st two columns of next two query
#begin
SELECT SELECT t2 FROM WHERE.a = t1.a)  = t1.a)aa  (ISTINCT bjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
FROM t1 GROUP BY aa, b;
aa b COUNT(DISTINCT b)
1 10 1
2 20 1
3 30 1
4 40 1
SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT(         b)
FROM t1 GROUP BY aa, b;
bCOUNT(b
1 10 1
2 20 2
3 30 1
4 40 1
# ORDER BY for sure:
SELECT (SELECT procedure bug4579_1|
FROM t1 GROUP BY aa, b ORDER BY -aa, -b;
aa b COUNT(DISTINCT drop  bug4579_2|
4 40 1
3 30 1
2 20 1
1 10 1
 (t2 FROM WHERE t2.a= t1.a) aa, b,COUNT(         b)
FROM t1 GROUP BY aa, b ORDER BY -aa,-;
aa COUNT         )
4 40 1
3 30 1
2 20 2
 1
DROP TABLE t1, t2;
#
# Bug#52051: Aggregate functions incorrectly returns NULL from outer
# query
#
CREATE TABLE t1 (a INTjava.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
CREATE TABLE t2 (java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 15
INSERT  tablet3java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
SELECTt2a)FROMt2 LEFT t1ON t2. = t1a
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
MIN(t2.a)
1
EXPLAIN SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
MAX(t2.a)
2
DROP TABLE t1, t2;
CREATE TABLE t1 (a int(11) NOT NULL);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (
key_col int(11) NOT NULL,
l)
);
INSERT INTO t2 VALUES (1),(2);
select min(t2.key_col) from t1,t2 where t1.a=1;columns from t1;
min(t2.key_col)
1
select min(t2.key_col) from t1,t2 where t1.a > 1000;
min(t2.key_col)
NULL
select min(t2.key_col)+1 from t1,t2 where t1.a> 1000;
min(t2.key_col)+1
NULL
drop  ,t2;
#
# Bug#55188: GROUP BY, GROUP_CONCAT and TEXT - inconsistent results
#
TABLEt1 (a text, b varchar(10));
INSERT INTO t1 VALUES (repeat('
1', 1300),'one'), (repeat('1', 1300),'two');
EXPLAIN 
SELECT SUBSTRING(a,1,10), LENGTH(a), GROUP_CONCAT(b) FROM t1 GROUP BY a;
id 1
select_type SIMPLE
table t1
type ALL
possible_keys NULL
key NULL
key_len NULL
ref NULL
rows 2
Extra Using filesort
SELECT SUBSTRING(a,1,10Charset Default collationMaxlen
a,110LENGTHa b
1111111111 1300 one,two
Warnings:
Warning 4202 2 values were longer t1 TABLE `1 java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
EXPLAIN 
SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
id 1
select_type SIMPLE
table t1
type ALL
NULL
key NULL
key_len NULL
refNULL
rows 2
Extra Using temporary; Using filesort
SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
SUBSTRING(a,1,10) LENGTH(a)
1111111111 1300
Warnings:
Warning 4202 1 values were longer than max_sort_length. Sorting used only the first 1024 bytes
DROP TABLE t1;
#
# Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
#
CREATE TABLE t1(f1 INT NOT NULL);
INSERT INTO t1 VALUES (16777214),(0);
SELECT COUNT(*) FROM t1 LEFT JOIN t1 t2
ON 1 WHERE t2.f1 > 1 GROUP BY t2.f1;
COUNT(*)
2
DROP TABLE t1;
#
# Bug#59839: Aggregation followed by subquery yields wrong result
#
CREATE TABLE t1 (
a INT,
b INT,
c INT,
EY(,b)
);
INSERT INTO t1 VALUES
( 1, 1,  1 )  collation Maxlen
(1 2  2 ,
3,  3)java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
( 1, 4,  6 ),
( 1, 5,  5 ),
( 1, 9, Database Create Database
( 2, 1,  6 ),
( 2, 2,  7 ),
( 2, 3,  8 );
EXPLAIN
SELECT a, AVG(t1.b),
cFROM  WHERE a = aAND .  t.) t11cjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
(
FROM t1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 10 NULL 9 Using index
3 DEPENDENT SUBQUERY t12 ref a a 10 func,func 1 Using index condition
2 DEPENDENT SUBQUERY t11 ref a a 10 func,func 1 Using index condition
SELECT a, AVG(t1.b),
(SELECT t11.c FROM t1 t11 WHERE t11.a = t1.a AND t11.b = AVG(t1.b)) AS t11c,
(SELECT t12.c FROM t1 t12 WHERE t12.a = t1.a AND t12.b = AVG(t1.b))end|
FROM t1   ;
AVGAVG(.)t11c 
1drop table t3|
2 2.0000 7 7
DROP TABLE t1;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
# Bug#11765254 (58200): Assertionset x = (sum.data)from .t1t;
# by functions
#
set tmp_memory_table_size=0insert into values (a"
,,(""3|
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (0),(0);
SELECTselect @y|
1
1
SELECT 1 FROM delete t|
1
1
SELECT 1 FROM if(elect *from  
1
1
Warnings:
Warning 1292  n=0
Warningjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
Warning 1292 Truncated incorrect INTEGERbug5251)
SELECT 1 FROM t1 GROUP BYdrop java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 23
1
java.lang.StringIndexOutOfBoundsException: Range [29, 1) out of bounds for length 1
Warnings: intot1 
Warning 1292  * from t1
Warningjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
 INTEGERvalue:'java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
Warning set datacreate  ug5307(
Warning 1292 Truncated incorrect INTEGER value: 'K'
Warning 1292 Truncated java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 4
DROP TABLE t1;
=java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
#
) drop  bug5307|
#Bug#: :INCORRECT 'ELECT SQL_BIG_RESULT..' 
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
#
TE
col1 int,java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 25
if c = m then
(),(12,13,14,15)(6)(7)(8,19,(0)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
 SELECT col1 AS field1,col1 AS field2
FROM t1 GROUP BY field1, field2end|
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL idx 5 NULL 20 Using index
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2
SELECT col1 AS field1drop  |
FROM t1 GROUP BY field1, field2;;
field1 field2
11
2 2
3 3
4 4
5 N  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
6 6
7 7
8
 9
10 max_join_size 100487|
11 11
12 12
 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
14 14
1515
16 16
d java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 19
18
19 19
20 20
SHOW   LIKE 'java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 15
  (int)
call 3|
setx = -1;
FROM t1 GROUP BY field1, field2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL idx java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
FLUSH STATUS;
SELECT SQL_BIG_RESULT col1 AS field1,id declare
FROM t1 GROUP BY drop procedurea)
field1  test.1 alues (repeat(b,) ;
11
2bbb2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
16 java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 3
17 17
18 18
19 19
20 20
java.lang.StringIndexOutOfBoundsException: Range [19, 4) out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 3
1
CREATE VIEW v1
SQL_BIG_RESULT field1,  field2
FROM v1 
 BY field1,field2
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 15
sel *from t1
3
4
5 5
6 6
7 7
8 8
9 9
10

 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
13 13
4 14

16 ) nulljava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
17 s i d
18 y -1 19.2
19 19
20 dprocedure |
tbl1.cASfield1,,tbl2.Sfield2
b   char28) )
GROUP insert test.1values nsigned;
;
java.lang.StringIndexOutOfBoundsException: Range [11, 6) out of bounds for length 13
1 1
1 2
1 3
explain
select col1 f1, col1 f2( 16java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
id select_type table insert into test.t1 values (concat(x, "2"), y+2);
1var
java.lang.StringIndexOutOfBoundsException: Range [12, 7) out of bounds for length 7
select col1 f1, col1 f2 from t1 order by f2, f1+0;
d table typepossible_keyskey rrowsExtra
1 SIMPLE t1 index NULL idx 5 NULL 20 Using index; Using filesort*fromjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 4
selectdeclare  int
f1 
1 1
2 2callinto_test4()|
3 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
4
5 5
6 6
7 7NULL
8procedurejava.lang.StringIndexOutOfBoundsException: Range [29, 26) out of bounds for length 48
9 9
10 10
11 11
12 12
13 e|
14 14
d |
16 16
17 17
8 18
19 mul(1,1), mul(3,5), mul(4711, 666)|
20 20
explain
(",""
table p key key_len rowsE
SIMPLE 1indexNULL idxsplus;
ab 241324.659882171924
f1 f2
1 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
dpfunctionunjava.lang.StringIndexOutOfBoundsException: Range [18, 19) out of bounds for length 18
3 3
4 4
5 5
6 6
7 7
8 8
9 9
 
11
12 12
13 13
14 14
15 15

17 17
18 18

20 20
explain
java.lang.StringIndexOutOfBoundsException: Range [43, 6) out of bounds for length 48
fetch intoa b;
1 SIMPLE insert into.3 values (,b)
selectendif;
f1 f2
1 1
2 2
3select*fromt3 order byi,|
4foo40
5 5
6 6
7
8

10 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
11 11
12 12
 13
14 14
15 
16 16
17 17
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [3, 2) out of bounds for length 5
20 20
explain
select col1 f1, col1 f2 from t1 group by f2 order by f2, f1;
_table type ossible_keyskey ey_lenref  
1 SIMPLE t1 select1| 2intoc1;
select
f1 f2
1 
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 3
3
4 4
5 5
drop database sp_db2|
7 7
8 8
9
10java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
11 
12 java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
13 row_count(
14 14
 15
16 16
17 17
18 18
19 function1x
20 20
explain
select col1 f1, col1 f2 from java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 12
select_type   possible_keys   ref  Extra
declare  int;|
select  f1,col1   t1  by ,f2  byf2,f1;
f1 f2
11
2 2
3
a  1
d procedure ug8762|
6 6
77
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
9 9
10 10
11 11
12 12
13 13
14 14
15 15
16 16
17 17
18 18
19 19
20 20
CREATE TABLE t2(
col1 int, 
col2 int, 
UNIQUE INDEXend|
, col2 VALUES
(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(11,10)   |
explain
id a
ect_type type possible_keyskeykey_lenr rows Extra
1 SIMPLE t2 rangeNULL idx   7 singi  group-by
explain
select java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 6
id insert  sum(data)from )+(select ()from )java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
ULL 5NULL 7Using index  -by
ERROR  Recursive  functions and  not 
select
create  (
1 SIMPLE t2 index create view v0 as select f0()|
select*from |
select  f1,col1  from t2  by java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 15
id  table type java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 23
1 7create   java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
explain
select col1 f1, col2 f2select f0(|
id select_type table type ERROR HY000: Table 'v0' was not locked with java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 36
 t2NULL  ULL  index; Using temporary; Using filesort
ltradingareaid int(1 not null default '
'
f1 f3

2 19 2
3 18 3
4 17 4
5 16 5
6 15 6
7 14 7
8 13 8
9 12 9
10 11 10
11 10 11
12
13  13
14 7 14
615
16 5 16
17 4 17
18 3 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
19  java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
20 1 20
explain
select col1 f1, java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 13
id select_type table type
1 SIMPLE t2 index NULL idx c temporary table  id int)
explain
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 4
id select f11() from t1|
  t2 index NULL idx 10 NULL 20 Using index; Using filesort
java.lang.StringIndexOutOfBoundsException: Range [29, 6) out of bounds for length 63
f1 f2 f3
1 20 1create temporary   (d int)
2 19 2
3 end|
4 17 4
5  5
6 15 6
7 47
8
9 12 9
 1 java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8

 12
13 8drop  |
14drop functionf12_1|
15 6 calldrop view |
16 5 16drop view |
17 4 17
18 3 18
19 2 19
20 1 20end;
DROP VIEW v1;
sele data
# 6;
#
 LP bug#  result withinsert into  data)values () () 3,() 6)
#
SET SESSION SQL_MODE='
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 17
CREATE TABLE t1 (
f1 int(11), f2 int(11), .
INSERT IGNORE INTO t1 VALUES ('1','9','2004-10-11delete from t1|
create table t3 wchar unique, x char)|
field1 field2
2004-101 :3: 1
20090219020500java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
lue:'

g Truncated   :''
SELECTtest facjava.lang.StringIndexOutOfBoundsException: Range [9, 17) out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
2004t3values '' b)
2009-02-02:00 
Warnings:
Warning 1292 Truncated incorrect DECIMAL exit handler for sqlstate '23000' set x3 = 1;         
Warning 1292 Truncated incorrect DECIMAL value: 'o'
Warning 1292 Truncated incorrect DECIMAL value: 'v'
SET end begin2_;
drop table t1;
#
# LP bug#967242 Wrong result (extra rows, not grouped) with JOIN, AND in ON condition, multi-part key, GROUP BY, OR in WHERE
#
CREATE TABLE t1 ( a VARCHAR(1) ) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('x');
CREATE TABLEt2   INT cVARCHAR1,KEY c ))ENGINE=
INSERT INTO t2 VALUES
(4, 'd'),(8, 'g'),(3,java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 5
(java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
SELECT t2_1.b as zzz
FROM t1 JOIN t2 ASinsert t3 (a', 'b)
ON (t2_2.b = t2_1.binsert into t3values ('x', 'y', 'z');
WHERE
rand() + 1  0 OR
a = t2_1.c
GROUP BY zzz;
zzz
0
3
4
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
SELECT t2_1.b as zzz
FROM
ON(. =t2_1.  (.  c )
WHERE
1 > 0 OR
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
GROUP BY zzz@sql_mode
zzz
0
3
4
8
SELECT t2_1.b as zzz
FROM t1 JOIN t2 AS t2_1 JOIN t2 AS t2_2
ON(22.b = t2_1.b ) AND (t2_2.c =t2_1.c)
WHERE
t2_1.b + 1 > 0 OR
a = t2_1.java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
GROUP BY zzz;
zzz
0
3
4
8
SET @save_optimizer_switch967242=@@optimizer_switch;
SET optimizer_switch = 'java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 34
SELECT t2_1.b
FROM t1 JOIN t2 AS t2_1 JOINdeclare c cursor for select data from t1;
ON (t2_2.b = t2_1.b ) AND (t2_2.c = t2_1.c )
WHEREfunction fac|
( open c;
OR a = t2_1.c
GROUP BY t2_1.b;
b
0
3
4java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 52
8
ET @java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 18
e;
# Bug#create procedurecreate procedure )
 bigint 
#
CREATE TABLE t1 (col1 intifpp then
INSERTend if;
CREATE TABLEjava.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 23
INSERT INTO t2 VALUES (java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 17

 b s default 0;
id select_type     
1 SIMPLE t2 punsigned
1 java.lang.StringIndexOutOfBoundsException: Range [41, 4) out of bounds for length 58
SELECT SQL_BUFFER_RESULT t2.col2 FROM t2 JOIN t1 ON t1.col1 GROUP BY t2.col2;
col2
8

EXPLAIN SELECT t2.col2 FROM t2 JOIN t1 ON t1.col1 GROUPcreateprocedure bug9598_2(n char(16)
id select_type table type possible_keys key java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 14
1 SIMPLE t2 java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 8
1 SIMPLE t1 show procedure status where name like '
%p%' Db Name Type Definer Modified Created Security_java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 22
SELECTshowlike'
ar'
col2
8

DROP TABLE t1,t2;
#
# BUGselect tar   `@`java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 73
QUERY OUTPUT
#
CREATE TABLEdrop bug9598_2|
a 
b varchar(1),
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 9
) CHARSET1
INSERT INTO t1 VALUES
)0'
)1,)(,a ,a)0,,,'(')
ANALYZE TABLEi where  3
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 26
test  
java.lang.StringIndexOutOfBoundsException: Range [13, 4) out of bounds for length 25

EXPLAIN SELECTjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 49
id select_typetable 
t1b9  ;indexby

()bFROMt1 .  ' BY ;
MIN(a) b
0 a

 MIN(a,  t1create function bug9775(v1 char(1)) re '
'')v1java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
id java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 66
1 SIMPLE t1 rangexi;

SELECT MIN
java.lang.StringIndexOutOfBoundsException: Range [5, 3) out of bounds for length 8


TABLE
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 31
insert 
t2(,  );
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 45
distinctsumb,d fromt2wherec= bymax() 1 fromt1group   rderby maxb;
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 60

45java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
4 89;
drop java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5

handlerjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 46
#  
CREATE java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 26
ALLEROMt1a=;

1
declarexint

NULL
drop table t1;
  2java.lang.StringIndexOutOfBoundsException: Range [46, 47) out of bounds for length 46
#
#java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 26
#
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
INSERT INTO t1insertinto continue or found
 t2 ( int 
select intoxfrom t3 a =42call (x|
FROM t1
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 11
SELECT t2. java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 38
FROM t2
) ORselec good  h_nn;
GROUP BY 1;
a
DROP TABLE t1,  for 
FLUSH STATUS;
CREATE TABLE t1 (f1 call bug9004_2('12345678901234567890'12345678901234567890|
INSERT INTO t1 values(11,NULL,'
blob'),(11,NULL,'java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 9
 ()java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Range [36, 6) out of bounds for length 36
blob NULL
DROP TABLEt1;
the''
show status like '
Created_tmp_disk_tables';
Variable_name Value
Created_tmp_disk_tables 1
#
#  Bug #1002146: Unneeded filesort if usage of join buffer is not allowed
#  (bug mdev-645)
#
CREATE  t1 (pk int  KEY,aint,INDEX idx(a))java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
INSERT INTO t1 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 4
CREATE TABLE selectO bad)'
 as '_ws;
INTOt2 java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 68
 java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 23
EXPLAIN
SELECT t2java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 39
id select_type table type possible_keys key key_len ref rows Extra
1 select '
nner()  hw'
1 SIMPLE t1 index java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 15
SELECT t2.a  bug5963_1_)
GROUP BY t2.a;
a
3
4
100
200
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 42
set@optimizer_switch
set optimizer_switch='outer_join_with_cachedeclare  java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 5
EXPLAIN
SELECT t2.a FROM t2 LEFTallb|
GROUPBY .java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 rangejava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
1 index NULL  N Using java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
SELECT t2.a FROM t2 into values()
GROUP BY t2.a
a
0
3
I b)
100

set optimizer_switch=@java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 4
DROP TABLE t1,t2;
#
# MDEV-ch_ss()
#
(select 1 order by x(y)) java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 4
ERROR 42S22: UnknownInner ()
# End Inner (bad)
#
# Bugdeclare v char;
#
TETABLE int,f2java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
 INTO t1 VALUES (1,200404-19) 1'
00000000)(,20040418)
(2,'2004-05-19'), (2
ELECT f2)MAX)FROMt1;
MIN(f2) MAX(f2)
0000-00-00 2004-05-19
SELECT f1,MIN
f1  t3java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
1h_ex|
2 0001-01-01 2004-05-19
3--10 20040410
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
CREATE TABLE t1dropprocedureh_ww|
INSERT INTO t1 VALUES (1,'01:drop procedure h_xe|
(2,'
procedureh_xs|
procedurebug822(char16,
MIN(f2) MAX(f2)
nthen
java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 45
f1 callbug822I tt2V(, )
1foo42INTO  ,c'|
2 19:53:05 b|
3 05:45:11 10:55:12
 ::000025ug6866_1int)
 java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 14
f 49771
#
# Test of bug in create procedure bug1547(s char(16))
#
CREATEx ;
INSERT INTO t1 (a,b) VALUES 1  if x > then
CREATE TABLE t2 
INSERT INTO t2java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 7
 bVIEW |
FROM t1 JOIN call"
ar)
b java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 7
c 1c
v 2v,bug1547java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
SELECT
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 23
b GROUP_CONCAT( java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
c 1c
22
NULL 1c,2v,2v
dropbug1862
#
# MDEV-24855 ER_CRASHED_ON_USAGE or Assertion `lengthccccc 3
# failed in ma_blockrec.c
#
CREATE TABLE t1 (a BIT(5), c BINARY(179));
INSERT INTO t1 VALUES (b'1100','foo'b 2
name
DROP TABLE t1;
#
# MDEV-6129selectjava.lang.StringIndexOutOfBoundsException: Range [10, 7) out of bounds for length 32
#
 sql_mode'NLY_FULL_GROUP_BY'
1 test   (sum,x,0)
test
1
2
java.lang.StringIndexOutOfBoundsException: Range [12, 3) out of bounds for length 16
#
# MDEV-6484: Assertionin 0
#
drop procedurebug1874|
INSERT INTOdeclare java.lang.StringIndexOutOfBoundsException: Range [10, 10) out of bounds for length 7
CREATE c1
INSERT INTO t2 java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 7
 i2 FROM  java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 BY i2;
i2
DROPend|
#
# MDEVdrop java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 24
# MIN(*) with createpbug2267_4(
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
CREATE )
INSERTbug22671C DEFINER`@java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 24
CREATETABLE 2(j=
INSERT INTO t2 VALUES (0),(8),(1),(8),(9);
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 25
WHERE c !=java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
MAX status 
0 bar
7 foo
drop table t1,t2;
#
LY_FULL_GROUP_BYreferences
#
set @save_sql_modeprocedure (
etsql_mode='ONLY_FULL_GROUP_BYbel java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
create table t1 (a int, b int);
select a+b as x from t1 java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 18
x
select a as x from t1 java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 16
x
select a from t1 group by a having a createbug2614)
a
drop table t1;
setsql_mode=@
table t1 (f1 ;
insert create bug2674(  
create(2 @=262000java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
insertset l:begin end;
create table  ;
insert into t3 values (6vint 42;
create table t4 (
drop procedurejava.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 11
select 
(select min(f1) from t1  temporary table temp_t1
(tcount()from where  in(select max(f4)t2declare VARCHAR(10)
OrderID  nt not ,
ERRORry keyOrderID)
drop)|
create table t1 (i1 int);
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 26
 table t2 i int)
insert into t2 values (2);
select java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 6
1
1
drop
createtablet1 (1int,c2 int)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
create table t2 (c1 int, c2where       
select t1.c1 as c1, t2.c2 as java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 14
c1 
drop table t1, t2;
MarketID Two
SET @@sort_buffer_size=256*1024;
CREATE TABLE t1 (c INT) ENGINE=MyISAM;drop bug2656_1|
INSERT INTO t1 VALUES  ,java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
(2011),(1977if is then
(1993),(NULL),(set =1
(2033),(1900set @stamped_time=in_time;
(2007),(2012),(1900),(1983),(1900),(2010),(1987),(java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 8
(2010),1989,2014,(1900),(1900)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 23
(,()(1900NULL)(2000(java.lang.StringIndexOutOfBoundsException: Range [70, 40) out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
(1994),(2014),(2025),(2006),v'
'  security invoker|
(2001),(1977),(2023),(2012)@,from_unixtime(set@  x+ ;
,1976),900,,)2023)1900(1978),1990java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
( 0101 ::10
( (1000,@i)|
(1984),(1978),(drop procedure bug12297|
ELECTExtractValue(<a>/a'
'a' create function f_bug11247(param int)
f1 returnsint
 tunsigned nullprimary ey
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 NULL
NULL NULL
Warnings:
functionial',DBMSstands or .'
  old_sort_buff_size;
DROP  ;
#
# Bug #(1001MySQLTricks''.Never runmysqldas  . tablet4 a int)
#Missingrows  with  .WHERE.IN java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51
# with  procedurebug3734 (aram1 if  a 
#
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
pk INT NOT NULL,
col_int_nokey INT,
PRIMARY KEY (pk)
);
INSERT INTO t1 VALUES (10,7);
INSERT INTO t1 VALUES (11,1);
INSERT INTO t1 VALUES (12,5);
INSERT INTO t1 VALUES (13,3);
SELECT pk AS field1, col_int_nokey AS field2 
FROM t1 
WHERE col_int_nokey > 0
GROUP BY field1, field2;
field1 field2
107
11 1
12MySQLTutorial DBMS stands for DataBase.eave ;
 3
CREATE TABLE where_subselect
drop t t3|
FROMend f
WHERE@  0
GROUP BY set @a = @a + 1;
;
SELECT * 
FROMwhere_subselect
WHERE (field1, field2callb = 0;
SELECTpkASfield1,col_int_nokeyc2_repeat: repeat
FROM t1
WHERE col_int_nokey  > 0
GROUP BY field1@a
);
field1 field2
10 7
111
12 5
13 3
 TABLE t1;
DROP TABLE where_subselect;
# End of Bug #58782
#
#MDEV-8988: Apparently validend;
#
table ();
insert into t0 where n0.id = n1.rid
create java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
insert into t1 end|
insert into t1 values (NULL, NULL, NULL);
create table t2 (ccall bug12168(b)
insert into t2 selectinsertintot3  ( , '', ( 1 'r',(,,' zap)
analyze table t2;
Table java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 1
test.t2  bug2460_12)|
est.2 analyze status Table is already up to date
explain 
 
 ejava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 24
from t1 
group by t1call bug2460_2(|
id select_type table type selectselect *fromt3|
1 PRIMARY t1 ALL NULL NULL NULL NULLjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
2drop table t3|
 
max(dropprocedure bug12168|
from t1 
create table t3 (c1 char(128))|
max(a) + (selectset @@sql_mode = '
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
NULL
100090
100091
100092
100093
100094
100095
100096
100097
java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
0099
drop table t0,t1,t2;
#
#  when group by constant
#
createwherec1='AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
Warnings:
Warning 1286 Unknown storage engine 'innodb'
Warning 1266 Using storage engine MyISAM for table 't1'
select distinct a from t1 group by 'a';
a
rtinto  values("2001-0202","2001-02-03");
selectdrop procedure |
a
2001-02-02
drop table t1;
#
# bug2564_4,AIANSI CREATE DEFINER=root@localhost"FUNCTION java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
#
java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 17
Hello,Bobjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
job_cmd varbinary(60) NOT NULL DEFAULT '',
job_namespace int(11) NOT NULL,
varbinary255)NOTNULL,
job_params blob NOT NULL,
stampvarbinary14) DEFAULTjava.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 4
job_random int(10is up date
job_token varbinary(32) NOT NULL DEFAULT '',
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
job_sha1 varbinary(32) NOT NULL DEFAULTinsert into t3 values ('a'), ('b')|
job_attempts intbegin
PRIMARY KEY (job_id),
KEY job_cmd (job_cmd,job_namespacecall bug12849_1(roup_concat(v
KEY select g)
KEY job_sha1 (job_sha1),
KEY job_cmd_token (job_cmd,job_token,job_random),
KEYjob_cmd_token_idjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 47
);
INSERT INTO t1 VALUES 
(NULL, 'foo',end
(NULL, 'bar', 2, 'barset@var'abcd'|
call bug4579_1()|
job_cmd
drop table |
CREATETABLE t1 (1INT NOT NULL, create (returns int return |
INSERT INTO t1 VALUES (0,'foo')t3 CREATETABLE t`(
ELECT 1IN(SELECTCOUNT(DISTINCT )FROM WHERE  < 4 ;
1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 a M CHARSETuCOLLATE=
0
drop t1;
#
# MDEV-:Adding an order by changes the query results
#
CREATE TABLE a int,  ;
INSERT java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 9
create
declaretmp_d_id INT default e|
java.lang.StringIndexOutOfBoundsException: Range [3, 1) out of bounds for length 3
101 set tmp_d_id =java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
201 3
 1AS x,COUNT(DISTINCT )ASjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
x y
101 2
201 3
drop view v1;
 tablet1NULL
#
  java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 98
#
create fromt1
insert into t1 values(-126,7),(1,1),(0#Removed resultwill in mode
select distinct 1 from t1 group by a,tableslike 'foo';
1
1
drop table t1;
CREATE TABLE t1 ( pk int, i1 int, v1 varchar(1));
explain
SELECT 1FROM t1
GROUP   i`char(16  '',
  data`int(1  NULL
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 61
 1FROMt1
  (
F   Extra
drop table t1;
#
# MDEV-22019: Sig 11 in next_breadth_first_tab | max_sort_length setting + doubledeclare exit handler for sqlexception select 42;
# GROUP BY leads to crash
#
CALL mtr.add_suppression("
Out of sort memory");
CALL mtr.add_suppression("
Sortaborted");
SET @save_max_sort_length= @@max_sort_length;
SET max_sort_length2000000;
SELECT * FROM information_schema.tables t t1 CREATE TABLE `t1` (
ON tend|
WHERE c.able_schema=SELECT COUNT() FROM INFORMATION_SCHEMA.columns GROUP BY )
GROUP BY t.table_name;
ERROR HY001:select ) ENGINE=MyISAM CHARSET=COLLATE=utf8mb4_uca1400_ai_ci
SETmax_sort_length= save_max_sort_length;
#
#Field TypeKey DefaultExtra
#
CREATE TABLETable Key_name Seq_in_index Column_name Collation  Sub_part
(
id INT PRIMARY KEY AUTO_INCREMENT,
Variable_nam Value
INDEX(dt),
foo int
);
INSERT INTO t1 VALUES (1,'
2020-09declare
 INTO t1 (2,2020-- 13:00042
RTt1  ('092713java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
INSERT INTO t1 VALUESjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
INSERT INTO t1 VALUES (5,'
2020ERROR entry 'create procedure bug4904 (
20--28::00,);
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1
 INTO n java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
,'
2020--26 13::00'1;
CREATE VIEW v1 AS SELECT * FROM t1;
CREATE VIEW v2 AS set x = (select sum(tdata)from test.t1 t);
SELECT dt, sum(foo) AS foo FROMend|
dt foo
202009-2512::00 
2020-09-select @y|
2020-09-26 12:00:00 1
2020-09-26 13:00:00 2
2020-09-27 12:00:00 1
2020-09-27 13:00:00 1
2020-09-28 12:00:00 b
2020-09-28 13:00:00 1
bug13124(|
dt fooend
injava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 31
2020-09-25 13:00:00 1
2020-09-26 12:00:00 1
2020-09-26 13:00:
0200927:00001
: 1
2020-db'
create procedurjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 29
2020-09-28 13:00checksumnternal_vardecimal5)
DROP TABLE t1;
DROP VIEW v1,v2;
#
# End of 10create procedure bug5287(param1 int)
#
#
 -6170
#java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 4
#
CREATE TABLE create procedur bug6127(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
INSERTif  forsqlstate'3000
SELECT d != '
2023-03-04' AS f, java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 7
f COUNT(*)
1 1
NULL 1
DROP TABLE t1;
#
 MDEV-24710  value upon insert into t3 ()
#
call (|
INSERT INTO t1 (ajava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 4
CREATEC1
*from t2;
f1 f2
NULL NULL
SELECT MAX(a) AS f1, a AS f2 FROM t1 WHERE VALUE(a) IS NOT NULL;
f1 f2
NULL NULL
Sf1 ajava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
f1 f2
NULL NULL
drop table drop procedureselect bug4487()
# java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 4
create table t20 (pk int primary key, a int);
into  ccforselect  from2 ;
create  (key,bint notjava.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54
insert into t21 values (1,1);
create table t22 a int);
insert into t22 values (1),(2);
select a, @java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
where t20.pk=1 dropprocedure bug4941|
a SUBQ table t3 (s1intbegin
1reate procedure bug4905()

showjava.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 4
#
# End of 10.3 tests
#
#
# MDEV-29351 SIGSEGV when doing java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 11
#
java.lang.StringIndexOutOfBoundsException: Range [22, 6) out of bounds for length 24
UPDATE t1 SET c=1 ORDER BY (java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 25
ERROR 42S22: Unknown column '
cdeclare  handler  sqlstatecall bug12589_1(
UPDATE t1 SET c=1 ORDER BY (SELECT c);
 42S22Unknown column cin'''
DROPrt t values (1;
#
 35238   from

 OR java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 49
SELECT 1+0, min(drop procedure bug6029|
1+ min(1)
1 NULL
explain format=json SELECT 1+0, min(1) FROM t1 WHERE if(uuid_shortdeclare xint default 1;
EXPLAIN
{
": {
    "select_id": 1,
    "table": {
""I const tablesjava.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70
    
  }
}
INSERT INTO(java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 14
SELECT 1insertinto t3 ()()java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
1+ (1)
1 NULL
explain formatcount(java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
EXPLAIN
{
  "
query_block": {
    "
select_id": c table t4 (
    "
pseudo_bits_condition": "ifb 5 not null
    "nested_loop": [
      {
        "table": {
          " bug7743  char())
          "access_type: s,
":1,
          "filtered": 100
        }
      }
    ]
  }
}
DROP TABLE t1;
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=myisam;
INSERT t1 VALUES (1)
CREATE TABLE t2java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4
 t2VALUES (0drop table ||
SELECT 1+0, MIN(t1.a) FROMinsertinto t3 values(1)|
1+0 MIN(t1.a)
1 1
java.lang.StringIndexOutOfBoundsException: Range [19, 7) out of bounds for length 73
EXPLAIN
{
  "query_block": {
    ,
    "pseudo_bits_condition": "10 = rand()",
    "nested_loop": [
      {
        "tabledrop table t3|
          "declare x int default 0;
          access_type" "system",
          "rows": 1,
          "filtered": 100
        }
      java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
      {
        java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
          "java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 17
          "access_type": "
          "rows": 1,
          "filtered": 100
        }
      }
    ]
  }
}
DROPjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
#Endof 105 tests
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
# MDEV-39932: Assert correct ONLY_FULL_GROUP_BY behavior with outer refs in correlated subqueries
#
SET @save_sql_mode=@@sql_mode;
java.lang.StringIndexOutOfBoundsException: Range [25, 3) out of bounds for length 36
CREATE TABLEt1(a INT PRIMARY KEYdeclare y ;
LUES(1,1,21)(,2,(,2),5,3),(6,3);
fetch c2 into y;
FROM t12
ERROR 42000: '
test.t1_outer.areturns end;
SELECT (SELECT fetch c1 into x
FROM t1 AS t1_outer GROUP BY t1_outer.b;
ERROR:'est.t1_outer.a' isn't in GROUP BY
SELECT (SELECT delete from t1|
    java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 31
ERROR 42000: 'test.java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 3
CT SUM(a) + t1_outerjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 15
FROM t1 AS t1_outer GROUP BY t1_outerdrop procedure if exists bug8762; create procedure bug8762() begin end|procedurebug13941(out sout varchar()java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

4
9
14
SELECTreturn ;
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 40
ERROR 42000: 'test.t1_outer.a' isn't in id,bug5240( from all @a)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
SELECT (SELECT t1_inner.a FROM t1 drop  |
FROM t1 AS t1_outer GROUP BY t1_outer.b;
ERROR create pr bug7992()
SELECT (SELECT t1_inner.a FROM t1 AS drop function bug13941|
FROM t1drop  bug13941|
c1
NULL
1
d  |
SELECT (SELECT t1_inner.a FROM t1 AS t1_inner GROUP BYcreate table (
FROM t1 AS lrecordtype int(11) default null
c1
3
1
1
SELECT COUNT(*), (SELECT SUM(t1_inner.a +ltradingmodeid (11 not  default'
0'
FROM t1  GROUPBY .;
ERROR 42000: '
test.t1_outer.aPREPAREstmtFROM@tr;
DROP TABLE t1;
SET=ave_sql_modejava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
#
# End of 10.11 tests
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
#
x
#
create table t1 e|
nsertt1selectseqCALL';
dropprocedurebug8849|
id select_type tablecreate procedurebug8937()
1  t1declare ,y int;
explain select a from t1 where a in (1,2,3) or a = 22 group by a;
id select_type table type possible_keys select
1SIMPLEt1 range a a 5 java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 4
nselecta t1 wherea in (23  <sjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  type  key key_len ;
1 SIMPLE t1 range3bigint()
explain select a,b from t1 where (a) in (1,2,3createtable t3 wchar unique,return 42
id show create  bug14723;;
SIMPLE t1 rangeinsert   ('
''java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
xplainselect, t1where (,)in (1,1),22,33)group by 
id insert into t3 values ('','','';
1 SIMPLE t1 range a a end
explain select a,b,c from t1 where (a,b) inselectbug14723(
id java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2
t1range a15NULL intot3(a' ')
# Will not use index for group-by
explain java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
id select_type table type possible_keys key key_len java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 39
angeaa   983  java.lang.StringIndexOutOfBoundsException: Range [96, 9) out of bounds for length 96
 exit handler or'3000 DEFINER=root``` PROCEDURE`ug14723`)
id  table  key ref Extra
1 1ra java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 58
drop set x4 ;
# End of 11.4 tests

# MDEV-38709 ASAN heapjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
#
CREATE TABLE t1 (a varchar(1024));drop  |
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
('
LOXRI'),('willing'),('bright'),('behavior'declare achar(255);
'
)('b),('ZKUAX','',declare cursor forselect () where  ;
('
v'),('insertt3 values (x,'eclare continue handlerfor  02000 set = ;
('
AVBWKopenc;
')(sodium)(
('
)ug9074)java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
('cause'),('MYEFDc 0|
('
RQWBDjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
('b'),('f'),('flip')call bug14845()qlexception
CREATE TABLEdropprocedure bug9074java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
INSERT drop procedure bug14845|drop table t3|
('c'),('BPYFY'),('i'),('l'),('n'),('programming'),('r'),('then'),('t'),
('MVAUI'),('XQGSK'),(begin
('relatively'),('frequency'),('certainly');
SELECT a, b AS b1, b AS b2 set  0;
a b1 b2
v r r
v regret regret
v relatively relatively
v t t
v then then
v XIDWZ XIDWZ
v XQGSK XQGSK
we agree agree
we BPYFY BPYFY
we c c
DROP TABLE t1, t2;
# End of 11.8 tests

Messung
CHZG
989710098

¤ Dauer der Verarbeitung: 0.56 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland