[Zorba-coders] [Bug 867262] Re: Ext func arg item seq can not be consumed 2 times
** Changed in: zorba Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of Zorba Coders, which is the registrant for Zorba. https://bugs.launchpad.net/bugs/867262 Title: Ext func arg item seq can not be consumed 2 times Status in Zorba - The XQuery Processor: Fix Released Bug description: If one tried to consume an external function argument item sequence 2 times, the 2nd time no more item is returned: next returns false and the item is NULL. To reproduce, take any external module and in the "evaluate" implementation of a function do the following (make sure that the function receives a non non-empty sequence as the first parameter): Item item; Iterator_t iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is valid here iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is NULL here To manage notifications about this bug go to: https://bugs.launchpad.net/zorba/+bug/867262/+subscriptions -- 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
[Zorba-coders] [Bug 867262] Re: Ext func arg item seq can not be consumed 2 times
** Changed in: zorba Status: Fix Released => Fix Committed ** Changed in: zorba Milestone: None => 2.1 -- You received this bug notification because you are a member of Zorba Coders, which is the registrant for Zorba. https://bugs.launchpad.net/bugs/867262 Title: Ext func arg item seq can not be consumed 2 times Status in Zorba - The XQuery Processor: Fix Committed Bug description: If one tried to consume an external function argument item sequence 2 times, the 2nd time no more item is returned: next returns false and the item is NULL. To reproduce, take any external module and in the "evaluate" implementation of a function do the following (make sure that the function receives a non non-empty sequence as the first parameter): Item item; Iterator_t iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is valid here iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is NULL here To manage notifications about this bug go to: https://bugs.launchpad.net/zorba/+bug/867262/+subscriptions -- 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
[Zorba-coders] [Bug 867262] Re: Ext func arg item seq can not be consumed 2 times
** Changed in: zorba Status: New => Fix Released -- You received this bug notification because you are a member of Zorba Coders, which is the registrant for Zorba. https://bugs.launchpad.net/bugs/867262 Title: Ext func arg item seq can not be consumed 2 times Status in Zorba - The XQuery Processor: Fix Released Bug description: If one tried to consume an external function argument item sequence 2 times, the 2nd time no more item is returned: next returns false and the item is NULL. To reproduce, take any external module and in the "evaluate" implementation of a function do the following (make sure that the function receives a non non-empty sequence as the first parameter): Item item; Iterator_t iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is valid here iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is NULL here To manage notifications about this bug go to: https://bugs.launchpad.net/zorba/+bug/867262/+subscriptions -- 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
[Zorba-coders] [Bug 867262] Re: Ext func arg item seq can not be consumed 2 times
What about this bug? Is it done? -- You received this bug notification because you are a member of Zorba Coders, which is the registrant for Zorba. https://bugs.launchpad.net/bugs/867262 Title: Ext func arg item seq can not be consumed 2 times Status in Zorba - The XQuery Processor: New Bug description: If one tried to consume an external function argument item sequence 2 times, the 2nd time no more item is returned: next returns false and the item is NULL. To reproduce, take any external module and in the "evaluate" implementation of a function do the following (make sure that the function receives a non non-empty sequence as the first parameter): Item item; Iterator_t iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is valid here iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is NULL here To manage notifications about this bug go to: https://bugs.launchpad.net/zorba/+bug/867262/+subscriptions -- 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
[Zorba-coders] [Bug 867262] Re: Ext func arg item seq can not be consumed 2 times
I think it's fine to restrict the API to only allow one iterator at a time. If the user has a use case that requires two active iterators at a time, he should think about his use case and eventually materialize in his code. I'm going to approve the merge proposal. -- You received this bug notification because you are a member of Zorba Coders, which is the registrant for Zorba. https://bugs.launchpad.net/bugs/867262 Title: Ext func arg item seq can not be consumed 2 times Status in Zorba - The XQuery Processor: New Bug description: If one tried to consume an external function argument item sequence 2 times, the 2nd time no more item is returned: next returns false and the item is NULL. To reproduce, take any external module and in the "evaluate" implementation of a function do the following (make sure that the function receives a non non-empty sequence as the first parameter): Item item; Iterator_t iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is valid here iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is NULL here To manage notifications about this bug go to: https://bugs.launchpad.net/zorba/+bug/867262/+subscriptions -- 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
[Zorba-coders] [Bug 867262] Re: Ext func arg item seq can not be consumed 2 times
Gabriel, would it be ok with your use case if instead of calling getIterator() a second time, you reused the same iterator? Basically, the code would look something like this: Item item; Iterator_t iter = args[0] ->getIterator( ); iter->open(); iter->next(item); iter->close(); // iter = args[0] ->getIterator( ); iter->open(); iter->next(item); iter->close(); The only difference between the above code and your example is that I have commented-out the 2nd call to getIterator(). In general, it doesn't make sense to have more than one iterator on a ExtFuncArgItemSequence, unless the sequence is materialized, and then you would get a performance hit. -- You received this bug notification because you are a member of Zorba Coders, which is the registrant for Zorba. https://bugs.launchpad.net/bugs/867262 Title: Ext func arg item seq can not be consumed 2 times Status in Zorba - The XQuery Processor: New Bug description: If one tried to consume an external function argument item sequence 2 times, the 2nd time no more item is returned: next returns false and the item is NULL. To reproduce, take any external module and in the "evaluate" implementation of a function do the following (make sure that the function receives a non non-empty sequence as the first parameter): Item item; Iterator_t iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is valid here iter = args[0]->getIterator(); iter->open(); iter->next(item); iter->close(); // item is NULL here To manage notifications about this bug go to: https://bugs.launchpad.net/zorba/+bug/867262/+subscriptions -- 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