diff options
author | Andrew McDonnell <bugs@andrewmcdonnell.net> | 2014-06-15 21:39:23 +0930 |
---|---|---|
committer | Andrew McDonnell <bugs@andrewmcdonnell.net> | 2015-02-28 22:29:42 +1030 |
commit | 826141368c83fe9e6cbda4c69f937ae1e526effd (patch) | |
tree | 2f27c61a8ffb9317a695fb9dfb3d8334fce32098 /storage/oqgraph/mysql-test | |
parent | 1973c009701f8b26eb3f1b40efa5bc2ee163ca34 (diff) | |
download | mariadb-git-826141368c83fe9e6cbda4c69f937ae1e526effd.tar.gz |
Added regression test for MDEV-6282
Diffstat (limited to 'storage/oqgraph/mysql-test')
-rw-r--r-- | storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.result | 37 | ||||
-rw-r--r-- | storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.test | 47 |
2 files changed, 84 insertions, 0 deletions
diff --git a/storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.result b/storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.result new file mode 100644 index 00000000000..42c86405503 --- /dev/null +++ b/storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.result @@ -0,0 +1,37 @@ +CREATE TABLE `db_history` ( +`version` VARCHAR(10) NOT NULL, +`updateJSON` MEDIUMTEXT, +`prevVersion` VARCHAR(10) NOT NULL, +`nodeID` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', +`prevNodeID` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', +PRIMARY KEY (`prevNodeID`,`nodeID`), +KEY `version` (`version`) USING BTREE, +KEY `prevVersion` (`prevVersion`) USING BTREE, +KEY `nodeID` (`nodeID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +INSERT INTO `db_history` VALUES +('0.0.1','{}','0.0.0',1,0), +('0.0.2','{\"data\":{\"add\":{},\"update\":{},\"delete\":{}}}','0.0.1',2,1), +('0.0.3','{\"data\":{\"add\":{},\"update\":{},\"delete\":{}}}','0.0.2',3,2); +CREATE TABLE IF NOT EXISTS version_history ( +latch VARCHAR(32) NULL, +origid BIGINT UNSIGNED NULL, +destid BIGINT UNSIGNED NULL, +weight DOUBLE NULL, +seq BIGINT UNSIGNED NULL, +linkid BIGINT UNSIGNED NULL, +KEY (latch, origid, destid) USING HASH, +KEY (latch, destid, origid) USING HASH +) ENGINE=OQGRAPH DATA_TABLE='db_history' ORIGID='prevNodeID' DESTID='nodeID'; +SELECT `db`.`version`, `db`.`nodeID` +FROM `version_history` AS `v` INNER JOIN `db_history` AS `db` ON `db`.`nodeID` = `v`.`linkid` +WHERE `latch` = 'breadth_first' AND `origid` = '1' ORDER BY `weight` DESC LIMIT 1; +version nodeID +0.0.3 3 +SELECT `db`.`version`, `db`.`nodeID` +FROM `version_history` AS `v` INNER JOIN `db_history` AS `db` ON `db`.`nodeID` = `v`.`linkid` +WHERE `latch` = 'breadth_first' AND `origid` = '1' ORDER BY `weight` DESC LIMIT 1; +version nodeID +0.0.3 3 +DROP TABLE db_history; +DROP TABLE version_history; diff --git a/storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.test b/storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.test new file mode 100644 index 00000000000..3a7a0e5af08 --- /dev/null +++ b/storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.test @@ -0,0 +1,47 @@ +--connect (con1,localhost,root,,test) + + CREATE TABLE `db_history` ( + `version` VARCHAR(10) NOT NULL, + `updateJSON` MEDIUMTEXT, + `prevVersion` VARCHAR(10) NOT NULL, + `nodeID` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', + `prevNodeID` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (`prevNodeID`,`nodeID`), + KEY `version` (`version`) USING BTREE, + KEY `prevVersion` (`prevVersion`) USING BTREE, + KEY `nodeID` (`nodeID`) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + INSERT INTO `db_history` VALUES + ('0.0.1','{}','0.0.0',1,0), + ('0.0.2','{\"data\":{\"add\":{},\"update\":{},\"delete\":{}}}','0.0.1',2,1), + ('0.0.3','{\"data\":{\"add\":{},\"update\":{},\"delete\":{}}}','0.0.2',3,2); + + CREATE TABLE IF NOT EXISTS version_history ( + latch VARCHAR(32) NULL, + origid BIGINT UNSIGNED NULL, + destid BIGINT UNSIGNED NULL, + weight DOUBLE NULL, + seq BIGINT UNSIGNED NULL, + linkid BIGINT UNSIGNED NULL, + KEY (latch, origid, destid) USING HASH, + KEY (latch, destid, origid) USING HASH + ) ENGINE=OQGRAPH DATA_TABLE='db_history' ORIGID='prevNodeID' DESTID='nodeID'; + + SELECT `db`.`version`, `db`.`nodeID` + FROM `version_history` AS `v` INNER JOIN `db_history` AS `db` ON `db`.`nodeID` = `v`.`linkid` + WHERE `latch` = 'breadth_first' AND `origid` = '1' ORDER BY `weight` DESC LIMIT 1; +--disconnect con1 + +--connect (con2,localhost,root,,test) + SELECT `db`.`version`, `db`.`nodeID` + FROM `version_history` AS `v` INNER JOIN `db_history` AS `db` ON `db`.`nodeID` = `v`.`linkid` + WHERE `latch` = 'breadth_first' AND `origid` = '1' ORDER BY `weight` DESC LIMIT 1; +--disconnect con2 + +--connect (con3,localhost,root,,test) +DROP TABLE db_history; +DROP TABLE version_history; +--disconnect con3 + + |