Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5744

OQGRAPH backing table changes not reflected in OQGRAPH table

    Details

      Description

      An update to the backing OQGRAPH table does not reflect when querying the OQGRAPH table. The change reflects after a server restart.

      Running Ubuntu 12.04 32-bit. MariaDB 10.0.7 installed from standard package, 3.2.0-58-gerneric-pae kernel, dual CPU

      How to repeat:

      CREATE TABLE oq2_backing (
        origid INT UNSIGNED NOT NULL,
        destid INT UNSIGNED NOT NULL,
        weight DOUBLE NOT NULL,
        PRIMARY KEY (origid, destid),
        KEY (destid)
      );
      
      INSERT INTO oq2_backing(origid, destid, weight)
       VALUES (1,2,1), (2,3,1), (3,4,3), (4,5,1), (2,6,10), (5,6,2);
      
      CREATE TABLE oq2_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='oq2_backing' origid='origid' destid='destid' weight='weight';
      
      UPDATE oq2_backing SET weight=4 WHERE origid=2 AND destid=6;
      
      SELECT * FROM oq2_backing;
      +--------+--------+--------+
      | origid | destid | weight |
      +--------+--------+--------+
      | 1 | 2 | 1 |
      | 2 | 3 | 1 |
      | 2 | 6 | 4 |
      | 3 | 4 | 3 |
      | 4 | 5 | 1 |
      | 5 | 6 | 2 |
      +--------+--------+--------+
      
      SELECT * FROM oq2_graph;
      +-------+--------+--------+--------+------+--------+
      | latch | origid | destid | weight | seq | linkid |
      +-------+--------+--------+--------+------+--------+
      | NULL | 1 | 2 | 1 | NULL | NULL |
      | NULL | 2 | 3 | 1 | NULL | NULL |
      | NULL | 2 | 6 | 10 | NULL | NULL |
      | NULL | 3 | 4 | 3 | NULL | NULL |
      | NULL | 4 | 5 | 1 | NULL | NULL |
      | NULL | 5 | 6 | 2 | NULL | NULL |
      +-------+--------+--------+--------+------+--------+
      

      I have repeated the bug on another machine, Ubuntu 12.04 64-bit, both fairly standard my.cnf settings. The problem persists on 10.0.8.

      I have reported this bug upstream at https://bugs.launchpad.net/oqgraph/+bug/1279246 but there has been no activity.

      The problem also appears to affect others - see https://mariadb.com/kb/en/how-do-i-keep-the-graph-table-and-data-table-in-sync/#comment_1055

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              rspadim roberto spadim added a comment -
              Show
              rspadim roberto spadim added a comment - i think this problem isn't solved, at least to 10.1 and launchpad 10.0 http://bazaar.launchpad.net/~maria-captains/maria/10.0/changes?filter_file_id=ha_oqgraph.cc-20091109115125-39rbuqeoqlrz4bux-11
              Hide
              elenst Elena Stepanova added a comment -

              The change was in ha_oqgraph.h, while you are looking at ha_oqgraph.cc.
              If you tthink it doesn't work, please provide a test case.

              Show
              elenst Elena Stepanova added a comment - The change was in ha_oqgraph.h, while you are looking at ha_oqgraph.cc. If you tthink it doesn't work, please provide a test case.
              Hide
              rspadim roberto spadim added a comment -

              that's right i was searching rev 4012 at .cc not .h

              Show
              rspadim roberto spadim added a comment - that's right i was searching rev 4012 at .cc not .h
              Hide
              rspadim roberto spadim added a comment -

              i will change documentation

              Show
              rspadim roberto spadim added a comment - i will change documentation
              Hide
              rspadim roberto spadim added a comment -

              docs changed...
              but i'm with another idea....
              internally at query cache we have tables used in a query, right?
              instead of only report to query cache as can't cache queries, could we include the data table to query cache? when the data table invalidate query cache it will check that the oqgraph queries are using the data table and will invalidate it too, for example:

              select * from oq_graph
              this will include "select * from oq_graph" at query cache using table 'oq_graph'
              but instead of only using 'oq_graph' we include 'oq_graph' AND 'data_table' even when we 'only' used oq_graph at FROM part
              this is more interesting than turning query cache off to oq_graph

              Show
              rspadim roberto spadim added a comment - docs changed... but i'm with another idea.... internally at query cache we have tables used in a query, right? instead of only report to query cache as can't cache queries, could we include the data table to query cache? when the data table invalidate query cache it will check that the oqgraph queries are using the data table and will invalidate it too, for example: select * from oq_graph this will include "select * from oq_graph" at query cache using table 'oq_graph' but instead of only using 'oq_graph' we include 'oq_graph' AND 'data_table' even when we 'only' used oq_graph at FROM part this is more interesting than turning query cache off to oq_graph

                People

                • Assignee:
                  elenst Elena Stepanova
                  Reporter:
                  greenman Ian Gilfillan
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 1 hour
                    1h