Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.1.18, 10.0.27, 10.2.2
-
10.1.22, 10.2.10
Description
OQGRAPH has several algorithms that support listing vertices from which a path can be found to a given destination node.
Tables:
CREATE TABLE `oq_backing` ( |
`origid` int(10) unsigned NOT NULL, |
`destid` int(10) unsigned NOT NULL, |
PRIMARY KEY (`origid`,`destid`), |
KEY `destid` (`destid`) |
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
|
CREATE TABLE `oq_graph` ( |
`latch` varchar(32) DEFAULT NULL, |
`origid` bigint(20) unsigned DEFAULT NULL, |
`destid` bigint(20) unsigned DEFAULT NULL, |
`weight` double DEFAULT NULL, |
`seq` bigint(20) unsigned DEFAULT NULL, |
`linkid` bigint(20) unsigned DEFAULT NULL, |
KEY `latch` (`latch`,`origid`,`destid`) USING HASH, |
KEY `latch_2` (`latch`,`destid`,`origid`) USING HASH |
) ENGINE=OQGRAPH DEFAULT CHARSET=latin1 `data_table`='oq_backing' `origid`='origid' `destid`='destid'; |
prepare data:
INSERT INTO oq_backing (origid, destid) VALUES (0,1), (1,2), (2,3); |
query:
SELECT * FROM oq_graph WHERE latch = 'breadth_first' AND destid = 2; |
+---------------+--------+--------+--------+------+--------+ |
| latch | origid | destid | weight | seq | linkid |
|
+---------------+--------+--------+--------+------+--------+ |
| breadth_first | NULL | 2 | 1 | 2 | 3 | |
| breadth_first | NULL | 2 | 0 | 1 | 2 | |
+---------------+--------+--------+--------+------+--------+ |