diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-12-16 13:32:03 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-12-16 13:32:03 +0100 |
commit | ce2fabe442fd731a3d265ff685bc4e5288a370d8 (patch) | |
tree | ccf71b3d1d11780252fa3f0e82dad2405496767c /mysql-test | |
parent | c1a65228757e25aabccfcf77c494811ed1e5a633 (diff) | |
download | mariadb-git-ce2fabe442fd731a3d265ff685bc4e5288a370d8.tar.gz |
move oqgraph and sphinx suites into storage/*/mysql-test/
Diffstat (limited to 'mysql-test')
49 files changed, 0 insertions, 7346 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index de5b6697e69..124ede14dbb 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -177,14 +177,12 @@ my @DEFAULT_SUITES= qw( maria- multi_source- optimizer_unfixed_bugs- - oqgraph- parts- percona- perfschema- plugins- roles- rpl- - sphinx- sys_vars- unit- vcol- diff --git a/mysql-test/suite/oqgraph/basic.result b/mysql-test/suite/oqgraph/basic.result deleted file mode 100644 index 84943d05070..00000000000 --- a/mysql-test/suite/oqgraph/basic.result +++ /dev/null @@ -1,1438 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -DROP TABLE IF EXISTS graph2; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); -INSERT INTO graph_base(from_id, to_id) VALUES (5,7); -INSERT INTO graph_base(from_id, to_id) VALUES (9,9); -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -INSERT INTO graph_base(from_id, to_id) VALUES (11,12); -INSERT INTO graph_base(from_id, to_id) VALUES (12,10); -# Return all edges -SELECT * FROM graph; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -NULL 1 3 1 NULL NULL -NULL 3 1 1 NULL NULL -NULL 3 4 1 NULL NULL -NULL 4 3 1 NULL NULL -NULL 5 6 1 NULL NULL -NULL 6 5 1 NULL NULL -NULL 5 7 1 NULL NULL -NULL 9 9 1 NULL NULL -NULL 10 11 1 NULL NULL -NULL 11 12 1 NULL NULL -NULL 12 10 1 NULL NULL -# Currently count should be 13 -SELECT count(*) FROM graph; -count(*) -13 -# Return all edges when latch is NULL - this is different to latch='' and same as no where clause -SELECT * FROM graph where latch is NULL; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -NULL 1 3 1 NULL NULL -NULL 3 1 1 NULL NULL -NULL 3 4 1 NULL NULL -NULL 4 3 1 NULL NULL -NULL 5 6 1 NULL NULL -NULL 6 5 1 NULL NULL -NULL 5 7 1 NULL NULL -NULL 9 9 1 NULL NULL -NULL 10 11 1 NULL NULL -NULL 11 12 1 NULL NULL -NULL 12 10 1 NULL NULL -# Return all vertices, and subsets of vertices -SELECT * FROM graph where latch=''; -latch origid destid weight seq linkid - NULL NULL NULL NULL 1 - NULL NULL NULL NULL 2 - NULL NULL NULL NULL 3 - NULL NULL NULL NULL 4 - NULL NULL NULL NULL 5 - NULL NULL NULL NULL 6 - NULL NULL NULL NULL 7 - NULL NULL NULL NULL 9 - NULL NULL NULL NULL 10 - NULL NULL NULL NULL 11 - NULL NULL NULL NULL 12 -SELECT * FROM graph where latch='0'; -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 1 -0 NULL NULL NULL NULL 2 -0 NULL NULL NULL NULL 3 -0 NULL NULL NULL NULL 4 -0 NULL NULL NULL NULL 5 -0 NULL NULL NULL NULL 6 -0 NULL NULL NULL NULL 7 -0 NULL NULL NULL NULL 9 -0 NULL NULL NULL NULL 10 -0 NULL NULL NULL NULL 11 -0 NULL NULL NULL NULL 12 -# Currently count should be 11 -SELECT count(*) FROM graph where latch=''; -count(*) -11 -SELECT * FROM graph where latch='' and linkid = 2; -latch origid destid weight seq linkid - NULL NULL NULL NULL 2 -SELECT * FROM graph where latch='' and (linkid > 2 and linkid < 6); -latch origid destid weight seq linkid - NULL NULL NULL NULL 3 - NULL NULL NULL NULL 4 - NULL NULL NULL NULL 5 -SELECT * FROM graph where latch='' and linkid = NULL; -latch origid destid weight seq linkid -SELECT * FROM graph where latch='' and linkid = 666; -latch origid destid weight seq linkid -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 1; -from to -1 3 -1 2 -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 2; -from to -2 1 -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 4; -from to -4 3 -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 9; -from to -9 9 -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 10; -from to -10 11 -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = NULL; -from to -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 666; -from to -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 1; -from to -3 1 -2 1 -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 2; -from to -1 2 -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 4; -from to -3 4 -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 9; -from to -9 9 -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 10; -from to -12 10 -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = NULL; -from to -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 666; -from to -SELECT * FROM graph where latch='0'; -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 1 -0 NULL NULL NULL NULL 2 -0 NULL NULL NULL NULL 3 -0 NULL NULL NULL NULL 4 -0 NULL NULL NULL NULL 5 -0 NULL NULL NULL NULL 6 -0 NULL NULL NULL NULL 7 -0 NULL NULL NULL NULL 9 -0 NULL NULL NULL NULL 10 -0 NULL NULL NULL NULL 11 -0 NULL NULL NULL NULL 12 -SELECT count(*) FROM graph where latch='0'; -count(*) -11 -SELECT * FROM graph where latch='0' and linkid = 2; -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 2 -SELECT * FROM graph where latch='0' and (linkid > 2 and linkid < 6); -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 3 -0 NULL NULL NULL NULL 4 -0 NULL NULL NULL NULL 5 -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 1; -from to -1 3 -1 2 -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 2; -from to -2 1 -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 4; -from to -4 3 -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 9; -from to -9 9 -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 10; -from to -10 11 -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 1; -from to -3 1 -2 1 -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 2; -from to -1 2 -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 4; -from to -3 4 -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 9; -from to -9 9 -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 10; -from to -12 10 -# Breadth-first search tests -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1; -latch origid destid weight seq linkid -breadth_first 1 NULL 2 4 4 -breadth_first 1 NULL 1 3 3 -breadth_first 1 NULL 1 2 2 -breadth_first 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2; -latch origid destid weight seq linkid -breadth_first 2 NULL 3 4 4 -breadth_first 2 NULL 2 3 3 -breadth_first 2 NULL 1 2 1 -breadth_first 2 NULL 0 1 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3; -latch origid destid weight seq linkid -breadth_first 3 NULL 2 4 2 -breadth_first 3 NULL 1 3 4 -breadth_first 3 NULL 1 2 1 -breadth_first 3 NULL 0 1 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4; -latch origid destid weight seq linkid -breadth_first 4 NULL 3 4 2 -breadth_first 4 NULL 2 3 1 -breadth_first 4 NULL 1 2 3 -breadth_first 4 NULL 0 1 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5; -latch origid destid weight seq linkid -breadth_first 5 NULL 1 3 7 -breadth_first 5 NULL 1 2 6 -breadth_first 5 NULL 0 1 5 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6; -latch origid destid weight seq linkid -breadth_first 6 NULL 2 3 7 -breadth_first 6 NULL 1 2 5 -breadth_first 6 NULL 0 1 6 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7; -latch origid destid weight seq linkid -breadth_first 7 NULL 0 1 7 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9; -latch origid destid weight seq linkid -breadth_first 9 NULL 0 1 9 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10; -latch origid destid weight seq linkid -breadth_first 10 NULL 2 3 12 -breadth_first 10 NULL 1 2 11 -breadth_first 10 NULL 0 1 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11; -latch origid destid weight seq linkid -breadth_first 11 NULL 2 3 10 -breadth_first 11 NULL 1 2 12 -breadth_first 11 NULL 0 1 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12; -latch origid destid weight seq linkid -breadth_first 12 NULL 2 3 11 -breadth_first 12 NULL 1 2 10 -breadth_first 12 NULL 0 1 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 1 NULL 1 3 3 -breadth_first 1 NULL 1 2 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 2 NULL 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 3 NULL 1 3 4 -breadth_first 3 NULL 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 4 NULL 1 2 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 5 NULL 1 3 7 -breadth_first 5 NULL 1 2 6 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 6 NULL 1 2 5 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 10 NULL 1 2 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 11 NULL 1 2 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 12 NULL 1 2 10 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 1; -count(*) -1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 1 NULL 2 4 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 2 NULL 2 3 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 3 NULL 2 4 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 4 NULL 2 3 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 6 NULL 2 3 7 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 10 NULL 2 3 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 11 NULL 2 3 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 12 NULL 2 3 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 3; -latch origid destid weight seq linkid -breadth_first 2 NULL 3 4 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 3; -latch origid destid weight seq linkid -breadth_first 4 NULL 3 4 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 1 NULL 2 4 4 -breadth_first 1 NULL 1 3 3 -breadth_first 1 NULL 1 2 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 2 NULL 2 3 3 -breadth_first 2 NULL 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 3 NULL 2 4 2 -breadth_first 3 NULL 1 3 4 -breadth_first 3 NULL 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 4 NULL 2 3 1 -breadth_first 4 NULL 1 2 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 5 NULL 1 3 7 -breadth_first 5 NULL 1 2 6 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 6 NULL 2 3 7 -breadth_first 6 NULL 1 2 5 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 10 NULL 2 3 12 -breadth_first 10 NULL 1 2 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 11 NULL 2 3 10 -breadth_first 11 NULL 1 2 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 12 NULL 2 3 11 -breadth_first 12 NULL 1 2 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1; -latch origid destid weight seq linkid -breadth_first NULL 1 2 4 4 -breadth_first NULL 1 1 3 3 -breadth_first NULL 1 1 2 2 -breadth_first NULL 1 0 1 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2; -latch origid destid weight seq linkid -breadth_first NULL 2 3 4 4 -breadth_first NULL 2 2 3 3 -breadth_first NULL 2 1 2 1 -breadth_first NULL 2 0 1 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3; -latch origid destid weight seq linkid -breadth_first NULL 3 2 4 2 -breadth_first NULL 3 1 3 4 -breadth_first NULL 3 1 2 1 -breadth_first NULL 3 0 1 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4; -latch origid destid weight seq linkid -breadth_first NULL 4 3 4 2 -breadth_first NULL 4 2 3 1 -breadth_first NULL 4 1 2 3 -breadth_first NULL 4 0 1 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5; -latch origid destid weight seq linkid -breadth_first NULL 5 1 3 7 -breadth_first NULL 5 1 2 6 -breadth_first NULL 5 0 1 5 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6; -latch origid destid weight seq linkid -breadth_first NULL 6 2 3 7 -breadth_first NULL 6 1 2 5 -breadth_first NULL 6 0 1 6 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7; -latch origid destid weight seq linkid -breadth_first NULL 7 0 1 7 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9; -latch origid destid weight seq linkid -breadth_first NULL 9 0 1 9 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10; -latch origid destid weight seq linkid -breadth_first NULL 10 2 3 12 -breadth_first NULL 10 1 2 11 -breadth_first NULL 10 0 1 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11; -latch origid destid weight seq linkid -breadth_first NULL 11 2 3 10 -breadth_first NULL 11 1 2 12 -breadth_first NULL 11 0 1 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12; -latch origid destid weight seq linkid -breadth_first NULL 12 2 3 11 -breadth_first NULL 12 1 2 10 -breadth_first NULL 12 0 1 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 1 1 3 3 -breadth_first NULL 1 1 2 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 2 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 3 1 3 4 -breadth_first NULL 3 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 4 1 2 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 5 1 3 7 -breadth_first NULL 5 1 2 6 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 6 1 2 5 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 10 1 2 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 11 1 2 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 12 1 2 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 1 2 4 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 2 2 3 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 3 2 4 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 4 2 3 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 6 2 3 7 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 10 2 3 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 11 2 3 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 12 2 3 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 3; -latch origid destid weight seq linkid -breadth_first NULL 2 3 4 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 3; -latch origid destid weight seq linkid -breadth_first NULL 4 3 4 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = NULL; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = NULL; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first'; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 1; -latch origid destid weight seq linkid -2 1 NULL 2 4 4 -2 1 NULL 1 3 3 -2 1 NULL 1 2 2 -2 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 2; -latch origid destid weight seq linkid -2 2 NULL 3 4 4 -2 2 NULL 2 3 3 -2 2 NULL 1 2 1 -2 2 NULL 0 1 2 -SELECT * FROM graph WHERE latch = '2' AND origid = 3; -latch origid destid weight seq linkid -2 3 NULL 2 4 2 -2 3 NULL 1 3 4 -2 3 NULL 1 2 1 -2 3 NULL 0 1 3 -SELECT * FROM graph WHERE latch = '2' AND origid = 4; -latch origid destid weight seq linkid -2 4 NULL 3 4 2 -2 4 NULL 2 3 1 -2 4 NULL 1 2 3 -2 4 NULL 0 1 4 -SELECT * FROM graph WHERE latch = '2' AND origid = 5; -latch origid destid weight seq linkid -2 5 NULL 1 3 7 -2 5 NULL 1 2 6 -2 5 NULL 0 1 5 -SELECT * FROM graph WHERE latch = '2' AND origid = 6; -latch origid destid weight seq linkid -2 6 NULL 2 3 7 -2 6 NULL 1 2 5 -2 6 NULL 0 1 6 -SELECT * FROM graph WHERE latch = '2' AND origid = 7; -latch origid destid weight seq linkid -2 7 NULL 0 1 7 -SELECT * FROM graph WHERE latch = '2' AND origid = 8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 9; -latch origid destid weight seq linkid -2 9 NULL 0 1 9 -SELECT * FROM graph WHERE latch = '2' AND origid = 10; -latch origid destid weight seq linkid -2 10 NULL 2 3 12 -2 10 NULL 1 2 11 -2 10 NULL 0 1 10 -SELECT * FROM graph WHERE latch = '2' AND origid = 11; -latch origid destid weight seq linkid -2 11 NULL 2 3 10 -2 11 NULL 1 2 12 -2 11 NULL 0 1 11 -SELECT * FROM graph WHERE latch = '2' AND origid = 12; -latch origid destid weight seq linkid -2 12 NULL 2 3 11 -2 12 NULL 1 2 10 -2 12 NULL 0 1 12 -SELECT * FROM graph WHERE latch = '2' AND origid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 1; -latch origid destid weight seq linkid -2 1 NULL 1 3 3 -2 1 NULL 1 2 2 -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 1; -latch origid destid weight seq linkid -2 2 NULL 1 2 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 1; -latch origid destid weight seq linkid -2 3 NULL 1 3 4 -2 3 NULL 1 2 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 1; -latch origid destid weight seq linkid -2 4 NULL 1 2 3 -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 1; -latch origid destid weight seq linkid -2 5 NULL 1 3 7 -2 5 NULL 1 2 6 -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 1; -latch origid destid weight seq linkid -2 6 NULL 1 2 5 -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 1; -latch origid destid weight seq linkid -2 10 NULL 1 2 11 -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 1; -latch origid destid weight seq linkid -2 11 NULL 1 2 12 -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 1; -latch origid destid weight seq linkid -2 12 NULL 1 2 10 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 1 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 2 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 3 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 4 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 5 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 6 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 7 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 8 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 9 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 10 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 11 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 12 AND weight = 1; -count(*) -1 -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 2; -latch origid destid weight seq linkid -2 1 NULL 2 4 4 -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 2; -latch origid destid weight seq linkid -2 2 NULL 2 3 3 -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 2; -latch origid destid weight seq linkid -2 3 NULL 2 4 2 -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 2; -latch origid destid weight seq linkid -2 4 NULL 2 3 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 2; -latch origid destid weight seq linkid -2 6 NULL 2 3 7 -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 2; -latch origid destid weight seq linkid -2 10 NULL 2 3 12 -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 2; -latch origid destid weight seq linkid -2 11 NULL 2 3 10 -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 2; -latch origid destid weight seq linkid -2 12 NULL 2 3 11 -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 3; -latch origid destid weight seq linkid -2 2 NULL 3 4 4 -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 3; -latch origid destid weight seq linkid -2 4 NULL 3 4 2 -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 1 NULL 2 4 4 -2 1 NULL 1 3 3 -2 1 NULL 1 2 2 -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 2 NULL 2 3 3 -2 2 NULL 1 2 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 3 NULL 2 4 2 -2 3 NULL 1 3 4 -2 3 NULL 1 2 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 4 NULL 2 3 1 -2 4 NULL 1 2 3 -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 5 NULL 1 3 7 -2 5 NULL 1 2 6 -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 6 NULL 2 3 7 -2 6 NULL 1 2 5 -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 10 NULL 2 3 12 -2 10 NULL 1 2 11 -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 11 NULL 2 3 10 -2 11 NULL 1 2 12 -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 12 NULL 2 3 11 -2 12 NULL 1 2 10 -SELECT * FROM graph WHERE latch = '2' AND destid = 1; -latch origid destid weight seq linkid -2 NULL 1 2 4 4 -2 NULL 1 1 3 3 -2 NULL 1 1 2 2 -2 NULL 1 0 1 1 -SELECT * FROM graph WHERE latch = '2' AND destid = 2; -latch origid destid weight seq linkid -2 NULL 2 3 4 4 -2 NULL 2 2 3 3 -2 NULL 2 1 2 1 -2 NULL 2 0 1 2 -SELECT * FROM graph WHERE latch = '2' AND destid = 3; -latch origid destid weight seq linkid -2 NULL 3 2 4 2 -2 NULL 3 1 3 4 -2 NULL 3 1 2 1 -2 NULL 3 0 1 3 -SELECT * FROM graph WHERE latch = '2' AND destid = 4; -latch origid destid weight seq linkid -2 NULL 4 3 4 2 -2 NULL 4 2 3 1 -2 NULL 4 1 2 3 -2 NULL 4 0 1 4 -SELECT * FROM graph WHERE latch = '2' AND destid = 5; -latch origid destid weight seq linkid -2 NULL 5 1 3 7 -2 NULL 5 1 2 6 -2 NULL 5 0 1 5 -SELECT * FROM graph WHERE latch = '2' AND destid = 6; -latch origid destid weight seq linkid -2 NULL 6 2 3 7 -2 NULL 6 1 2 5 -2 NULL 6 0 1 6 -SELECT * FROM graph WHERE latch = '2' AND destid = 7; -latch origid destid weight seq linkid -2 NULL 7 0 1 7 -SELECT * FROM graph WHERE latch = '2' AND destid = 8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 9; -latch origid destid weight seq linkid -2 NULL 9 0 1 9 -SELECT * FROM graph WHERE latch = '2' AND destid = 10; -latch origid destid weight seq linkid -2 NULL 10 2 3 12 -2 NULL 10 1 2 11 -2 NULL 10 0 1 10 -SELECT * FROM graph WHERE latch = '2' AND destid = 11; -latch origid destid weight seq linkid -2 NULL 11 2 3 10 -2 NULL 11 1 2 12 -2 NULL 11 0 1 11 -SELECT * FROM graph WHERE latch = '2' AND destid = 12; -latch origid destid weight seq linkid -2 NULL 12 2 3 11 -2 NULL 12 1 2 10 -2 NULL 12 0 1 12 -SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 1; -latch origid destid weight seq linkid -2 NULL 1 1 3 3 -2 NULL 1 1 2 2 -SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 1; -latch origid destid weight seq linkid -2 NULL 2 1 2 1 -SELECT * FROM graph WHERE latch = '2' AND destid = 3 and weight = 1; -latch origid destid weight seq linkid -2 NULL 3 1 3 4 -2 NULL 3 1 2 1 -SELECT * FROM graph WHERE latch = '2' AND destid = 4 and weight = 1; -latch origid destid weight seq linkid -2 NULL 4 1 2 3 -SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 1; -latch origid destid weight seq linkid -2 NULL 5 1 3 7 -2 NULL 5 1 2 6 -SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 1; -latch origid destid weight seq linkid -2 NULL 6 1 2 5 -SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 1; -latch origid destid weight seq linkid -2 NULL 10 1 2 11 -SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 1; -latch origid destid weight seq linkid -2 NULL 11 1 2 12 -SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 1; -latch origid destid weight seq linkid -2 NULL 12 1 2 10 -SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 2; -latch origid destid weight seq linkid -2 NULL 1 2 4 4 -SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 2; -latch origid destid weight seq linkid -2 NULL 2 2 3 3 -SELECT * FROM graph WHERE latch = '2' AND destid = 3 and weight = 2; -latch origid destid weight seq linkid -2 NULL 3 2 4 2 -SELECT * FROM graph WHERE latch = '2' AND destid = 4 and weight = 2; -latch origid destid weight seq linkid -2 NULL 4 2 3 1 -SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 2; -latch origid destid weight seq linkid -2 NULL 6 2 3 7 -SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 2; -latch origid destid weight seq linkid -2 NULL 10 2 3 12 -SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 2; -latch origid destid weight seq linkid -2 NULL 11 2 3 10 -SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 2; -latch origid destid weight seq linkid -2 NULL 12 2 3 11 -SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 3; -latch origid destid weight seq linkid -2 NULL 2 3 4 4 -SELECT * FROM graph WHERE latch = '2' AND destid = 3 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 4 and weight = 3; -latch origid destid weight seq linkid -2 NULL 4 3 4 2 -SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = NULL; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = NULL; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2'; -latch origid destid weight seq linkid -# Dijkstras algorithm tests -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=1; -latch origid destid weight seq linkid -dijkstras 1 1 NULL 0 1 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=2; -latch origid destid weight seq linkid -dijkstras 1 2 NULL 0 1 -dijkstras 1 2 1 1 2 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=2 AND destid=1; -latch origid destid weight seq linkid -dijkstras 2 1 NULL 0 2 -dijkstras 2 1 1 1 1 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=4; -latch origid destid weight seq linkid -dijkstras 1 4 NULL 0 1 -dijkstras 1 4 1 1 3 -dijkstras 1 4 1 2 4 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=4 AND destid=1; -latch origid destid weight seq linkid -dijkstras 4 1 NULL 0 4 -dijkstras 4 1 1 1 3 -dijkstras 4 1 1 2 1 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=5; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND origid=5 AND destid=7; -latch origid destid weight seq linkid -dijkstras 5 7 NULL 0 5 -dijkstras 5 7 1 1 7 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=7 AND destid=5; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=11; -latch origid destid weight seq linkid -dijkstras 10 11 NULL 0 10 -dijkstras 10 11 1 1 11 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=12; -latch origid destid weight seq linkid -dijkstras 10 12 NULL 0 10 -dijkstras 10 12 1 1 11 -dijkstras 10 12 1 2 12 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11 AND destid=10; -latch origid destid weight seq linkid -dijkstras 11 10 NULL 0 11 -dijkstras 11 10 1 1 12 -dijkstras 11 10 1 2 10 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11 AND destid=12; -latch origid destid weight seq linkid -dijkstras 11 12 NULL 0 11 -dijkstras 11 12 1 1 12 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=10; -latch origid destid weight seq linkid -dijkstras 12 10 NULL 0 12 -dijkstras 12 10 1 1 10 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=11; -latch origid destid weight seq linkid -dijkstras 12 11 NULL 0 12 -dijkstras 12 11 1 1 10 -dijkstras 12 11 1 2 11 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -latch origid destid weight seq linkid -dijkstras 1 NULL 2 4 4 -dijkstras 1 NULL 1 3 3 -dijkstras 1 NULL 1 2 2 -dijkstras 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=2; -latch origid destid weight seq linkid -dijkstras 2 NULL 3 4 4 -dijkstras 2 NULL 2 3 3 -dijkstras 2 NULL 1 2 1 -dijkstras 2 NULL 0 1 2 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=3; -latch origid destid weight seq linkid -dijkstras 3 NULL 2 4 2 -dijkstras 3 NULL 1 3 4 -dijkstras 3 NULL 1 2 1 -dijkstras 3 NULL 0 1 3 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=4; -latch origid destid weight seq linkid -dijkstras 4 NULL 3 4 2 -dijkstras 4 NULL 2 3 1 -dijkstras 4 NULL 1 2 3 -dijkstras 4 NULL 0 1 4 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=5; -latch origid destid weight seq linkid -dijkstras 5 NULL 1 3 7 -dijkstras 5 NULL 1 2 6 -dijkstras 5 NULL 0 1 5 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=6; -latch origid destid weight seq linkid -dijkstras 6 NULL 2 3 7 -dijkstras 6 NULL 1 2 5 -dijkstras 6 NULL 0 1 6 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=7; -latch origid destid weight seq linkid -dijkstras 7 NULL 0 1 7 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND origid=9; -latch origid destid weight seq linkid -dijkstras 9 NULL 0 1 9 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10; -latch origid destid weight seq linkid -dijkstras 10 NULL 2 3 12 -dijkstras 10 NULL 1 2 11 -dijkstras 10 NULL 0 1 10 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11; -latch origid destid weight seq linkid -dijkstras 11 NULL 2 3 10 -dijkstras 11 NULL 1 2 12 -dijkstras 11 NULL 0 1 11 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12; -latch origid destid weight seq linkid -dijkstras 12 NULL 2 3 11 -dijkstras 12 NULL 1 2 10 -dijkstras 12 NULL 0 1 12 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND destid=1; -latch origid destid weight seq linkid -dijkstras NULL 1 2 4 4 -dijkstras NULL 1 1 3 3 -dijkstras NULL 1 1 2 2 -dijkstras NULL 1 0 1 1 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=2; -latch origid destid weight seq linkid -dijkstras NULL 2 3 4 4 -dijkstras NULL 2 2 3 3 -dijkstras NULL 2 1 2 1 -dijkstras NULL 2 0 1 2 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=3; -latch origid destid weight seq linkid -dijkstras NULL 3 2 4 2 -dijkstras NULL 3 1 3 4 -dijkstras NULL 3 1 2 1 -dijkstras NULL 3 0 1 3 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=4; -latch origid destid weight seq linkid -dijkstras NULL 4 3 4 2 -dijkstras NULL 4 2 3 1 -dijkstras NULL 4 1 2 3 -dijkstras NULL 4 0 1 4 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=5; -latch origid destid weight seq linkid -dijkstras NULL 5 1 3 7 -dijkstras NULL 5 1 2 6 -dijkstras NULL 5 0 1 5 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=6; -latch origid destid weight seq linkid -dijkstras NULL 6 2 3 7 -dijkstras NULL 6 1 2 5 -dijkstras NULL 6 0 1 6 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=7; -latch origid destid weight seq linkid -dijkstras NULL 7 0 1 7 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND destid=9; -latch origid destid weight seq linkid -dijkstras NULL 9 0 1 9 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=10; -latch origid destid weight seq linkid -dijkstras NULL 10 2 3 12 -dijkstras NULL 10 1 2 11 -dijkstras NULL 10 0 1 10 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=11; -latch origid destid weight seq linkid -dijkstras NULL 11 2 3 10 -dijkstras NULL 11 1 2 12 -dijkstras NULL 11 0 1 11 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=12; -latch origid destid weight seq linkid -dijkstras NULL 12 2 3 11 -dijkstras NULL 12 1 2 10 -dijkstras NULL 12 0 1 12 -# legacy string number -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=1; -latch origid destid weight seq linkid -1 1 1 NULL 0 1 -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=2; -latch origid destid weight seq linkid -1 1 2 NULL 0 1 -1 1 2 1 1 2 -SELECT * FROM graph WHERE latch='1' AND origid=2 AND destid=1; -latch origid destid weight seq linkid -1 2 1 NULL 0 2 -1 2 1 1 1 1 -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=4; -latch origid destid weight seq linkid -1 1 4 NULL 0 1 -1 1 4 1 1 3 -1 1 4 1 2 4 -SELECT * FROM graph WHERE latch='1' AND origid=4 AND destid=1; -latch origid destid weight seq linkid -1 4 1 NULL 0 4 -1 4 1 1 1 3 -1 4 1 1 2 1 -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=5; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND origid=5 AND destid=7; -latch origid destid weight seq linkid -1 5 7 NULL 0 5 -1 5 7 1 1 7 -SELECT * FROM graph WHERE latch='1' AND origid=7 AND destid=5; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND origid=10 AND destid=11; -latch origid destid weight seq linkid -1 10 11 NULL 0 10 -1 10 11 1 1 11 -SELECT * FROM graph WHERE latch='1' AND origid=10 AND destid=12; -latch origid destid weight seq linkid -1 10 12 NULL 0 10 -1 10 12 1 1 11 -1 10 12 1 2 12 -SELECT * FROM graph WHERE latch='1' AND origid=11 AND destid=10; -latch origid destid weight seq linkid -1 11 10 NULL 0 11 -1 11 10 1 1 12 -1 11 10 1 2 10 -SELECT * FROM graph WHERE latch='1' AND origid=11 AND destid=12; -latch origid destid weight seq linkid -1 11 12 NULL 0 11 -1 11 12 1 1 12 -SELECT * FROM graph WHERE latch='1' AND origid=12 AND destid=10; -latch origid destid weight seq linkid -1 12 10 NULL 0 12 -1 12 10 1 1 10 -SELECT * FROM graph WHERE latch='1' AND origid=12 AND destid=11; -latch origid destid weight seq linkid -1 12 11 NULL 0 12 -1 12 11 1 1 10 -1 12 11 1 2 11 -SELECT * FROM graph WHERE latch='1' AND origid=1; -latch origid destid weight seq linkid -1 1 NULL 2 4 4 -1 1 NULL 1 3 3 -1 1 NULL 1 2 2 -1 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch='1' AND origid=2; -latch origid destid weight seq linkid -1 2 NULL 3 4 4 -1 2 NULL 2 3 3 -1 2 NULL 1 2 1 -1 2 NULL 0 1 2 -SELECT * FROM graph WHERE latch='1' AND origid=3; -latch origid destid weight seq linkid -1 3 NULL 2 4 2 -1 3 NULL 1 3 4 -1 3 NULL 1 2 1 -1 3 NULL 0 1 3 -SELECT * FROM graph WHERE latch='1' AND origid=4; -latch origid destid weight seq linkid -1 4 NULL 3 4 2 -1 4 NULL 2 3 1 -1 4 NULL 1 2 3 -1 4 NULL 0 1 4 -SELECT * FROM graph WHERE latch='1' AND origid=5; -latch origid destid weight seq linkid -1 5 NULL 1 3 7 -1 5 NULL 1 2 6 -1 5 NULL 0 1 5 -SELECT * FROM graph WHERE latch='1' AND origid=6; -latch origid destid weight seq linkid -1 6 NULL 2 3 7 -1 6 NULL 1 2 5 -1 6 NULL 0 1 6 -SELECT * FROM graph WHERE latch='1' AND origid=7; -latch origid destid weight seq linkid -1 7 NULL 0 1 7 -SELECT * FROM graph WHERE latch='1' AND origid=8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND origid=9; -latch origid destid weight seq linkid -1 9 NULL 0 1 9 -SELECT * FROM graph WHERE latch='1' AND origid=10; -latch origid destid weight seq linkid -1 10 NULL 2 3 12 -1 10 NULL 1 2 11 -1 10 NULL 0 1 10 -SELECT * FROM graph WHERE latch='1' AND origid=11; -latch origid destid weight seq linkid -1 11 NULL 2 3 10 -1 11 NULL 1 2 12 -1 11 NULL 0 1 11 -SELECT * FROM graph WHERE latch='1' AND origid=12; -latch origid destid weight seq linkid -1 12 NULL 2 3 11 -1 12 NULL 1 2 10 -1 12 NULL 0 1 12 -SELECT * FROM graph WHERE latch='1' AND origid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND destid=1; -latch origid destid weight seq linkid -1 NULL 1 2 4 4 -1 NULL 1 1 3 3 -1 NULL 1 1 2 2 -1 NULL 1 0 1 1 -SELECT * FROM graph WHERE latch='1' AND destid=2; -latch origid destid weight seq linkid -1 NULL 2 3 4 4 -1 NULL 2 2 3 3 -1 NULL 2 1 2 1 -1 NULL 2 0 1 2 -SELECT * FROM graph WHERE latch='1' AND destid=3; -latch origid destid weight seq linkid -1 NULL 3 2 4 2 -1 NULL 3 1 3 4 -1 NULL 3 1 2 1 -1 NULL 3 0 1 3 -SELECT * FROM graph WHERE latch='1' AND destid=4; -latch origid destid weight seq linkid -1 NULL 4 3 4 2 -1 NULL 4 2 3 1 -1 NULL 4 1 2 3 -1 NULL 4 0 1 4 -SELECT * FROM graph WHERE latch='1' AND destid=5; -latch origid destid weight seq linkid -1 NULL 5 1 3 7 -1 NULL 5 1 2 6 -1 NULL 5 0 1 5 -SELECT * FROM graph WHERE latch='1' AND destid=6; -latch origid destid weight seq linkid -1 NULL 6 2 3 7 -1 NULL 6 1 2 5 -1 NULL 6 0 1 6 -SELECT * FROM graph WHERE latch='1' AND destid=7; -latch origid destid weight seq linkid -1 NULL 7 0 1 7 -SELECT * FROM graph WHERE latch='1' AND destid=8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND destid=9; -latch origid destid weight seq linkid -1 NULL 9 0 1 9 -SELECT * FROM graph WHERE latch='1' AND destid=10; -latch origid destid weight seq linkid -1 NULL 10 2 3 12 -1 NULL 10 1 2 11 -1 NULL 10 0 1 10 -SELECT * FROM graph WHERE latch='1' AND destid=11; -latch origid destid weight seq linkid -1 NULL 11 2 3 10 -1 NULL 11 1 2 12 -1 NULL 11 0 1 11 -SELECT * FROM graph WHERE latch='1' AND destid=12; -latch origid destid weight seq linkid -1 NULL 12 2 3 11 -1 NULL 12 1 2 10 -1 NULL 12 0 1 12 -INSERT INTO graph_base(from_id, to_id) VALUES (11,13); -INSERT INTO graph_base(from_id, to_id) VALUES (10,14); -INSERT INTO graph_base(from_id, to_id) VALUES (14,13); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; -latch origid destid weight seq linkid -dijkstras 10 13 NULL 0 10 -dijkstras 10 13 1 1 11 -dijkstras 10 13 1 2 13 -DELETE FROM graph_base where from_id=10 and to_id=11; -INSERT INTO graph_base(from_id, to_id) VALUES (10,15); -INSERT INTO graph_base(from_id, to_id) VALUES (15,13); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; -latch origid destid weight seq linkid -dijkstras 10 13 NULL 0 10 -dijkstras 10 13 1 1 14 -dijkstras 10 13 1 2 13 -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; -latch origid destid weight seq linkid -dijkstras 10 13 NULL 0 10 -dijkstras 10 13 1 1 11 -dijkstras 10 13 1 2 13 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -latch origid destid weight seq linkid -dijkstras 1 NULL 2 4 4 -dijkstras 1 NULL 1 3 3 -dijkstras 1 NULL 1 2 2 -dijkstras 1 NULL 0 1 1 -INSERT INTO graph_base(from_id, to_id) VALUES (21,22); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=21; -latch origid destid weight seq linkid -dijkstras 21 NULL 1 2 22 -dijkstras 21 NULL 0 1 21 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=22; -latch origid destid weight seq linkid -dijkstras 22 NULL 0 1 22 -INSERT INTO graph_base(from_id, to_id) VALUES (4,17); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -latch origid destid weight seq linkid -dijkstras 1 NULL 3 5 17 -dijkstras 1 NULL 2 4 4 -dijkstras 1 NULL 1 3 3 -dijkstras 1 NULL 1 2 2 -dijkstras 1 NULL 0 1 1 -INSERT INTO graph_base(from_id, to_id) VALUES (4,16); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -latch origid destid weight seq linkid -dijkstras 1 NULL 3 6 17 -dijkstras 1 NULL 3 5 16 -dijkstras 1 NULL 2 4 4 -dijkstras 1 NULL 1 3 3 -dijkstras 1 NULL 1 2 2 -dijkstras 1 NULL 0 1 1 -INSERT INTO graph_base(from_id, to_id) VALUES (17,18); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -latch origid destid weight seq linkid -dijkstras 1 NULL 4 7 18 -dijkstras 1 NULL 3 6 17 -dijkstras 1 NULL 3 5 16 -dijkstras 1 NULL 2 4 4 -dijkstras 1 NULL 1 3 3 -dijkstras 1 NULL 1 2 2 -dijkstras 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=1; -latch origid destid weight seq linkid -dijkstras NULL 1 4 7 18 -dijkstras NULL 1 3 6 17 -dijkstras NULL 1 3 5 16 -dijkstras NULL 1 2 4 4 -dijkstras NULL 1 1 3 3 -dijkstras NULL 1 1 2 2 -dijkstras NULL 1 0 1 1 -# Now we add a connection from 4->6 -INSERT INTO graph_base (from_id,to_id) VALUES (4,6); -# And delete all references to node 5 -DELETE FROM graph_base WHERE from_id=5; -DELETE FROM graph_base WHERE from_id=3 AND to_id=5; -# which means there is a path in one direction only 1>3>4>6 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=6; -latch origid destid weight seq linkid -dijkstras 1 6 NULL 0 1 -dijkstras 1 6 1 1 3 -dijkstras 1 6 1 2 4 -dijkstras 1 6 1 3 6 -# but not 6>4>3>1 (so no result) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=6 AND destid=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=6; -latch origid destid weight seq linkid -1 1 6 NULL 0 1 -1 1 6 1 1 3 -1 1 6 1 2 4 -1 1 6 1 3 6 -SELECT * FROM graph WHERE latch='1' AND origid=6 AND destid=1; -latch origid destid weight seq linkid -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/basic.test b/mysql-test/suite/oqgraph/basic.test deleted file mode 100644 index 088b69ef00a..00000000000 --- a/mysql-test/suite/oqgraph/basic.test +++ /dev/null @@ -1,640 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -DROP TABLE IF EXISTS graph2; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - -#-- -#-- ASCII art graph of this test data -#-- +-->(2) -#-- ( )<---+ -#-- (1) -#-- ( )<---+ -#-- +-->(3)<------->(4) -#-- -#-- (7)<----------(5)<--------->(6) (9) -#-- -#-- +--->(11) -#-- | | -#-- (10) | -#-- ^ v -#-- +----(12) - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); - -#-- extra unidirected node -INSERT INTO graph_base(from_id, to_id) VALUES (5,7); - -#-- isolated node with no loop - disallowed -#-- so origid 8 below should return an empty rowset -#-- INSERT INTO graph_base(from_id, to_id) VALUES (8,NULL); - -#-- isolated node with a (undirected) loop -#-- we have no way of representing a directed loop on an isolated node, is this valid in pure graph theory? -INSERT INTO graph_base(from_id, to_id) VALUES (9,9); - -#-- directed _cyclic_ graph triangle? -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -INSERT INTO graph_base(from_id, to_id) VALUES (11,12); -INSERT INTO graph_base(from_id, to_id) VALUES (12,10); - ---echo # Return all edges -#-- we note that when weight is NULL it defaults to 1 -SELECT * FROM graph; ---echo # Currently count should be 13 -SELECT count(*) FROM graph; - ---echo # Return all edges when latch is NULL - this is different to latch='' and same as no where clause -SELECT * FROM graph where latch is NULL; - ---echo # Return all vertices, and subsets of vertices -SELECT * FROM graph where latch=''; -SELECT * FROM graph where latch='0'; - ---echo # Currently count should be 11 - -SELECT count(*) FROM graph where latch=''; -#-- get a subset of vertices -SELECT * FROM graph where latch='' and linkid = 2; -SELECT * FROM graph where latch='' and (linkid > 2 and linkid < 6); -SELECT * FROM graph where latch='' and linkid = NULL; -SELECT * FROM graph where latch='' and linkid = 666; - -#-- Query out-edges for vertex (no_search AND origid=N) -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 1; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 2; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 4; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 9; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 10; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = NULL; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 666; - -#-- Query in-edges for vertex (no_search AND destid=N) -#-- linkid will have the other end -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 1; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 2; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 4; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 9; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 10; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = NULL; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 666; - -# The following returns a result that makes no sense... -#-- what happens when we combined orig and dest? -#-- Bug https://bugs.launchpad.net/oqgraph/+bug/1195778 -#SELECT * FROM graph where latch='' and origid = 1; -#SELECT * FROM graph where latch='' and destid = 2; -#SELECT * FROM graph where latch='' and origid=1 and destid = 2; - -SELECT * FROM graph where latch='0'; -SELECT count(*) FROM graph where latch='0'; -SELECT * FROM graph where latch='0' and linkid = 2; -SELECT * FROM graph where latch='0' and (linkid > 2 and linkid < 6); -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 1; -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 2; -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 4; -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 9; -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 10; -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 1; -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 2; -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 4; -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 9; -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 10; - ---echo # Breadth-first search tests -#-- We are asking "Is there a path from node 'origid' to (all) other nodes?" -#-- We return a row for each other node that is reachable, with its id in 'linkid' -#-- and the weight calculated as "How many _directed_ hops to get there" -#-- If there is no path from origid to another node then there is no row for that linkid -#-- We include 'origid' in the set of reachable nodes i.e. as a 'loop', with weight 0 -#-- 'seq' is the counted distance of the search, thus, the loop link will always have seq 1 -#-- if there are two reachable neighbours, they will have seq 2,3 and so on -#-- linkid is the other end -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 666; # <-- note, should return nothing -#-- The above results can then be filtered by weight, so the results should be a subset for the corresponding origid above -#-- so effectively, `AND weight=1` returns the neighbours of origid in linkid -#<----- orig test harness - still returns (breadth_first 1 NULL 1 3 3), (breadth_first 1 NULL 1 2 2) -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 1; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 1; -#-- so effectively, `count(... AND weight=1)` returns the number of _reachable_ immediate neighbours -#-- included because it allows human to quickly eyeball against the visual ASCII graph for correctness... -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 1; # <-- note, should return nothing -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 1; -#-- so effectively, `AND weight=2` returns the second-level neighbours of origid in linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 2; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 3; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 3; - -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND (weight = 1 or weight = 2); # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND (weight = 1 or weight = 2); - -#-- now do it in reverse - using destid find originating vertices -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 1; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 2; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 3; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 3; - -#-- These return empty sets - origid or destid must be specified and non null to get a result set -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = NULL; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = NULL; -SELECT * FROM graph WHERE latch = 'breadth_first' AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first'; - -#-- Repeat the above with legacy string -SELECT * FROM graph WHERE latch = '2' AND origid = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 4; -SELECT * FROM graph WHERE latch = '2' AND origid = 5; -SELECT * FROM graph WHERE latch = '2' AND origid = 6; -SELECT * FROM graph WHERE latch = '2' AND origid = 7; -SELECT * FROM graph WHERE latch = '2' AND origid = 8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 9; -SELECT * FROM graph WHERE latch = '2' AND origid = 10; -SELECT * FROM graph WHERE latch = '2' AND origid = 11; -SELECT * FROM graph WHERE latch = '2' AND origid = 12; -SELECT * FROM graph WHERE latch = '2' AND origid = 666; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 1; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 1 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 2 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 3 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 4 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 5 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 6 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 7 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 8 AND weight = 1; # <-- note, should return nothing -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 9 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 10 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 11 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 12 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 2; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 3; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 3; - -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND (weight = 1 or weight = 2); # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND (weight = 1 or weight = 2); - -SELECT * FROM graph WHERE latch = '2' AND destid = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 3; -SELECT * FROM graph WHERE latch = '2' AND destid = 4; -SELECT * FROM graph WHERE latch = '2' AND destid = 5; -SELECT * FROM graph WHERE latch = '2' AND destid = 6; -SELECT * FROM graph WHERE latch = '2' AND destid = 7; -SELECT * FROM graph WHERE latch = '2' AND destid = 8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND destid = 9; -SELECT * FROM graph WHERE latch = '2' AND destid = 10; -SELECT * FROM graph WHERE latch = '2' AND destid = 11; -SELECT * FROM graph WHERE latch = '2' AND destid = 12; -SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 3 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 4 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 1; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 3 and weight = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 4 and weight = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 2; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 2; -SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 3; -SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 3; -SELECT * FROM graph WHERE latch = '2' AND destid = 3 and weight = 3; -SELECT * FROM graph WHERE latch = '2' AND destid = 4 and weight = 3; -SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 3; -SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 3; -SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 3; -SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 3; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 3; -SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 3; -SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 3; -SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 3; - -#-- These return empty sets - origid must be specified and non null to get a result set -SELECT * FROM graph WHERE latch = '2' AND origid = NULL; -SELECT * FROM graph WHERE latch = '2' AND destid = NULL; -SELECT * FROM graph WHERE latch = '2' AND weight = 1; -SELECT * FROM graph WHERE latch = '2'; - - ---echo # Dijkstras algorithm tests -#-- We ask 'What is the shortest path (if any) between 'origid' and 'destid' -#-- This returns the number of directed hops +1 (for the starting node) -#-- 'weight' is NULL for the starting point, or 1 -#-- 'linkid' is the way point id -#-- 'seq' is the distance of the waypoint from the start (counting from zero) -#-- the default order returned is waypoints out from the start -#-- zero hop (1 row) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=1; -#-- one hop -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=2; -#-- one hop in reverse -SELECT * FROM graph WHERE latch='dijkstras' AND origid=2 AND destid=1; -#-- two hops (via 3) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=4; -#-- two hops in reverse direction -SELECT * FROM graph WHERE latch='dijkstras' AND origid=4 AND destid=1; -#-- no result (no connection) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=5; -#-- no result (no destination exists) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=666; - -#-- one hop on a unidirected link -SELECT * FROM graph WHERE latch='dijkstras' AND origid=5 AND destid=7; -#-- zero hop in reverse direction on a unidirected link -SELECT * FROM graph WHERE latch='dijkstras' AND origid=7 AND destid=5; - -#-- Trickery - what about the cyclic loop? -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=11; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=12; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11 AND destid=10; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11 AND destid=12; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=10; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=11; - -#-- reachable vertices -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=2; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=3; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=4; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=5; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=6; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=7; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='dijkstras' AND origid=9; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=666; # <-- note, should return nothing - -#-- originating vertices -SELECT * FROM graph WHERE latch='dijkstras' AND destid=1; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=2; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=3; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=4; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=5; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=6; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=7; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='dijkstras' AND destid=9; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=10; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=11; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=12; - ---echo # legacy string number -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=1; -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=2; -SELECT * FROM graph WHERE latch='1' AND origid=2 AND destid=1; -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=4; -SELECT * FROM graph WHERE latch='1' AND origid=4 AND destid=1; -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=5; -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=666; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='1' AND origid=5 AND destid=7; -SELECT * FROM graph WHERE latch='1' AND origid=7 AND destid=5; -SELECT * FROM graph WHERE latch='1' AND origid=10 AND destid=11; -SELECT * FROM graph WHERE latch='1' AND origid=10 AND destid=12; -SELECT * FROM graph WHERE latch='1' AND origid=11 AND destid=10; -SELECT * FROM graph WHERE latch='1' AND origid=11 AND destid=12; -SELECT * FROM graph WHERE latch='1' AND origid=12 AND destid=10; -SELECT * FROM graph WHERE latch='1' AND origid=12 AND destid=11; -SELECT * FROM graph WHERE latch='1' AND origid=1; -SELECT * FROM graph WHERE latch='1' AND origid=2; -SELECT * FROM graph WHERE latch='1' AND origid=3; -SELECT * FROM graph WHERE latch='1' AND origid=4; -SELECT * FROM graph WHERE latch='1' AND origid=5; -SELECT * FROM graph WHERE latch='1' AND origid=6; -SELECT * FROM graph WHERE latch='1' AND origid=7; -SELECT * FROM graph WHERE latch='1' AND origid=8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='1' AND origid=9; -SELECT * FROM graph WHERE latch='1' AND origid=10; -SELECT * FROM graph WHERE latch='1' AND origid=11; -SELECT * FROM graph WHERE latch='1' AND origid=12; -SELECT * FROM graph WHERE latch='1' AND origid=666; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='1' AND destid=1; -SELECT * FROM graph WHERE latch='1' AND destid=2; -SELECT * FROM graph WHERE latch='1' AND destid=3; -SELECT * FROM graph WHERE latch='1' AND destid=4; -SELECT * FROM graph WHERE latch='1' AND destid=5; -SELECT * FROM graph WHERE latch='1' AND destid=6; -SELECT * FROM graph WHERE latch='1' AND destid=7; -SELECT * FROM graph WHERE latch='1' AND destid=8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='1' AND destid=9; -SELECT * FROM graph WHERE latch='1' AND destid=10; -SELECT * FROM graph WHERE latch='1' AND destid=11; -SELECT * FROM graph WHERE latch='1' AND destid=12; - -#-- What if we add two equally valid two-hop paths? -#-- -#-- -#-- +--->(14)----------+ -#-- | v -#-- | +--->(11)---->(13) -#-- | | | -#-- +-(10) | -#-- ^ v -#-- +----(12) -#-- -#-- We note it chooses 10,11,13 but will it always? -INSERT INTO graph_base(from_id, to_id) VALUES (11,13); -INSERT INTO graph_base(from_id, to_id) VALUES (10,14); -INSERT INTO graph_base(from_id, to_id) VALUES (14,13); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; -DELETE FROM graph_base where from_id=10 and to_id=11; -INSERT INTO graph_base(from_id, to_id) VALUES (10,15); -INSERT INTO graph_base(from_id, to_id) VALUES (15,13); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -#-- We note is _appears_ to use the lowered valued node id if there are two equal paths -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; - -#-- add some extra and check -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -INSERT INTO graph_base(from_id, to_id) VALUES (21,22); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=21; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=22; -INSERT INTO graph_base(from_id, to_id) VALUES (4,17); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -INSERT INTO graph_base(from_id, to_id) VALUES (4,16); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -INSERT INTO graph_base(from_id, to_id) VALUES (17,18); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=1; - ---echo # Now we add a connection from 4->6 -INSERT INTO graph_base (from_id,to_id) VALUES (4,6); - ---echo # And delete all references to node 5 -DELETE FROM graph_base WHERE from_id=5; -DELETE FROM graph_base WHERE from_id=3 AND to_id=5; - ---echo # which means there is a path in one direction only 1>3>4>6 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=6; ---echo # but not 6>4>3>1 (so no result) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=6 AND destid=1; - -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=6; -SELECT * FROM graph WHERE latch='1' AND origid=6 AND destid=1; - - -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; - -DROP TABLE graph_base; -DROP TABLE graph; - -#-- Reminder - the basic spec is at http://openquery.com/graph/doc -#-- Query edges stored in graph engine (latch=NULL) -#-- SELECT * FROM foo; -#-- Results: -#-- vertex id for origin of edge in origid column. -#-- vertex id for destination of edge in destid column. -#-- weight of edge in weight column. -#-- Essentially this returns the values (origid,destid pairs with optional weight) you put in, in this mode OQGRAPH looks very close to a real table. But it also does nothing special, it's just store/retrieve for those columns. The other columns will be returned as NULL. -#-- -#-- Query vertices stored in graph engine (latch=0) -#-- SELECT * FROM foo WHERE latch = 0; -#-- Results: -#-- vertex id in linkid column -#-- -#-- Query out-edges for vertex (latch=0 AND origid=N) -#-- SELECT * FROM foo WHERE latch = 0 AND origid = 2; -#-- Results: -#-- vertex id in linkid column -#-- edge weight in weight column -#-- -#-- Query in-edges for vertex (latch=0 AND destid=N) -#-- SELECT * FROM foo WHERE latch = 0 AND destid = 6; -#-- Results: -#-- vertex id in linkid column -#-- edge weight in weight column -#-- -#-- Dijkstra's shortest path algorithm (latch=1) -#-- Find shortest path: -#-- SELECT * FROM foo WHERE latch = 1 AND origid = 1 AND destid = 6; -#-- Results: -#-- latch, origid, destid are same as input. -#-- vertex id of the current step in linkid column. -#-- weight of traversed edge in weight column. -#-- step counter in seq column, so you can sort and use the result (starting at step 0). -#-- Example: SELECT GROUP_CONCAT(linkid ORDER BY seq) ... -#-- -#-- Find reachable vertices: -#-- SELECT * FROM foo WHERE latch = 1 AND origid = 1; -#-- Results: -#-- latch, origid, destid are same as input. -#-- vertex id in linkid column. -#-- aggregate of weights in weight column. -#-- -#-- Find originating vertices: -#-- SELECT * FROM foo WHERE latch = 1 AND destid = 6; -#-- Results: -#-- latch, origid, destid are same as input. -#-- vertex id in linkid column. -#-- aggregate of weights in weight column. -#-- -#-- Breadth-first search (latch=2, assumes that each vertex is weight 1) -#-- Find shortest path: -#-- SELECT * FROM foo WHERE latch = 2 AND origid = 1 AND destid = 6; -#-- Results: -#-- vertex id in linkid column. -#-- weight column = 1 for each hop. -#-- -#-- Find reachable vertices: -#-- SELECT * FROM foo WHERE latch = 2 AND origid = 1; -#-- Results: -#-- vertex id in linkid column. -#-- computed number of hops in weight column. -#-- -#-- Find originating vertices: -#-- SELECT * FROM foo WHERE latch = 2 AND destid = 6; -#-- Results: -#-- vertex id in linkid column. -#-- computed number of hops in weight column. - - diff --git a/mysql-test/suite/oqgraph/boundary_conditions.result b/mysql-test/suite/oqgraph/boundary_conditions.result deleted file mode 100644 index 9aa806eace9..00000000000 --- a/mysql-test/suite/oqgraph/boundary_conditions.result +++ /dev/null @@ -1,214 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -DROP TABLE IF EXISTS graph2; -CREATE TABLE graph2 ( -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='graph_base' ORIGID='from_id', DESTID='to_id'; -SELECT * FROM graph2 WHERE latch='dijkstras' AND origid=1 AND destid=6; -ERROR 42S02: Table 'test.graph_base' doesn't exist -DROP TABLE graph2; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); -# Expect no result, because of autocast -SELECT * FROM graph WHERE latch=0 ; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=0 and destid=2 and origid=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=0 and origid=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=0 and destid=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=0 and origid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=0 and origid is NULL; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=1 ; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=1 and destid=2 and origid=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=1 and origid=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=1 and destid=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=1 and origid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=1 and origid is NULL; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=2 ; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=2 and destid=2 and origid=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=2 and origid=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=2 and destid=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=2 and origid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=2 and origid is NULL; -latch origid destid weight seq linkid -# Should this return an error? it seems we treat it as just another bogus latch -SELECT * FROM graph WHERE latch='ThisExceeds32Characters456789012'; -latch origid destid weight seq linkid -# Expect no result, because of invalid latch -SELECT * FROM graph WHERE latch='bogus'; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='bogus' and destid=2 and origid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='bogus' and origid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='bogus' and destid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='bogus' and origid=666; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='bogus' and origid is NULL; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='666'; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='666' and destid=2 and origid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='666' and origid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='666' and destid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='666' and origid=666; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='666' and origid is NULL; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='-1'; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='-1' and destid=2 and origid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='-1' and origid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='-1' and destid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='-1' and origid=666; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='-1' and origid is NULL; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -# Make sure we dont crash if someone passed in a UTF string -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄'; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and destid=2 and origid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and origid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and destid=1; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and origid=666; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and origid is NULL; -latch origid destid weight seq linkid -Warnings: -Warning 1210 Incorrect arguments to OQGRAPH latch -# Return all edges when latch is NULL -SELECT * FROM graph WHERE latch is NULL; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -NULL 1 3 1 NULL NULL -NULL 3 1 1 NULL NULL -NULL 3 4 1 NULL NULL -NULL 4 3 1 NULL NULL -NULL 5 6 1 NULL NULL -NULL 6 5 1 NULL NULL -SELECT * FROM graph WHERE latch is NULL and destid=2 and origid=1; -latch origid destid weight seq linkid -NULL 1 2 1 3 1 -NULL 1 2 1 2 3 -NULL 1 2 1 1 2 -SELECT * FROM graph WHERE latch is NULL and origid=1; -latch origid destid weight seq linkid -NULL 1 NULL 1 2 3 -NULL 1 NULL 1 1 2 -SELECT * FROM graph WHERE latch is NULL and destid=1; -latch origid destid weight seq linkid -NULL NULL 1 1 2 3 -NULL NULL 1 1 1 2 -SELECT * FROM graph WHERE latch is NULL and origid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch is NULL and origid is NULL; -latch origid destid weight seq linkid -NULL NULL NULL NULL NULL 1 -NULL NULL NULL NULL NULL 2 -NULL NULL NULL NULL NULL 3 -NULL NULL NULL NULL NULL 4 -NULL NULL NULL NULL NULL 5 -NULL NULL NULL NULL NULL 6 -INSERT INTO graph_base(from_id, to_id) VALUES (1,2); -ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY' -DELETE FROM graph_base; -SELECT * FROM graph; -latch origid destid weight seq linkid -FLUSH TABLES; -TRUNCATE TABLE graph_base; -SELECT * FROM graph; -latch origid destid weight seq linkid -DROP TABLE graph_base; -FLUSH TABLES; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=6; -ERROR 42S02: Table 'test.graph_base' doesn't exist -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/boundary_conditions.test b/mysql-test/suite/oqgraph/boundary_conditions.test deleted file mode 100644 index 869994aa208..00000000000 --- a/mysql-test/suite/oqgraph/boundary_conditions.test +++ /dev/null @@ -1,137 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -DROP TABLE IF EXISTS graph2; ---enable_warnings - -CREATE TABLE graph2 ( - 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='graph_base' ORIGID='from_id', DESTID='to_id'; -# Because the backing store graph_base doesnt exist yet, the select should fail ---error S42S02 -SELECT * FROM graph2 WHERE latch='dijkstras' AND origid=1 AND destid=6; -DROP TABLE graph2; - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); - ---echo # Expect no result, because of autocast -SELECT * FROM graph WHERE latch=0 ; -SELECT * FROM graph WHERE latch=0 and destid=2 and origid=1; -SELECT * FROM graph WHERE latch=0 and origid=1; -SELECT * FROM graph WHERE latch=0 and destid=1; -SELECT * FROM graph WHERE latch=0 and origid=666; -SELECT * FROM graph WHERE latch=0 and origid is NULL; -SELECT * FROM graph WHERE latch=1 ; -SELECT * FROM graph WHERE latch=1 and destid=2 and origid=1; -SELECT * FROM graph WHERE latch=1 and origid=1; -SELECT * FROM graph WHERE latch=1 and destid=1; -SELECT * FROM graph WHERE latch=1 and origid=666; -SELECT * FROM graph WHERE latch=1 and origid is NULL; -SELECT * FROM graph WHERE latch=2 ; -SELECT * FROM graph WHERE latch=2 and destid=2 and origid=1; -SELECT * FROM graph WHERE latch=2 and origid=1; -SELECT * FROM graph WHERE latch=2 and destid=1; -SELECT * FROM graph WHERE latch=2 and origid=666; -SELECT * FROM graph WHERE latch=2 and origid is NULL; - ---echo # Should this return an error? it seems we treat it as just another bogus latch -SELECT * FROM graph WHERE latch='ThisExceeds32Characters456789012'; ---echo # Expect no result, because of invalid latch -SELECT * FROM graph WHERE latch='bogus'; -SELECT * FROM graph WHERE latch='bogus' and destid=2 and origid=1; -SELECT * FROM graph WHERE latch='bogus' and origid=1; -SELECT * FROM graph WHERE latch='bogus' and destid=1; -SELECT * FROM graph WHERE latch='bogus' and origid=666; -SELECT * FROM graph WHERE latch='bogus' and origid is NULL; -#-- Note the next line couter-intuitively produces no warning -SELECT * FROM graph WHERE latch='666'; -SELECT * FROM graph WHERE latch='666' and destid=2 and origid=1; -SELECT * FROM graph WHERE latch='666' and origid=1; -SELECT * FROM graph WHERE latch='666' and destid=1; -SELECT * FROM graph WHERE latch='666' and origid=666; -#-- Note the next line couter-intuitively produces no warning -SELECT * FROM graph WHERE latch='666' and origid is NULL; -SELECT * FROM graph WHERE latch='-1'; -SELECT * FROM graph WHERE latch='-1' and destid=2 and origid=1; -SELECT * FROM graph WHERE latch='-1' and origid=1; -SELECT * FROM graph WHERE latch='-1' and destid=1; -SELECT * FROM graph WHERE latch='-1' and origid=666; -SELECT * FROM graph WHERE latch='-1' and origid is NULL; - ---echo # Make sure we dont crash if someone passed in a UTF string -#-- Note the next line couter-intuitively produces no warning -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄'; -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and destid=2 and origid=1; -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and origid=1; -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and destid=1; -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and origid=666; -#-- Note the next line couter-intuitively produces no warning -SELECT * FROM graph WHERE latch='Ω Ohms Tennis Ball 〄' and origid is NULL; - -#--echo # Expect no result, because of NULL latch -#-- FIXME - in v2 according to http://openquery.com/graph/doc NULL latch should -#-- FIXME - return same as select * from graph; -#--https://bugs.launchpad.net/oqgraph/+bug/1196021 ---echo # Return all edges when latch is NULL -SELECT * FROM graph WHERE latch is NULL; -SELECT * FROM graph WHERE latch is NULL and destid=2 and origid=1; -SELECT * FROM graph WHERE latch is NULL and origid=1; -SELECT * FROM graph WHERE latch is NULL and destid=1; -SELECT * FROM graph WHERE latch is NULL and origid=666; -SELECT * FROM graph WHERE latch is NULL and origid is NULL; - -#-- what happens if we have two links the same? primay key violation... ---error 1062 -INSERT INTO graph_base(from_id, to_id) VALUES (1,2); - -DELETE FROM graph_base; -#-- Uncomment the following after fixing https://bugs.launchpad.net/oqgraph/+bug/1195735 -SELECT * FROM graph; - -FLUSH TABLES; - -TRUNCATE TABLE graph_base; -#-- Uncomment the following after fixing https://bugs.launchpad.net/oqgraph/+bug/xxxxxxx - Causes the later select to not fail! -#-- For now dont report a separate bug as it may be a manifestation of https://bugs.launchpad.net/oqgraph/+bug/1195735 -SELECT * FROM graph; - -#-- Expect error if we pull the table out from under -DROP TABLE graph_base; -FLUSH TABLES; - ---error S42S02 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=6; - -DROP TABLE graph; - diff --git a/mysql-test/suite/oqgraph/create_attr.result b/mysql-test/suite/oqgraph/create_attr.result deleted file mode 100644 index 57b44c05770..00000000000 --- a/mysql-test/suite/oqgraph/create_attr.result +++ /dev/null @@ -1,127 +0,0 @@ -DROP TABLE IF EXISTS not_backing; -DROP TABLE IF EXISTS backing; -DROP TABLE IF EXISTS oqtable; -CREATE TABLE `not_backing` ( -id int(10) unsigned NOT NULL DEFAULT '0', -id2 int(10) unsigned NOT NULL DEFAULT '0', -info varchar(20) DEFAULT NULL, -KEY name (info) -) DEFAULT CHARSET=latin1; -CREATE TABLE backing ( -id int(10) unsigned NOT NULL DEFAULT '0', -id2 int(10) unsigned NOT NULL DEFAULT '0', -parent int(10) unsigned DEFAULT NULL, -weight real(10,4) NOT NULL DEFAULT 0.0, -info varchar(20) DEFAULT NULL, -not_id_type varchar(20) DEFAULT NULL, -not_weight_type varchar(20) DEFAULT NULL, -PRIMARY KEY (id), -KEY name (info) -) DEFAULT CHARSET=latin1; -CREATE TABLE oqtable ( 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; -# Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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, ORIGID='id', DESTID='id2'; -# Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='', ORIGID='id', DESTID='id2'; -# Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='', ORIGID='id'; -# Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='', DESTID='id2'; -# Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='bogus', ORIGID='id', DESTID='id2'; -# Expect: 'Table 'test.bogus' doesn't exist'' -DESCRIBE oqtable; -ERROR 42S02: Table 'test.bogus' doesn't exist -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='not_backing'; -# Expect 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='backing', DESTID='id2'; -# Expect 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='backing',ORIGID='', DESTID='id2'; -# Expect 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='backing',ORIGID='bogus', DESTID='id2'; -# Expect Invalid OQGRAPH backing store ('/oqtable'.origid attribute not set to a valid column of 'backing')' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('oqtable.origid' attribute not set to a valid column of 'backing')' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='backing',ORIGID='not_id_type', DESTID='id2'; -# Expect 'Column 'backing.not_id_type' is not a not-null integer type' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Column 'backing.not_id_type' (origid) is not a not-null integer type' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='backing',ORIGID='id'; -# Expect 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID=''; -# Expect 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='bogus'; -# Expect Invalid OQGRAPH backing store ('/oqtable'.destid attribute not set to a valid column of 'backing')' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('oqtable.destid' attribute not set to a valid column of 'backing')' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='not_id_type'; -# Expect 'Column 'backing.not_id_type' is not a not-null integer type' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Column 'backing.not_id_type' (destid) is not a not-null integer type or is a different type to origi' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='id'; -# Expect 'Invalid OQGRAPH backing store ('/oqtable'.destid attribute set to same column as origid attribute)' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('oqtable.destid' attribute set to same column as origid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT=''; -# Expect 'Invalid OQGRAPH backing store ('/oqtable'.weight attribute not set to a valid column of 'backing')' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('oqtable.weight' attribute not set to a valid column of 'backing')' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='bogus'; -# Expect 'Invalid OQGRAPH backing store ('/oqtable'.weight attribute not set to a valid column of 'backing')' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('oqtable.weight' attribute not set to a valid column of 'backing')' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='not_weight_type'; -# Expect 'Column 'backing.not_weight_type' is not a not-null real type' -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Column 'backing.not_weight_type' (weight) is not a not-null real type' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='weight'; -DESCRIBE oqtable; -Field Type Null Key Default Extra -latch varchar(32) YES MUL NULL -origid bigint(20) unsigned YES NULL -destid bigint(20) unsigned YES NULL -weight double YES NULL -seq bigint(20) unsigned YES NULL -linkid bigint(20) unsigned YES NULL -DROP TABLE IF EXISTS oqtable; -DROP TABLE IF EXISTS backing; -DROP TABLE IF EXISTS not_backing; diff --git a/mysql-test/suite/oqgraph/create_attr.test b/mysql-test/suite/oqgraph/create_attr.test deleted file mode 100644 index d681d601fae..00000000000 --- a/mysql-test/suite/oqgraph/create_attr.test +++ /dev/null @@ -1,220 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS not_backing; -DROP TABLE IF EXISTS backing; -DROP TABLE IF EXISTS oqtable; ---enable_warnings - - -CREATE TABLE `not_backing` ( - id int(10) unsigned NOT NULL DEFAULT '0', - id2 int(10) unsigned NOT NULL DEFAULT '0', - info varchar(20) DEFAULT NULL, - KEY name (info) -) DEFAULT CHARSET=latin1; - -CREATE TABLE backing ( - id int(10) unsigned NOT NULL DEFAULT '0', - id2 int(10) unsigned NOT NULL DEFAULT '0', - parent int(10) unsigned DEFAULT NULL, - weight real(10,4) NOT NULL DEFAULT 0.0, - info varchar(20) DEFAULT NULL, - not_id_type varchar(20) DEFAULT NULL, - not_weight_type varchar(20) DEFAULT NULL, - PRIMARY KEY (id), - KEY name (info) -) DEFAULT CHARSET=latin1; - - -# oqgraph v2 create table should fail (missing attributes) -CREATE TABLE oqtable ( 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; ---echo # Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' ---error 1296 -DESCRIBE oqtable; - - -# no table reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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, ORIGID='id', DESTID='id2'; ---echo # Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' ---error 1296 -DESCRIBE oqtable; - -# empty table reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='', ORIGID='id', DESTID='id2'; ---echo # Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' ---error 1296 -DESCRIBE oqtable; - -# empty table reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='', ORIGID='id'; ---echo # Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' ---error 1296 -DESCRIBE oqtable; - - -# empty table reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='', DESTID='id2'; ---echo # Expect: 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' ---error 1296 -DESCRIBE oqtable; - -# non-existent table reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='bogus', ORIGID='id', DESTID='id2'; ---echo # Expect: 'Table 'test.bogus' doesn't exist'' ---disable_warnings ---error 1146 -DESCRIBE oqtable; ---enable_warnings - -# Table exists but no orig or dest specified ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='not_backing'; ---echo # Expect 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' ---error 1296 -DESCRIBE oqtable; - -# missing origid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='backing', DESTID='id2'; ---echo # Expect 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' ---error 1296 -DESCRIBE oqtable; - -# empty origid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='backing',ORIGID='', DESTID='id2'; ---echo # Expect 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' ---error 1296 -DESCRIBE oqtable; - -# invalid origid reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='backing',ORIGID='bogus', DESTID='id2'; ---echo # Expect Invalid OQGRAPH backing store ('/oqtable'.origid attribute not set to a valid column of 'backing')' ---error 1296 -DESCRIBE oqtable; - -# wrong type origid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='backing',ORIGID='not_id_type', DESTID='id2'; ---echo # Expect 'Column 'backing.not_id_type' is not a not-null integer type' ---error 1296 -DESCRIBE oqtable; - -# missing destid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='backing',ORIGID='id'; ---echo # Expect 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' ---error 1296 -DESCRIBE oqtable; - -# empty destid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID=''; ---echo # Expect 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' ---error 1296 -DESCRIBE oqtable; - -# invalid destid reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='bogus'; ---echo # Expect Invalid OQGRAPH backing store ('/oqtable'.destid attribute not set to a valid column of 'backing')' ---error 1296 -DESCRIBE oqtable; - -# wrong type destid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='not_id_type'; ---echo # Expect 'Column 'backing.not_id_type' is not a not-null integer type' ---error 1296 -DESCRIBE oqtable; - -# same origid and destid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( 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='backing',ORIGID='id',DESTID='id'; ---echo # Expect 'Invalid OQGRAPH backing store ('/oqtable'.destid attribute set to same column as origid attribute)' ---error 1296 -DESCRIBE oqtable; - -# invalid weight reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT=''; ---echo # Expect 'Invalid OQGRAPH backing store ('/oqtable'.weight attribute not set to a valid column of 'backing')' ---error 1296 -DESCRIBE oqtable; - -# invalid weight reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='bogus'; ---echo # Expect 'Invalid OQGRAPH backing store ('/oqtable'.weight attribute not set to a valid column of 'backing')' ---error 1296 -DESCRIBE oqtable; - -# wrong type weight ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='not_weight_type'; ---echo # Expect 'Column 'backing.not_weight_type' is not a not-null real type' ---error 1296 -DESCRIBE oqtable; - -# all valid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch varchar(32) NULL 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='backing',ORIGID='id',DESTID='id2',WEIGHT='weight'; -DESCRIBE oqtable; - -#-- Expect an error if we attempt to use a view as the backing store -#-- 'VIEWs are not supported for an OQGRAPH backing store.' -#-- TODO - -#-- TODO - what happens if we make two tables with the same backing store? - -#-- TODO - what happens if data_table is a TEMPORARY table? - -# cleanup ---disable_warnings -DROP TABLE IF EXISTS oqtable; -DROP TABLE IF EXISTS backing; -DROP TABLE IF EXISTS not_backing; ---enable_warnings diff --git a/mysql-test/suite/oqgraph/create_attr_legacy.result b/mysql-test/suite/oqgraph/create_attr_legacy.result deleted file mode 100644 index 3af2359506d..00000000000 --- a/mysql-test/suite/oqgraph/create_attr_legacy.result +++ /dev/null @@ -1,150 +0,0 @@ -DROP TABLE IF EXISTS not_backing; -DROP TABLE IF EXISTS backing; -DROP TABLE IF EXISTS oqtable; -CREATE TABLE `not_backing` ( -id int(10) unsigned NOT NULL DEFAULT '0', -info varchar(20) DEFAULT NULL, -KEY name (info) -) DEFAULT CHARSET=latin1; -CREATE TABLE backing ( -id int(10) unsigned NOT NULL DEFAULT '0', -nullparent int(10) unsigned DEFAULT NULL, -parent int(10) unsigned DEFAULT 1 NOT NULL, -weight real(10,4) NOT NULL DEFAULT 0.0, -info varchar(20) DEFAULT NULL, -not_id_type varchar(20) DEFAULT NULL, -not_weight_type varchar(20) DEFAULT NULL, -PRIMARY KEY (id), -KEY name (info) -) DEFAULT CHARSET=latin1; -SET GLOBAL oqgraph_allow_create_integer_latch=true; -The next warnings 1287 are expected -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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=''; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty data_table attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='bogus'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='Ω Ohms Tennis Ball 〄'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='not_backing', ORIGID='id'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID=''; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty origid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='bogus'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='not_id_type'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID=''; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store (unspecified or empty destid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='bogus'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('oqtable.destid' attribute not set to a valid column of 'backing')' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='not_id_type'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Column 'backing.not_id_type' (destid) is not a not-null integer type or is a different type to origi' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='bogus',DESTID='id'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('oqtable.origid' attribute not set to a valid column of 'backing')' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='not_id_type',DESTID='id'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Column 'backing.not_id_type' (origid) is not a not-null integer type' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='id'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('oqtable.destid' attribute set to same column as origid attribute)' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='parent',WEIGHT='bogus'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('oqtable.weight' attribute not set to a valid column of 'backing')' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='parent',WEIGHT='not_weight_type'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Column 'backing.not_weight_type' (weight) is not a not-null real type' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='nullparent',DESTID='id',WEIGHT='weight'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Column 'backing.nullparent' (origid) is not a not-null integer type' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='nullparent',WEIGHT='weight'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -ERROR HY000: Got error -1 'Column 'backing.nullparent' (destid) is not a not-null integer type or is a different type to origid' from OQGRAPH -DROP TABLE IF EXISTS oqtable; -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='parent',WEIGHT='weight'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -DESCRIBE oqtable; -Field Type Null Key Default Extra -latch smallint(5) unsigned YES MUL NULL -origid bigint(20) unsigned YES NULL -destid bigint(20) unsigned YES NULL -weight double YES NULL -seq bigint(20) unsigned YES NULL -linkid bigint(20) unsigned YES NULL -DROP TABLE IF EXISTS oqtable; -DROP TABLE IF EXISTS backing; -DROP TABLE IF EXISTS not_backing; -SET GLOBAL oqgraph_allow_create_integer_latch=false; diff --git a/mysql-test/suite/oqgraph/create_attr_legacy.test b/mysql-test/suite/oqgraph/create_attr_legacy.test deleted file mode 100644 index ba1d9791367..00000000000 --- a/mysql-test/suite/oqgraph/create_attr_legacy.test +++ /dev/null @@ -1,202 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS not_backing; -DROP TABLE IF EXISTS backing; -DROP TABLE IF EXISTS oqtable; ---enable_warnings - - -CREATE TABLE `not_backing` ( - id int(10) unsigned NOT NULL DEFAULT '0', - info varchar(20) DEFAULT NULL, - KEY name (info) -) DEFAULT CHARSET=latin1; - -CREATE TABLE backing ( - id int(10) unsigned NOT NULL DEFAULT '0', - nullparent int(10) unsigned DEFAULT NULL, - parent int(10) unsigned DEFAULT 1 NOT NULL, - weight real(10,4) NOT NULL DEFAULT 0.0, - info varchar(20) DEFAULT NULL, - not_id_type varchar(20) DEFAULT NULL, - not_weight_type varchar(20) DEFAULT NULL, - PRIMARY KEY (id), - KEY name (info) -) DEFAULT CHARSET=latin1; - -# Here we enable scaffolding to let us create a deprecated table -# so we can check that the new code will still allow queries to be performed -# on a legacy database -# It should still generate a warning (1287) - but I dont know how to test for that -# -# latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future -# release. Please use 'latch VARCHAR(32) NULL' instead -# -SET GLOBAL oqgraph_allow_create_integer_latch=true; ---echo The next warnings 1287 are expected - - -# oqgraph v2 create table should fail (missing attributes) -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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; ---error 1296 -DESCRIBE oqtable; - -# attributes test -# empty table reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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=''; ---error 1296 -DESCRIBE oqtable; - -# non-existent table reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='bogus'; ---error 1296 -DESCRIBE oqtable; - -# UTF in table name, make sure it doesnt crash ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='Ω Ohms Tennis Ball 〄'; ---error 1296 -DESCRIBE oqtable; - -# Invalid backing table (backing table has no primary key) ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='not_backing', ORIGID='id'; ---error 1296 -DESCRIBE oqtable; - -# table with empty origid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID=''; ---error 1296 -DESCRIBE oqtable; - -# invalid origid reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='bogus'; ---error 1296 -DESCRIBE oqtable; - -# wrong type origid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='not_id_type'; ---error 1296 -DESCRIBE oqtable; - -# missing destid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id'; ---error 1296 -DESCRIBE oqtable; - -# empty destid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID=''; ---error 1296 -DESCRIBE oqtable; - -# invalid destid reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='bogus'; ---error 1296 -DESCRIBE oqtable; - -# wrong type destid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='not_id_type'; ---error 1296 -DESCRIBE oqtable; - -# invalid origid with valid destid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='bogus',DESTID='id'; ---error 1296 -DESCRIBE oqtable; - -# wrong type origid with valid destid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='not_id_type',DESTID='id'; ---error 1296 -DESCRIBE oqtable; - -# same origid and destid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='id'; ---error 1296 -DESCRIBE oqtable; - -# invalid weight reference ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='parent',WEIGHT='bogus'; ---error 1296 -DESCRIBE oqtable; - -# wrong type weight ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='parent',WEIGHT='not_weight_type'; ---error 1296 -DESCRIBE oqtable; - -# NULLABLE ORIGID ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='nullparent',DESTID='id',WEIGHT='weight'; ---error 1296 -DESCRIBE oqtable; - -# NULLABLE DESTID ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='nullparent',WEIGHT='weight'; ---error 1296 -DESCRIBE oqtable; - -# all valid ---disable_warnings -DROP TABLE IF EXISTS oqtable; ---enable_warnings -CREATE TABLE oqtable ( latch SMALLINT UNSIGNED 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='backing',ORIGID='id',DESTID='parent',WEIGHT='weight'; -DESCRIBE oqtable; - -# cleanup ---disable_warnings -DROP TABLE IF EXISTS oqtable; -DROP TABLE IF EXISTS backing; -DROP TABLE IF EXISTS not_backing; ---enable_warnings -SET GLOBAL oqgraph_allow_create_integer_latch=false; - diff --git a/mysql-test/suite/oqgraph/invalid_operations.result b/mysql-test/suite/oqgraph/invalid_operations.result deleted file mode 100644 index 046c468b768..00000000000 --- a/mysql-test/suite/oqgraph/invalid_operations.result +++ /dev/null @@ -1,31 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,2), (2,3); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -insert into graph values (NULL, 1, 2, 3.0, NULL, NULL); -ERROR HY000: Table 'graph' is read only -delete from graph; -ERROR HY000: Table 'graph' is read only -truncate graph; -ERROR HY000: Table 'graph' is read only -update graph set origid=123; -ERROR HY000: Table 'graph' is read only -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/invalid_operations.test b/mysql-test/suite/oqgraph/invalid_operations.test deleted file mode 100644 index 8f79b23ed43..00000000000 --- a/mysql-test/suite/oqgraph/invalid_operations.test +++ /dev/null @@ -1,48 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,2), (2,3); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); - -# -- check readonly'ness ---error 1036 -insert into graph values (NULL, 1, 2, 3.0, NULL, NULL); - ---error 1036 -delete from graph; - ---error 1036 -truncate graph; - -# This was hitting bug https://bugs.launchpad.net/oqgraph/+bug/1233113 ---error 1036 -update graph set origid=123; - - -DROP TABLE graph_base; -DROP TABLE graph; - diff --git a/mysql-test/suite/oqgraph/isnull.result b/mysql-test/suite/oqgraph/isnull.result deleted file mode 100644 index 38ebf12413c..00000000000 --- a/mysql-test/suite/oqgraph/isnull.result +++ /dev/null @@ -1,42 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -DROP TABLE IF EXISTS graph2; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); -select * from graph where latch is null; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -NULL 1 3 1 NULL NULL -NULL 3 1 1 NULL NULL -NULL 3 4 1 NULL NULL -NULL 4 3 1 NULL NULL -NULL 5 6 1 NULL NULL -NULL 6 5 1 NULL NULL -select * from graph where latch is null and origid=1; -latch origid destid weight seq linkid -NULL 1 NULL 1 2 3 -NULL 1 NULL 1 1 2 -select * from graph where latch is null and destid=2; -latch origid destid weight seq linkid -NULL NULL 2 1 1 1 -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/isnull.test b/mysql-test/suite/oqgraph/isnull.test deleted file mode 100644 index 93105887834..00000000000 --- a/mysql-test/suite/oqgraph/isnull.test +++ /dev/null @@ -1,39 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -DROP TABLE IF EXISTS graph2; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); - -select * from graph where latch is null; -select * from graph where latch is null and origid=1; -select * from graph where latch is null and destid=2; - -DROP TABLE graph_base; -DROP TABLE graph; - diff --git a/mysql-test/suite/oqgraph/legacy_upgrade.result b/mysql-test/suite/oqgraph/legacy_upgrade.result deleted file mode 100644 index 0b437217cb6..00000000000 --- a/mysql-test/suite/oqgraph/legacy_upgrade.result +++ /dev/null @@ -1,99 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -The next error 140 + 1005 is expected -CREATE TABLE graph ( -latch SMALLINT UNSIGNED 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='graph_base' ORIGID='from_id', DESTID='to_id'; -ERROR HY000: Can't create table `test`.`graph` (errno: 140 "Wrong create options") -SET GLOBAL oqgraph_allow_create_integer_latch=true; -The next warning 1287 is expected -CREATE TABLE graph ( -latch SMALLINT UNSIGNED 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='graph_base' ORIGID='from_id', DESTID='to_id'; -Warnings: -Warning 1287 'latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future release. Please use 'latch VARCHAR(32) NULL' instead -SET GLOBAL oqgraph_allow_create_integer_latch=false; -The next error 140 + 1005 is expected -CREATE TABLE graph_again ( -latch SMALLINT UNSIGNED 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='graph_base' ORIGID='from_id', DESTID='to_id'; -ERROR HY000: Can't create table `test`.`graph_again` (errno: 140 "Wrong create options") -# Populating base table -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); -# Exercising latch==2 -SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND weight = 1; -latch origid destid weight seq linkid -2 1 NULL 1 3 3 -2 1 NULL 1 2 2 -SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND weight = 2; -latch origid destid weight seq linkid -2 1 NULL 2 4 4 -SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND (weight = 1 OR weight = 2); -latch origid destid weight seq linkid -2 1 NULL 2 4 4 -2 1 NULL 1 3 3 -2 1 NULL 1 2 2 -# Exercising latch==1 -SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=6; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=4; -latch origid destid weight seq linkid -1 1 4 NULL 0 1 -1 1 4 1 1 3 -1 1 4 1 2 4 -SELECT * FROM graph WHERE latch=1 AND origid=4 AND destid=1; -latch origid destid weight seq linkid -1 4 1 NULL 0 4 -1 4 1 1 1 3 -1 4 1 1 2 1 -SELECT * FROM graph WHERE latch=0 and destid=2 and origid=1; -latch origid destid weight seq linkid -0 1 2 1 3 1 -0 1 2 1 2 3 -0 1 2 1 1 2 -# Adding new row to base table -INSERT INTO graph_base (from_id,to_id) VALUES (4,6); -# Deleting rows from base table -DELETE FROM graph_base WHERE from_id=5; -DELETE FROM graph_base WHERE from_id=3 AND to_id=5; -# Execising latch==1 on new data -SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=6; -latch origid destid weight seq linkid -1 1 6 NULL 0 1 -1 1 6 1 1 3 -1 1 6 1 2 4 -1 1 6 1 3 6 -SELECT * FROM graph WHERE latch=1 AND origid=6 AND destid=1; -latch origid destid weight seq linkid -DROP TABLE IF EXISTS graph; -DROP TABLE IF EXISTS graph_base; diff --git a/mysql-test/suite/oqgraph/legacy_upgrade.test b/mysql-test/suite/oqgraph/legacy_upgrade.test deleted file mode 100644 index f7fc79340ce..00000000000 --- a/mysql-test/suite/oqgraph/legacy_upgrade.test +++ /dev/null @@ -1,106 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - -# Backwards compatibility test -# First we ensure the scaffolding is disabled (default situation) -# and check we cant create a table with an integer latch -# Assume this is the default, so dont explicity set false yet: -# SET GLOBAL oqgraph_allow_create_integer_latch=false; ---echo The next error 140 + 1005 is expected ---error 140 ---error 1005 -CREATE TABLE graph ( - latch SMALLINT UNSIGNED 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='graph_base' ORIGID='from_id', DESTID='to_id'; - -# Here we enable scaffolding to let us create a deprecated table -# so we can check that the new code will still allow queries to be performed -# on a legacy database -# It should still generate a warning (1287) - but I dont know how to test for that -# -# latch SMALLINT UNSIGNED NULL' is deprecated and will be removed in a future -# release. Please use 'latch VARCHAR(32) NULL' instead -# -SET GLOBAL oqgraph_allow_create_integer_latch=true; ---echo The next warning 1287 is expected -CREATE TABLE graph ( - latch SMALLINT UNSIGNED 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='graph_base' ORIGID='from_id', DESTID='to_id'; - -# Prevent further tables being create this way again -# and make sure the set is effective ... -SET GLOBAL oqgraph_allow_create_integer_latch=false; ---echo The next error 140 + 1005 is expected ---error 140 ---error 1005 -CREATE TABLE graph_again ( - latch SMALLINT UNSIGNED 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='graph_base' ORIGID='from_id', DESTID='to_id'; - -# Regression test expected v2 behaviour in this situation - ---echo # Populating base table -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); - ---echo # Exercising latch==2 -SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND weight = 1; -SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND weight = 2; -SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND (weight = 1 OR weight = 2); ---echo # Exercising latch==1 -SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=6; -SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=4; -SELECT * FROM graph WHERE latch=1 AND origid=4 AND destid=1; - -SELECT * FROM graph WHERE latch=0 and destid=2 and origid=1; - - ---echo # Adding new row to base table -INSERT INTO graph_base (from_id,to_id) VALUES (4,6); - ---echo # Deleting rows from base table -DELETE FROM graph_base WHERE from_id=5; -DELETE FROM graph_base WHERE from_id=3 AND to_id=5; - ---echo # Execising latch==1 on new data -SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=6; - -SELECT * FROM graph WHERE latch=1 AND origid=6 AND destid=1; - -# FIXME - if the following DROPs are missing then mysql will segfault on exit -# indicating an ordering dependency on destruction somewhere... -DROP TABLE IF EXISTS graph; -DROP TABLE IF EXISTS graph_base; - diff --git a/mysql-test/suite/oqgraph/regression_1133093.result b/mysql-test/suite/oqgraph/regression_1133093.result deleted file mode 100644 index e5a99d39e9a..00000000000 --- a/mysql-test/suite/oqgraph/regression_1133093.result +++ /dev/null @@ -1,44 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -another_id INT UNSIGNED NOT NULL DEFAULT 1, -w DOUBLE NOT NULL DEFAULT 1, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id', WEIGHT='w'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,4), (4,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -SELECT * from graph; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -NULL 1 3 1 NULL NULL -NULL 3 1 1 NULL NULL -NULL 1 4 1 NULL NULL -NULL 4 1 1 NULL NULL -NULL 3 4 1 NULL NULL -NULL 4 3 1 NULL NULL -SELECT * FROM graph WHERE latch='1' and destid=2 and origid=1; -latch origid destid weight seq linkid -1 1 2 NULL 0 1 -1 1 2 1 1 2 -SELECT * FROM graph WHERE latch='1' and destid=2 and origid=1 order by seq; -latch origid destid weight seq linkid -1 1 2 NULL 0 1 -1 1 2 1 1 2 -DROP TABLE graph; -DROP TABLE graph_base; diff --git a/mysql-test/suite/oqgraph/regression_1133093.test b/mysql-test/suite/oqgraph/regression_1133093.test deleted file mode 100644 index c3a9a996136..00000000000 --- a/mysql-test/suite/oqgraph/regression_1133093.test +++ /dev/null @@ -1,46 +0,0 @@ -# Regression test for https://bugs.launchpad.net/oqgraph/+bug/1133093 -# Reproduce bug where order by seq crashes ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - another_id INT UNSIGNED NOT NULL DEFAULT 1, - w DOUBLE NOT NULL DEFAULT 1, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id', WEIGHT='w'; - -# -- do some stuff - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,4), (4,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); - -SELECT * from graph; -SELECT * FROM graph WHERE latch='1' and destid=2 and origid=1; -SELECT * FROM graph WHERE latch='1' and destid=2 and origid=1 order by seq; - -DROP TABLE graph; -DROP TABLE graph_base; - - -# Probably a separate issue: if the test is exited without dropping the tables at all -# then there is a memory leak reported diff --git a/mysql-test/suite/oqgraph/regression_1134355.result b/mysql-test/suite/oqgraph/regression_1134355.result deleted file mode 100644 index 015b42ab9bb..00000000000 --- a/mysql-test/suite/oqgraph/regression_1134355.result +++ /dev/null @@ -1,46 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -another_id INT UNSIGNED NOT NULL DEFAULT 1, -w DOUBLE NOT NULL DEFAULT 1, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id', WEIGHT='w'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,4), (4,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -SELECT * from graph; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -NULL 1 3 1 NULL NULL -NULL 3 1 1 NULL NULL -NULL 1 4 1 NULL NULL -NULL 4 1 1 NULL NULL -NULL 3 4 1 NULL NULL -NULL 4 3 1 NULL NULL -SELECT * FROM graph WHERE destid=2 and origid=1; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -alter table graph ORIGID = 'another_id'; -ERROR HY000: Storage engine OQGRAPH of the table `test`.`graph` doesn't have this option -alter table graph ORIGID = 'something_else'; -ERROR HY000: Storage engine OQGRAPH of the table `test`.`graph` doesn't have this option -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/regression_1134355.test b/mysql-test/suite/oqgraph/regression_1134355.test deleted file mode 100644 index ca9c7e36bc8..00000000000 --- a/mysql-test/suite/oqgraph/regression_1134355.test +++ /dev/null @@ -1,59 +0,0 @@ -# Regression test for https://bugs.launchpad.net/oqgraph/+bug/1134355 -#--reproduce bug where renaming a column in the graph crashes instead of returning an error ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - another_id INT UNSIGNED NOT NULL DEFAULT 1, - w DOUBLE NOT NULL DEFAULT 1, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id', WEIGHT='w'; - -# -- do some stuff - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,4), (4,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); - -SELECT * from graph; -SELECT * FROM graph WHERE destid=2 and origid=1; - -# We cant do this anyway because of read onlyness of table.... 1036 == read only -# In any case I changed the flags to make alter unsupported; later we can try and work out why the core doesnt help us clean up properly -# --error 1036 ---error 1031 -alter table graph ORIGID = 'another_id'; - -# But we need that to hold even in an invalid situation! -# -- bug was: the following alter table would crash, instead of returning error 1296 -# -- currently following may not crash, but does with the previous error 1036 causing statement present -# 'attribute not set to a valid column of 'xxx' - note currently truncating to graph_b instead of graph_base for some reason... -#--error 1296 ---error 1031 -alter table graph ORIGID = 'something_else'; - -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; -DROP TABLE graph_base; -DROP TABLE graph; - diff --git a/mysql-test/suite/oqgraph/regression_1195735.result b/mysql-test/suite/oqgraph/regression_1195735.result deleted file mode 100644 index 67aa885d3d4..00000000000 --- a/mysql-test/suite/oqgraph/regression_1195735.result +++ /dev/null @@ -1,32 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -One select of any clauses at all on graph here caused a hang on the select after the DELETE FROM -SELECT * FROM graph WHERE destid=2 and origid=1; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -DELETE FROM graph_base; -SELECT * from graph; -latch origid destid weight seq linkid -FLUSH TABLES; -TRUNCATE TABLE graph_base; -DROP TABLE graph_base; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=6; -ERROR 42S02: Table 'test.graph_base' doesn't exist -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/regression_1195735.test b/mysql-test/suite/oqgraph/regression_1195735.test deleted file mode 100644 index 12ab7ecb9ea..00000000000 --- a/mysql-test/suite/oqgraph/regression_1195735.test +++ /dev/null @@ -1,44 +0,0 @@ -# Regression test for https://bugs.launchpad.net/oqgraph/+bug/1195735 -#--reproduce bug where select * from graph after delete from graph_base hangs the server ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); - ---echo One select of any clauses at all on graph here caused a hang on the select after the DELETE FROM -#-- even this if it is the only one - but it doesnt hang here ... SELECT * FROM graph; -SELECT * FROM graph WHERE destid=2 and origid=1; - -DELETE FROM graph_base; -#-- Bug 1195735 hangs on the next line -SELECT * from graph; -FLUSH TABLES; -TRUNCATE TABLE graph_base; -DROP TABLE graph_base; ---error S42S02 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=6; -DROP TABLE graph; - diff --git a/mysql-test/suite/oqgraph/regression_1196020.result b/mysql-test/suite/oqgraph/regression_1196020.result deleted file mode 100644 index 3ffc5a0ecb6..00000000000 --- a/mysql-test/suite/oqgraph/regression_1196020.result +++ /dev/null @@ -1,68 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '1' AND origid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '1' AND destid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 666 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 666 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 666 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '1' AND origid = 666 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 666 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = 666 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 666 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '1' AND destid = 666 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '' AND origid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '0' AND origid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch is NULL AND origid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '' AND destid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '0' AND destid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch is NULL AND destid = 666; -latch origid destid weight seq linkid -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/regression_1196020.test b/mysql-test/suite/oqgraph/regression_1196020.test deleted file mode 100644 index a4df1790b4d..00000000000 --- a/mysql-test/suite/oqgraph/regression_1196020.test +++ /dev/null @@ -1,71 +0,0 @@ -# Regression test for https://bugs.launchpad.net/oqgraph/+bug/1196020 -#-- bug where select blah with origid = X where X does not exist, returns a row -#-- bug where select blah with destid = X where X does not exist, returns a row ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); - -# All the following should return no result because no vertex 666 exists in the graph - -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 666; -SELECT * FROM graph WHERE latch = '2' AND origid = 666; -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 666; -SELECT * FROM graph WHERE latch = '1' AND origid = 666; - -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 666; -SELECT * FROM graph WHERE latch = '2' AND destid = 666; -SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 666; -SELECT * FROM graph WHERE latch = '1' AND destid = 666; - -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 666 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 666 and weight = 1; -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 666 and weight = 1; -SELECT * FROM graph WHERE latch = '1' AND origid = 666 and weight = 1; - -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 666 and weight = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 666 and weight = 1; -SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 666 and weight = 1; -SELECT * FROM graph WHERE latch = '1' AND destid = 666 and weight = 1; - -# Sanity check for no-search -SELECT * FROM graph WHERE latch = '' AND origid = 666; -SELECT * FROM graph WHERE latch = '0' AND origid = 666; -SELECT * FROM graph WHERE latch is NULL AND origid = 666; - -SELECT * FROM graph WHERE latch = '' AND destid = 666; -SELECT * FROM graph WHERE latch = '0' AND destid = 666; -SELECT * FROM graph WHERE latch is NULL AND destid = 666; - - - -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; - -DROP TABLE graph_base; -DROP TABLE graph; - diff --git a/mysql-test/suite/oqgraph/regression_1196027.result b/mysql-test/suite/oqgraph/regression_1196027.result deleted file mode 100644 index 6c42374d992..00000000000 --- a/mysql-test/suite/oqgraph/regression_1196027.result +++ /dev/null @@ -1,56 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1; -latch origid destid weight seq linkid -breadth_first NULL 1 1 2 2 -breadth_first NULL 1 0 1 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2; -latch origid destid weight seq linkid -breadth_first NULL 2 1 2 1 -breadth_first NULL 2 0 1 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1; -latch origid destid weight seq linkid -breadth_first 1 NULL 1 2 2 -breadth_first 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2; -latch origid destid weight seq linkid -breadth_first 2 NULL 1 2 1 -breadth_first 2 NULL 0 1 2 -SELECT * FROM graph WHERE latch = '2' AND destid = 1; -latch origid destid weight seq linkid -2 NULL 1 1 2 2 -2 NULL 1 0 1 1 -SELECT * FROM graph WHERE latch = '2' AND destid = 2; -latch origid destid weight seq linkid -2 NULL 2 1 2 1 -2 NULL 2 0 1 2 -SELECT * FROM graph WHERE latch = '2' AND origid = 1; -latch origid destid weight seq linkid -2 1 NULL 1 2 2 -2 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 2; -latch origid destid weight seq linkid -2 2 NULL 1 2 1 -2 2 NULL 0 1 2 -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/regression_1196027.test b/mysql-test/suite/oqgraph/regression_1196027.test deleted file mode 100644 index 5e7017bd599..00000000000 --- a/mysql-test/suite/oqgraph/regression_1196027.test +++ /dev/null @@ -1,51 +0,0 @@ -# Regression test for https://bugs.launchpad.net/oqgraph/+bug/1196027 -#-- These were returning NULL which is incorrect -#-- https://bugs.launchpad.net/oqgraph/+bug/1196027 ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); - -# All the following should return no result because no vertex 666 exists in the graph - -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2; - -SELECT * FROM graph WHERE latch = '2' AND destid = 1; -SELECT * FROM graph WHERE latch = '2' AND destid = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 2; - - -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; - -DROP TABLE graph_base; -DROP TABLE graph; - diff --git a/mysql-test/suite/oqgraph/regression_1196036.result b/mysql-test/suite/oqgraph/regression_1196036.result deleted file mode 100644 index 45bbccfa87e..00000000000 --- a/mysql-test/suite/oqgraph/regression_1196036.result +++ /dev/null @@ -1,103 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -weight FLOAT NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id', WEIGHT='weight'; -INSERT INTO graph_base(from_id, to_id, weight) VALUES (1,2,16), (2,1,16); -INSERT INTO graph_base(from_id, to_id, weight) VALUES (2,3,256), (3,2,256); -INSERT INTO graph_base(from_id, to_id, weight) VALUES (3,4,65536), (4,3,65536); -INSERT INTO graph_base(from_id, to_id, weight) VALUES (2,4,768); -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1; -latch origid destid weight seq linkid -dijkstras 1 NULL 784 4 4 -dijkstras 1 NULL 272 3 3 -dijkstras 1 NULL 16 2 2 -dijkstras 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2; -latch origid destid weight seq linkid -dijkstras 2 NULL 768 4 4 -dijkstras 2 NULL 256 3 3 -dijkstras 2 NULL 16 2 1 -dijkstras 2 NULL 0 1 2 -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3; -latch origid destid weight seq linkid -dijkstras 3 NULL 1024 4 4 -dijkstras 3 NULL 272 3 1 -dijkstras 3 NULL 256 2 2 -dijkstras 3 NULL 0 1 3 -SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 1; -latch origid destid weight seq linkid -dijkstras NULL 1 784 4 4 -dijkstras NULL 1 272 3 3 -dijkstras NULL 1 16 2 2 -dijkstras NULL 1 0 1 1 -SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 2; -latch origid destid weight seq linkid -dijkstras NULL 2 768 4 4 -dijkstras NULL 2 256 3 3 -dijkstras NULL 2 16 2 1 -dijkstras NULL 2 0 1 2 -SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 3; -latch origid destid weight seq linkid -dijkstras NULL 3 1024 4 4 -dijkstras NULL 3 272 3 1 -dijkstras NULL 3 256 2 2 -dijkstras NULL 3 0 1 3 -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and destid=3; -latch origid destid weight seq linkid -dijkstras 1 3 NULL 0 1 -dijkstras 1 3 16 1 2 -dijkstras 1 3 256 2 3 -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and destid=4; -latch origid destid weight seq linkid -dijkstras 1 4 NULL 0 1 -dijkstras 1 4 16 1 2 -dijkstras 1 4 768 2 4 -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=16; -latch origid destid weight seq linkid -dijkstras 1 NULL 16 2 2 -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=16; -latch origid destid weight seq linkid -dijkstras 2 NULL 16 2 1 -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=16; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=784; -latch origid destid weight seq linkid -dijkstras 1 NULL 784 4 4 -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=784; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=784; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=256; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=256; -latch origid destid weight seq linkid -dijkstras 2 NULL 256 3 3 -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=256; -latch origid destid weight seq linkid -dijkstras 3 NULL 256 2 2 -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/regression_1196036.test b/mysql-test/suite/oqgraph/regression_1196036.test deleted file mode 100644 index a95a1c6d841..00000000000 --- a/mysql-test/suite/oqgraph/regression_1196036.test +++ /dev/null @@ -1,68 +0,0 @@ -# Regression test for https://bugs.launchpad.net/oqgraph/+bug/1196036 -#-- bug with Djikstras algorithm - find reachable vertices (origid=X) returns weight=0 instead of weight=count of hops ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - weight FLOAT NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id', WEIGHT='weight'; - - -INSERT INTO graph_base(from_id, to_id, weight) VALUES (1,2,16), (2,1,16); -INSERT INTO graph_base(from_id, to_id, weight) VALUES (2,3,256), (3,2,256); -INSERT INTO graph_base(from_id, to_id, weight) VALUES (3,4,65536), (4,3,65536); -INSERT INTO graph_base(from_id, to_id, weight) VALUES (2,4,768); - -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1; -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2; -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3; - -SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 1; -SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 2; -SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 3; - -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and destid=3; -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and destid=4; - -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=1; # <-- should return nothing -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=1; # <-- should return nothing -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=1; # <-- should return nothing - -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=16; -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=16; -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=16; # <-- should return nothing - -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=784; -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=784; # <-- should return nothing -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=784; # <-- should return nothing - -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=256; # <-- should return nothing -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=256; -SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=256; - -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; - -DROP TABLE graph_base; -DROP TABLE graph; - diff --git a/mysql-test/suite/oqgraph/regression_1213120.result b/mysql-test/suite/oqgraph/regression_1213120.result deleted file mode 100644 index b6cd53ab673..00000000000 --- a/mysql-test/suite/oqgraph/regression_1213120.result +++ /dev/null @@ -1,1348 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -DROP TABLE IF EXISTS graph2; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); -INSERT INTO graph_base(from_id, to_id) VALUES (5,7); -INSERT INTO graph_base(from_id, to_id) VALUES (9,9); -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -INSERT INTO graph_base(from_id, to_id) VALUES (11,12); -INSERT INTO graph_base(from_id, to_id) VALUES (12,10); -# Return all edges -SELECT * FROM graph; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -NULL 1 3 1 NULL NULL -NULL 3 1 1 NULL NULL -NULL 3 4 1 NULL NULL -NULL 4 3 1 NULL NULL -NULL 5 6 1 NULL NULL -NULL 6 5 1 NULL NULL -NULL 5 7 1 NULL NULL -NULL 9 9 1 NULL NULL -NULL 10 11 1 NULL NULL -NULL 11 12 1 NULL NULL -NULL 12 10 1 NULL NULL -# Currently count should be 13 -SELECT count(*) FROM graph; -count(*) -13 -SELECT count(*) FROM graph_base; -count(*) -13 -# Return all edges when latch is NULL - this is different to latch='' and same as no where clause -SELECT * FROM graph where latch is NULL; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -NULL 1 3 1 NULL NULL -NULL 3 1 1 NULL NULL -NULL 3 4 1 NULL NULL -NULL 4 3 1 NULL NULL -NULL 5 6 1 NULL NULL -NULL 6 5 1 NULL NULL -NULL 5 7 1 NULL NULL -NULL 9 9 1 NULL NULL -NULL 10 11 1 NULL NULL -NULL 11 12 1 NULL NULL -NULL 12 10 1 NULL NULL -# Return all vertices, and subsets of vertices -SELECT * FROM graph where latch=''; -latch origid destid weight seq linkid - NULL NULL NULL NULL 1 - NULL NULL NULL NULL 2 - NULL NULL NULL NULL 3 - NULL NULL NULL NULL 4 - NULL NULL NULL NULL 5 - NULL NULL NULL NULL 6 - NULL NULL NULL NULL 7 - NULL NULL NULL NULL 9 - NULL NULL NULL NULL 10 - NULL NULL NULL NULL 11 - NULL NULL NULL NULL 12 -SELECT * FROM graph where latch='0'; -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 1 -0 NULL NULL NULL NULL 2 -0 NULL NULL NULL NULL 3 -0 NULL NULL NULL NULL 4 -0 NULL NULL NULL NULL 5 -0 NULL NULL NULL NULL 6 -0 NULL NULL NULL NULL 7 -0 NULL NULL NULL NULL 9 -0 NULL NULL NULL NULL 10 -0 NULL NULL NULL NULL 11 -0 NULL NULL NULL NULL 12 -# Currently count should be 11 -SELECT count(*) FROM graph where latch=''; -count(*) -11 -SELECT * FROM graph where latch='' and linkid = 2; -latch origid destid weight seq linkid - NULL NULL NULL NULL 2 -SELECT * FROM graph where latch='' and (linkid > 2 and linkid < 6); -latch origid destid weight seq linkid - NULL NULL NULL NULL 3 - NULL NULL NULL NULL 4 - NULL NULL NULL NULL 5 -SELECT * FROM graph where latch='' and linkid = NULL; -latch origid destid weight seq linkid -SELECT * FROM graph where latch='' and linkid = 666; -latch origid destid weight seq linkid -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 1; -from to -1 3 -1 2 -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 2; -from to -2 1 -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 4; -from to -4 3 -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 9; -from to -9 9 -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 10; -from to -10 11 -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = NULL; -from to -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 666; -from to -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 1; -from to -3 1 -2 1 -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 2; -from to -1 2 -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 4; -from to -3 4 -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 9; -from to -9 9 -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 10; -from to -12 10 -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = NULL; -from to -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 666; -from to -SELECT * FROM graph where latch='0'; -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 1 -0 NULL NULL NULL NULL 2 -0 NULL NULL NULL NULL 3 -0 NULL NULL NULL NULL 4 -0 NULL NULL NULL NULL 5 -0 NULL NULL NULL NULL 6 -0 NULL NULL NULL NULL 7 -0 NULL NULL NULL NULL 9 -0 NULL NULL NULL NULL 10 -0 NULL NULL NULL NULL 11 -0 NULL NULL NULL NULL 12 -SELECT count(*) FROM graph where latch='0'; -count(*) -11 -SELECT * FROM graph where latch='0' and linkid = 2; -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 2 -SELECT * FROM graph where latch='0' and (linkid > 2 and linkid < 6); -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 3 -0 NULL NULL NULL NULL 4 -0 NULL NULL NULL NULL 5 -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 1; -from to -1 3 -1 2 -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 2; -from to -2 1 -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 4; -from to -4 3 -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 9; -from to -9 9 -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 10; -from to -10 11 -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 1; -from to -3 1 -2 1 -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 2; -from to -1 2 -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 4; -from to -3 4 -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 9; -from to -9 9 -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 10; -from to -12 10 -# Breadth-first search tests -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1; -latch origid destid weight seq linkid -breadth_first 1 NULL 2 4 4 -breadth_first 1 NULL 1 3 3 -breadth_first 1 NULL 1 2 2 -breadth_first 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2; -latch origid destid weight seq linkid -breadth_first 2 NULL 3 4 4 -breadth_first 2 NULL 2 3 3 -breadth_first 2 NULL 1 2 1 -breadth_first 2 NULL 0 1 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3; -latch origid destid weight seq linkid -breadth_first 3 NULL 2 4 2 -breadth_first 3 NULL 1 3 4 -breadth_first 3 NULL 1 2 1 -breadth_first 3 NULL 0 1 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4; -latch origid destid weight seq linkid -breadth_first 4 NULL 3 4 2 -breadth_first 4 NULL 2 3 1 -breadth_first 4 NULL 1 2 3 -breadth_first 4 NULL 0 1 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5; -latch origid destid weight seq linkid -breadth_first 5 NULL 1 3 7 -breadth_first 5 NULL 1 2 6 -breadth_first 5 NULL 0 1 5 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6; -latch origid destid weight seq linkid -breadth_first 6 NULL 2 3 7 -breadth_first 6 NULL 1 2 5 -breadth_first 6 NULL 0 1 6 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7; -latch origid destid weight seq linkid -breadth_first 7 NULL 0 1 7 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9; -latch origid destid weight seq linkid -breadth_first 9 NULL 0 1 9 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10; -latch origid destid weight seq linkid -breadth_first 10 NULL 2 3 12 -breadth_first 10 NULL 1 2 11 -breadth_first 10 NULL 0 1 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11; -latch origid destid weight seq linkid -breadth_first 11 NULL 2 3 10 -breadth_first 11 NULL 1 2 12 -breadth_first 11 NULL 0 1 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12; -latch origid destid weight seq linkid -breadth_first 12 NULL 2 3 11 -breadth_first 12 NULL 1 2 10 -breadth_first 12 NULL 0 1 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 1 NULL 1 3 3 -breadth_first 1 NULL 1 2 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 2 NULL 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 3 NULL 1 3 4 -breadth_first 3 NULL 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 4 NULL 1 2 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 5 NULL 1 3 7 -breadth_first 5 NULL 1 2 6 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 6 NULL 1 2 5 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 10 NULL 1 2 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 11 NULL 1 2 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 1; -latch origid destid weight seq linkid -breadth_first 12 NULL 1 2 10 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 1; -count(*) -1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 1 NULL 2 4 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 2 NULL 2 3 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 3 NULL 2 4 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 4 NULL 2 3 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 6 NULL 2 3 7 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 10 NULL 2 3 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 11 NULL 2 3 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 2; -latch origid destid weight seq linkid -breadth_first 12 NULL 2 3 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 3; -latch origid destid weight seq linkid -breadth_first 2 NULL 3 4 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 3; -latch origid destid weight seq linkid -breadth_first 4 NULL 3 4 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 1 NULL 2 4 4 -breadth_first 1 NULL 1 3 3 -breadth_first 1 NULL 1 2 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 2 NULL 2 3 3 -breadth_first 2 NULL 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 3 NULL 2 4 2 -breadth_first 3 NULL 1 3 4 -breadth_first 3 NULL 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 4 NULL 2 3 1 -breadth_first 4 NULL 1 2 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 5 NULL 1 3 7 -breadth_first 5 NULL 1 2 6 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 6 NULL 2 3 7 -breadth_first 6 NULL 1 2 5 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 10 NULL 2 3 12 -breadth_first 10 NULL 1 2 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 11 NULL 2 3 10 -breadth_first 11 NULL 1 2 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -breadth_first 12 NULL 2 3 11 -breadth_first 12 NULL 1 2 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1; -latch origid destid weight seq linkid -breadth_first NULL 1 2 4 4 -breadth_first NULL 1 1 3 3 -breadth_first NULL 1 1 2 2 -breadth_first NULL 1 0 1 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2; -latch origid destid weight seq linkid -breadth_first NULL 2 3 4 4 -breadth_first NULL 2 2 3 3 -breadth_first NULL 2 1 2 1 -breadth_first NULL 2 0 1 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3; -latch origid destid weight seq linkid -breadth_first NULL 3 2 4 2 -breadth_first NULL 3 1 3 4 -breadth_first NULL 3 1 2 1 -breadth_first NULL 3 0 1 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4; -latch origid destid weight seq linkid -breadth_first NULL 4 3 4 2 -breadth_first NULL 4 2 3 1 -breadth_first NULL 4 1 2 3 -breadth_first NULL 4 0 1 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5; -latch origid destid weight seq linkid -breadth_first NULL 5 1 3 7 -breadth_first NULL 5 1 2 6 -breadth_first NULL 5 0 1 5 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6; -latch origid destid weight seq linkid -breadth_first NULL 6 2 3 7 -breadth_first NULL 6 1 2 5 -breadth_first NULL 6 0 1 6 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7; -latch origid destid weight seq linkid -breadth_first NULL 7 0 1 7 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9; -latch origid destid weight seq linkid -breadth_first NULL 9 0 1 9 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10; -latch origid destid weight seq linkid -breadth_first NULL 10 2 3 12 -breadth_first NULL 10 1 2 11 -breadth_first NULL 10 0 1 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11; -latch origid destid weight seq linkid -breadth_first NULL 11 2 3 10 -breadth_first NULL 11 1 2 12 -breadth_first NULL 11 0 1 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12; -latch origid destid weight seq linkid -breadth_first NULL 12 2 3 11 -breadth_first NULL 12 1 2 10 -breadth_first NULL 12 0 1 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 1 1 3 3 -breadth_first NULL 1 1 2 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 2 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 3 1 3 4 -breadth_first NULL 3 1 2 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 4 1 2 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 5 1 3 7 -breadth_first NULL 5 1 2 6 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 6 1 2 5 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 10 1 2 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 11 1 2 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 1; -latch origid destid weight seq linkid -breadth_first NULL 12 1 2 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 1 2 4 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 2 2 3 3 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 3 2 4 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 4 2 3 1 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 6 2 3 7 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 10 2 3 12 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 11 2 3 10 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 2; -latch origid destid weight seq linkid -breadth_first NULL 12 2 3 11 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 3; -latch origid destid weight seq linkid -breadth_first NULL 2 3 4 4 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 3; -latch origid destid weight seq linkid -breadth_first NULL 4 3 4 2 -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = NULL; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = NULL; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = 'breadth_first'; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 1; -latch origid destid weight seq linkid -2 1 NULL 2 4 4 -2 1 NULL 1 3 3 -2 1 NULL 1 2 2 -2 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 2; -latch origid destid weight seq linkid -2 2 NULL 3 4 4 -2 2 NULL 2 3 3 -2 2 NULL 1 2 1 -2 2 NULL 0 1 2 -SELECT * FROM graph WHERE latch = '2' AND origid = 3; -latch origid destid weight seq linkid -2 3 NULL 2 4 2 -2 3 NULL 1 3 4 -2 3 NULL 1 2 1 -2 3 NULL 0 1 3 -SELECT * FROM graph WHERE latch = '2' AND origid = 4; -latch origid destid weight seq linkid -2 4 NULL 3 4 2 -2 4 NULL 2 3 1 -2 4 NULL 1 2 3 -2 4 NULL 0 1 4 -SELECT * FROM graph WHERE latch = '2' AND origid = 5; -latch origid destid weight seq linkid -2 5 NULL 1 3 7 -2 5 NULL 1 2 6 -2 5 NULL 0 1 5 -SELECT * FROM graph WHERE latch = '2' AND origid = 6; -latch origid destid weight seq linkid -2 6 NULL 2 3 7 -2 6 NULL 1 2 5 -2 6 NULL 0 1 6 -SELECT * FROM graph WHERE latch = '2' AND origid = 7; -latch origid destid weight seq linkid -2 7 NULL 0 1 7 -SELECT * FROM graph WHERE latch = '2' AND origid = 8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 9; -latch origid destid weight seq linkid -2 9 NULL 0 1 9 -SELECT * FROM graph WHERE latch = '2' AND origid = 10; -latch origid destid weight seq linkid -2 10 NULL 2 3 12 -2 10 NULL 1 2 11 -2 10 NULL 0 1 10 -SELECT * FROM graph WHERE latch = '2' AND origid = 11; -latch origid destid weight seq linkid -2 11 NULL 2 3 10 -2 11 NULL 1 2 12 -2 11 NULL 0 1 11 -SELECT * FROM graph WHERE latch = '2' AND origid = 12; -latch origid destid weight seq linkid -2 12 NULL 2 3 11 -2 12 NULL 1 2 10 -2 12 NULL 0 1 12 -SELECT * FROM graph WHERE latch = '2' AND origid = 666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 1; -latch origid destid weight seq linkid -2 1 NULL 1 3 3 -2 1 NULL 1 2 2 -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 1; -latch origid destid weight seq linkid -2 2 NULL 1 2 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 1; -latch origid destid weight seq linkid -2 3 NULL 1 3 4 -2 3 NULL 1 2 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 1; -latch origid destid weight seq linkid -2 4 NULL 1 2 3 -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 1; -latch origid destid weight seq linkid -2 5 NULL 1 3 7 -2 5 NULL 1 2 6 -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 1; -latch origid destid weight seq linkid -2 6 NULL 1 2 5 -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 1; -latch origid destid weight seq linkid -2 10 NULL 1 2 11 -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 1; -latch origid destid weight seq linkid -2 11 NULL 1 2 12 -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 1; -latch origid destid weight seq linkid -2 12 NULL 1 2 10 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 1 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 2 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 3 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 4 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 5 AND weight = 1; -count(*) -2 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 6 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 7 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 8 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 9 AND weight = 1; -count(*) -0 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 10 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 11 AND weight = 1; -count(*) -1 -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 12 AND weight = 1; -count(*) -1 -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 2; -latch origid destid weight seq linkid -2 1 NULL 2 4 4 -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 2; -latch origid destid weight seq linkid -2 2 NULL 2 3 3 -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 2; -latch origid destid weight seq linkid -2 3 NULL 2 4 2 -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 2; -latch origid destid weight seq linkid -2 4 NULL 2 3 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 2; -latch origid destid weight seq linkid -2 6 NULL 2 3 7 -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 2; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 2; -latch origid destid weight seq linkid -2 10 NULL 2 3 12 -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 2; -latch origid destid weight seq linkid -2 11 NULL 2 3 10 -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 2; -latch origid destid weight seq linkid -2 12 NULL 2 3 11 -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 3; -latch origid destid weight seq linkid -2 2 NULL 3 4 4 -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 3; -latch origid destid weight seq linkid -2 4 NULL 3 4 2 -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 3; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 1 NULL 2 4 4 -2 1 NULL 1 3 3 -2 1 NULL 1 2 2 -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 2 NULL 2 3 3 -2 2 NULL 1 2 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 3 NULL 2 4 2 -2 3 NULL 1 3 4 -2 3 NULL 1 2 1 -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 4 NULL 2 3 1 -2 4 NULL 1 2 3 -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 5 NULL 1 3 7 -2 5 NULL 1 2 6 -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 6 NULL 2 3 7 -2 6 NULL 1 2 5 -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 10 NULL 2 3 12 -2 10 NULL 1 2 11 -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 11 NULL 2 3 10 -2 11 NULL 1 2 12 -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND (weight = 1 or weight = 2); -latch origid destid weight seq linkid -2 12 NULL 2 3 11 -2 12 NULL 1 2 10 -SELECT * FROM graph WHERE latch = '2' AND destid = 1; -latch origid destid weight seq linkid -2 NULL 1 2 4 4 -2 NULL 1 1 3 3 -2 NULL 1 1 2 2 -2 NULL 1 0 1 1 -SELECT * FROM graph WHERE latch = '2' AND destid = 12; -latch origid destid weight seq linkid -2 NULL 12 2 3 11 -2 NULL 12 1 2 10 -2 NULL 12 0 1 12 -SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 1; -latch origid destid weight seq linkid -2 NULL 1 1 3 3 -2 NULL 1 1 2 2 -SELECT * FROM graph WHERE latch = '2' AND origid = NULL; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND destid = NULL; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2' AND weight = 1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch = '2'; -latch origid destid weight seq linkid -# Dijkstras algorithm tests -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=1; -latch origid destid weight seq linkid -dijkstras 1 1 NULL 0 1 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=2; -latch origid destid weight seq linkid -dijkstras 1 2 NULL 0 1 -dijkstras 1 2 1 1 2 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=2 AND destid=1; -latch origid destid weight seq linkid -dijkstras 2 1 NULL 0 2 -dijkstras 2 1 1 1 1 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=4; -latch origid destid weight seq linkid -dijkstras 1 4 NULL 0 1 -dijkstras 1 4 1 1 3 -dijkstras 1 4 1 2 4 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=4 AND destid=1; -latch origid destid weight seq linkid -dijkstras 4 1 NULL 0 4 -dijkstras 4 1 1 1 3 -dijkstras 4 1 1 2 1 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=5; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND origid=5 AND destid=7; -latch origid destid weight seq linkid -dijkstras 5 7 NULL 0 5 -dijkstras 5 7 1 1 7 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=7 AND destid=5; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=11; -latch origid destid weight seq linkid -dijkstras 10 11 NULL 0 10 -dijkstras 10 11 1 1 11 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=12; -latch origid destid weight seq linkid -dijkstras 10 12 NULL 0 10 -dijkstras 10 12 1 1 11 -dijkstras 10 12 1 2 12 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11 AND destid=10; -latch origid destid weight seq linkid -dijkstras 11 10 NULL 0 11 -dijkstras 11 10 1 1 12 -dijkstras 11 10 1 2 10 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11 AND destid=12; -latch origid destid weight seq linkid -dijkstras 11 12 NULL 0 11 -dijkstras 11 12 1 1 12 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=10; -latch origid destid weight seq linkid -dijkstras 12 10 NULL 0 12 -dijkstras 12 10 1 1 10 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=11; -latch origid destid weight seq linkid -dijkstras 12 11 NULL 0 12 -dijkstras 12 11 1 1 10 -dijkstras 12 11 1 2 11 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -latch origid destid weight seq linkid -dijkstras 1 NULL 2 4 4 -dijkstras 1 NULL 1 3 3 -dijkstras 1 NULL 1 2 2 -dijkstras 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=2; -latch origid destid weight seq linkid -dijkstras 2 NULL 3 4 4 -dijkstras 2 NULL 2 3 3 -dijkstras 2 NULL 1 2 1 -dijkstras 2 NULL 0 1 2 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=3; -latch origid destid weight seq linkid -dijkstras 3 NULL 2 4 2 -dijkstras 3 NULL 1 3 4 -dijkstras 3 NULL 1 2 1 -dijkstras 3 NULL 0 1 3 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=4; -latch origid destid weight seq linkid -dijkstras 4 NULL 3 4 2 -dijkstras 4 NULL 2 3 1 -dijkstras 4 NULL 1 2 3 -dijkstras 4 NULL 0 1 4 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=5; -latch origid destid weight seq linkid -dijkstras 5 NULL 1 3 7 -dijkstras 5 NULL 1 2 6 -dijkstras 5 NULL 0 1 5 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=6; -latch origid destid weight seq linkid -dijkstras 6 NULL 2 3 7 -dijkstras 6 NULL 1 2 5 -dijkstras 6 NULL 0 1 6 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=7; -latch origid destid weight seq linkid -dijkstras 7 NULL 0 1 7 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND origid=9; -latch origid destid weight seq linkid -dijkstras 9 NULL 0 1 9 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10; -latch origid destid weight seq linkid -dijkstras 10 NULL 2 3 12 -dijkstras 10 NULL 1 2 11 -dijkstras 10 NULL 0 1 10 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11; -latch origid destid weight seq linkid -dijkstras 11 NULL 2 3 10 -dijkstras 11 NULL 1 2 12 -dijkstras 11 NULL 0 1 11 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12; -latch origid destid weight seq linkid -dijkstras 12 NULL 2 3 11 -dijkstras 12 NULL 1 2 10 -dijkstras 12 NULL 0 1 12 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND destid=1; -latch origid destid weight seq linkid -dijkstras NULL 1 2 4 4 -dijkstras NULL 1 1 3 3 -dijkstras NULL 1 1 2 2 -dijkstras NULL 1 0 1 1 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=2; -latch origid destid weight seq linkid -dijkstras NULL 2 3 4 4 -dijkstras NULL 2 2 3 3 -dijkstras NULL 2 1 2 1 -dijkstras NULL 2 0 1 2 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=3; -latch origid destid weight seq linkid -dijkstras NULL 3 2 4 2 -dijkstras NULL 3 1 3 4 -dijkstras NULL 3 1 2 1 -dijkstras NULL 3 0 1 3 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=4; -latch origid destid weight seq linkid -dijkstras NULL 4 3 4 2 -dijkstras NULL 4 2 3 1 -dijkstras NULL 4 1 2 3 -dijkstras NULL 4 0 1 4 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=5; -latch origid destid weight seq linkid -dijkstras NULL 5 1 3 7 -dijkstras NULL 5 1 2 6 -dijkstras NULL 5 0 1 5 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=6; -latch origid destid weight seq linkid -dijkstras NULL 6 2 3 7 -dijkstras NULL 6 1 2 5 -dijkstras NULL 6 0 1 6 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=7; -latch origid destid weight seq linkid -dijkstras NULL 7 0 1 7 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='dijkstras' AND destid=9; -latch origid destid weight seq linkid -dijkstras NULL 9 0 1 9 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=10; -latch origid destid weight seq linkid -dijkstras NULL 10 2 3 12 -dijkstras NULL 10 1 2 11 -dijkstras NULL 10 0 1 10 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=11; -latch origid destid weight seq linkid -dijkstras NULL 11 2 3 10 -dijkstras NULL 11 1 2 12 -dijkstras NULL 11 0 1 11 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=12; -latch origid destid weight seq linkid -dijkstras NULL 12 2 3 11 -dijkstras NULL 12 1 2 10 -dijkstras NULL 12 0 1 12 -# legacy string number -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=1; -latch origid destid weight seq linkid -1 1 1 NULL 0 1 -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=2; -latch origid destid weight seq linkid -1 1 2 NULL 0 1 -1 1 2 1 1 2 -SELECT * FROM graph WHERE latch='1' AND origid=2 AND destid=1; -latch origid destid weight seq linkid -1 2 1 NULL 0 2 -1 2 1 1 1 1 -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=4; -latch origid destid weight seq linkid -1 1 4 NULL 0 1 -1 1 4 1 1 3 -1 1 4 1 2 4 -SELECT * FROM graph WHERE latch='1' AND origid=4 AND destid=1; -latch origid destid weight seq linkid -1 4 1 NULL 0 4 -1 4 1 1 1 3 -1 4 1 1 2 1 -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=5; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND origid=5 AND destid=7; -latch origid destid weight seq linkid -1 5 7 NULL 0 5 -1 5 7 1 1 7 -SELECT * FROM graph WHERE latch='1' AND origid=7 AND destid=5; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND origid=10 AND destid=11; -latch origid destid weight seq linkid -1 10 11 NULL 0 10 -1 10 11 1 1 11 -SELECT * FROM graph WHERE latch='1' AND origid=10 AND destid=12; -latch origid destid weight seq linkid -1 10 12 NULL 0 10 -1 10 12 1 1 11 -1 10 12 1 2 12 -SELECT * FROM graph WHERE latch='1' AND origid=11 AND destid=10; -latch origid destid weight seq linkid -1 11 10 NULL 0 11 -1 11 10 1 1 12 -1 11 10 1 2 10 -SELECT * FROM graph WHERE latch='1' AND origid=11 AND destid=12; -latch origid destid weight seq linkid -1 11 12 NULL 0 11 -1 11 12 1 1 12 -SELECT * FROM graph WHERE latch='1' AND origid=12 AND destid=10; -latch origid destid weight seq linkid -1 12 10 NULL 0 12 -1 12 10 1 1 10 -SELECT * FROM graph WHERE latch='1' AND origid=12 AND destid=11; -latch origid destid weight seq linkid -1 12 11 NULL 0 12 -1 12 11 1 1 10 -1 12 11 1 2 11 -SELECT * FROM graph WHERE latch='1' AND origid=1; -latch origid destid weight seq linkid -1 1 NULL 2 4 4 -1 1 NULL 1 3 3 -1 1 NULL 1 2 2 -1 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch='1' AND origid=2; -latch origid destid weight seq linkid -1 2 NULL 3 4 4 -1 2 NULL 2 3 3 -1 2 NULL 1 2 1 -1 2 NULL 0 1 2 -SELECT * FROM graph WHERE latch='1' AND origid=3; -latch origid destid weight seq linkid -1 3 NULL 2 4 2 -1 3 NULL 1 3 4 -1 3 NULL 1 2 1 -1 3 NULL 0 1 3 -SELECT * FROM graph WHERE latch='1' AND origid=4; -latch origid destid weight seq linkid -1 4 NULL 3 4 2 -1 4 NULL 2 3 1 -1 4 NULL 1 2 3 -1 4 NULL 0 1 4 -SELECT * FROM graph WHERE latch='1' AND origid=5; -latch origid destid weight seq linkid -1 5 NULL 1 3 7 -1 5 NULL 1 2 6 -1 5 NULL 0 1 5 -SELECT * FROM graph WHERE latch='1' AND origid=6; -latch origid destid weight seq linkid -1 6 NULL 2 3 7 -1 6 NULL 1 2 5 -1 6 NULL 0 1 6 -SELECT * FROM graph WHERE latch='1' AND origid=7; -latch origid destid weight seq linkid -1 7 NULL 0 1 7 -SELECT * FROM graph WHERE latch='1' AND origid=8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND origid=9; -latch origid destid weight seq linkid -1 9 NULL 0 1 9 -SELECT * FROM graph WHERE latch='1' AND origid=10; -latch origid destid weight seq linkid -1 10 NULL 2 3 12 -1 10 NULL 1 2 11 -1 10 NULL 0 1 10 -SELECT * FROM graph WHERE latch='1' AND origid=11; -latch origid destid weight seq linkid -1 11 NULL 2 3 10 -1 11 NULL 1 2 12 -1 11 NULL 0 1 11 -SELECT * FROM graph WHERE latch='1' AND origid=12; -latch origid destid weight seq linkid -1 12 NULL 2 3 11 -1 12 NULL 1 2 10 -1 12 NULL 0 1 12 -SELECT * FROM graph WHERE latch='1' AND origid=666; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND destid=1; -latch origid destid weight seq linkid -1 NULL 1 2 4 4 -1 NULL 1 1 3 3 -1 NULL 1 1 2 2 -1 NULL 1 0 1 1 -SELECT * FROM graph WHERE latch='1' AND destid=2; -latch origid destid weight seq linkid -1 NULL 2 3 4 4 -1 NULL 2 2 3 3 -1 NULL 2 1 2 1 -1 NULL 2 0 1 2 -SELECT * FROM graph WHERE latch='1' AND destid=3; -latch origid destid weight seq linkid -1 NULL 3 2 4 2 -1 NULL 3 1 3 4 -1 NULL 3 1 2 1 -1 NULL 3 0 1 3 -SELECT * FROM graph WHERE latch='1' AND destid=4; -latch origid destid weight seq linkid -1 NULL 4 3 4 2 -1 NULL 4 2 3 1 -1 NULL 4 1 2 3 -1 NULL 4 0 1 4 -SELECT * FROM graph WHERE latch='1' AND destid=5; -latch origid destid weight seq linkid -1 NULL 5 1 3 7 -1 NULL 5 1 2 6 -1 NULL 5 0 1 5 -SELECT * FROM graph WHERE latch='1' AND destid=6; -latch origid destid weight seq linkid -1 NULL 6 2 3 7 -1 NULL 6 1 2 5 -1 NULL 6 0 1 6 -SELECT * FROM graph WHERE latch='1' AND destid=7; -latch origid destid weight seq linkid -1 NULL 7 0 1 7 -SELECT * FROM graph WHERE latch='1' AND destid=8; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND destid=9; -latch origid destid weight seq linkid -1 NULL 9 0 1 9 -SELECT * FROM graph WHERE latch='1' AND destid=10; -latch origid destid weight seq linkid -1 NULL 10 2 3 12 -1 NULL 10 1 2 11 -1 NULL 10 0 1 10 -SELECT * FROM graph WHERE latch='1' AND destid=11; -latch origid destid weight seq linkid -1 NULL 11 2 3 10 -1 NULL 11 1 2 12 -1 NULL 11 0 1 11 -SELECT * FROM graph WHERE latch='1' AND destid=12; -latch origid destid weight seq linkid -1 NULL 12 2 3 11 -1 NULL 12 1 2 10 -1 NULL 12 0 1 12 -SELECT count(*) FROM graph; -count(*) -13 -SELECT count(*) FROM graph_base; -count(*) -13 -INSERT INTO graph_base(from_id, to_id) VALUES (11,13); -INSERT INTO graph_base(from_id, to_id) VALUES (10,14); -INSERT INTO graph_base(from_id, to_id) VALUES (14,13); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; -latch origid destid weight seq linkid -dijkstras 10 13 NULL 0 10 -dijkstras 10 13 1 1 11 -dijkstras 10 13 1 2 13 -DELETE FROM graph_base where from_id=10 and to_id=11; -INSERT INTO graph_base(from_id, to_id) VALUES (10,15); -INSERT INTO graph_base(from_id, to_id) VALUES (15,13); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; -latch origid destid weight seq linkid -dijkstras 10 13 NULL 0 10 -dijkstras 10 13 1 1 14 -dijkstras 10 13 1 2 13 -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; -latch origid destid weight seq linkid -dijkstras 10 13 NULL 0 10 -dijkstras 10 13 1 1 11 -dijkstras 10 13 1 2 13 -SELECT count(*) FROM graph; -count(*) -18 -SELECT count(*) FROM graph_base; -count(*) -18 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -latch origid destid weight seq linkid -dijkstras 1 NULL 2 4 4 -dijkstras 1 NULL 1 3 3 -dijkstras 1 NULL 1 2 2 -dijkstras 1 NULL 0 1 1 -INSERT INTO graph_base(from_id, to_id) VALUES (21,22); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=21; -latch origid destid weight seq linkid -dijkstras 21 NULL 1 2 22 -dijkstras 21 NULL 0 1 21 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=22; -latch origid destid weight seq linkid -dijkstras 22 NULL 0 1 22 -INSERT INTO graph_base(from_id, to_id) VALUES (4,17); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -latch origid destid weight seq linkid -dijkstras 1 NULL 3 5 17 -dijkstras 1 NULL 2 4 4 -dijkstras 1 NULL 1 3 3 -dijkstras 1 NULL 1 2 2 -dijkstras 1 NULL 0 1 1 -INSERT INTO graph_base(from_id, to_id) VALUES (4,16); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -latch origid destid weight seq linkid -dijkstras 1 NULL 3 6 17 -dijkstras 1 NULL 3 5 16 -dijkstras 1 NULL 2 4 4 -dijkstras 1 NULL 1 3 3 -dijkstras 1 NULL 1 2 2 -dijkstras 1 NULL 0 1 1 -INSERT INTO graph_base(from_id, to_id) VALUES (17,18); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -latch origid destid weight seq linkid -dijkstras 1 NULL 4 7 18 -dijkstras 1 NULL 3 6 17 -dijkstras 1 NULL 3 5 16 -dijkstras 1 NULL 2 4 4 -dijkstras 1 NULL 1 3 3 -dijkstras 1 NULL 1 2 2 -dijkstras 1 NULL 0 1 1 -SELECT * FROM graph WHERE latch='dijkstras' AND destid=1; -latch origid destid weight seq linkid -dijkstras NULL 1 4 7 18 -dijkstras NULL 1 3 6 17 -dijkstras NULL 1 3 5 16 -dijkstras NULL 1 2 4 4 -dijkstras NULL 1 1 3 3 -dijkstras NULL 1 1 2 2 -dijkstras NULL 1 0 1 1 -# Now we add a connection from 4->6 -INSERT INTO graph_base (from_id,to_id) VALUES (4,6); -SELECT * FROM graph; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -NULL 1 3 1 NULL NULL -NULL 3 1 1 NULL NULL -NULL 3 4 1 NULL NULL -NULL 4 3 1 NULL NULL -NULL 5 6 1 NULL NULL -NULL 6 5 1 NULL NULL -NULL 5 7 1 NULL NULL -NULL 9 9 1 NULL NULL -NULL 10 15 1 NULL NULL -NULL 11 12 1 NULL NULL -NULL 12 10 1 NULL NULL -NULL 11 13 1 NULL NULL -NULL 10 14 1 NULL NULL -NULL 14 13 1 NULL NULL -NULL 15 13 1 NULL NULL -NULL 10 11 1 NULL NULL -NULL 21 22 1 NULL NULL -NULL 4 17 1 NULL NULL -NULL 4 16 1 NULL NULL -NULL 17 18 1 NULL NULL -NULL 4 6 1 NULL NULL -SELECT count(*) FROM graph; -count(*) -23 -SELECT count(*) FROM graph_base; -count(*) -23 -# And delete all references to node 5 -DELETE FROM graph_base WHERE from_id=5; -DELETE FROM graph_base WHERE from_id=3 AND to_id=5; -# which means there is a path in one direction only 1>3>4>6 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=6; -latch origid destid weight seq linkid -dijkstras 1 6 NULL 0 1 -dijkstras 1 6 1 1 3 -dijkstras 1 6 1 2 4 -dijkstras 1 6 1 3 6 -# but not 6>4>3>1 (so no result) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=6 AND destid=1; -latch origid destid weight seq linkid -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=6; -latch origid destid weight seq linkid -1 1 6 NULL 0 1 -1 1 6 1 1 3 -1 1 6 1 2 4 -1 1 6 1 3 6 -SELECT * FROM graph WHERE latch='1' AND origid=6 AND destid=1; -latch origid destid weight seq linkid -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/regression_1213120.test b/mysql-test/suite/oqgraph/regression_1213120.test deleted file mode 100644 index 0f11f91cfad..00000000000 --- a/mysql-test/suite/oqgraph/regression_1213120.test +++ /dev/null @@ -1,548 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -DROP TABLE IF EXISTS graph2; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - -#-- -#-- ASCII art graph of this test data -#-- +-->(2) -#-- ( )<---+ -#-- (1) -#-- ( )<---+ -#-- +-->(3)<------->(4) -#-- -#-- (7)<----------(5)<--------->(6) (9) -#-- -#-- +--->(11) -#-- | | -#-- (10) | -#-- ^ v -#-- +----(12) - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); - -#-- extra unidirected node -INSERT INTO graph_base(from_id, to_id) VALUES (5,7); - -#-- isolated node with no loop - disallowed -#-- so origid 8 below should return an empty rowset -#-- INSERT INTO graph_base(from_id, to_id) VALUES (8,NULL); - -#-- isolated node with a (undirected) loop -#-- we have no way of representing a directed loop on an isolated node, is this valid in pure graph theory? -INSERT INTO graph_base(from_id, to_id) VALUES (9,9); - -#-- directed _cyclic_ graph triangle? -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -INSERT INTO graph_base(from_id, to_id) VALUES (11,12); -INSERT INTO graph_base(from_id, to_id) VALUES (12,10); - ---echo # Return all edges -#-- we note that when weight is NULL it defaults to 1 -SELECT * FROM graph; ---echo # Currently count should be 13 -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - ---echo # Return all edges when latch is NULL - this is different to latch='' and same as no where clause -SELECT * FROM graph where latch is NULL; - ---echo # Return all vertices, and subsets of vertices -SELECT * FROM graph where latch=''; -SELECT * FROM graph where latch='0'; - ---echo # Currently count should be 11 - -SELECT count(*) FROM graph where latch=''; -#-- get a subset of vertices -SELECT * FROM graph where latch='' and linkid = 2; -SELECT * FROM graph where latch='' and (linkid > 2 and linkid < 6); -SELECT * FROM graph where latch='' and linkid = NULL; -SELECT * FROM graph where latch='' and linkid = 666; - -#-- Query out-edges for vertex (no_search AND origid=N) -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 1; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 2; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 4; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 9; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 10; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = NULL; -SELECT origid as `from`, linkid as `to` FROM graph where latch='' and origid = 666; - -#-- Query in-edges for vertex (no_search AND destid=N) -#-- linkid will have the other end -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 1; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 2; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 4; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 9; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 10; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = NULL; -SELECT linkid as `from`, destid as `to` FROM graph where latch='' and destid = 666; - -# The following returns a result that makes no sense... -#-- what happens when we combined orig and dest? -#-- Bug https://bugs.launchpad.net/oqgraph/+bug/1195778 -#SELECT * FROM graph where latch='' and origid = 1; -#SELECT * FROM graph where latch='' and destid = 2; -#SELECT * FROM graph where latch='' and origid=1 and destid = 2; - -SELECT * FROM graph where latch='0'; -SELECT count(*) FROM graph where latch='0'; -SELECT * FROM graph where latch='0' and linkid = 2; -SELECT * FROM graph where latch='0' and (linkid > 2 and linkid < 6); -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 1; -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 2; -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 4; -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 9; -SELECT origid as `from`, linkid as `to` FROM graph where latch='0' and origid = 10; -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 1; -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 2; -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 4; -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 9; -SELECT linkid as `from`, destid as `to` FROM graph where latch='0' and destid = 10; - ---echo # Breadth-first search tests -#-- We are asking "Is there a path from node 'origid' to (all) other nodes?" -#-- We return a row for each other node that is reachable, with its id in 'linkid' -#-- and the weight calculated as "How many _directed_ hops to get there" -#-- If there is no path from origid to another node then there is no row for that linkid -#-- We include 'origid' in the set of reachable nodes i.e. as a 'loop', with weight 0 -#-- 'seq' is the counted distance of the search, thus, the loop link will always have seq 1 -#-- if there are two reachable neighbours, they will have seq 2,3 and so on -#-- linkid is the other end -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 666; # <-- note, should return nothing -#-- The above results can then be filtered by weight, so the results should be a subset for the corresponding origid above -#-- so effectively, `AND weight=1` returns the neighbours of origid in linkid -#<----- orig test harness - still returns (breadth_first 1 NULL 1 3 3), (breadth_first 1 NULL 1 2 2) -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 1; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 1; -#-- so effectively, `count(... AND weight=1)` returns the number of _reachable_ immediate neighbours -#-- included because it allows human to quickly eyeball against the visual ASCII graph for correctness... -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 1; # <-- note, should return nothing -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 1; -#-- so effectively, `AND weight=2` returns the second-level neighbours of origid in linkid -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 2; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND weight = 3; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND weight = 3; - -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 2 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 3 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 4 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 5 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 6 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 7 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8 AND (weight = 1 or weight = 2); # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 10 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND (weight = 1 or weight = 2); - -#-- now do it in reverse - using destid find originating vertices -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 1; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 2; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 2; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 3; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 3; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 3; - -#-- These return empty sets - origid or destid must be specified and non null to get a result set -SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = NULL; -SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = NULL; -SELECT * FROM graph WHERE latch = 'breadth_first' AND weight = 1; -SELECT * FROM graph WHERE latch = 'breadth_first'; - -#-- Repeat the above with legacy string -SELECT * FROM graph WHERE latch = '2' AND origid = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 4; -SELECT * FROM graph WHERE latch = '2' AND origid = 5; -SELECT * FROM graph WHERE latch = '2' AND origid = 6; -SELECT * FROM graph WHERE latch = '2' AND origid = 7; -SELECT * FROM graph WHERE latch = '2' AND origid = 8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 9; -SELECT * FROM graph WHERE latch = '2' AND origid = 10; -SELECT * FROM graph WHERE latch = '2' AND origid = 11; -SELECT * FROM graph WHERE latch = '2' AND origid = 12; -SELECT * FROM graph WHERE latch = '2' AND origid = 666; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 1; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 1 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 2 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 3 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 4 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 5 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 6 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 7 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 8 AND weight = 1; # <-- note, should return nothing -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 9 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 10 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 11 AND weight = 1; -SELECT count(*) FROM graph WHERE latch = '2' AND origid = 12 AND weight = 1; -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 2; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 2; -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND weight = 3; # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND weight = 3; -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND weight = 3; - -SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 2 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 3 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 4 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 5 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 6 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 7 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 8 AND (weight = 1 or weight = 2); # <-- note, should return nothing -SELECT * FROM graph WHERE latch = '2' AND origid = 9 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 11 AND (weight = 1 or weight = 2); -SELECT * FROM graph WHERE latch = '2' AND origid = 12 AND (weight = 1 or weight = 2); - -SELECT * FROM graph WHERE latch = '2' AND destid = 1; - -SELECT * FROM graph WHERE latch = '2' AND destid = 12; -SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 1; - - -#-- These return empty sets - origid must be specified and non null to get a result set -SELECT * FROM graph WHERE latch = '2' AND origid = NULL; -SELECT * FROM graph WHERE latch = '2' AND destid = NULL; -SELECT * FROM graph WHERE latch = '2' AND weight = 1; -SELECT * FROM graph WHERE latch = '2'; - - ---echo # Dijkstras algorithm tests -#-- We ask 'What is the shortest path (if any) between 'origid' and 'destid' -#-- This returns the number of directed hops +1 (for the starting node) -#-- 'weight' is NULL for the starting point, or 1 -#-- 'linkid' is the way point id -#-- 'seq' is the distance of the waypoint from the start (counting from zero) -#-- the default order returned is waypoints out from the start -#-- zero hop (1 row) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=1; -#-- one hop -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=2; -#-- one hop in reverse -SELECT * FROM graph WHERE latch='dijkstras' AND origid=2 AND destid=1; -#-- two hops (via 3) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=4; -#-- two hops in reverse direction -SELECT * FROM graph WHERE latch='dijkstras' AND origid=4 AND destid=1; -#-- no result (no connection) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=5; -#-- no result (no destination exists) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=666; - -#-- one hop on a unidirected link -SELECT * FROM graph WHERE latch='dijkstras' AND origid=5 AND destid=7; -#-- zero hop in reverse direction on a unidirected link -SELECT * FROM graph WHERE latch='dijkstras' AND origid=7 AND destid=5; - -#-- Trickery - what about the cyclic loop? -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=11; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=12; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11 AND destid=10; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11 AND destid=12; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=10; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12 AND destid=11; - -#-- reachable vertices -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=2; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=3; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=4; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=5; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=6; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=7; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='dijkstras' AND origid=9; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=11; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=12; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=666; # <-- note, should return nothing - -#-- originating vertices -SELECT * FROM graph WHERE latch='dijkstras' AND destid=1; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=2; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=3; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=4; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=5; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=6; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=7; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='dijkstras' AND destid=9; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=10; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=11; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=12; - ---echo # legacy string number -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=1; -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=2; -SELECT * FROM graph WHERE latch='1' AND origid=2 AND destid=1; -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=4; -SELECT * FROM graph WHERE latch='1' AND origid=4 AND destid=1; -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=5; -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=666; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='1' AND origid=5 AND destid=7; -SELECT * FROM graph WHERE latch='1' AND origid=7 AND destid=5; -SELECT * FROM graph WHERE latch='1' AND origid=10 AND destid=11; -SELECT * FROM graph WHERE latch='1' AND origid=10 AND destid=12; -SELECT * FROM graph WHERE latch='1' AND origid=11 AND destid=10; -SELECT * FROM graph WHERE latch='1' AND origid=11 AND destid=12; -SELECT * FROM graph WHERE latch='1' AND origid=12 AND destid=10; -SELECT * FROM graph WHERE latch='1' AND origid=12 AND destid=11; -SELECT * FROM graph WHERE latch='1' AND origid=1; -SELECT * FROM graph WHERE latch='1' AND origid=2; -SELECT * FROM graph WHERE latch='1' AND origid=3; -SELECT * FROM graph WHERE latch='1' AND origid=4; -SELECT * FROM graph WHERE latch='1' AND origid=5; -SELECT * FROM graph WHERE latch='1' AND origid=6; -SELECT * FROM graph WHERE latch='1' AND origid=7; -SELECT * FROM graph WHERE latch='1' AND origid=8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='1' AND origid=9; -SELECT * FROM graph WHERE latch='1' AND origid=10; -SELECT * FROM graph WHERE latch='1' AND origid=11; -SELECT * FROM graph WHERE latch='1' AND origid=12; -SELECT * FROM graph WHERE latch='1' AND origid=666; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='1' AND destid=1; -SELECT * FROM graph WHERE latch='1' AND destid=2; -SELECT * FROM graph WHERE latch='1' AND destid=3; -SELECT * FROM graph WHERE latch='1' AND destid=4; -SELECT * FROM graph WHERE latch='1' AND destid=5; -SELECT * FROM graph WHERE latch='1' AND destid=6; -SELECT * FROM graph WHERE latch='1' AND destid=7; -SELECT * FROM graph WHERE latch='1' AND destid=8; # <-- note, should return nothing -SELECT * FROM graph WHERE latch='1' AND destid=9; -SELECT * FROM graph WHERE latch='1' AND destid=10; -SELECT * FROM graph WHERE latch='1' AND destid=11; -SELECT * FROM graph WHERE latch='1' AND destid=12; - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - -#-- What if we add two equally valid two-hop paths? -#-- -#-- -#-- +--->(14)----------+ -#-- | v -#-- | +--->(11)---->(13) -#-- | | | -#-- +-(10) | -#-- ^ v -#-- +----(12) -#-- -#-- We note it chooses 10,11,13 but will it always? -INSERT INTO graph_base(from_id, to_id) VALUES (11,13); -INSERT INTO graph_base(from_id, to_id) VALUES (10,14); -INSERT INTO graph_base(from_id, to_id) VALUES (14,13); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; -DELETE FROM graph_base where from_id=10 and to_id=11; -INSERT INTO graph_base(from_id, to_id) VALUES (10,15); -INSERT INTO graph_base(from_id, to_id) VALUES (15,13); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -#-- We note is _appears_ to use the lowered valued node id if there are two equal paths -SELECT * FROM graph WHERE latch='dijkstras' AND origid=10 AND destid=13; - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - -#-- add some extra and check -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -INSERT INTO graph_base(from_id, to_id) VALUES (21,22); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=21; -SELECT * FROM graph WHERE latch='dijkstras' AND origid=22; -INSERT INTO graph_base(from_id, to_id) VALUES (4,17); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -INSERT INTO graph_base(from_id, to_id) VALUES (4,16); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -INSERT INTO graph_base(from_id, to_id) VALUES (17,18); -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1; -SELECT * FROM graph WHERE latch='dijkstras' AND destid=1; - ---echo # Now we add a connection from 4->6 -INSERT INTO graph_base (from_id,to_id) VALUES (4,6); - -SELECT * FROM graph; - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - ---echo # And delete all references to node 5 -DELETE FROM graph_base WHERE from_id=5; -DELETE FROM graph_base WHERE from_id=3 AND to_id=5; - -#-- The following queries would currently return incorrect results -#-- 6 rows instead of 21 -#-- Maybe manifestation of https://bugs.launchpad.net/oqgraph/+bug/796647 -#-- SELECT count(*) FROM graph; -#-- SELECT count(*) FROM graph_base; - ---echo # which means there is a path in one direction only 1>3>4>6 -SELECT * FROM graph WHERE latch='dijkstras' AND origid=1 AND destid=6; ---echo # but not 6>4>3>1 (so no result) -SELECT * FROM graph WHERE latch='dijkstras' AND origid=6 AND destid=1; - -SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=6; -SELECT * FROM graph WHERE latch='1' AND origid=6 AND destid=1; - -DELETE FROM graph_base; - -#-- The following line would hang mysqld currently, see bug https://bugs.launchpad.net/oqgraph/+bug/1195735 -#-- SELECT * FROM graph; - -FLUSH TABLES; -TRUNCATE TABLE graph_base; - -DROP TABLE graph_base; -DROP TABLE graph; - diff --git a/mysql-test/suite/oqgraph/regression_1233113.result b/mysql-test/suite/oqgraph/regression_1233113.result deleted file mode 100644 index 415b2181bbb..00000000000 --- a/mysql-test/suite/oqgraph/regression_1233113.result +++ /dev/null @@ -1,25 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,2), (2,3); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -update graph set origid=123; -ERROR HY000: Table 'graph' is read only -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/regression_1233113.test b/mysql-test/suite/oqgraph/regression_1233113.test deleted file mode 100644 index 26e6656eea5..00000000000 --- a/mysql-test/suite/oqgraph/regression_1233113.test +++ /dev/null @@ -1,38 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,2), (2,3); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); - -# The following line crashes when MTR run with --gdb, see bug https://bugs.launchpad.net/oqgraph/+bug/1233113 ---error 1036 -update graph set origid=123; - -# Otherwise, MTR hangs on the next line -DROP TABLE graph_base; -DROP TABLE graph; - diff --git a/mysql-test/suite/oqgraph/regression_796647.result b/mysql-test/suite/oqgraph/regression_796647.result deleted file mode 100644 index 36bd00b8115..00000000000 --- a/mysql-test/suite/oqgraph/regression_796647.result +++ /dev/null @@ -1,40 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -von INT NOT NULL, -nach INT NOT NULL, -weight DOUBLE NOT NULL, -PRIMARY KEY (von,nach), -INDEX (von) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='von' DESTID='nach' WEIGHT='weight'; -INSERT INTO graph_base(von,nach,weight) VALUES (3,5,2), (5,4,1), (5,6,1); -SELECT * FROM graph_base; -von nach weight -3 5 2 -5 4 1 -5 6 1 -SELECT * FROM graph; -latch origid destid weight seq linkid -NULL 3 5 2 NULL NULL -NULL 5 4 1 NULL NULL -NULL 5 6 1 NULL NULL -INSERT INTO graph_base(von,nach,weight) VALUES (6,3,1); -SELECT * FROM graph; -latch origid destid weight seq linkid -NULL 3 5 2 NULL NULL -NULL 5 4 1 NULL NULL -NULL 5 6 1 NULL NULL -NULL 6 3 1 NULL NULL -FLUSH TABLES; -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/regression_796647.test b/mysql-test/suite/oqgraph/regression_796647.test deleted file mode 100644 index aaecee7479f..00000000000 --- a/mysql-test/suite/oqgraph/regression_796647.test +++ /dev/null @@ -1,43 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - - -# Create the backing store -CREATE TABLE graph_base ( - von INT NOT NULL, - nach INT NOT NULL, - weight DOUBLE NOT NULL, - PRIMARY KEY (von,nach), - INDEX (von) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='von' DESTID='nach' WEIGHT='weight'; - -INSERT INTO graph_base(von,nach,weight) VALUES (3,5,2), (5,4,1), (5,6,1); - -SELECT * FROM graph_base; - -SELECT * FROM graph; - -INSERT INTO graph_base(von,nach,weight) VALUES (6,3,1); - -SELECT * FROM graph; - -FLUSH TABLES; - -DROP TABLE graph_base; -DROP TABLE graph; - - diff --git a/mysql-test/suite/oqgraph/regression_796647b.result b/mysql-test/suite/oqgraph/regression_796647b.result deleted file mode 100644 index 2a5e632b674..00000000000 --- a/mysql-test/suite/oqgraph/regression_796647b.result +++ /dev/null @@ -1,221 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); -SELECT count(*) FROM graph; -count(*) -8 -SELECT count(*) FROM graph_base; -count(*) -8 -INSERT INTO graph_base(from_id, to_id) VALUES (5,7); -INSERT INTO graph_base(from_id, to_id) VALUES (9,9); -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -INSERT INTO graph_base(from_id, to_id) VALUES (11,12); -INSERT INTO graph_base(from_id, to_id) VALUES (12,10); -SELECT count(*) FROM graph; -count(*) -13 -SELECT count(*) FROM graph_base; -count(*) -13 -INSERT INTO graph_base(from_id, to_id) VALUES (11,13); -INSERT INTO graph_base(from_id, to_id) VALUES (10,14); -INSERT INTO graph_base(from_id, to_id) VALUES (14,13); -SELECT count(*) FROM graph; -count(*) -16 -SELECT count(*) FROM graph_base; -count(*) -16 -DELETE FROM graph_base where from_id=10 and to_id=11; -INSERT INTO graph_base(from_id, to_id) VALUES (10,15); -INSERT INTO graph_base(from_id, to_id) VALUES (15,13); -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -SELECT count(*) FROM graph; -count(*) -18 -SELECT count(*) FROM graph_base; -count(*) -18 -INSERT INTO graph_base(from_id, to_id) VALUES (21,22); -INSERT INTO graph_base(from_id, to_id) VALUES (4,17); -INSERT INTO graph_base(from_id, to_id) VALUES (4,16); -INSERT INTO graph_base(from_id, to_id) VALUES (17,18); -INSERT INTO graph_base (from_id,to_id) VALUES (4,6); -SELECT count(*) FROM graph; -count(*) -23 -SELECT count(*) FROM graph_base; -count(*) -23 -SELECT * from graph; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -NULL 1 3 1 NULL NULL -NULL 3 1 1 NULL NULL -NULL 3 4 1 NULL NULL -NULL 4 3 1 NULL NULL -NULL 5 6 1 NULL NULL -NULL 6 5 1 NULL NULL -NULL 5 7 1 NULL NULL -NULL 9 9 1 NULL NULL -NULL 10 15 1 NULL NULL -NULL 11 12 1 NULL NULL -NULL 12 10 1 NULL NULL -NULL 11 13 1 NULL NULL -NULL 10 14 1 NULL NULL -NULL 14 13 1 NULL NULL -NULL 15 13 1 NULL NULL -NULL 10 11 1 NULL NULL -NULL 21 22 1 NULL NULL -NULL 4 17 1 NULL NULL -NULL 4 16 1 NULL NULL -NULL 17 18 1 NULL NULL -NULL 4 6 1 NULL NULL -SELECT * from graph where latch='0'; -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 1 -0 NULL NULL NULL NULL 2 -0 NULL NULL NULL NULL 3 -0 NULL NULL NULL NULL 4 -0 NULL NULL NULL NULL 5 -0 NULL NULL NULL NULL 6 -0 NULL NULL NULL NULL 7 -0 NULL NULL NULL NULL 9 -0 NULL NULL NULL NULL 10 -0 NULL NULL NULL NULL 15 -0 NULL NULL NULL NULL 11 -0 NULL NULL NULL NULL 12 -0 NULL NULL NULL NULL 13 -0 NULL NULL NULL NULL 14 -0 NULL NULL NULL NULL 21 -0 NULL NULL NULL NULL 22 -0 NULL NULL NULL NULL 17 -0 NULL NULL NULL NULL 16 -0 NULL NULL NULL NULL 18 -SELECT * from graph_base; -from_id to_id -1 2 -1 3 -2 1 -3 1 -3 4 -4 3 -4 6 -4 16 -4 17 -5 6 -5 7 -6 5 -9 9 -10 11 -10 14 -10 15 -11 12 -11 13 -12 10 -14 13 -15 13 -17 18 -21 22 -# And delete all references to node 5 -DELETE FROM graph_base WHERE from_id=5; -DELETE FROM graph_base WHERE from_id=3 AND to_id=5; -# This is currently bogus: -SELECT count(*) FROM graph; -count(*) -21 -SELECT count(*) FROM graph_base; -count(*) -21 -SELECT * from graph; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -NULL 1 3 1 NULL NULL -NULL 3 1 1 NULL NULL -NULL 3 4 1 NULL NULL -NULL 4 3 1 NULL NULL -NULL 6 5 1 NULL NULL -NULL 9 9 1 NULL NULL -NULL 10 15 1 NULL NULL -NULL 11 12 1 NULL NULL -NULL 12 10 1 NULL NULL -NULL 11 13 1 NULL NULL -NULL 10 14 1 NULL NULL -NULL 14 13 1 NULL NULL -NULL 15 13 1 NULL NULL -NULL 10 11 1 NULL NULL -NULL 21 22 1 NULL NULL -NULL 4 17 1 NULL NULL -NULL 4 16 1 NULL NULL -NULL 17 18 1 NULL NULL -NULL 4 6 1 NULL NULL -SELECT * from graph where latch='0'; -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 1 -0 NULL NULL NULL NULL 2 -0 NULL NULL NULL NULL 3 -0 NULL NULL NULL NULL 4 -0 NULL NULL NULL NULL 6 -0 NULL NULL NULL NULL 5 -0 NULL NULL NULL NULL 9 -0 NULL NULL NULL NULL 10 -0 NULL NULL NULL NULL 15 -0 NULL NULL NULL NULL 11 -0 NULL NULL NULL NULL 12 -0 NULL NULL NULL NULL 13 -0 NULL NULL NULL NULL 14 -0 NULL NULL NULL NULL 21 -0 NULL NULL NULL NULL 22 -0 NULL NULL NULL NULL 17 -0 NULL NULL NULL NULL 16 -0 NULL NULL NULL NULL 18 -SELECT * from graph_base; -from_id to_id -1 2 -1 3 -2 1 -3 1 -3 4 -4 3 -4 6 -4 16 -4 17 -6 5 -9 9 -10 11 -10 14 -10 15 -11 12 -11 13 -12 10 -14 13 -15 13 -17 18 -21 22 -DELETE FROM graph_base; -FLUSH TABLES; -TRUNCATE TABLE graph_base; -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/regression_796647b.test b/mysql-test/suite/oqgraph/regression_796647b.test deleted file mode 100644 index c3b81fd07b0..00000000000 --- a/mysql-test/suite/oqgraph/regression_796647b.test +++ /dev/null @@ -1,97 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1); -INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3); -INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5); - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - -INSERT INTO graph_base(from_id, to_id) VALUES (5,7); -INSERT INTO graph_base(from_id, to_id) VALUES (9,9); -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -INSERT INTO graph_base(from_id, to_id) VALUES (11,12); -INSERT INTO graph_base(from_id, to_id) VALUES (12,10); - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - -INSERT INTO graph_base(from_id, to_id) VALUES (11,13); -INSERT INTO graph_base(from_id, to_id) VALUES (10,14); -INSERT INTO graph_base(from_id, to_id) VALUES (14,13); - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - -DELETE FROM graph_base where from_id=10 and to_id=11; -INSERT INTO graph_base(from_id, to_id) VALUES (10,15); -INSERT INTO graph_base(from_id, to_id) VALUES (15,13); -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - -INSERT INTO graph_base(from_id, to_id) VALUES (21,22); -INSERT INTO graph_base(from_id, to_id) VALUES (4,17); -INSERT INTO graph_base(from_id, to_id) VALUES (4,16); -INSERT INTO graph_base(from_id, to_id) VALUES (17,18); -INSERT INTO graph_base (from_id,to_id) VALUES (4,6); - -#-- Without this when the line immediately after gets executed -#-- we get a segfault -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; -SELECT * from graph; -SELECT * from graph where latch='0'; -SELECT * from graph_base; - ---echo # And delete all references to node 5 -DELETE FROM graph_base WHERE from_id=5; -DELETE FROM graph_base WHERE from_id=3 AND to_id=5; - -#-- The following queries would currently return incorrect results -#-- 6 rows instead of 21 -#-- Maybe manifestation of https://bugs.launchpad.net/oqgraph/+bug/796647 ---echo # This is currently bogus: -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; -SELECT * from graph; -SELECT * from graph where latch='0'; -SELECT * from graph_base; - -DELETE FROM graph_base; - -#-- The following line would hang mysqld currently, see bug https://bugs.launchpad.net/oqgraph/+bug/1195735 -#-- SELECT * FROM graph; - -FLUSH TABLES; -TRUNCATE TABLE graph_base; - -DROP TABLE graph_base; -DROP TABLE graph; - - diff --git a/mysql-test/suite/oqgraph/regression_796647c.result b/mysql-test/suite/oqgraph/regression_796647c.result deleted file mode 100644 index d648e7ff192..00000000000 --- a/mysql-test/suite/oqgraph/regression_796647c.result +++ /dev/null @@ -1,127 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -SELECT count(*) FROM graph; -count(*) -2 -SELECT count(*) FROM graph_base; -count(*) -2 -INSERT INTO graph_base(from_id, to_id) VALUES (12,10); -SELECT count(*) FROM graph; -count(*) -3 -SELECT count(*) FROM graph_base; -count(*) -3 -INSERT INTO graph_base(from_id, to_id) VALUES (14,13); -SELECT count(*) FROM graph; -count(*) -4 -SELECT count(*) FROM graph_base; -count(*) -4 -DELETE FROM graph_base where from_id=10 and to_id=11; -INSERT INTO graph_base(from_id, to_id) VALUES (10,15); -INSERT INTO graph_base(from_id, to_id) VALUES (15,13); -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); -SELECT count(*) FROM graph; -count(*) -7 -SELECT count(*) FROM graph_base; -count(*) -7 -INSERT INTO graph_base(from_id, to_id) VALUES (21,22); -INSERT INTO graph_base (from_id,to_id) VALUES (4,6); -SELECT count(*) FROM graph; -count(*) -9 -SELECT count(*) FROM graph_base; -count(*) -9 -SELECT * FROM graph where latch='0'; -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 1 -0 NULL NULL NULL NULL 2 -0 NULL NULL NULL NULL 12 -0 NULL NULL NULL NULL 10 -0 NULL NULL NULL NULL 14 -0 NULL NULL NULL NULL 13 -0 NULL NULL NULL NULL 15 -0 NULL NULL NULL NULL 11 -0 NULL NULL NULL NULL 21 -0 NULL NULL NULL NULL 22 -0 NULL NULL NULL NULL 4 -0 NULL NULL NULL NULL 6 -SELECT * FROM graph_base; -from_id to_id -1 2 -2 1 -4 6 -10 11 -10 15 -12 10 -14 13 -15 13 -21 22 -# And delete all references to node 2 -DELETE FROM graph_base WHERE from_id=2; -DELETE FROM graph_base WHERE to_id=2; -SELECT count(*) FROM graph; -count(*) -7 -SELECT count(*) FROM graph_base; -count(*) -7 -SELECT * FROM graph where latch='0'; -latch origid destid weight seq linkid -0 NULL NULL NULL NULL 12 -0 NULL NULL NULL NULL 10 -0 NULL NULL NULL NULL 14 -0 NULL NULL NULL NULL 13 -0 NULL NULL NULL NULL 15 -0 NULL NULL NULL NULL 11 -0 NULL NULL NULL NULL 21 -0 NULL NULL NULL NULL 22 -0 NULL NULL NULL NULL 4 -0 NULL NULL NULL NULL 6 -SELECT * FROM graph_base; -from_id to_id -4 6 -10 11 -10 15 -12 10 -14 13 -15 13 -21 22 -DELETE FROM graph_base; -SELECT count(*) FROM graph; -count(*) -0 -SELECT count(*) FROM graph_base; -count(*) -0 -SELECT * FROM graph where latch='0'; -latch origid destid weight seq linkid -SELECT * FROM graph_base; -from_id to_id -FLUSH TABLES; -TRUNCATE TABLE graph_base; -DROP TABLE graph_base; -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/regression_796647c.test b/mysql-test/suite/oqgraph/regression_796647c.test deleted file mode 100644 index e0406122018..00000000000 --- a/mysql-test/suite/oqgraph/regression_796647c.test +++ /dev/null @@ -1,84 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - -INSERT INTO graph_base(from_id, to_id) VALUES (12,10); - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - -INSERT INTO graph_base(from_id, to_id) VALUES (14,13); - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - -DELETE FROM graph_base where from_id=10 and to_id=11; -INSERT INTO graph_base(from_id, to_id) VALUES (10,15); -INSERT INTO graph_base(from_id, to_id) VALUES (15,13); -INSERT INTO graph_base(from_id, to_id) VALUES (10,11); - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; - -INSERT INTO graph_base(from_id, to_id) VALUES (21,22); -INSERT INTO graph_base (from_id,to_id) VALUES (4,6); - -#-- Without this when the line immediately after gets executed -#-- we get a segfault -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; -SELECT * FROM graph where latch='0'; -SELECT * FROM graph_base; - ---echo # And delete all references to node 2 -DELETE FROM graph_base WHERE from_id=2; -DELETE FROM graph_base WHERE to_id=2; - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; -SELECT * FROM graph where latch='0'; -SELECT * FROM graph_base; - -DELETE FROM graph_base; - -SELECT count(*) FROM graph; -SELECT count(*) FROM graph_base; -SELECT * FROM graph where latch='0'; -SELECT * FROM graph_base; - -#-- The following line would hang mysqld currently, see bug https://bugs.launchpad.net/oqgraph/+bug/1195735 -#-- SELECT * FROM graph; - -FLUSH TABLES; -TRUNCATE TABLE graph_base; - -DROP TABLE graph_base; -DROP TABLE graph; - - diff --git a/mysql-test/suite/oqgraph/regression_drop_after.result b/mysql-test/suite/oqgraph/regression_drop_after.result deleted file mode 100644 index 84902676ef2..00000000000 --- a/mysql-test/suite/oqgraph/regression_drop_after.result +++ /dev/null @@ -1,28 +0,0 @@ -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; -CREATE TABLE graph_base ( -from_id INT UNSIGNED NOT NULL, -to_id INT UNSIGNED NOT NULL, -PRIMARY KEY (from_id,to_id), -INDEX (to_id) -) ENGINE=MyISAM; -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -SELECT * FROM graph; -latch origid destid weight seq linkid -NULL 1 2 1 NULL NULL -NULL 2 1 1 NULL NULL -DROP TABLE graph_base; -FLUSH TABLES; -SELECT * FROM graph; -ERROR 42S02: Table 'test.graph_base' doesn't exist -DROP TABLE graph; diff --git a/mysql-test/suite/oqgraph/regression_drop_after.test b/mysql-test/suite/oqgraph/regression_drop_after.test deleted file mode 100644 index b6f4418112c..00000000000 --- a/mysql-test/suite/oqgraph/regression_drop_after.test +++ /dev/null @@ -1,38 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS graph_base; -DROP TABLE IF EXISTS graph; ---enable_warnings - -# Create the backing store -CREATE TABLE graph_base ( - from_id INT UNSIGNED NOT NULL, - to_id INT UNSIGNED NOT NULL, - PRIMARY KEY (from_id,to_id), - INDEX (to_id) - ) ENGINE=MyISAM; - - -CREATE TABLE 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='graph_base' ORIGID='from_id', DESTID='to_id'; - - -INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1); -SELECT * FROM graph; -DROP TABLE graph_base; -FLUSH TABLES; # <-- without this, we still had it open so never see error... ---error S42S02 -SELECT * FROM graph; -DROP TABLE graph; - -# gdb script: -# bre ha_oqgraph::rnd_init -# ignore 1 1 -# run diff --git a/mysql-test/suite/oqgraph/social.result b/mysql-test/suite/oqgraph/social.result deleted file mode 100644 index 9b47701fb1a..00000000000 --- a/mysql-test/suite/oqgraph/social.result +++ /dev/null @@ -1,111 +0,0 @@ -DROP TABLE IF EXISTS rsb, rsb_graph; -CREATE TABLE rsb ( -f INT UNSIGNED NOT NULL, -t INT UNSIGNED NOT NULL, -weight FLOAT NOT NULL, -PRIMARY KEY (`f`,`t`), -KEY `t` (`t`) -) ENGINE=MyISAM; -CREATE TABLE rsb_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='rsb' origid='f' destid='t' weight='weight'; -DROP PROCEDURE IF EXISTS randnotx| -CREATE PROCEDURE randnotx (INOUT rseed INT, IN items INT, IN x INT, OUT rval INT) DETERMINISTIC -BEGIN -REPEAT -# Simple LCG (BSD) -SET rseed = (rseed * 1103515245 + 12345) & 2147483647; -SET rval = ((rseed >> 16) & 32767) MOD items; -UNTIL rval <> x -END REPEAT; -END;| -DROP PROCEDURE IF EXISTS randgraphproc| -CREATE PROCEDURE randgraphproc (IN items INT, IN friends INT, IN fanof INT, IN maxweight INT) DETERMINISTIC -BEGIN -DECLARE i,j,weight,rseed,rval INT; -SET rseed = items; -SET i = 0; -WHILE i < items DO -SET j = 0; -WHILE j < (friends + fanof) DO -CALL randnotx(rseed,items,i,rval); -IF (maxweight > 0) THEN -CALL randnotx(rseed,items,-1,weight); -SET weight = weight MOD maxweight; -ELSE -SET weight = 0; -END IF; -INSERT IGNORE rsb VALUES (i,rval,weight); -IF (j < friends) THEN -INSERT IGNORE rsb VALUES (rval,i,weight); -END IF; -SET j = j + 1; -END WHILE; -SET i = i + 1; -END WHILE; -END;| -CALL randgraphproc(10000,5,2,3); -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=1 AND destid=20; -GROUP_CONCAT(linkid ORDER BY seq) -1,5378,9993,8029,5613,9338,3730,7694,3546,9658,2825,6157,6461,1246,8678,8811,20 -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=1 AND destid=77; -GROUP_CONCAT(linkid ORDER BY seq) -1,5378,9993,8029,5613,9338,3730,7694,3546,2367,9994,3130,9577,7992,7995,53,8735,8654,9850,587,177,6509,8447,6927,6690,5454,1277,77 -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=1 AND destid=203; -GROUP_CONCAT(linkid ORDER BY seq) -1,5378,9993,8597,6078,2632,8846,6514,3189,8336,3327,4653,203 -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=1595 AND destid=8358; -GROUP_CONCAT(linkid ORDER BY seq) -1595,6255,7652,394,1532,3451,5615,9737,5886,8214,7462,6984,5822,5711,6363,2743,8584,7759,8683,7525,1874,212,5923,2399,3138,740,932,8358 -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=1 AND destid=9999; -GROUP_CONCAT(linkid ORDER BY seq) -1,5378,9993,8597,6078,2632,7381,6403,9177,1637,9762,2610,319,1310,3579,9999 -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=6841 AND destid=615; -GROUP_CONCAT(linkid ORDER BY seq) -6841,2979,9109,8306,7777,620,9982,8535,8151,6118,8654,9428,611,9696,3082,7219,9868,615 -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=369 AND destid=1845; -GROUP_CONCAT(linkid ORDER BY seq) -369,4586,6078,8597,9993,8029,5613,2993,1637,9177,3451,5615,9104,4004,2818,8311,8996,9023,9975,3847,4988,4480,6739,7520,6040,4585,7632,3956,1319,2427,6606,3443,9114,2907,1130,2389,8613,1534,4856,6961,6636,9136,7504,2777,8273,8215,7681,8859,1480,7167,663,3433,4719,3773,1845 -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=73 AND destid=914; -GROUP_CONCAT(linkid ORDER BY seq) -73,4247,9061,9994,3130,8274,9298,8790,8465,712,9028,646,1255,7384,6554,3193,914 -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=12345 AND destid=500; -GROUP_CONCAT(linkid ORDER BY seq) -NULL -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=300 AND destid=54321; -GROUP_CONCAT(linkid ORDER BY seq) -NULL -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND origid=1; -COUNT(*) -10000 -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND origid=8365; -COUNT(*) -10000 -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND origid=976; -COUNT(*) -10000 -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND origid=74; -COUNT(*) -10000 -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND destid=1; -COUNT(*) -10000 -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND destid=9999; -COUNT(*) -10000 -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND destid=52; -COUNT(*) -10000 -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND destid=6483; -COUNT(*) -10000 -DROP TABLE rsb_graph, rsb; -DROP PROCEDURE randgraphproc; -DROP PROCEDURE randnotx; diff --git a/mysql-test/suite/oqgraph/social.test b/mysql-test/suite/oqgraph/social.test deleted file mode 100644 index 69eb7698bb9..00000000000 --- a/mysql-test/suite/oqgraph/social.test +++ /dev/null @@ -1,131 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS rsb, rsb_graph; ---enable_warnings - -CREATE TABLE rsb ( - f INT UNSIGNED NOT NULL, - t INT UNSIGNED NOT NULL, - weight FLOAT NOT NULL, - PRIMARY KEY (`f`,`t`), - KEY `t` (`t`) -) ENGINE=MyISAM; - -CREATE TABLE rsb_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='rsb' origid='f' destid='t' weight='weight'; - - -# this graph generator is designed to be deterministic -# (so we don't need to ship a large test dataset) -# --source suite/oqgraph/randgraphproc.inc - -# SQL implementation of randsocial.c for OQGRAPH -# Copyright (C) 2013 by Arjen Lentz <arjen@openquery.com> for Open Query -# GPL v2+ licensed with the rest of OQGRAPH -# for use in mysql-test -# 2013-03-01 first implementation based on randsocial.c in old oqgraph v2 tree - -delimiter |; ---disable_warnings -DROP PROCEDURE IF EXISTS randnotx| ---enable_warnings -CREATE PROCEDURE randnotx (INOUT rseed INT, IN items INT, IN x INT, OUT rval INT) DETERMINISTIC -BEGIN - REPEAT - # Simple LCG (BSD) - SET rseed = (rseed * 1103515245 + 12345) & 2147483647; - SET rval = ((rseed >> 16) & 32767) MOD items; - UNTIL rval <> x - END REPEAT; -END;| - - -# this procedure is deterministic with its private seeded random generator ---disable_warnings -DROP PROCEDURE IF EXISTS randgraphproc| ---enable_warnings -CREATE PROCEDURE randgraphproc (IN items INT, IN friends INT, IN fanof INT, IN maxweight INT) DETERMINISTIC -BEGIN - DECLARE i,j,weight,rseed,rval INT; - - SET rseed = items; - - SET i = 0; - WHILE i < items DO - SET j = 0; - WHILE j < (friends + fanof) DO - CALL randnotx(rseed,items,i,rval); - - IF (maxweight > 0) THEN - CALL randnotx(rseed,items,-1,weight); - SET weight = weight MOD maxweight; - ELSE - SET weight = 0; - END IF; - - INSERT IGNORE rsb VALUES (i,rval,weight); - - IF (j < friends) THEN - INSERT IGNORE rsb VALUES (rval,i,weight); - END IF; - - SET j = j + 1; - END WHILE; - - SET i = i + 1; - END WHILE; -END;| - -DELIMITER ;| - - -# generate social graph of 10000 people having 5 friends (two-way) and being fan of 2 others (one-way)), max weight 3 -CALL randgraphproc(10000,5,2,3); - -# some random paths -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=1 AND destid=20; -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=1 AND destid=77; -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=1 AND destid=203; -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=1595 AND destid=8358; -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=1 AND destid=9999; -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=6841 AND destid=615; -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=369 AND destid=1845; -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=73 AND destid=914; - -# nonexistent origin -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=12345 AND destid=500; - -# noexistent destination -SELECT GROUP_CONCAT(linkid ORDER BY seq) FROM rsb_graph WHERE latch='dijkstras' AND origid=300 AND destid=54321; - -# how many possible destinations from here -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND origid=1; -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND origid=8365; -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND origid=976; -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND origid=74; - -# how many possible sources to here -# this doesn't appear to work right now in v3 ? #if 0 in code. check with Antony -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND destid=1; -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND destid=9999; -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND destid=52; -SELECT COUNT(*) FROM rsb_graph WHERE latch='dijkstras' AND destid=6483; - -# breadth first -# other algorithms -# joins - -# cleaning up our tables -DROP TABLE rsb_graph, rsb; - -# cleaning up procs from randgraphproc.inc -DROP PROCEDURE randgraphproc; -DROP PROCEDURE randnotx; - diff --git a/mysql-test/suite/oqgraph/suite.opt b/mysql-test/suite/oqgraph/suite.opt deleted file mode 100644 index 9f10d4e06ef..00000000000 --- a/mysql-test/suite/oqgraph/suite.opt +++ /dev/null @@ -1 +0,0 @@ ---plugin-load-add=$HA_OQGRAPH_SO --enable-oqgraph diff --git a/mysql-test/suite/oqgraph/suite.pm b/mysql-test/suite/oqgraph/suite.pm deleted file mode 100644 index 4e98aa9757c..00000000000 --- a/mysql-test/suite/oqgraph/suite.pm +++ /dev/null @@ -1,9 +0,0 @@ -package My::Suite::OQGraph; - -@ISA = qw(My::Suite); - -return "No OQGraph" unless $ENV{HA_OQGRAPH_SO} or - $::mysqld_variables{'oqgraph'} eq "ON"; - -bless { }; - diff --git a/mysql-test/suite/sphinx/my.cnf b/mysql-test/suite/sphinx/my.cnf deleted file mode 100644 index a3789a065bf..00000000000 --- a/mysql-test/suite/sphinx/my.cnf +++ /dev/null @@ -1,30 +0,0 @@ -!include include/default_my.cnf - -[source src1] -type = xmlpipe2 -xmlpipe_command = cat @ENV.MTR_SUITE_DIR/testdata.xml - -[index test1] -source = src1 -docinfo = extern -charset_type = utf-8 -path = @ENV.MYSQLTEST_VARDIR/searchd/test1 - -[indexer] -mem_limit = 32M - -[searchd] -read_timeout = 5 -max_children = 30 -max_matches = 1000 -seamless_rotate = 1 -preopen_indexes = 0 -unlink_old = 1 -log = @ENV.MYSQLTEST_VARDIR/searchd/sphinx-searchd.log -query_log = @ENV.MYSQLTEST_VARDIR/searchd/sphinx-query.log -#log-error = @ENV.MYSQLTEST_VARDIR/searchd/sphinx.log -pid_file = @ENV.MYSQLTEST_VARDIR/run/searchd.pid -port = @ENV.SPHINXSEARCH_PORT - -[ENV] -SPHINXSEARCH_PORT = @OPT.port diff --git a/mysql-test/suite/sphinx/sphinx.result b/mysql-test/suite/sphinx/sphinx.result deleted file mode 100644 index 5fe11f4671b..00000000000 --- a/mysql-test/suite/sphinx/sphinx.result +++ /dev/null @@ -1,56 +0,0 @@ -create table ts ( id bigint unsigned not null, w int not null, q varchar(255) not null, index(q) ) engine=sphinx connection="sphinx://127.0.0.1:SPHINXSEARCH_PORT/*"; -select * from ts where q='test'; -id w q -1 2 test -2 2 test -4 1 test -drop table ts; -create table ts ( id bigint unsigned not null, w int not null, q varchar(255) not null, index(q) ) engine=sphinx connection="sphinx://127.0.0.1:SPHINXSEARCH_PORT/*"; -select * from ts where q='test;filter=gid,1;mode=extended'; -id w q -1 2421 test;filter=gid,1;mode=extended -2 2421 test;filter=gid,1;mode=extended -select * from ts where q='test|one;mode=extended'; -id w q -1 3595 test|one;mode=extended -2 2460 test|one;mode=extended -4 1471 test|one;mode=extended -select * from ts where q='test;offset=1;limit=1'; -id w q -2 2 test;offset=1;limit=1 -alter table ts connection="sphinx://127.0.0.1:SPHINXSEARCH_PORT/test1"; -select id, w from ts where q='one'; -id w -1 2 -drop table ts; -create table ts ( id bigint unsigned not null, w int not null, q varchar(255) not null, gid int not null, _sph_count int not null, index(q) ) engine=sphinx connection="sphinx://127.0.0.1:SPHINXSEARCH_PORT/test1"; -select * from ts; -id w q gid _sph_count -select * from ts where q=''; -id w q gid _sph_count -1 1 1 0 -2 1 1 0 -3 1 2 0 -4 1 2 0 -select * from ts where q=';groupby=attr:gid'; -id w q gid _sph_count -3 1 ;groupby=attr:gid 2 2 -1 1 ;groupby=attr:gid 1 2 -explain select * from ts where q=';groupby=attr:gid'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE ts ref q q 257 const 3 Using where with pushed condition -SET @save_optimizer_switch=@@optimizer_switch; -SET optimizer_switch='index_condition_pushdown=off'; -explain select * from ts where q=';groupby=attr:gid'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE ts ref q q 257 const 3 Using where with pushed condition -SET optimizer_switch=@save_optimizer_switch; -drop table ts; -show status like "sphinx_total%"; -Variable_name Value -Sphinx_total 2 -Sphinx_total_found 2 -show status like "sphinx_word%"; -Variable_name Value -Sphinx_word_count 0 -Sphinx_words diff --git a/mysql-test/suite/sphinx/sphinx.test b/mysql-test/suite/sphinx/sphinx.test deleted file mode 100644 index 126131209c5..00000000000 --- a/mysql-test/suite/sphinx/sphinx.test +++ /dev/null @@ -1,34 +0,0 @@ - ---replace_result $SPHINXSEARCH_PORT SPHINXSEARCH_PORT -eval create table ts ( id bigint unsigned not null, w int not null, q varchar(255) not null, index(q) ) engine=sphinx connection="sphinx://127.0.0.1:$SPHINXSEARCH_PORT/*"; -select * from ts where q='test'; -drop table ts; - ---replace_result $SPHINXSEARCH_PORT SPHINXSEARCH_PORT -eval create table ts ( id bigint unsigned not null, w int not null, q varchar(255) not null, index(q) ) engine=sphinx connection="sphinx://127.0.0.1:$SPHINXSEARCH_PORT/*"; -select * from ts where q='test;filter=gid,1;mode=extended'; -select * from ts where q='test|one;mode=extended'; -select * from ts where q='test;offset=1;limit=1'; ---replace_result $SPHINXSEARCH_PORT SPHINXSEARCH_PORT -eval alter table ts connection="sphinx://127.0.0.1:$SPHINXSEARCH_PORT/test1"; -select id, w from ts where q='one'; -drop table ts; - ---replace_result $SPHINXSEARCH_PORT SPHINXSEARCH_PORT -eval create table ts ( id bigint unsigned not null, w int not null, q varchar(255) not null, gid int not null, _sph_count int not null, index(q) ) engine=sphinx connection="sphinx://127.0.0.1:$SPHINXSEARCH_PORT/test1"; -select * from ts; -select * from ts where q=''; -select * from ts where q=';groupby=attr:gid'; -explain select * from ts where q=';groupby=attr:gid'; -SET @save_optimizer_switch=@@optimizer_switch; -SET optimizer_switch='index_condition_pushdown=off'; -explain select * from ts where q=';groupby=attr:gid'; -SET optimizer_switch=@save_optimizer_switch; -drop table ts; - -# -# Don't show sphinx error as this is different between sphinx versions -# show status like "sphinx_error%"; - -show status like "sphinx_total%"; -show status like "sphinx_word%"; diff --git a/mysql-test/suite/sphinx/suite.opt b/mysql-test/suite/sphinx/suite.opt deleted file mode 100644 index 7b425b045f7..00000000000 --- a/mysql-test/suite/sphinx/suite.opt +++ /dev/null @@ -1 +0,0 @@ ---plugin-load-add=$HA_SPHINX_SO --sphinx diff --git a/mysql-test/suite/sphinx/suite.pm b/mysql-test/suite/sphinx/suite.pm deleted file mode 100644 index f9787d80aa3..00000000000 --- a/mysql-test/suite/sphinx/suite.pm +++ /dev/null @@ -1,118 +0,0 @@ -package My::Suite::Sphinx; - -use My::SafeProcess; -use My::File::Path; -use mtr_report; - -@ISA = qw(My::Suite); - -############# initialization ###################### -sub locate_sphinx_binary { - my ($name)= @_; - my $res; - my @list= map "$_/$name", split /:/, $ENV{PATH}; - my $env_override= $ENV{"SPHINXSEARCH_\U$name"}; - @list= ($env_override) if $env_override; - for (@list) { return $_ if -x $_; } -} - -# Look for Sphinx binaries. -my $exe_sphinx_indexer = &locate_sphinx_binary('indexer'); -my $exe_sphinx_searchd = &locate_sphinx_binary('searchd'); - -return "No Sphinx" unless $exe_sphinx_indexer and $exe_sphinx_searchd; -return "No SphinxSE" unless $ENV{HA_SPHINX_SO} or - $::mysqld_variables{'sphinx'} eq "ON"; - -{ - local $_ = `"$exe_sphinx_searchd" --help`; - mtr_verbose("tool: $exe_sphinx_searchd\n$_"); - my $ver = sprintf "%04d.%04d.%04d", (/([0-9]+)\.([0-9]+)(?:\.([0-9]+))?/); - return "Sphinx 2.0.4 or later is needed (found $ver) " unless $ver ge '0002.0000.0004'; -} - -############# action methods ###################### - -sub write_sphinx_conf { - my ($config) = @_; # My::Config - my $res; - - foreach my $group ($config->groups()) { - my $name= $group->{name}; - # Only the ones relevant to Sphinx search. - next unless ($name eq 'indexer' or $name eq 'searchd' or - $name =~ /^(source|index) \w+$/); - $res .= "$name\n{\n"; - foreach my $option ($group->options()) { - $res .= $option->name(); - my $value= $option->value(); - if (defined $value) { - $res .= "=$value"; - } - $res .= "\n"; - } - $res .= "}\n\n"; - } - $res; -} - -sub searchd_start { - my ($sphinx, $test) = @_; # My::Config::Group, My::Test - - return unless $exe_sphinx_indexer and $exe_sphinx_searchd; - - # First we must run the indexer to create the data. - my $sphinx_data_dir= "$::opt_vardir/" . $sphinx->name(); - mkpath($sphinx_data_dir); - my $sphinx_log= $sphinx->value('#log-error'); - my $sphinx_config= "$::opt_vardir/my_sphinx.conf"; - my $cmd= "\"$exe_sphinx_indexer\" --config \"$sphinx_config\" test1 > \"$sphinx_log\" 2>&1"; - &::mtr_verbose("cmd: $cmd"); - system $cmd; - - # Then start the searchd daemon. - my $args; - &::mtr_init_args(\$args); - &::mtr_add_arg($args, "--config"); - &::mtr_add_arg($args, $sphinx_config); - &::mtr_add_arg($args, "--console"); - &::mtr_add_arg($args, "--pidfile"); - - $sphinx->{'proc'}= My::SafeProcess->new - ( - name => 'sphinx-' . $sphinx->name(), - path => $exe_sphinx_searchd, - args => \$args, - output => $sphinx_log, - error => $sphinx_log, - append => 1, - nocore => 1, - ); - &::mtr_verbose("Started $sphinx->{proc}"); -} - -sub searchd_wait { - my ($sphinx) = @_; # My::Config::Group - - return not &::sleep_until_file_created($sphinx->value('pid_file'), 20, - $sphinx->{'proc'}) -} - -############# declaration methods ###################### - -sub config_files() { - ( 'my_sphinx.conf' => \&write_sphinx_conf ) -} - -sub servers { - ( qr/^searchd$/ => { - SORT => 400, - START => \&searchd_start, - WAIT => \&searchd_wait, - } - ) -} - -############# return an object ###################### -bless { }; - diff --git a/mysql-test/suite/sphinx/testdata.xml b/mysql-test/suite/sphinx/testdata.xml deleted file mode 100644 index e0d7394190f..00000000000 --- a/mysql-test/suite/sphinx/testdata.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<sphinx:docset> - -<sphinx:schema> -<sphinx:field name="title"/> -<sphinx:field name="content"/> -<sphinx:attr name="gid" type="int"/> -</sphinx:schema> - -<sphinx:document id="1"> -<title>test one</title> -<content>this is my test document number one. also checking search within phrases.</content> -<gid>1</gid> -</sphinx:document> - -<sphinx:document id="2"> -<title>test two</title> -<content>this is my test document number two</content> -<gid>1</gid> -</sphinx:document> - -<sphinx:document id="3"> -<title>another doc</title> -<content>this is another group</content> -<gid>2</gid> -</sphinx:document> - -<sphinx:document id="4"> -<title>doc number four</title> -<content>this is to test groups</content> -<gid>2</gid> -</sphinx:document> - -</sphinx:docset> - |