Bugs item #2860574, was opened at 2009-09-17 12:13
Message generated for change (Settings changed) made by tsheyar
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2860574&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: PF general
Group: Pathfinder "stable"
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Axel Belinfante (axelbel)
Assigned to: Jan Rittinger (tsheyar)
Summary: atal error: column ... not found  / BATappend access denied

Initial Comment:
when I paste the forst following (lower down) xquery fragment at the 
interactive prompt of  mclient -lx -p portnumber I get an error:

MAPI  = mone...@localhost:51012
QUERY = declare function add-int-attr($element as element()
ERROR = !fatal error: column 'item72' with type '0x1' not found in environment
        !# halted in milgen.brg (env_mvar_), line 695

when I simplify the stuff that I paste (as shown in second block, even lower 
down)
it does work as expected.

this is on linux Linux ewi865 2.6.16.21-0.8-smp #1 SMP Mon Jul 3 18:25:39 UTC 
2006 x86_64 x86_64 x86_64 GNU/Linux
with the Aug-2009 version.

This used to work  in the May 2009 version (same machine).



Sidenote: when I access the same functionality via xrpc I get a different error:

Error occurred during execution.
!ERROR: BATappend: access denied to tmp_375, aborting.
!ERROR: BATappend_wrap: operation failed.



====== first block start  ===================

declare function add-int-attr($element as element()
                                 ,$val as xs:integer?)
 as element()?
{
   element {$element/name()} {
        attribute  { 'seq' } { $val },
        $element/@*,
        $element/node()
   }
};


declare updating function save-view($savedoc as xs:string
                                       ,$name as xs:string
                                       ,$user as xs:string
                                       ,$view as element())
{
   let $doc := doc($savedoc)
   let $save := $doc/views/active/vi...@name eq $name and @user eq $user]
   return
        if (empty($save))
        then 
                let $v := add-int-attr($view, 0)
                return do insert $v as last into $doc/views/active
        else (
               let $n := (abs($save/@seq) +1 ) cast as xs:integer?
               let $v := add-int-attr($view, $n)
               return (
                   do replace $save with $v,
                   do insert $save as last into $doc/views/archive
               )
        )
};


 save-view("view-defs.xml", "zambon", "axel", <view now='1253179900.00036' 
name='zambon' prevseq='0' user='axel'><select allany=''  inex='include' ><cond 
cmp='eq' field='creators_family'>zambon</cond></select></view>)

====== first block end ===================

====== second block start ================

declare function add-int-attr($element as element()
                                 ,$val as xs:integer?)
 as element()?
{
   element {$element/name()} {
        attribute  { 'seq' } { $val },
        $element/@*,
        $element/node()
   }
};


declare updating function save-view($savedoc as xs:string
                                       ,$name as xs:string
                                       ,$user as xs:string
                                       ,$view as element())
{
   let $doc := doc($savedoc)
   let $save := $doc/views/active/vi...@name eq $name and @user eq $user]
   return
        if (empty($save))
        then 
                let $v := $view
                return do insert $v as last into $doc/views/active
        else (
               let $v := $view
               return (
                   do replace $save with $v,
                   do insert $save as last into $doc/views/archive
               )
        )
};


 save-view("view-defs.xml", "zambon", "axel", <view now='1253179900.00036' 
name='zambon' prevseq='0' user='axel'><select allany=''  inex='include' ><cond 
cmp='eq' field='creators_family'>zambon</cond></select></view>)

====== second block end ===================



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

Comment By: Jan Rittinger (tsheyar)
Date: 2009-09-28 15:46

Message:
Added fix in stable version (compiler/algebra planner.c, Aug2009, 1.86,
1.86.2.1).

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

Comment By: Stefan Manegold (stmane)
Date: 2009-09-24 15:39

Message:
With the two XQuery blocks saved in /tmp/2860574-1.xq & /tmp/2860574-2.xq,
respectively, I get

$ pf /tmp/2860574-1.xq > /tmp/2860574-1.mil
looking for col: item72, ty: 0x1 in function do_reduce (line 9708)
environment looks like:
  col: item72, type: 0x100000, mvar->name: a0037
  col: item72, type: 0x200000, mvar->name: a0039
  col: iter73, type: 0x1, mvar->name: a0036
fatal error: column 'item72' with type '0x1' not found in environment
# halted in
/ufs/manegold/_/scratch0/Monet/Testing/Stable/source/pathfinder/compiler/mil/milgen.brg
(env_mvar_), line 695

$ wc /tmp/2860574-1.mil
0 0 0 /tmp/2860574-1.mil


$ pf /tmp/2860574-2.xq > /tmp/2860574-2.mil
$ wc /tmp/2860574-2.mil
 2405  9605 92523 /tmp/2860574-2.mil

Looks like a compiler / optimizer problem to me ...

Jan,

could you plase have a look?
Thanks!


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

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

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to