[Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
The proposal to merge lp:~paul-lucas/zorba/bug-1147518 into lp:zorba has been updated. Status: Approved => Merged For more details, see: https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
Validation queue job bug-1147518-2013-04-11T20-36-46.216Z is finished. The final status was: All tests succeeded! -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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
Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
I could write a script to automatically vote Needs Fixing on any merge proposal that has RAISE_ERROR in it. -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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
Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
Here's the e-mail I originally complained about this: From: "Paul J. Lucas" Subject: diagnostics/util_macros.h Date: Thu, 30 Jun 2011 10:34:50 -0700 Message-Id: <448a6241-b258-40f2-bcb2-498fde95c...@lucasmail.org> To: zorba-coders Markos - Why did you add this file and these macros? Part of the point of reworking exceptions was to get rid of all those ugly ZORBA_ERROR macros -- and here you are putting them back. It's also not clear to anybody what they do. If I see: RAISE_ERROR( ... ) I don't know what it does. Does it print an error message and call abort? Does it throw an exception? The reason I designed the current exception mechanism the way it is is precisely to leave the "throw" in the code explicitly visible so anybody reading the code knows that an exception is being thrown and that execution will not continue past that line. - Paul -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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
Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
> We have to agree on which error raising macro is used where. It doesn't make > sense to go back and forth between "throw XQUERY_EXCEPTION" and "RAISE_ERROR". RAISE_ERROR was something that Markos introduced. It's completely unnecessary. It gratuitously changes the order or the arguments. It doesn't work for ZORBA_EXCEPTION (which often means that code is incorrectly throwing an XQueryException rather than a ZorbaException where a ZorbaException is the correct exception to throw). There are 4 flavors of the macro that are difficult to remember. Those 4 flavors don't even cover all cases. These macros are similar to the original, ugly error macros. Since Markos is intransigent, the only thing we can do is to not approve merge proposals if anybody other than Markos uses the macros. -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
Validation queue starting for merge proposal. Log at: http://zorbatest.lambda.nu:8080/remotequeue/bug-1147518-2013-04-11T20-36-46.216Z/log.html -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
The proposal to merge lp:~paul-lucas/zorba/bug-1147518 into lp:zorba has been updated. Status: Needs review => Approved For more details, see: https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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
Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
Review: Approve We have to agree on which error raising macro is used where. It doesn't make sense to go back and forth between "throw XQUERY_EXCEPTION" and "RAISE_ERROR". -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
The proposal to merge lp:~paul-lucas/zorba/bug-1147518 into lp:zorba has been updated. Status: Approved => Needs review For more details, see: https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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
Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1, Needs Information < 1, Resubmit < 1. Got: 1 Approve. -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
Validation queue job bug-1147518-2013-04-11T18-39-52.691Z is finished. The final status was: All tests succeeded! -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
Validation queue starting for merge proposal. Log at: http://zorbatest.lambda.nu:8080/remotequeue/bug-1147518-2013-04-11T18-39-52.691Z/log.html -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
The proposal to merge lp:~paul-lucas/zorba/bug-1147518 into lp:zorba has been updated. Status: Needs review => Approved For more details, see: https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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
Re: [Zorba-coders] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
Review: Approve -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. -- 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] [Merge] lp:~paul-lucas/zorba/bug-1147518 into lp:zorba
Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/bug-1147518 into lp:zorba. Commit message: Fixed all FOTS test failures. Requested reviews: Paul J. Lucas (paul-lucas) Related bugs: Bug #1147518 in Zorba: "fn:round-half-to-even (at least 11 failures)" https://bugs.launchpad.net/zorba/+bug/1147518 For more details, see: https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Fixed all FOTS test failures. -- https://code.launchpad.net/~paul-lucas/zorba/bug-1147518/+merge/158449 Your team Zorba Coders is subscribed to branch lp:zorba. === modified file 'ChangeLog' --- ChangeLog 2013-04-11 16:59:33 + +++ ChangeLog 2013-04-11 18:16:24 + @@ -40,6 +40,7 @@ Bug Fixes/Other Changes: * Fixed bug #1123836 (overflows in date/time casts now return FODT0001 and in durations return FODT0002) + * Fixed bug #1147518 (fn:round-half-to-even (at least 11 failures)) * Fixed bug #1114228 (unrecognized options in the XQuery namespace now raise an error) * Fixed bug #1124273 (xqdoc crash because of annotation literals) * Fixed bug #867027 (XQST0059 error messages inconsistent) === modified file 'src/runtime/numerics/numerics_impl.cpp' --- src/runtime/numerics/numerics_impl.cpp 2013-04-04 04:06:57 + +++ src/runtime/numerics/numerics_impl.cpp 2013-04-11 18:16:24 + @@ -258,7 +258,6 @@ RoundIterator::nextImpl(store::Item_t& result, PlanState& planState) const { store::Item_t item; - store::Item_t res; xqtref_t type; store::Item_t precision; Integer precision_integer(0); @@ -327,72 +326,77 @@ } //6.4.5 fn:round-half-to-even -bool -RoundHalfToEvenIterator::nextImpl(store::Item_t& result, PlanState& planState) const -{ +bool RoundHalfToEvenIterator::nextImpl( store::Item_t &result, +PlanState& planState ) const { store::Item_t item; - store::Item_t itemPrec; - store::Item_t res; + xs_integer precision; + RootTypeManager const &rtm = GENV_TYPESYSTEM; + TypeManager const *const tm = theSctx->get_typemanager(); xqtref_t type; - Integer precision(0); - - const TypeManager* tm = theSctx->get_typemanager(); - const RootTypeManager& rtm = GENV_TYPESYSTEM; - - PlanIteratorState* state; - DEFAULT_STACK_INIT ( PlanIteratorState, state, planState ); - - if (consumeNext(result, theChildren [0].getp(), planState )) - { -if (theChildren.size() == 2) -{ - consumeNext(itemPrec, theChildren[1].getp(), planState); - assert(itemPrec->isAtomic()); - - precision = itemPrec->getIntegerValue(); -} - -//get the value and the type of the item -assert(result->isAtomic()); - -type = tm->create_value_type(result); - -//Parameters of type xs:untypedAtomic are always promoted to xs:double -if ( TypeOps::is_subtype(tm, *type, *rtm.UNTYPED_ATOMIC_TYPE_ONE)) -{ - GenericCast::castToAtomic(result, result, &*rtm.DOUBLE_TYPE_ONE, tm, NULL, loc); - type = tm->create_value_type (result); -} - -//item type is subtype of DOUBLE -if ( TypeOps::is_subtype(tm, *type, *rtm.DOUBLE_TYPE_ONE)) - GENV_ITEMFACTORY->createDouble(result, result->getDoubleValue().roundHalfToEven(precision)); - -//item type is subtype of FLOAT -else if ( TypeOps::is_subtype(tm, *type, *rtm.FLOAT_TYPE_ONE)) - GENV_ITEMFACTORY->createFloat(result, result->getFloatValue().roundHalfToEven(precision)); - -//item type is subtype of INTEGER -else if(TypeOps::is_subtype(tm, *type, *rtm.INTEGER_TYPE_ONE)) -{ /* do nothing */ } -//item type is subtype of DECIMAL -else if (TypeOps::is_subtype (tm, *type, *rtm.DECIMAL_TYPE_ONE)) - GENV_ITEMFACTORY->createDecimal(result, result->getDecimalValue().roundHalfToEven(precision)); + + PlanIteratorState *state; + DEFAULT_STACK_INIT( PlanIteratorState, state, planState ); + + if ( consumeNext( result, theChildren [0].getp(), planState ) ) { +assert( result->isAtomic() ); +type = tm->create_value_type( result ); + +if ( theChildren.size() == 2 ) { + consumeNext( item, theChildren[1].getp(), planState ); + assert( item->isAtomic() ); + precision = item->getIntegerValue(); +} + +if ( TypeOps::is_subtype( tm, *type, *rtm.UNTYPED_ATOMIC_TYPE_ONE ) ) { + // + // XQuery 3.0 3.1.5.2: Each item in the atomic sequence that is of type + // xs:untypedAtomic is cast to the expected generalized atomic type. For + // built-in functions where the expected type is specified as numeric, + // arguments of type xs:untypedAtomic are cast to xs:double. + // + GenericCast::castToAtomic( +result, result, &*rtm.DOUBLE_TYPE_ONE, tm, NULL, loc + ); + type = tm->create_value_type( result ); +} + +if ( TypeOps::is_subtype( tm, *type, *rtm.DOUBLE_TYPE_ONE ) ) + GENV_ITEMFACTORY->createDouble( +result, result->getDoubleValue().roundHalfToEven( precision ) + ); + +else if ( TypeOps::is_subtype( tm, *type, *rtm.FLOAT_TYPE_ONE ) ) +