db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (DERBY-5420) TableLockBasicTest is locale sensitive: failed with Norwegian locale on Windows.
Date Thu, 22 Sep 2011 21:51:26 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112942#comment-13112942
] 

Dag H. Wanvik edited comment on DERBY-5420 at 9/22/11 9:51 PM:
---------------------------------------------------------------

It turns out that RealBasicNoPutResultSetStatistics#formatDouble caches the decimal format:
 :
 if (df == null)
 {
    // RESOLVE: This really should use the database locale to 
    // format the number.
    df = new DecimalFormat("###########0.00");
    df.setMinimumIntegerDigits(1);
}

and even though we currently have correct Locale (language is English and country US), the
cached decimal format descriptor has the wrong decimal character, i.e. a comma, presumably
from an earlier test which did not specify locale and thus inherited the default locale on
my box. Since this is an engine static variable, it will remain in the wrong form until the
engine is rebooted, hence the error. Now, I just need to figure out which test first gives
it the wrong form :) As the comment indicates, this is broken...

      was (Author: dagw):
    It turns out that RealBasicNoPutResultSetStatistics#formatDouble caches the decimal format:
 :
 if (df == null)
 {
    // RESOLVE: This really should use the database locale to 
    // format the number.
    df = new DecimalFormat("###########0.00");
    df.setMinimumIntegerDigits(1);
}

and even though we currently have correct Locale (language is English and country US), the
cached decimal format descriptor has the wrong decimal character, i.e. a comma, presumably
from an earlier test in another locale. Since this is an engine static variable, it will remain
in the wrong form until the engine is rebooted, hence the error. Now, I just need to figure
out which test first gives it the wrong form :) As the comment indicates, this is broken...
  
> TableLockBasicTest is locale sensitive: failed with Norwegian locale on Windows.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-5420
>                 URL: https://issues.apache.org/jira/browse/DERBY-5420
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>         Environment: Windows Vista SP2, Norwegian locale, JDK 7.
>            Reporter: Dag H. Wanvik
>            Priority: Minor
>
> The execution plans are asserted in this test and I saw this diff:
> Expected:
>         :
> 	optimizer estimated row count:            6.00
> 	optimizer estimated cost:          100.40<
> Found:
>         :
>         optimizer estimated row count:            6,00
> 	optimizer estimated cost:          100,40<
> the latter using a decimal comma whereas a decimal point is expected.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message