← Back to team overview

oqgraph-dev team mailing list archive

[Bug 1133093] Re: Crash on ORDER BY in OQGRAPH v3

 

I think I fixed this, by calling row_ref from index_read() before the
cursor gets set (and using in place new)

=== modified file 'storage/oqgraph/graphcore.cc'
--- storage/oqgraph/graphcore.cc	2013-08-09 11:20:16 +0000
+++ storage/oqgraph/graphcore.cc	2013-08-11 14:29:41 +0000
@@ -947,7 +947,7 @@
     if (cursor)
       cursor->current(ref);
     else
-      ref= reference();
+      new (ref_ptr) reference(); // avoid assignment operator because the intrusive_ptr swaps for unknown reasons, which means if ref is uninitialised it segfaults
   }

=== modified file 'storage/oqgraph/ha_oqgraph.cc'
--- storage/oqgraph/ha_oqgraph.cc	2013-08-10 15:01:12 +0000
+++ storage/oqgraph/ha_oqgraph.cc	2013-08-11 14:31:05 +0000
@@ -740,6 +740,7 @@
 			enum ha_rkey_function find_flag)
 {
   DBUG_ASSERT(inited==INDEX);
+  graph->row_ref((void*) ref);	// reset before we have a cursor, so the memory is inited, avoiding the sefgault in position() when select with order by (bug #1133093)
   return index_read_idx(buf, active_index, key, key_len, find_flag);
 }
 

Problem is it now causes an assertion inside myisam via closefrm() when
closing edges in ha_oqgraph::close() when DROP TABLE at finish of test

Looks like a cursor didn't close something somewhere?  And I really
don't understand how to fix this one :-(

-- 
You received this bug notification because you are a member of OQgraph
developers, which is a bug assignee.
https://bugs.launchpad.net/bugs/1133093

Title:
  Crash on ORDER BY in OQGRAPH v3

Status in OQGraph Engine for MariaDB:
  Triaged

Bug description:
  SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=6;
  works

  SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=6 ORDER BY seq;
  segfaults.

To manage notifications about this bug go to:
https://bugs.launchpad.net/oqgraph/+bug/1133093/+subscriptions


References