← Back to team overview

zorba-coders team mailing list archive

[Bug 866547] Re: Assertion failure flworExpr!=__null in index_join_rule.cpp

 

I ran into the same assertion with the following example:

module namespace foo = "http://foo.com";;

import module namespace db = "http://www.zorba-
xquery.com/modules/store/static/collections/dml";

declare collection foo:bet as element(bet)*;
declare collection foo:game as element(game)*;

declare function foo:bet()
{
  for $bet in db:collection(xs:QName("foo:bet"))[@uid = 1]
  let $game := db:collection(xs:QName("foo:game"))[@gid = $bet/@gid]
  where not($game/result)
  let $gid := fn:data($game/@gid)
  return 1
};

main module:

import module namespace foo = "http://foo.com"; at "foo.xq";

foo:bet()

** Changed in: zorba
       Status: Invalid => New

** Changed in: zorba
     Assignee: nobody (nobody-users) => Markos Zaharioudakis (markos-za)

** Changed in: zorba
   Importance: Medium => High

** Changed in: zorba
    Milestone: None => 2.5

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/866547

Title:
  Assertion failure flworExpr!=__null in index_join_rule.cpp

Status in Zorba - The XQuery Processor:
  New

Bug description:
  The following query generates an assertion failure in
  index_join_rule.cpp :

  zorba: ~/work/xquery_temp1/src/compiler/rewriter/rules/index_join_rule.cpp:671: void zorba::findFlworForVar(zorba::RewriterContext&, const zorba::var_expr*, zorba::flwor_expr*&, zorba::sequential_expr*&, ulong&, ulong&): Assertion `flworExpr != __null' failed.
  ./test.sh: line 11: 31507 Aborted                 $ZORBA_BINARY --optimization-level O1 -z "omit-xml-declaration=yes" -z "indent=yes" -f -q test.xq 

  -----------------------------------------------------
  declare namespace l = "l";

  declare variable $page as node()* := ();
  declare variable $old_list as node()* := ();
  declare variable $lastPageNum as xs:integer := 0;

  declare function l:getLastPage($page as node()*) as xs:integer
  {
    let $pageNum := $page[last()]
    return if (count($pageNum) eq 0)
           then -1
           else 1
  };

  set $lastPageNum := l:getLastPage($page);

  for $rec in $page
    let $id as xs:string := $rec
    let $old_rec := $old_list[id/text() eq $id]
  return ();

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