<?xml version="1.0" encoding="utf-8"?>
<launchpad-bug id="837496">
  <date_last_updated>2011-10-13 16:23:16.444574+00:00</date_last_updated>
  <api_links>
    <bug_api_link>https://api.launchpad.net/1.0/bugs/837496</bug_api_link>
    <bug_owner_link>https://api.launchpad.net/1.0/~svar</bug_owner_link>
    <milestone_link></milestone_link>
    <linked_branches_collection_link>https://api.launchpad.net/1.0/bugs/837496/linked_branches</linked_branches_collection_link>
    <activity_link>https://api.launchpad.net/1.0/bugs/837496/activity</activity_link>
  </api_links>
  <bug_web_link>https://bugs.launchpad.net/bugs/837496</bug_web_link>
  <owner>Stephane VAROQUI</owner>
  <assignee></assignee>
  <milestone_title></milestone_title>
  <duplicate_link></duplicate_link>
  <duplicate_bug_id></duplicate_bug_id>
  <title>Empty resultset when joining OQGRAPH tables</title>
  <status>New</status>
  <importance>Undecided</importance>
  <created>2011-08-30 15:59:36.853937+00:00</created>
  <description>
<![CDATA[tested on mariadb 5.2.8

Issue SELECT with JOIN OR SUBQUERIES    

SELECT * FROM t_oqg WHERE  t_oqg.origid IN (1,2,3) AND latch =1;
works fine 

SELECT * FROM t_oqg INNER JON t1 ON t1.id = t_oqg.origid WHERE  t1.id IN (1,2,3)  AND  t_oqg.latch =1;
empty result

SELECT * FROM t_oqg  WHERE   t_oqg.origid IN (SELECT t1.id  FROM t1  WHERE  t1.id IN (1,2,3))  AND  t_oqg.latch =1;
empty result]]>  </description>
  <activities>
    <activity datechanged="2011-08-30T15:59:36.853937+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Stephane VAROQUI</person>
      <message>added bug</message>
    </activity>
    <activity datechanged="2011-08-30T16:13:03.378386+00:00">
      <oldvalue>
<![CDATA[oqgraph]]>      </oldvalue>
      <newvalue>
<![CDATA[maria]]>      </newvalue>
      <whatchanged>affects</whatchanged>
      <person>Stephane VAROQUI</person>
      <message></message>
    </activity>
    <activity datechanged="2011-08-30T17:48:54.960908+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[oqgraph]]>      </newvalue>
      <whatchanged>bug task added</whatchanged>
      <person>Philip Stoev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-08-31T03:08:15.394168+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Antony T Curtis (atcurtis)]]>      </newvalue>
      <whatchanged>oqgraph: assignee</whatchanged>
      <person>Arjen Lentz</person>
      <message></message>
    </activity>
    <activity datechanged="2011-08-31T03:12:23.289745+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Arjen Lentz</person>
      <message>added subscriber Arjen Lentz</message>
    </activity>
    <activity datechanged="2011-10-13T16:23:15.702176+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[leaf-explain.txt https://bugs.launchpad.net/oqgraph/+bug/837496/+attachment/2540219/+files/leaf-explain.txt]]>      </newvalue>
      <whatchanged>attachment added</whatchanged>
      <person>Steven Peckins</person>
      <message></message>
    </activity>
  </activities>
  <comments>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/837496/comments/1" datecreated="2011-08-31T03:12:57.297862+00:00">
      <person>Arjen Lentz</person>
      <subject>
<![CDATA[Re: Empty resultset when joining OQGRAPH tables]]>      </subject>
      <content>
<![CDATA[Interesting, Stephane. I haven't seen a join fail like this before.

One issue might be the join-order that the optimiser works out for your join, likely it'll do t1 first and that might create a problem, as looking up origid makes no sense, it should be "stuffed in to" the engine so it can do its calculations. The subquery does something similar.

Do you have EXPLAIN output for this, and possibly a debug log so we can see what the optimiser is thinking?
thanks]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/837496/comments/2" datecreated="2011-10-13T16:23:15.702176+00:00">
      <person>Steven Peckins</person>
      <subject>
<![CDATA[Re: Empty resultset when joining OQGRAPH tables]]>      </subject>
      <content>
<![CDATA[I'm just discovering OQGRAPH, and I immediately ran into this issue.  I'm looking at OQG for simplifying management and queries of categorical data (trees) , and one of the queries I want to execute is "show me the paths for leaf nodes to the root of a branch."  The query works for explicit values in an IN() clause but not the same values returned by a subquery.

I'll attach a simple case using a tiny subset of the Tree of Life data including EXPLAIN EXTENDED for each query.  Generated using MariaDB 5.2.9.
]]>      </content>
    </comment>
  </comments>
  <messages>
    <message created="2011-10-13 16:23:15.702176+00:00" owner="Steven Peckins">
<![CDATA[I'm just discovering OQGRAPH, and I immediately ran into this issue.  I'm looking at OQG for simplifying management and queries of categorical data (trees) , and one of the queries I want to execute is "show me the paths for leaf nodes to the root of a branch."  The query works for explicit values in an IN() clause but not the same values returned by a subquery.

I'll attach a simple case using a tiny subset of the Tree of Life data including EXPLAIN EXTENDED for each query.  Generated using MariaDB 5.2.9.
]]>      <attachment link="https://bugs.launchpad.net/bugs/837496/+attachment/2540219" type="Unspecified">
        <title>leaf-explain.txt</title>
        <file>LPexportBug837496_leaf-explain.txt</file>
      </attachment>
    </message>
  </messages>
</launchpad-bug>
