[MDEV-15006] OQGraph doesn't produce next step links Created: 2018-01-19 Updated: 2022-09-12 Resolved: 2022-09-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - OQGRAPH |
| Affects Version/s: | 10.0 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Mr A Kitson | Assignee: | Andrew McDonnell |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux - Ubuntu 16.04 |
||
| Description |
|
Hi, I'm prototyping an accounting system based around OQGraph but I've hit a stop Here's my data: SELECT linkid gives me linkid which is expected and works. Perfect for updating all the parent accounts in one go. but select linkid from sa_coa_graph where latch = '' gives nothing. Not what I'm expecting. In this case I'd expect a result containing linkid == 1 i.e. the first hop link. Setting origid to any other 'parent' gives no first hop links as described in docs at https://mariadb.com/kb/en/library/oqgraph-examples/ In this case I want to use OQGraph to help me reconstruct the tree back into my parent program (PHP).As there is no functionality to get the linkage in any form of tree, I assumed you'd intended that this mechanism was a step towards doing so. Am I missing something? Kind regards |
| Comments |
| Comment by Elena Stepanova [ 2018-01-23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Which version are you using? What is the engine of the backing table? Could you please paste the structures and attach the cnf file?
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mr A Kitson [ 2018-01-23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Elena I figured a different way to do it, but you can find the code at https://github.com/chippyash/simple-accounts-3/tree/master/src/sql. The code I developed to get round the problem is in https://github.com/chippyash/simple-accounts-3/blob/master/src/sql/build-procs.sql sa_sp_get_tree function, which works just fine. It runs on mariadb 10.0. You can see build result (of the running code) at https://travis-ci.org/chippyash/simple-accounts-3 I'd still be interested as to why select linkid from sa_coa_graph where latch = '' failed to perform as expected. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2018-10-05 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It appears that the result depends on the indexes in the backing table.
But if you add a key on prntId, it works as you expect:
I'm not sure if it's by design, the current documentation doesn't say it explicitly. Assigning to andymc73 to confirm (or not). pprkut, or should it be for you? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-09-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
10.0 was EOLed in March 2019 |