Skip to content

Commit

Permalink
Added regression test for MDEV-6345
Browse files Browse the repository at this point in the history
  • Loading branch information
pastcompute committed Feb 28, 2015
1 parent a657abd commit 6ff6bf8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions storage/oqgraph/mysql-test/oqgraph/regression_mdev6345.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DROP TABLE IF EXISTS oq_backing;
DROP TABLE IF EXISTS oq_graph;
CREATE TABLE oq_backing (origid INT UNSIGNED NOT NULL, destid INT UNSIGNED NOT NULL, PRIMARY KEY (origid, destid), KEY (destid));
INSERT INTO oq_backing(origid, destid) VALUES (1,2), (2,3), (3,4), (4,5), (2,6), (5,6);
CREATE TABLE oq_graph (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='oq_backing' origid='origid' destid='destid';
SELECT * FROM oq_graph WHERE latch='breadth_first' AND origid=1 AND destid=6;
latch origid destid weight seq linkid
breadth_first 1 6 NULL 0 1
breadth_first 1 6 1 1 2
breadth_first 1 6 1 2 6
DROP TABLE IF EXISTS oq_backing;
DROP TABLE IF EXISTS oq_graph;
19 changes: 19 additions & 0 deletions storage/oqgraph/mysql-test/oqgraph/regression_mdev6345.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#-- This test is probably not right, because the real bug manifested over a network connection on a busy server.

--disable_warnings
DROP TABLE IF EXISTS oq_backing;
DROP TABLE IF EXISTS oq_graph;
--enable_warnings


CREATE TABLE oq_backing (origid INT UNSIGNED NOT NULL, destid INT UNSIGNED NOT NULL, PRIMARY KEY (origid, destid), KEY (destid));

INSERT INTO oq_backing(origid, destid) VALUES (1,2), (2,3), (3,4), (4,5), (2,6), (5,6);

CREATE TABLE oq_graph (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='oq_backing' origid='origid' destid='destid';

SELECT * FROM oq_graph WHERE latch='breadth_first' AND origid=1 AND destid=6;

DROP TABLE IF EXISTS oq_backing;
DROP TABLE IF EXISTS oq_graph;

0 comments on commit 6ff6bf8

Please sign in to comment.