Menu

#51 seg fault on module & trigger

Sedna_(current)
closed
7
2012-09-14
2010-04-08
No

import module namespace ps = "www.packetscale.com/test1";
CREATE TRIGGER "t1" BEFORE INSERT ON doc("someDoc")/* FOR EACH NODE DO { ps:error(); } &

This statement is accepted by the engine, but the static context holding module functions is lost after its end, leaving behind PPFunCall object holding fn_id to destroyed static context. When executing an UPDATE triggering the

Discussion

  • Yanko Yankulov

    Yanko Yankulov - 2010-04-08

    pressed some buttons too early :) ...

    When executing an UPDATE causing the trigger to fire, fn_id is looked up in current context which hodls undefined function at this fn_id.
    Same problem must exist for other static context members -> vars, namespaces, etc.

    Workaround: There's an ugly workaround for this -> use always the same prolog for every query.

     
  • Ivan Shcheklein

    Ivan Shcheklein - 2010-04-08

    Yanko, thank you for bug report! This is a known issue with Sedna: http://thread.gmane.org/gmane.text.xml.sedna/1454 . It requires full refactoring of dynamic and static contexts.

     
  • Yanko Yankulov

    Yanko Yankulov - 2010-04-08

    Thanks for the fast reply Ivan.
    I suspected that a full refactoring of the contexts will be necessary to properly handle this issue. Do you have any idea about the expected timeline for this to happen ?

    As an alternative/partial/temporary solution I was thinking to implement a default prolog witch will be added to all queries for a given database. What do you/the community think about this. We at packetScale are definitely interested in using user functions in triggers, and we might be able to dedicate some man hours in doing this. Any comments/objections/comments about this idea?

     
  • Ivan Shcheklein

    Ivan Shcheklein - 2010-05-05

    Yanko, sorry for the delay in answer. Unfortunately, the team is working now on other features. I believe, that it will be posssible for us to fix this issue in month or two.

    Probably, alternative solution you described is possible, however I think it's also not that simple to implement.

     
  • Ivan Shcheklein

    Ivan Shcheklein - 2011-05-29

    Bug is fixed now. Prolog is still prohibited for the create trigger statements. If you need this feature open new artifact in features tracker.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB