Commit 1d7e28f9 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Imported Upstream version 5.5.43

parent 51b84100
call mtr.add_suppression("Could not use");
# Case 1: Setting fife file to general_log_file and slow_query_log_file
# Case 1: Setting fifo file to general_log_file and slow_query_log_file
# system variable.
SET GLOBAL general_log_file="MYSQLTEST_VARDIR/tmp/general_log.fifo";;
ERROR 42000: Variable 'general_log_file' can't be set to the value of 'MYSQLTEST_VARDIR/tmp/general_log.fifo'
......@@ -7,4 +6,6 @@ SET GLOBAL slow_query_log_file="MYSQLTEST_VARDIR/tmp/slow_log.fifo";;
ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'MYSQLTEST_VARDIR/tmp/slow_log.fifo'
# Case 2: Starting server with fifo file as general log file
# and slow query log file.
call mtr.add_suppression("Could not use .* for logging \\(error 6\\)");
call mtr.add_suppression("File '.*' not found \\(Errcode: 6\\)");
Setting fifo file as general log file and slow query log failed.
......@@ -11,8 +11,9 @@ Table Op Msg_type Msg_text
test.bug49823 repair status OK
RENAME TABLE general_log TO renamed_general_log;
RENAME TABLE test.bug49823 TO general_log;
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Phase 1/4: Fixing views
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
......@@ -44,7 +45,7 @@ mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
DROP TABLE general_log;
RENAME TABLE renamed_general_log TO general_log;
......
......@@ -823,4 +823,198 @@ create view v3 as select t2.id, t3.b from t2 join t3 using(id);
update t1 join v3 using (id) set t1.a=0;
drop view v1, v2, v3;
drop table t2, t3, t1;
#
# MDEV-7613: MariaDB 5.5.40 server crash on update table left join
# with a view
#
CREATE TABLE `t1` (
`f1` varchar(6) COLLATE latin1_general_ci DEFAULT NULL,
`f2` varchar(6) COLLATE latin1_general_ci DEFAULT NULL,
`f3` varchar(7) COLLATE latin1_general_ci DEFAULT NULL,
`f4` varchar(15) COLLATE latin1_general_ci DEFAULT NULL,
`f5` datetime DEFAULT NULL,
`f6` varchar(2) COLLATE latin1_general_ci DEFAULT NULL,
`f7` varchar(2) COLLATE latin1_general_ci DEFAULT NULL,
`ff1` int(1) DEFAULT NULL,
`ff2` int(1) DEFAULT NULL,
`ff3` int(1) DEFAULT NULL,
`ff4` int(1) DEFAULT NULL,
`ff5` int(1) DEFAULT NULL,
`ff6` int(1) DEFAULT NULL,
`ff7` int(1) DEFAULT NULL,
`ff8` int(2) DEFAULT NULL,
`ff9` int(1) DEFAULT NULL,
`ff10` int(1) DEFAULT NULL,
`ff11` int(1) DEFAULT NULL,
`ff12` int(1) DEFAULT NULL,
`ff13` int(1) DEFAULT NULL,
`ff14` int(1) DEFAULT NULL,
`ff15` int(1) DEFAULT NULL,
`f8` varchar(70) COLLATE latin1_general_ci DEFAULT NULL,
`f9` varchar(20) COLLATE latin1_general_ci DEFAULT NULL,
`f10` varchar(50) COLLATE latin1_general_ci NOT NULL,
`f11` varchar(50) COLLATE latin1_general_ci DEFAULT NULL,
`f12` varchar(255) COLLATE latin1_general_ci DEFAULT NULL,
`f13` text COLLATE latin1_general_ci,
`f14` time DEFAULT NULL,
`f15` varchar(30) COLLATE latin1_general_ci DEFAULT NULL,
`fg1` int(11) DEFAULT NULL,
`fg2` int(11) DEFAULT NULL,
`fg3` int(11) DEFAULT NULL,
`fg4` int(11) DEFAULT NULL,
`fg5` int(11) DEFAULT NULL,
`fg6` int(11) DEFAULT NULL,
`fg7` int(11) DEFAULT NULL,
`fg9` int(11) DEFAULT NULL,
`fg10` int(11) DEFAULT NULL,
`fg11` int(11) DEFAULT NULL,
`fg12` int(11) DEFAULT NULL,
`fg13` int(11) DEFAULT NULL,
`fg14` int(11) DEFAULT NULL,
`fg15` int(11) DEFAULT NULL,
`f16` double DEFAULT NULL,
`f17` double DEFAULT NULL,
`f18` int(11) DEFAULT NULL,
`f19` int(11) DEFAULT NULL,
`f20` varchar(255) COLLATE latin1_general_ci DEFAULT NULL,
`f21` int(11) DEFAULT NULL,
`f22` int(11) DEFAULT NULL,
`f23` int(11) DEFAULT NULL,
`f24` double DEFAULT NULL,
`f25` int(11) DEFAULT NULL,
`f26` double DEFAULT NULL,
`f27` int(11) DEFAULT NULL,
`f28` int(11) DEFAULT NULL,
`f29` double DEFAULT NULL,
`f30` int(11) DEFAULT NULL,
`f31` double DEFAULT NULL,
`PZ` double DEFAULT NULL,
`f32` varchar(50) COLLATE latin1_general_ci DEFAULT NULL,
`f33` varchar(50) COLLATE latin1_general_ci DEFAULT NULL,
`f34` varchar(50) COLLATE latin1_general_ci DEFAULT NULL,
`f35` varchar(30) COLLATE latin1_general_ci DEFAULT NULL,
`f36` varchar(20) COLLATE latin1_general_ci DEFAULT NULL,
`f37` varchar(50) COLLATE latin1_general_ci DEFAULT NULL,
`f20_2` varchar(20) COLLATE latin1_general_ci DEFAULT NULL,
`f38` varchar(30) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'Email = E-Mail / Whitemail = Brief',
`insert_ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`f10`),
KEY `f5_f12` (`f5`,`f12`),
KEY `f5_f20` (`f5`,`f20`),
KEY `f5_f33` (`f5`,`f33`)
) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ROW_FORMAT=COMPACT;
INSERT INTO `t1` VALUES ('2011/2','201105','2011/19','gstfbnfr','2011-05-06
00:00:00','gg','Ag',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,'','','','','','','21:56:28','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,0,0,'Dffgult',1,0,0,NULL,0,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ggggil',NULL),('2008/4','200812','2008/50','hgckbgfx','2008-12-08
00:00:00','gg','Ag',2,NULL,2,1,1,1,1,24,1,NULL,1,1,1,2,0,'gusschlifßlich
zugg
gflffonifrfn','88.77.79.214','10001614','fg-gtgggggdgtfn','fg-gtgggggdgtfn','birgit.tfrpfllf@gggx.df','11:55:21',NULL,1,0,1,1,1,1,1,1,0,1,1,1,0,0,NULL,NULL,0,4,'ffrtrgg',1,6,10,1.66666666666667,4,1,10,14,1.4,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.',NULL,'ggggil',NULL),('2008/4','200812','2008/51','hgckbgfx','2008-12-15
00:00:00','gg','Ag',4,5,5,4,5,5,5,NULL,4,5,1,1,1,4,0,'gusschlifßlich zugg
gflffonifrfn','79.197.185.64','10001686','fg-gtgggggdgtfn','fg-gtgggggdgtfn','kgtjg@swfftys.df','09:28:42',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,11,4.71428571428571,16,1.2,12,49,4.08111111111111,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.',NULL,'ggggil',NULL),('2008/4','200812','2008/50','nufchti','2008-12-08
00:00:00','gg','Ag',4,1,1,5,5,5,5,12,4,5,1,1,2,1,0,'gusschlifßlich zugg
gflffonifrfn','89.54.151.216','10001700','fg-gtgggggdgtfn','fg-gtgggggdgtfn','H_K2006@frffnft.df','16:41:45',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,10,4.28571428571429,11,2.6,12,41,1.58111111111111,1,NULL,NULL,'ffrtrgg
Bgckofficf 5','vb5','Nufchtfr,
Iris','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','junghdro','2008-12-11
00:00:00','Do','Ag',2,2,5,5,4,4,2,72,2,5,2,2,1,1,0,'gusschlifßlich zugg
gflffonifrfn','84.61.20.216','10001849','fg-ggriff','fg-ggriff','schofnf-glftfr@grcor.df','20:18:05',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,24,1.42857142857141,12,2.4,12,16,1,1,NULL,NULL,'ffrtrgg
Bgckofficf 5','vb5','Junghfinrich,
Dorothfg','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','fbflktj','2008-12-08
00:00:00','gg','Ag',4,2,2,5,1,1,1,24,NULL,NULL,NULL,NULL,NULL,0,0,'Kgggfrg
bzw. DigiCggg
Funktion','217.84.62.6','10001888','fg-Kündigungfn','fg-Kündigungfn','f.frofschkf@gggx.df','21:05:59',NULL,1,1,1,1,1,1,1,0,0,0,0,0,0,0,NULL,NULL,0,0,'ffrtrgg',1,7,16,2.28571428571429,0,NULL,7,16,2.28571428571429,0,NULL,NULL,'out',NULL,'gbfl,
Kgtjg','49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL),('2008/4','200812','2008/50','gltggggri','2008-12-09
00:00:00','Di','Ag',4,1,1,4,2,1,2,16,1,2,2,2,2,2,0,'gusschlifßlich zugg
gflffonifrfn','81.171.157.211','10001988','fg-gtgggggdgtfn','fg-gtgggggdgtfn','bistfr@nftcolognf.df','11:07:54',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,21,1,11,2.2,12,12,2.66666666666667,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL),('2008/4','200812','2008/50','ggufllfsg','2008-12-09
00:00:00','Di','Ag',2,2,2,2,1,1,2,12,2,2,2,1,1,2,0,'ggobilfs
Intfrnft','62.154.142.186','10002097','fg-gtgggggdgtfn','fg-gtgggggdgtfn','norbfrtwfdlich@fgggil.df','09:42:11',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,12,1.71428571428571,8,1.6,12,20,1.66666666666667,1,NULL,NULL,'ffrtrgg
Bgckofficf 1','vb1','Mufllfr,
ggbinf','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','wggnfg','2008-12-09
00:00:00','Di','Ag',5,5,5,5,5,5,5,12,5,5,5,5,5,5,0,'gls grsgtz für
Ffstnftz','85.180.141.246','10002127','fg-Kündigungfn','fg-Kündigungfn','rfinhgrt.gdolph@yghoo.df','17:44:11',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,15,5,25,5,12,60,5,1,NULL,NULL,'ffrtrgg
Bgckofficf 1','vb1','Wggnfr,
Annftt','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','schubrbf','2008-12-10
00:00:00','Mi','Ag',1,2,NULL,2,1,2,1,24,NULL,NULL,NULL,NULL,NULL,0,0,'Kgggfrg
bzw. DigiCggg
Funktion','91.40.98.242','10002160','fg-gtgggggdgtfn','fg-gtgggggdgtfn','olgf.lifb@gggx.nft','18:18:25',NULL,1,1,0,1,1,1,1,0,0,0,0,0,0,0,NULL,NULL,0,0,'ffrtrgg',1,6,11,1.81111111111111,0,NULL,6,11,1.81111111111111,0,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL);
CREATE TABLE `t2` (
`ft1` datetime DEFAULT NULL,
`ft2` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`ft3` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`ft4` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`ft5` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`ft6` varchar(255) COLLATE latin1_general_ci DEFAULT NULL,
`ft6_2` varchar(255) COLLATE latin1_general_ci DEFAULT NULL,
`ft7` varchar(255) COLLATE latin1_general_ci DEFAULT NULL,
`ft8` varchar(255) COLLATE latin1_general_ci DEFAULT NULL,
`ft9` varchar(255) COLLATE latin1_general_ci DEFAULT NULL,
`ft10` varchar(255) COLLATE latin1_general_ci DEFAULT NULL,
PRIMARY KEY (`ft4`,`ft5`)
) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
INSERT INTO `t2` VALUES ('2013-03-13 00:00:00','2013-03-13 00:00:00','9999-12-31 00:00:00','#','extern FP f32 2','Default','Intern','DEFAULT',NULL,NULL,NULL),('2013-03-13 00:00:00','2013-03-13 00:00:00','9999-12-31 00:00:00','#','extern FP f32 3','Default','Intern','DEFAULT',NULL,NULL,NULL);
CREATE TABLE `t3` (
`fe1` int(10) NOT NULL DEFAULT '0',
`fe2` char(50) COLLATE latin1_general_ci DEFAULT 'nn',
`f34` char(50) COLLATE latin1_general_ci DEFAULT NULL,
`fe3` double DEFAULT NULL,
`fe4` double DEFAULT NULL,
`fe5` char(4) COLLATE latin1_general_ci DEFAULT NULL,
`f32` char(50) COLLATE latin1_general_ci DEFAULT NULL,
`fe6` int(3) DEFAULT '0',
`fe7` char(1) COLLATE latin1_general_ci DEFAULT NULL,
`ft6` char(50) COLLATE latin1_general_ci DEFAULT NULL,
`f33` char(4) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'virtuelle f33s',
`fe8` char(4) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'aus dem ADS',
`f37` char(50) COLLATE latin1_general_ci DEFAULT NULL,
`fe9` char(50) COLLATE latin1_general_ci DEFAULT NULL,
`fe10` int(5) DEFAULT '0',
`fe11` int(10) DEFAULT '0',
`fe12` char(50) COLLATE latin1_general_ci DEFAULT NULL,
`fe13` double DEFAULT NULL,
`fe14` char(50) COLLATE latin1_general_ci DEFAULT NULL,
`fe15` date DEFAULT NULL,
`fe16` date DEFAULT NULL,
`fe17` int(10) DEFAULT '0',
`fe18` date NOT NULL DEFAULT '0000-00-00',
`ft3` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`fe1`),
KEY `fe2` (`fe2`,`fe18`,`ft3`),
KEY `f33` (`f33`),
KEY `fe8` (`fe8`)
) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ROW_FORMAT=COMPACT COMMENT='CustomerService und Outsourcer Userinformationen';
INSERT INTO `t3` VALUES (1,'aabggn','gab, glgna',0,NULL,NULL,'gxtgrn D gnd g
gggsbgrg',0,NULL,'gxtgrn','dsa','dsa','gggsbgrg','0',91611,0,'0',0,'agsggschigdgn','2014-08-11','2014-09-05',0,'2011-01-01','2014-08-11'),(4,'aabigr','gab,
Iggr',0,NULL,NULL,'gxtgrn D gnd g
gggsbgrg',0,NULL,'gxtgrn','dsa','dsa','gggsbgrg','0',0,0,'0',0,'agsggschigdgn','2014-08-11','2014-09-05',0,'2012-10-01','2014-08-11'),(7,'abgcrist','gbg,
ghristggna',15182,1,'ja','ggshilfg gxtgrn 1',1,NULL,'gg
galgs','ag1','ag1','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'1900-01-01','2010-06-10'),(8,'abgcrist','gbg,
ghristggna',15182,1,'ja','Zgntralg gftgr galgs Bgtrgggng 1',1,NULL,'gg
galgs','sb1','sb1','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'2010-07-01','2012-08-11'),(9,'abgcrist','gbg,
ghristggna',15182,1,'ja','galgs Inbggnd 2',1,NULL,'gg
galgs','si2','si2','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'2012-09-01','2014-01-11'),(10,'abgcgr','gbg,
ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 1',1,NULL,'gg
galgs','sg1','sg1','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'1900-01-01','2010-11-10'),(11,'abgcgr','gbg,
ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 1',1,NULL,'gg
galgs','sg1','sg1','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'2010-12-01','2011-08-11'),(12,'abgcgr','gbg,
ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 2',1,NULL,'gg
galgs','sg2','sg2','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'2011-09-01','2012-01-11'),(13,'abgcgr','gbg,
ggrnglgg',14962,0.75,NULL,'galgs Ogtbggnd 2',1,NULL,'gg
galgs','sg2','sg2','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,'2011-09-11',11800647,'2012-02-01','2011-08-11'),(14,'rgghrsgr','gbg,
gigrid',14781,1,'ja','Fgrdgrgngsmanaggmgnt 1',1,NULL,'gg
Zahlgng','fm1','fm1','grfgrt','0',12141,0,'0',1,NULL,NULL,NULL,11010781,'1900-01-01','2012-08-11');
CREATE ALGORITHM=MERGE
DEFINER=`root`@`localhost` SQL SECURITY DEFINER
VIEW `v1` AS select `t1a`.`ft1` AS `ft1`,`t1a`.`ft2` AS `ft2`,`t1a`.`ft3` AS `ft3`,`t1a`.`ft4` AS `ft4`,`t1a`.`ft5` AS `ft5`,`t1a`.`ft6` AS `ft6`,`t1a`.`ft6_2` AS `ft6_2`,`t1a`.`ft7` AS `ft7`,`t1a`.`ft8` AS `ft8`,`t1a`.`ft9` AS `ft9`,`t1a`.`ft10` AS `ft10` from `t2` `t1a` where (if((`t1a`.`ft10` = 'virtuell'),0,1) = 1);
CREATE ALGORITHM=UNDEFINED
DEFINER=`root`@`localhost` SQL SECURITY DEFINER
VIEW `v2` AS select distinct `t1b`.`fe2` AS `fe2`,min(`t1b`.`fe18`) AS `fe18`,max(`t1b`.`ft3`) AS `ft3` from `t3` `t1b` where ((`t1b`.`fe2` <> '') and (curdate() >= `t1b`.`fe18`)) group by `t1b`.`fe2`;
CREATE ALGORITHM=UNDEFINED
DEFINER=`root`@`localhost` SQL SECURITY DEFINER
VIEW `v3` AS select `t1c`.`fe2` AS `fe2`,`t1c`.`f34` AS `f34`,`t1c`.`f33` AS `f33`,`t1c`.`f32` AS `f32`,`t1c`.`f37` AS `f37`,`t1c`.`fe10` AS `fe10`,if((`tov`.`ft6` in ('klarmobil','callmobile')),`tov`.`ft9`,`tov`.`ft6`) AS `ft6_1`,`tov`.`ft6_2` AS `ft6_2`,`ua`.`fe18` AS `fe18`,`ua`.`ft3` AS `ft3` from ((`t3` `t1c` left join `v2` `ua` on((`t1c`.`fe2` = `ua`.`fe2`))) left join `v1` `tov` on((`t1c`.`fe8` = `tov`.`ft4`))) where (`t1c`.`ft3` = `ua`.`ft3`) group by `t1c`.`fe2`,`t1c`.`f34`,`t1c`.`f33`,`t1c`.`f32` order by `t1c`.`f34`;
UPDATE t1 t1 left join v3 t2 on t1.f4 = t2.fe2 SET t1.f20 = t2.ft6_1, t1.f32 = t2.f32, t1.f33 = t2.f33, t1.f37 = t2.f37 WHERE f5 >= '2015-02-01';
#MDEV-8018: main.multi_update fails with --ps-protocol
prepare stmt1 from "UPDATE t1 t1 left join v3 t2 on t1.f4 = t2.fe2 SET t1.f20 = t2.ft6_1, t1.f32 = t2.f32, t1.f33 = t2.f33, t1.f37 = t2.f37 WHERE f5 >= '2015-02-01'";
execute stmt1;
execute stmt1;
deallocate prepare stmt1;
drop view v3,v2,v1;
drop table t1,t2,t3;
end of 5.5 tests
Run mysql_upgrade once
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Phase 1/4: Fixing views
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
......@@ -31,13 +32,14 @@ mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
Run it again - should say already completed
This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade
Force should run it regardless of wether it's been run before
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Phase 1/4: Fixing views
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
......@@ -68,13 +70,14 @@ mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila';
GRANT ALL ON *.* TO mysqltest1@'%';
Run mysql_upgrade with password protected account
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Phase 1/4: Fixing views
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
......@@ -105,7 +108,7 @@ mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
DROP USER mysqltest1@'%';
Version check failed. Got the following error when calling the 'mysql' command line client
......@@ -115,8 +118,9 @@ Run mysql_upgrade with a non existing server socket
mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect
FATAL ERROR: Upgrade failed
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Phase 1/4: Fixing views
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
......@@ -147,7 +151,7 @@ mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
set GLOBAL sql_mode=default;
#
......@@ -158,8 +162,9 @@ CREATE PROCEDURE testproc() BEGIN END;
UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc';
UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc';
UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc';
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Phase 1/4: Fixing views
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
......@@ -190,7 +195,7 @@ mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
CALL testproc();
DROP PROCEDURE testproc;
......@@ -204,8 +209,9 @@ WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been
GRANT USAGE ON *.* TO 'user3'@'%';
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%';
Run mysql_upgrade with all privileges on a user
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Phase 1/4: Fixing views
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
......@@ -236,7 +242,7 @@ mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
SHOW GRANTS FOR 'user3'@'%';
Grants for user3@%
......@@ -245,7 +251,10 @@ GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'
DROP USER 'user3'@'%';
End of 5.1 tests
The --upgrade-system-tables option was used, databases won't be touched.
Phase 3/3: Running 'mysql_fix_privilege_tables'...
Phase 1/4: Fixing views... Skipped
Phase 2/4: Fixing table and database names ... Skipped
Phase 3/4: Checking and upgrading tables... Skipped
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
#
# Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION
......@@ -253,8 +262,9 @@ OK
#
# Droping the previously created mysql_upgrade_info file..
# Running mysql_upgrade with --skip-write-binlog..
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Phase 1/4: Fixing views
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
......@@ -285,7 +295,7 @@ mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
#
# MDEV-4332 Increase username length from 16 characters
......@@ -313,8 +323,9 @@ GRANT INSERT ON mysql.user TO very_long_user_name_number_2;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_1;
GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_2;
CREATE PROCEDURE test.pr() BEGIN END;
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Phase 1/4: Fixing views
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
......@@ -345,7 +356,7 @@ mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
SELECT definer FROM mysql.proc WHERE db = 'test' AND name = 'pr';
definer
......
#
# Bug#55672 mysql_upgrade dies with internal error
#
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Phase 1/4: Fixing views
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
......@@ -33,5 +34,5 @@ mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
Phase 3/3: Running 'mysql_fix_privilege_tables'...
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
set sql_log_bin=0;
drop table if exists t1,v1,v2,v3,v4,v1badcheck;
drop view if exists t1,v1,v2,v3,v4,v1badcheck;
create table t1(a int);
create table kv(k varchar(30) NOT NULL PRIMARY KEY,v varchar(50));
flush tables;
check view v1;
Table Op Msg_type Msg_text
test.v1 check status OK
check view v1badcheck;
Table Op Msg_type Msg_text
test.v1badcheck check note View text checksum failed
check view v2;
Table Op Msg_type Msg_text
test.v2 check status OK
check view v3;
Table Op Msg_type Msg_text
test.v3 check status OK
check view v1 for upgrade;
Table Op Msg_type Msg_text
test.v1 check error Upgrade required. Please do "REPAIR VIEW `v1`" or dump/reload to fix it!
check view v1badcheck for upgrade;
Table Op Msg_type Msg_text
test.v1badcheck check note View text checksum failed
check view v2 for upgrade;
Table Op Msg_type Msg_text
test.v2 check error Upgrade required. Please do "REPAIR VIEW `v2`" or dump/reload to fix it!
check view v3 for upgrade;
Table Op Msg_type Msg_text
test.v3 check error Upgrade required. Please do "REPAIR VIEW `v3`" or dump/reload to fix it!
Phase 1/4: Fixing views
test.v1 OK
test.v1badcheck OK
test.v2 OK
test.v3 OK
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
test.kv OK
test.t1 OK
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci
show create view v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci
show create view v3;
View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci
set sql_log_bin=1;
REPAIR VIEW v1,v2;
Table Op Msg_type Msg_text
test.v1 repair status OK
test.v2 repair status OK
REPAIR VIEW v1badcheck;
Table Op Msg_type Msg_text
test.v1badcheck repair status OK
REPAIR NO_WRITE_TO_BINLOG VIEW v3;
Table Op Msg_type Msg_text
test.v3 repair status OK
set sql_log_bin=0;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; REPAIR VIEW v1,v2
master-bin.000001 # Query # # use `test`; REPAIR VIEW v1badcheck
LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '=';
SELECT k,v from kv where k in ('md5','algorithm');
k v
algorithm 1
md5 5e6eaf216e7b016fcedfd4e1113517af
SELECT k from kv where k ='mariadb-version';
k
mariadb-version
truncate table kv;
LOAD DATA INFILE 'MYSQLD_DATADIR/test/v2.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '=';
SELECT k,v from kv where k in ('md5','algorithm');
k v
algorithm 2
md5 5e6eaf216e7b016fcedfd4e1113517af
SELECT k from kv where k ='mariadb-version';
k
mariadb-version
truncate table kv;
LOAD DATA INFILE 'MYSQLD_DATADIR/test/v3.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '=';
SELECT k,v from kv where k in ('md5','algorithm');
k v
algorithm 0
md5 5e6eaf216e7b016fcedfd4e1113517af
SELECT k from kv where k ='mariadb-version';
k
mariadb-version
truncate table kv;
LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1badcheck.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '=';
SELECT k,v from kv where k in ('md5','algorithm');
k v
algorithm 1
md5 5e6eaf216e7b016fcedfd4e1113517af
SELECT k from kv where k ='mariadb-version';
k
mariadb-version
truncate table kv;
drop view if exists v1,v2,v3,v1badcheck;
rename table mysql.event to mysql.ev_bk;
flush tables;
create algorithm=temptable view v4 as select a from t1;
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci
show create view v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci
show create view v3;
View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci
show create view v4;
View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
MySQL upgrade detected
Phase 1/4: Fixing views from mysql
test.v1 OK
test.v2 OK
test.v3 OK
test.v4 OK
Phase 2/4: Fixing table and database names
Phase 3/4: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql
mysql.columns_priv OK
mysql.db OK
mysql.ev_bk OK
mysql.event OK
mysql.func OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
performance_schema
test
test.kv OK
test.t1 OK
Phase 4/4: Running 'mysql_fix_privilege_tables'
OK
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci
show create view v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci
show create view v3;
View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci
show create view v4;
View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '=';
SELECT k,v from kv where k in ('md5','algorithm');
k v
algorithm 2
md5 5e6eaf216e7b016fcedfd4e1113517af
SELECT k from kv where k ='mariadb-version';
k
mariadb-version
truncate table kv;
drop view if exists v1,v2,v3;
drop table mysql.event;
rename table mysql.ev_bk to mysql.event;
test.kv OK
test.t1 OK
test.v1 OK
test.v2 OK
test.v3 OK
test.v4 OK
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; REPAIR VIEW v1,v2
master-bin.000001 # Query # # use `test`; REPAIR VIEW v1badcheck
master-bin.000001 # Query # # use `test`; REPAIR TABLE `kv` USE_FRM
master-bin.000001 # Query # # use `test`; REPAIR TABLE `t1` USE_FRM
master-bin.000001 # Query # # use `test`; REPAIR VIEW `v1` FROM MYSQL
master-bin.000001 # Query # # use `test`; REPAIR VIEW `v2` FROM MYSQL
master-bin.000001 # Query # # use `test`; REPAIR VIEW `v3` FROM MYSQL
master-bin.000001 # Query # # use `test`; REPAIR VIEW `v4` FROM MYSQL
drop table if exists kv;
drop view v1,v2,v3,v4;
drop table t1;
DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
drop view if exists v1;
DROP TABLE IF EXISTS t1, `t``1`, `t 1`, test.`t.1`, v1;
drop view if exists t1, `t``1`, `t 1`, test.`t.1`, v1;
drop database if exists client_test_db;
mtr.global_suppressions OK
mtr.test_suppressions OK
......@@ -309,3 +309,10 @@ CHECK TABLE bug47205 FOR UPGRADE;
Table Op Msg_type Msg_text
test.bug47205 check status OK
DROP TABLE bug47205;
#
#MDEV-6128:[PATCH] mysqlcheck wrongly escapes '.' in table names
#
CREATE TABLE test.`t.1` (id int);
mysqlcheck test t.1
test.t.1 OK
drop table test.`t.1`;
......@@ -3,8 +3,8 @@ create table t1(f1 int);
insert into t1 values (5);
grant select on test.* to ssl_user1@localhost require SSL;
grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA";
grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB";
grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB/CN=client";
grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB/CN=client" ISSUER "/CN=cacert/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB";
grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
flush privileges;
connect(localhost,ssl_user2,,test,MASTER_PORT,MASTER_SOCKET);
......
......@@ -7,9 +7,8 @@ SELECT ID, TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE CONCAT(":", ID
SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
ID TIME TIME_MS
TID 0 0.000
SET DEBUG_SYNC = 'dispatch_command_end SIGNAL query_done EXECUTE 2';
SET DEBUG_SYNC= 'now WAIT_FOR query_done';
SET DEBUG_SYNC= 'now SIGNAL nosignal';
set debug_sync='reset';
SET debug_dbug="+d,sleep_inject_query_done_debug_sync";
select sleep(5);
sleep(5)
0
......
......@@ -4417,7 +4417,7 @@ INSERT INTO t1 VALUES
EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1 SIMPLE t2 hash_ALL a #hash#$hj 14 test.t1.a 2 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t2 hash_ALL a #hash#$hj 6 test.t1.a 2 Using where; Using join buffer (flat, BNLH join)
SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2;
1
1
......@@ -4427,7 +4427,7 @@ SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2;
EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1 SIMPLE t2 hash_ALL a #hash#$hj 14 test.t1.a 2 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t2 hash_ALL a #hash#$hj 6 test.t1.a 2 Using where; Using join buffer (flat, BNLH join)
SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a);
1
1
......
......@@ -170,3 +170,7 @@ Error 1548 Cannot load from mysql.proc. The table is probably corrupted
# Restore mysql.proc
DROP TABLE mysql.proc;
RENAME TABLE proc_backup TO mysql.proc;
create database mysqltest1;
create procedure mysqltest1.foo() select "foo";
update mysql.proc set name='' where db='mysqltest1';
drop database mysqltest1;
......@@ -30,3 +30,111 @@ CALL p1();
CALL p1();
drop procedure p1;
drop table t1,t2;
#
# BUG 16041903: CONTINUE HANDLER NOT INVOKED
# IN A STORED FUNCTION AFTER A LOCK WAIT TIMEOUT
#
# Save and set lock wait timeout
SET @lock_wait_timeout_saved= @@lock_wait_timeout;
SET @innodb_lock_wait_timeout_saved= @@innodb_lock_wait_timeout;
SET @@lock_wait_timeout= 1;
SET @@innodb_lock_wait_timeout= 1;
# Create a function with exit handler:
CREATE FUNCTION f1() RETURNS VARCHAR(20)
BEGIN
DECLARE EXIT HANDLER FOR SQLSTATE '42S02' RETURN 'No such table';
INSERT INTO no_such_table VALUES (1);
END//
# Create a function calling f1():
CREATE FUNCTION f2() RETURNS VARCHAR(20)
BEGIN
RETURN f1();
END//
# Create a function provoking deadlock:
CREATE FUNCTION f3() RETURNS VARCHAR(20)
BEGIN
UPDATE t1 SET i= 1 WHERE i= 1;
RETURN 'Will never get here';
END//
# Create a function calling f3, to create
# a deadlock indirectly:
CREATE FUNCTION f4() RETURNS VARCHAR(20)
BEGIN
RETURN f3();
END//
# Open another connection, create and initialize a table
# to be used for provoking deadlock, put a lock on the table:
CREATE TABLE t1 (i INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET AUTOCOMMIT= 0;
UPDATE t1 SET i=1 WHERE i=1;
# On the default connection, do an update to provoke a
# deadlock, then call the function with handler. This case
# fails without the patch (with error ER_NO_SUCH_TABLE):
SET AUTOCOMMIT= 0;
UPDATE t1 SET i=1 WHERE i=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT f1() AS 'f1():';
f1():
No such table
Warnings:
Error 1146 Table 'test.no_such_table' doesn't exist
# Provoke another deadlock, then call the function with
# handler indirectly. This case fails without the patch
# (with error ER_NO_SUCH_TABLE):
UPDATE t1 SET i= 1 WHERE i= 1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT f2() AS 'f2():';
f2():
No such table
Warnings:
Error 1146 Table 'test.no_such_table' doesn't exist
# Provoke yet another deadlock, but now from within a function,
# then call the function with handler. This succeeds even
# without the patch because is_fatal_sub_stmt_error is reset
# in restore_sub_stmt after the failing function has been
# executed. The test case is included anyway for better coverage:
SELECT f3() AS 'f3():';
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT f1() AS 'f1():';
f1():
No such table
Warnings:
Error 1146 Table 'test.no_such_table' doesn't exist
# Provoke yet another deadlock, but now from within a function,
# calling another function, then call the function with handler.
# This succeeds even without the patch because
# is_fatal_sub_stmt_error is reset in restore_sub_stmt after
# the failing function has been executed. The test case is
# included anyway for better coverage:
SELECT f4() AS 'f4():';
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT f1() AS 'f1():';
f1():
No such table
Warnings:
Error 1146 Table 'test.no_such_table' doesn't exist
# Disconnect, drop functions and table:
DROP FUNCTION f4;
DROP FUNCTION f3;
DROP FUNCTION f2;
DROP FUNCTION f1;
DROP TABLE t1;
# Reset lock wait timeouts
SET @@lock_wait_timeout= @lock_wait_timeout_saved;
SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved;
#
# BUG 16041903: End of test case
#
......@@ -447,7 +447,7 @@ WHERE t3.b IN (SELECT v1.b FROM v1, t2
WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
1 PRIMARY <derived3> ref key1 key1 10 const,const 0 Start temporary
1 PRIMARY <derived3> ref key1 key1 8 const,const 0 Start temporary
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer (flat, BNL join)
3 DERIVED t1 ALL NULL NULL NULL NULL 3
SELECT * FROM t3
......
......@@ -450,7 +450,7 @@ WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1
2 DEPENDENT SUBQUERY <derived3> ref key1 key1 10 const,const 0 Using where
2 DEPENDENT SUBQUERY <derived3> ref key1 key1 8 const,const 0 Using where
3 DERIVED t1 ALL NULL NULL NULL NULL 3
SELECT * FROM t3
WHERE t3.b IN (SELECT v1.b FROM v1, t2
......
......@@ -2986,4 +2986,13 @@ pk1 i1 i2 c2 pk3 i3 c3
SET join_cache_level=@tmp_mdev5059;
set optimizer_switch=@tmp_os_mdev5059;
DROP TABLE t1,t2,t3,t4;
#
# MDEV-7911: crash in Item_cond::eval_not_null_tables
#
create table t1(a int);
insert into t1 values(1),(2),(3),(null);
explain
select 1 from t1 where _cp932 "1" in (select '1' from t1);
ERROR HY000: Illegal mix of collations (cp932_japanese_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '='
drop table t1;
set optimizer_switch=@subselect_sj_tmp;
......@@ -1178,5 +1178,89 @@ id nombre
2 row 2
3 row 3
DROP TABLE t1, t2;
#
# MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped for some values of optimizer_search_depth
#
CREATE TABLE t1 (
t1id BIGINT(20) NOT NULL,
code VARCHAR(20),
PRIMARY KEY (t1id)
) COLLATE='utf8mb4_bin' ENGINE=InnoDB;
CREATE TABLE t2 (
t2id BIGINT(20) NOT NULL,
t1idref BIGINT(20) NOT NULL,
code VARCHAR(20),
PRIMARY KEY (t2id),
INDEX FK_T2_T1Id (t1idref),
CONSTRAINT FK_T2_T1Id FOREIGN KEY (t1idref) REFERENCES t1 (t1id)
) COLLATE='utf8mb4_bin' ENGINE=InnoDB;
CREATE TABLE t3 (
t3idref BIGINT(20) NOT NULL,
t2idref BIGINT(20) NOT NULL,
sequencenumber INT(10) NOT NULL,
PRIMARY KEY (t3idref, t2idref),
INDEX FK_T3_T2Id (t2idref),
CONSTRAINT FK_T3_T2Id FOREIGN KEY (t2idref) REFERENCES t2 (t2id)
) COLLATE='utf8mb4_bin' ENGINE=InnoDB;
INSERT INTO t1 (t1id) VALUES (100001),(100017),(100018),(100026),(100027),(100028),(100029),(100030),
(100031),(100032),(100033),(100034),(100035),(100036),(100037),(100038),(100040),(100041),(100042),
(100043),(100044),(100045),(100046),(100047);
INSERT IGNORE INTO t2 (t2id, t1idref) SELECT t1id, t1id FROM t1;
INSERT IGNORE INTO t1 VALUES (200001, 'a');
INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001);
INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3);
set @tmp7474= @@optimizer_search_depth;
SET SESSION optimizer_search_depth = 1;
SELECT SQL_NO_CACHE
T2_0_.t1idref,
T2_0_.t2id
FROM
t2 T2_0_
WHERE
T2_0_.t1idref IN (
SELECT
T1_1_.t1id
FROM
t3 T3_0_
INNER JOIN
t2 T2_1_
ON T3_0_.t2idref=T2_1_.t2id
INNER JOIN
t1 T1_1_
ON T2_1_.t1idref=T1_1_.t1id
WHERE
T3_0_.t3idref= 1
);
t1idref t2id
200001 200011
200001 200012
200001 200013
explain SELECT SQL_NO_CACHE
T2_0_.t1idref,
T2_0_.t2id
FROM
t2 T2_0_
WHERE
T2_0_.t1idref IN (
SELECT
T1_1_.t1id
FROM
t3 T3_0_
INNER JOIN
t2 T2_1_
ON T3_0_.t2idref=T2_1_.t2id
INNER JOIN
t1 T1_1_
ON T2_1_.t1idref=T1_1_.t1id
WHERE
T3_0_.t3idref= 1
);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary
1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1
1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index
1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary
drop table t3,t2,t1;
set optimizer_search_depth=@tmp7474;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
......@@ -9,3 +9,12 @@
SELECT * FROM t2
WHERE (a, a) IN (SELECT alias2.b, alias2.a FROM t1 AS alias1, t1 AS alias2
WHERE
@@ -1272,7 +1272,7 @@
);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary
-1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 Using join buffer (flat, BKA join); Key-ordered scan
+1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1
1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index
1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary
drop table t3,t2,t1;
......@@ -891,7 +891,7 @@ WHERE t3.b IN (SELECT b FROM t4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 1
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
1 PRIMARY t2 hash_ALL NULL #hash#$hj 5 test.t3.a 1 Using where; Using join buffer (flat, BNLH join)
1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t3.a 1 Using where; Using join buffer (flat, BNLH join)
1 PRIMARY <derived3> ALL NULL NULL NULL NULL 2 Using join buffer (incremental, BNL join)
2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2
3 DERIVED t1 ALL NULL NULL NULL NULL 1
......@@ -1161,7 +1161,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary; Using join buffer (flat, BNL join)
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
1 PRIMARY t4 hash_index NULL #hash#$hj:PRIMARY 55:59 test.t3.t3_c 2 Using where; End temporary; Using join buffer (incremental, BNLH join)
1 PRIMARY t4 hash_index NULL #hash#$hj:PRIMARY 54:59 test.t3.t3_c 2 Using where; End temporary; Using join buffer (incremental, BNLH join)
DROP TABLE t1,t2,t3,t4;
#
# MDEV-6263: Wrong result when using IN subquery with order by
......@@ -1193,6 +1193,90 @@ id nombre
2 row 2
3 row 3
DROP TABLE t1, t2;
#
# MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped for some values of optimizer_search_depth
#
CREATE TABLE t1 (
t1id BIGINT(20) NOT NULL,
code VARCHAR(20),
PRIMARY KEY (t1id)
) COLLATE='utf8mb4_bin' ENGINE=InnoDB;
CREATE TABLE t2 (
t2id BIGINT(20) NOT NULL,
t1idref BIGINT(20) NOT NULL,
code VARCHAR(20),
PRIMARY KEY (t2id),
INDEX FK_T2_T1Id (t1idref),
CONSTRAINT FK_T2_T1Id FOREIGN KEY (t1idref) REFERENCES t1 (t1id)
) COLLATE='utf8mb4_bin' ENGINE=InnoDB;
CREATE TABLE t3 (
t3idref BIGINT(20) NOT NULL,
t2idref BIGINT(20) NOT NULL,
sequencenumber INT(10) NOT NULL,
PRIMARY KEY (t3idref, t2idref),
INDEX FK_T3_T2Id (t2idref),
CONSTRAINT FK_T3_T2Id FOREIGN KEY (t2idref) REFERENCES t2 (t2id)
) COLLATE='utf8mb4_bin' ENGINE=InnoDB;
INSERT INTO t1 (t1id) VALUES (100001),(100017),(100018),(100026),(100027),(100028),(100029),(100030),
(100031),(100032),(100033),(100034),(100035),(100036),(100037),(100038),(100040),(100041),(100042),
(100043),(100044),(100045),(100046),(100047);
INSERT IGNORE INTO t2 (t2id, t1idref) SELECT t1id, t1id FROM t1;
INSERT IGNORE INTO t1 VALUES (200001, 'a');
INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001);
INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3);
set @tmp7474= @@optimizer_search_depth;
SET SESSION optimizer_search_depth = 1;
SELECT SQL_NO_CACHE
T2_0_.t1idref,
T2_0_.t2id
FROM
t2 T2_0_
WHERE
T2_0_.t1idref IN (
SELECT
T1_1_.t1id
FROM
t3 T3_0_
INNER JOIN
t2 T2_1_
ON T3_0_.t2idref=T2_1_.t2id
INNER JOIN
t1 T1_1_
ON T2_1_.t1idref=T1_1_.t1id
WHERE
T3_0_.t3idref= 1
);
t1idref t2id
200001 200011
200001 200012
200001 200013
explain SELECT SQL_NO_CACHE
T2_0_.t1idref,
T2_0_.t2id
FROM
t2 T2_0_
WHERE
T2_0_.t1idref IN (
SELECT
T1_1_.t1id
FROM
t3 T3_0_
INNER JOIN
t2 T2_1_
ON T3_0_.t2idref=T2_1_.t2id
INNER JOIN
t1 T1_1_
ON T2_1_.t1idref=T1_1_.t1id
WHERE
T3_0_.t3idref= 1
);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary
1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 Using join buffer (flat, BKA join); Key-ordered scan
1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index
1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary
drop table t3,t2,t1;
set optimizer_search_depth=@tmp7474;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
#
......
......@@ -1180,6 +1180,90 @@ id nombre
2 row 2
3 row 3
DROP TABLE t1, t2;
#
# MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped for some values of optimizer_search_depth
#
CREATE TABLE t1 (
t1id BIGINT(20) NOT NULL,
code VARCHAR(20),
PRIMARY KEY (t1id)
) COLLATE='utf8mb4_bin' ENGINE=InnoDB;
CREATE TABLE t2 (
t2id BIGINT(20) NOT NULL,
t1idref BIGINT(20) NOT NULL,
code VARCHAR(20),
PRIMARY KEY (t2id),
INDEX FK_T2_T1Id (t1idref),
CONSTRAINT FK_T2_T1Id FOREIGN KEY (t1idref) REFERENCES t1 (t1id)
) COLLATE='utf8mb4_bin' ENGINE=InnoDB;
CREATE TABLE t3 (
t3idref BIGINT(20) NOT NULL,
t2idref BIGINT(20) NOT NULL,
sequencenumber INT(10) NOT NULL,
PRIMARY KEY (t3idref, t2idref),
INDEX FK_T3_T2Id (t2idref),
CONSTRAINT FK_T3_T2Id FOREIGN KEY (t2idref) REFERENCES t2 (t2id)
) COLLATE='utf8mb4_bin' ENGINE=InnoDB;
INSERT INTO t1 (t1id) VALUES (100001),(100017),(100018),(100026),(100027),(100028),(100029),(100030),
(100031),(100032),(100033),(100034),(100035),(100036),(100037),(100038),(100040),(100041),(100042),
(100043),(100044),(100045),(100046),(100047);
INSERT IGNORE INTO t2 (t2id, t1idref) SELECT t1id, t1id FROM t1;
INSERT IGNORE INTO t1 VALUES (200001, 'a');
INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001);
INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3);
set @tmp7474= @@optimizer_search_depth;
SET SESSION optimizer_search_depth = 1;
SELECT SQL_NO_CACHE
T2_0_.t1idref,
T2_0_.t2id
FROM
t2 T2_0_
WHERE
T2_0_.t1idref IN (
SELECT
T1_1_.t1id
FROM
t3 T3_0_
INNER JOIN
t2 T2_1_
ON T3_0_.t2idref=T2_1_.t2id
INNER JOIN
t1 T1_1_
ON T2_1_.t1idref=T1_1_.t1id
WHERE
T3_0_.t3idref= 1
);
t1idref t2id
200001 200011
200001 200012
200001 200013
explain SELECT SQL_NO_CACHE
T2_0_.t1idref,
T2_0_.t2id
FROM
t2 T2_0_
WHERE
T2_0_.t1idref IN (
SELECT
T1_1_.t1id
FROM
t3 T3_0_
INNER JOIN
t2 T2_1_
ON T3_0_.t2idref=T2_1_.t2id
INNER JOIN
t1 T1_1_
ON T2_1_.t1idref=T1_1_.t1id
WHERE
T3_0_.t3idref= 1
);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary
1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1
1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index
1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary
drop table t3,t2,t1;
set optimizer_search_depth=@tmp7474;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
set optimizer_switch=default;
......
......@@ -3000,6 +3000,15 @@ pk1 i1 i2 c2 pk3 i3 c3
SET join_cache_level=@tmp_mdev5059;
set optimizer_switch=@tmp_os_mdev5059;
DROP TABLE t1,t2,t3,t4;
#
# MDEV-7911: crash in Item_cond::eval_not_null_tables
#
create table t1(a int);
insert into t1 values(1),(2),(3),(null);
explain
select 1 from t1 where _cp932 "1" in (select '1' from t1);
ERROR HY000: Illegal mix of collations (cp932_japanese_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '='
drop table t1;
set optimizer_switch=@subselect_sj_tmp;
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment