diff options
author | Andrew McDonnell <bugs@andrewmcdonnell.net> | 2013-08-02 20:36:45 +0930 |
---|---|---|
committer | Andrew McDonnell <bugs@andrewmcdonnell.net> | 2013-08-02 20:36:45 +0930 |
commit | 73c19f8473b451b5eeff2c8b6b8120f00809a130 (patch) | |
tree | d4518821ddcb0b6841bfc6c7f867014cff484b65 /mysql-test/suite/oqgraph | |
parent | e87960d346340e1674181dc1fc9686f9131c286e (diff) | |
download | mariadb-git-73c19f8473b451b5eeff2c8b6b8120f00809a130.tar.gz |
Update test case regression test comment for lp:1196027
Diffstat (limited to 'mysql-test/suite/oqgraph')
-rw-r--r-- | mysql-test/suite/oqgraph/basic.test | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/mysql-test/suite/oqgraph/basic.test b/mysql-test/suite/oqgraph/basic.test index a02783bf01e..b38c68cd52f 100644 --- a/mysql-test/suite/oqgraph/basic.test +++ b/mysql-test/suite/oqgraph/basic.test @@ -593,3 +593,73 @@ 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. + + |