From: Ben C. <bcl...@pe...> - 2004-12-20 16:45:31
|
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 are 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 = '0.16', ctime = FROM_UNIXTIME(1103561358) WHERE host = 'dummy' AND rkey = '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=innodb; 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 = atof(version) >> >> So '0.15' -> 0.15 but '0,15' -> 0.00 >> >> Can please enter: >> >> mysql> UPDATE perfdata_registry SET rvalue = '0.15' WHERE rkey = >> '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 = 0.15; printf("%.2lf", d); return 1 } >> > I have tested this source on my system and the output correctly is 0.15. > I updated my perfparse installation to version 0.104.4. > Because my old database schema is 0.15 my browse visualized the current > 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 |
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/ - |
From: Massimiliano M. <mmi...@ab...> - 2004-12-21 10:20:15
|
Hi Ben, I followed your steps. > 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 are > using. My system is a Fedora Core 2: "Linux 2.6.5-1.358 #1 Sat May 8 09:04:50 EDT 2004 i686 i686 i386 GNU/Linux" I use gcc and my current version is: "Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linuxThread model: posix gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)" > > 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 > The output is: "SQL: "SET AUTOCOMMIT=0" Rows: 0 SQL: "START TRANSACTION" Rows: 0 SQL: "SELECT rvalue,ctime from perfdata_registry WHERE host = 'dummy' AND rkey = 'pp/database/version'" Rows: 1 Warning, this stage may take some time: SQL: "EXPLAIN perfdata_service_raw" Rows: 6 SQL: "EXPLAIN perfdata_graphs" Rows: 6 Auto-convert database up to version 0.16... SQL: "SHOW TABLES" Rows: 13 SQL: "SELECT count(*) from perfdata_registry WHERE host = 'dummy' AND rkey = 'pp/database/version'" Rows: 1 SQL: "UPDATE perfdata_registry SET rvalue = '0,16', ctime = FROM_UNIXTIME(1103623029) WHERE host = 'dummy' AND rkey = 'pp/database/version'" SQL: "COMMIT" Rows: 0 SQL: "SET AUTOCOMMIT=1" Rows: 0 Conversions complete." > 3. Do you see this line: Can you return what you see? > > SQL: "UPDATE perfdata_registry SET rvalue = '0.16', ctime = > FROM_UNIXTIME(1103561358) WHERE host = 'dummy' AND rkey = > '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=innodb; > mysql> insert test values (0.15); > mysql> select * from test; > > Do you get 0.15 or 0,15? I get 0.15 > > If you could try these, this would be extremely useful to us! > > Kind regards, > Ben. Regards, Massimiliano |