|
From: Yves <yme...@pe...> - 2004-12-21 07:52:47
|
I have some idea, but no solution...
0,16 instead of 0.16 -> isn't that a problem with the locale ?
Massimiliano, could you test with an English locale ? Just set LANG=3DC i=
nstead of what
you may have LANG=3Dit. Then run Perfparse and tell us how it works :)
If this is it, our DB expert Ben will have some fun to find out how to do=
that
transparently :)
Yves
> Massimiliano,
>
> You have a very interesting problem. One which I have never seen
> before. Some call from you program is formatting 0.16 as 0,16.
>
> Can you tell me what system you are running. Also what compiler you ar=
e
> using.
>
> Can you try these for me:
>
> 1. In libpp_mysql/dbms.c can you uncomment the line:
>
> #define SHOW_SQL
>
> 2. Can you then make all you code again and try:
>
> perfparse-db-tool --update
>
> 3. Do you see this line: Can you return what you see?
>
> SQL: "UPDATE perfdata_registry SET rvalue =3D '0.16', ctime =3D
> FROM_UNIXTIME(1103561358) WHERE host =3D 'dummy' AND rkey =3D
> 'pp/database/version'"
>
> 4. Please remove the SHOW_SQL and recompile.
>
> 5. Can you launch MySQL and try:
>
> mysql> create table test ( value double ) type=3Dinnodb;
> mysql> insert test values (0.15);
> mysql> select * from test;
>
> Do you get 0.15 or 0,15?
>
> If you could try these, this would be extremely useful to us!
>
> Kind regards,
> Ben.
>
>
>
> Massimiliano Minniti wrote:
>
>> Hi All,
>>
>>> This is an interesting one, and I don't know how it happened.
>>>
>>> You version in your database is '0,15'. It should be '0.15'.
>>> Internally this is converted to a double:
>>>
>>> double version =3D atof(version)
>>>
>>> So '0.15' -> 0.15 but '0,15' -> 0.00
>>>
>>> Can please enter:
>>>
>>> mysql> UPDATE perfdata_registry SET rvalue =3D '0.15' WHERE rkey =3D
>>> 'pp/database/version';
>>>
>>> Would you have any idea how this got like this to begin with? Any
>>> information you have would be very useful.
>>>
>>> The code which sets this is:
>>>
>>> void setVersion(double version)
>>> {
>>> char s[10];
>>> sprintf(s, "%.2lf", version);
>>>
>>>
>>> Can you write a test program on your local UNIX box and let me know
>>> what this does on your system?
>>>
>>> int main() { double d =3D 0.15; printf("%.2lf", d); return 1 }
>>>
>> I have tested this source on my system and the output correctly is 0.1=
5.
>> I updated my perfparse installation to version 0.104.4.
>> Because my old database schema is 0.15 my browse visualized the curren=
t
>> error message:
>>
>> "Current Version: 0.00, Required Version: 0.16.
>> Consider upgrading with:
>> perfparse-db-tool --update"
>>
>> Then I run perfparse-db-tool --update that after it visualized the
>> following correct message:
>> "Warning, this stage may take some time:
>> Auto-convert database up to version 0.16...
>> Conversions complete."
>>
>> But on my db the old correct values 0.15 now it is a wrong value 0,16
>> and I fix this problem editing the correct value 0.16 on the db record=
.
>> IMHO the upgrading throught perfpars-db-tool have some some error.
>>
>> I hope that my description is clearly.
>>
>> Excuse me for my poor english! ;)
>>
>>> I note this is using the 'lf' GNU extension. Which GNU takes to mean
>>> 'long float'. Could your system take this to mean 'local float'? If
>>> you change this to "%.2f" does this fix the problem?
>>>
>>> Regards,
>>>
>>> Ben
>>
>>
>> Regards,
>> Massimiliano Minniti
>>
>
>
> --
> Ben Clewett bcl...@pe...
> PerfParse http://www.perfparse.org
> PP FAQ http://wiki.perfparse.org/tiki-list_faqs.php
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users=
.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Perfparse-devel mailing list
> Per...@li...
> https://lists.sourceforge.net/lists/listinfo/perfparse-devel
>
>
--=20
- Homepage - http://ymettier.free.fr - http://www.logicacmg.com -
- GPG key - http://ymettier.free.fr/gpg.txt -
- Maitretarot - http://www.nongnu.org/maitretarot/ -
- Perfparse - http://perfparse.sf.net/ -
|