I ran into the same assertion with the following example:

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

import module namespace db = "http://www.zorba-

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";


** 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.

  Assertion failure flworExpr!=__null in index_join_rule.cpp

Status in Zorba - The XQuery Processor:

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

~/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 

  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:

Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to