Comment 2 for bug 628419

Revision history for this message
Patrick Crews (patrick-crews) wrote :

randgen command line:
./gentest.pl --dsn=dbi:drizzle:host=localhost:port=9306:user=root:password=:database=test --threads=1 --engine=Innodb --gendata=conf/drizzle/drizzle.zz --grammar=conf/engines/engine_stress.yy --debug --queries=100000 --threads=1

You can also put the offending query into a randgen grammar by itself and it will crash immediately (leave other values the same).

test-suite test case:

--disable_warnings
DROP TABLE IF EXISTS `a`;
DROP TABLE IF EXISTS `c`;
DROP TABLE IF EXISTS `aa`;
--enable_warnings

CREATE TABLE `a` (
  `col_bigint` bigint DEFAULT NULL,
  `col_enum_not_null` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') NOT NULL,
  `col_enum_not_null_key` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') NOT NULL,
  `col_int_key` int DEFAULT NULL,
  `col_bigint_not_null` bigint NOT NULL,
  `col_enum` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') DEFAULT NULL,
  `col_text_not_null` text NOT NULL,
  `col_char_10_key` varchar(10) DEFAULT NULL,
  `col_int` int DEFAULT NULL,
  `col_char_1024` varchar(1024) DEFAULT NULL,
  `col_char_10_not_null_key` varchar(10) NOT NULL,
  `pk` int NOT NULL AUTO_INCREMENT,
  `col_enum_key` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') DEFAULT NULL,
  `col_char_1024_not_null_key` varchar(1024) NOT NULL,
  `col_char_10` varchar(10) DEFAULT NULL,
  `col_char_1024_key` varchar(1024) DEFAULT NULL,
  `col_text` text,
  `col_text_not_null_key` text NOT NULL,
  `col_bigint_not_null_key` bigint NOT NULL,
  `col_char_1024_not_null` varchar(1024) NOT NULL,
  `col_int_not_null` int NOT NULL,
  `col_int_not_null_key` int NOT NULL,
  `col_char_10_not_null` varchar(10) NOT NULL,
  `col_text_key` text,
  `col_bigint_key` bigint DEFAULT NULL,
  PRIMARY KEY (`pk`),
  KEY `col_enum_not_null_key` (`col_enum_not_null_key`),
  KEY `col_int_key` (`col_int_key`),
  KEY `col_char_10_key` (`col_char_10_key`),
  KEY `col_char_10_not_null_key` (`col_char_10_not_null_key`),
  KEY `col_enum_key` (`col_enum_key`),
  KEY `col_char_1024_not_null_key` (`col_char_1024_not_null_key`(255)),
  KEY `col_char_1024_key` (`col_char_1024_key`(255)),
  KEY `col_text_not_null_key` (`col_text_not_null_key`(255)),
  KEY `col_bigint_not_null_key` (`col_bigint_not_null_key`),
  KEY `col_int_not_null_key` (`col_int_not_null_key`),
  KEY `col_text_key` (`col_text_key`(255)),
  KEY `col_bigint_key` (`col_bigint_key`)
) ENGINE=InnoDB COLLATE = utf8_general_ci;

ALTER TABLE `a` DISABLE KEYS;
ALTER TABLE `a` ENABLE KEYS;

CREATE TABLE `c` (
  `pk` int NOT NULL AUTO_INCREMENT,
  `col_int_key` int DEFAULT NULL,
  `col_text_not_null_key` text NOT NULL,
  `col_bigint_key` bigint DEFAULT NULL,
  `col_char_10_not_null` varchar(10) NOT NULL,
  `col_text_key` text,
  `col_char_10_not_null_key` varchar(10) NOT NULL,
  `col_enum` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') DEFAULT NULL,
  `col_text_not_null` text NOT NULL,
  `col_enum_key` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') DEFAULT NULL,
  `col_bigint_not_null_key` bigint NOT NULL,
  `col_enum_not_null` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') NOT NULL,
  `col_int_not_null_key` int NOT NULL,
  `col_char_1024` varchar(1024) DEFAULT NULL,
  `col_int` int DEFAULT NULL,
  `col_text` text,
  `col_enum_not_null_key` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') NOT NULL,
  `col_char_10` varchar(10) DEFAULT NULL,
  `col_bigint_not_null` bigint NOT NULL,
  `col_int_not_null` int NOT NULL,
  `col_char_1024_not_null` varchar(1024) NOT NULL,
  `col_char_1024_not_null_key` varchar(1024) NOT NULL,
  `col_char_10_key` varchar(10) DEFAULT NULL,
  `col_char_1024_key` varchar(1024) DEFAULT NULL,
  `col_bigint` bigint DEFAULT NULL,
  PRIMARY KEY (`pk`),
  KEY `col_int_key` (`col_int_key`),
  KEY `col_text_not_null_key` (`col_text_not_null_key`(255)),
  KEY `col_bigint_key` (`col_bigint_key`),
  KEY `col_text_key` (`col_text_key`(255)),
  KEY `col_char_10_not_null_key` (`col_char_10_not_null_key`),
  KEY `col_enum_key` (`col_enum_key`),
  KEY `col_bigint_not_null_key` (`col_bigint_not_null_key`),
  KEY `col_int_not_null_key` (`col_int_not_null_key`),
  KEY `col_enum_not_null_key` (`col_enum_not_null_key`),
  KEY `col_char_1024_not_null_key` (`col_char_1024_not_null_key`(255)),
  KEY `col_char_10_key` (`col_char_10_key`),
  KEY `col_char_1024_key` (`col_char_1024_key`(255))
) ENGINE=InnoDB COLLATE = utf8_general_ci;

ALTER TABLE `c` DISABLE KEYS;
INSERT INTO `c` VALUES (1,NULL,'',2,'t',NULL,'d','v','','h',3251880405938208768,'v',0,'q',NULL,NULL,'n','h',1,6,'look','TYZGK','b','JRKMQ',NULL);
ALTER TABLE `c` ENABLE KEYS;

CREATE TABLE `aa` (
  `pk` int NOT NULL AUTO_INCREMENT,
  `col_char_10` varchar(10) DEFAULT NULL,
  `col_bigint` bigint DEFAULT NULL,
  `col_text` text,
  `col_char_10_key` varchar(10) DEFAULT NULL,
  `col_char_10_not_null` varchar(10) NOT NULL,
  `col_char_1024` varchar(1024) DEFAULT NULL,
  `col_int` int DEFAULT NULL,
  `col_enum_not_null_key` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') NOT NULL,
  `col_enum` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') DEFAULT NULL,
  `col_bigint_not_null_key` bigint NOT NULL,
  `col_char_1024_not_null_key` varchar(1024) NOT NULL,
  `col_int_not_null_key` int NOT NULL,
  `col_bigint_not_null` bigint NOT NULL,
  `col_char_1024_not_null` varchar(1024) NOT NULL,
  `col_char_10_not_null_key` varchar(10) NOT NULL,
  `col_int_key` int DEFAULT NULL,
  `col_text_not_null` text NOT NULL,
  `col_char_1024_key` varchar(1024) DEFAULT NULL,
  `col_enum_not_null` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') NOT NULL,
  `col_bigint_key` bigint DEFAULT NULL,
  `col_text_key` text,
  `col_text_not_null_key` text NOT NULL,
  `col_int_not_null` int NOT NULL,
  `col_enum_key` enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') DEFAULT NULL,
  PRIMARY KEY (`pk`),
  KEY `col_char_10_key` (`col_char_10_key`),
  KEY `col_enum_not_null_key` (`col_enum_not_null_key`),
  KEY `col_bigint_not_null_key` (`col_bigint_not_null_key`),
  KEY `col_char_1024_not_null_key` (`col_char_1024_not_null_key`(255)),
  KEY `col_int_not_null_key` (`col_int_not_null_key`),
  KEY `col_char_10_not_null_key` (`col_char_10_not_null_key`),
  KEY `col_int_key` (`col_int_key`),
  KEY `col_char_1024_key` (`col_char_1024_key`(255)),
  KEY `col_bigint_key` (`col_bigint_key`),
  KEY `col_text_key` (`col_text_key`(255)),
  KEY `col_text_not_null_key` (`col_text_not_null_key`(255)),
  KEY `col_enum_key` (`col_enum_key`)
) ENGINE=InnoDB COLLATE = utf8_general_ci;

ALTER TABLE `aa` DISABLE KEYS;
INSERT INTO `aa` VALUES (1,'t',NULL,NULL,'ZDPHP','what','w',9,'s','u',-6388637546401759232,'well',-523436032,-8847321467969339392,'think','at',2071265280,'','LPUJD','o',NULL,NULL,'',-1974206464,'w');
INSERT INTO `aa` VALUES (2,'JULPJ',7,NULL,'AIJUR','of','n',-1692139520,'p','u',5,'on',1,4369336063479513088,'were','VDMDI',1,'','don\'t','j',NULL,NULL,'',3,'f');
INSERT INTO `aa` VALUES (3,'here',NULL,NULL,'NEMIU','a','r',4,'n','u',1,'ASUNK',621543424,-4336122016227655680,'SDQKX','WPTIG',NULL,'','think','i',-2842897264777625600,NULL,'',-274595840,'v');
INSERT INTO `aa` VALUES (4,'didn\'t',6,NULL,'HMHFF','BYTHJ','PUKQU',9,'o','n',-9123448420122492928,'d',880148480,-2739595948324814848,'TQVBJ','your',1734213632,'','on','o',NULL,NULL,'',295501824,'d');
INSERT INTO `aa` VALUES (5,'the',4,NULL,'XIXMV','w','not',-1091567616,'b','w',9,'m',1963982848,1417789457691574272,'t','q',1505558528,'','YTUNQ','v',3557843705622691840,NULL,'',9,'q');
INSERT INTO `aa` VALUES (6,'UYRFL',5333950808666931200,NULL,'k','QPWUT','NZDDR',126156800,'c','o',6,'to',8,7526922352219652096,'l','OOQXU',8,'','o','d',-4628011567076605952,NULL,'',2,'d');
INSERT INTO `aa` VALUES (7,'is',NULL,NULL,'GJZBY','as','have',534904832,'p','q',5,'t',1445462016,8631711635808976896,'just','RDODX',NULL,'','so','f',-5755881798756204544,NULL,'',-1601306624,'g');
INSERT INTO `aa` VALUES (8,'f',-941533797097144320,NULL,'UGMMS','hey','OGLVA',8,'i','j',5903374686552588288,'m',0,-840765755434729472,'we','e',-1685520384,'','get','c',NULL,NULL,'',-1770323968,'v');
INSERT INTO `aa` VALUES (9,'KKWBL',NULL,NULL,'p','TWEJA','didn\'t',NULL,'f','l',2,'USQVA',-747241472,-4598175219545276416,'v','FEKXH',NULL,'','l','e',NULL,NULL,'',256311296,'e');
INSERT INTO `aa` VALUES (10,'g',NULL,NULL,'RMZLQ','e','t',NULL,'p','g',-3207125884641214464,'FUBQO',6,8817766595414720512,'going','GTHOM',-1431502848,'','h','g',-5719290051783819264,NULL,'',4,'c');
ALTER TABLE `aa` ENABLE KEYS;

SELECT X . `col_int_key` FROM `c` AS X LEFT JOIN `a` AS Y USING ( `col_enum_key` ) WHERE X . `col_enum_key` = ( SELECT `col_int_not_null_key` FROM `aa` WHERE `pk` = 5 ) LIMIT 8 ;

DROP TABLE `a`,`c`,`aa`;