Bugs item #2276427, was opened at 2008-11-13 14:48
Message generated for change (Comment added) made by tsheyar
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2276427&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Hans (hans_0_)
Assigned to: Jan Rittinger (tsheyar)
Summary: CMDmulti_merged_union: operation failed

Initial Comment:
This error was raised with the following xquery:


let $indexdoc :=   <XIRAF>
    <link xid="127403" nid="2070022"><properties/></link>
    <link xid="127431" nid="2070238"><properties/></link>
    <file xid="146327" 
nid="2367886"><properties><name>name1</name></properties></file>
    <folder xid="148892" 
nid="2408034"><properties><name>name2</name></properties></folder>
  </XIRAF>
let $notesdoc := (<root><notes>
<objectnote unixtime="1222247507" user="user1" xid="146327">On 24 Sep 2008 
09:11:47 GMT user1 wrote: Interessant </objectnote>
<objectnote unixtime="1216997181" user="user2" xid="148892">On 25 Jul 2008 
16:46:21 GMT user2 wrote: folder name sounds suspicious</objectnote>
<objectnote unixtime="1216652532" user="user2" xid="127403">On 21 Jul 2008 
17:02:12 GMT user2 wrote: een hyves account.. </objectnote>
<objectnote unixtime="1216652365" user="user2" xid="127431">On 21 Jul 2008 
16:59:25 GMT user2 wrote: Datum van zoekopdracht: 3 Jun 2008 16:10:42 
GMT</objectnote>
<objectnote unixtime="1216652301" user="user2" xid="127431">On 21 Jul 2008 
16:58:21 GMT user2 wrote: hmmm, </objectnote>
</notes></root>)
let $result := (let $input := ($indexdoc//*[properties])
let $notedxids := distinct-values($notesdoc/notes/objectnote/@xid) 
let $notedobjectsresult := $input intersect 
(for $notedxid in $notedxids 
 return [EMAIL PROTECTED]) 
 for $raw in $notedobjectsresult 
 return $raw 
)
let $subresult := subsequence($result, 1, 1000)
let $nobj := count($subresult)
let $out := (
  for $i in $subresult
  let $note := ($notesdoc/notes/[EMAIL PROTECTED]/@xid])[1]
  return element { name($i) } {
    attribute nid {  string(exactly-one(pf:nid(exactly-one($i)))) },
    $i/@xid,
    $i/properties/(name) 
    ,$note
})
return element result {
    element matches    { count($result) },
    element results    { $out }
}
<>

Raises the following error report:

MAPI  = [EMAIL PROTECTED]:51240
QUERY = let $indexdoc :=   <XIRAF>
ERROR = !ERROR: merged_union: tail of first BAT/column of table 3 must be 
sorted.
        !ERROR: CMDmulti_merged_union: operation failed.

Whereas the following xquery:

let $indexdoc :=   <XIRAF>
    <link xid="127403" nid="2070022"><properties/></link>
    <link xid="127431" nid="2070238"><properties/></link>
    <file xid="146327" 
nid="2367886"><properties><name>name1</name></properties></file>
    <folder xid="148892" 
nid="2408034"><properties><name>name2</name></properties></folder>
  </XIRAF>
let $notesdoc := (<root><notes>
<objectnote unixtime="1222247507" user="user1" xid="146327">On 24 Sep 2008 
09:11:47 GMT user1 wrote: Interessant </objectnote>
<objectnote unixtime="1216997181" user="user2" xid="148892">On 25 Jul 2008 
16:46:21 GMT user2 wrote: folder name sounds suspicious</objectnote>
<objectnote unixtime="1216652532" user="user2" xid="127403">On 21 Jul 2008 
17:02:12 GMT user2 wrote: een hyves account.. </objectnote>
<objectnote unixtime="1216652365" user="user2" xid="127431">On 21 Jul 2008 
16:59:25 GMT user2 wrote: Datum van zoekopdracht: 3 Jun 2008 16:10:42 
GMT</objectnote>
<objectnote unixtime="1216652301" user="user2" xid="127431">On 21 Jul 2008 
16:58:21 GMT user2 wrote: hmmm, </objectnote>
</notes></root>)
let $result := (let $input := ($indexdoc//*[properties])
let $notedxids := distinct-values($notesdoc/notes/objectnote/@xid) 
let $notedobjectsresult := $input intersect 
(for $notedxid in $notedxids 
 return [EMAIL PROTECTED]) 
 for $raw in $notedobjectsresult 
 return $raw 
)
let $subresult := subsequence($result, 1, 1000)
let $nobj := count($subresult)
let $out := (
  for $i in $subresult
  let $note := ($notesdoc/notes/[EMAIL PROTECTED]/@xid])[1]
  return element { name($i) } {
    attribute nid {  string(exactly-one(pf:nid(exactly-one($i)))) },
    $i/@xid,
    $i/properties/(name) 
    ,element objectnote {$note/@*, $note/*, $note/text()}
})
return element result {
    element matches    { count($result) },
    element results    { $out }
}
<>


Returns: 

<result><matches>4</matches>
<results>
<link xid="127403" nid="3"><objectnote xid="127403" user="user2" 
unixtime="1216652532">On 21 Jul 2008 17:02:12 GMT user2 wrote: een hyves 
account.. </objectnote></link>
<link xid="127431" nid="5"><objectnote xid="127431" user="user2" 
unixtime="1216652365">On 21 Jul 2008 16:59:25 GMT user2 wrote: Datum van 
zoekopdracht: 3 Jun 2008 16:10:42 GMT</objectnote></link>
<file xid="146327" nid="7"><name>name1</name><objectnote xid="146327" 
user="user1" unixtime="1222247507">On 24 Sep 2008 09:11:47 GMT user1 wrote: 
Interessant </objectnote></file>
<folder xid="148892" nid="11"><name>name2</name><objectnote xid="148892" 
user="user2" unixtime="1216997181">On 25 Jul 2008 16:46:21 GMT user2 wrote: 
folder name sounds suspicious</objectnote></folder>
</results></result>

The only difference in the xquery is in line 31:
  ,$note
is replaced by:
  ,element objectnote {$note/@*, $note/*, $note/text()}

I used a compiled version of the MonetDB-Aug2008-SuperBall.tar.bz2 on an Ubuntu 
8.04 Linux system.

Regards,
Hans van Rijswijk
Netherlands Forensic Institute
The Hague, Netherlands.

----------------------------------------------------------------------

>Comment By: Jan Rittinger (tsheyar)
Date: 2008-11-15 22:30

Message:
Fix committed and test added.

----------------------------------------------------------------------

Comment By: Jan Rittinger (tsheyar)
Date: 2008-11-14 09:39

Message:
Hi Hans,

after simplifying your query to

let $notesdoc := <root>
                   <notes>
                     <objectnote xid="3">a</objectnote>
                     <objectnote xid="1">b</objectnote>
                     <objectnote xid="1">c</objectnote>
                   </notes>
                 </root>
for $i in (<link xid="3"></link>, <link xid="1"></link>)
let $note := ($notesdoc/notes/[EMAIL PROTECTED]/@xid])[1]
return element { name($i) } { $i/@xid, $note }

I detected and fixed two bugs:
1.) In some merged_union settings MonetDB is not able to infer the correct
ordering (and we have to help it by triggering order checking manually).
2.) In a scenare were a positional predicate sits on top of a thetajoin,
the positional predicate was incorrectly pushed into one thetajoin
operand.

Attached you find a diff that fixes both problems in pf 0.25 -- the fix
however should also be applicable to the older June release.

(As soon as the release branch is open again -- I will check in the
fixes.)
File Added: bug#2276427.diff

----------------------------------------------------------------------

Comment By: Hans (hans_0_)
Date: 2008-11-14 08:13

Message:
Stefan,

The query result you described in your reply Date: 2008-11-13 16:36 is not
complete.
Please compare the my query result to yours and you will see three
objectnote nodes are missing.
So, in my opinion the problem has not been fixed.

Regards,
Hans


----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2008-11-13 17:36

Message:
Hans,

thanks for the report.

With the latest CVS version for the new Nov2008 release branches (the
version that will soon become the new Nov2008 release of MonetDB), the
query works fine for me, yielding

<result><matches>4</matches><results><link xid="127403" nid="3"/><link
xid="127431" nid="5"/><file xid="146327"
nid="7"><name>name1</name><objectnote xid="146327" user="user1"
unixtime="1222247507">On 24 Sep 2008
09:11:47 GMT user1 wrote: Interessant </objectnote></file><folder
xid="148892" nid="11"><name>name2</name></folder></results></result>

Hence, I assume the problem has been fixed (or "eliminated") in CVS since
the Aug2008 release and will be solved for you as soon as the upcoming
Nov2008 will be available and you will have upgraded to it.

For now, you could try whether the problem is "merely" a property
propagtion problem by running Mserver with property checking endabled,
i.e.,
`Mserver --debug=10 ...`.

In case you do so, please report your finding here.

Stefan



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2276427&group_id=56967

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to