GetDatabaseFloat()
(or Double) does not retrieve the post decimals in Ubuntu20.04,
works fine in OSX and on RASPI with same code and same remote Mariadb,
but not in the Ubuntu 64b Version,
it only retrieves until decimal point.
Tested on different Ubuntu 20.04 PCs and both backends.
PB V6 Beta08
PB V6 Beta08 mysql bug on Ubuntu 20.04
Re: PB V6 Beta08 mysql bug on Ubuntu 20.04
Just tested:
GetDatabaseFloat() does not work also for PB5.72 on X64_Ubuntu 20.04...
PB code is simply
SQLR=DatabaseQuery(0,"SELECT TEMP FROM DATASTAUB",#PB_Database_StaticCursor)
NextDatabaseRow(0)
SV(FRIN)\TEMP=GetDatabaseFloat(0, 0)
Gives a Value of 26.00
asking via mysql gives the correct 26.85
On the RASPI with U20.04 it works fine with PB.
GetDatabaseFloat() does not work also for PB5.72 on X64_Ubuntu 20.04...
PB code is simply
SQLR=DatabaseQuery(0,"SELECT TEMP FROM DATASTAUB",#PB_Database_StaticCursor)
NextDatabaseRow(0)
SV(FRIN)\TEMP=GetDatabaseFloat(0, 0)
Gives a Value of 26.00
asking via mysql gives the correct 26.85
On the RASPI with U20.04 it works fine with PB.
Re: PB V6 Beta08 mysql bug on Ubuntu 20.04
What does GetDatabaseString() return for this field?
Re: PB V6 Beta08 mysql bug on Ubuntu 20.04
Thanks infratec,
GetDatabaseString() returns the complete String /Number...as string
(correct with . as decimal seperator).
GetDatabaseColumnType() also returns correct value(3).
But now I know the origin:
-if locale is set to use "," as decimal seperator PB, floats are not retrieved.
-if locale is set to use "." as decimal seperator PB, floats are retrieved correctly.
In MacOS it does not matter on the locale settings.
So the Linux PB GetDatabaseFloat() or the libmariadb.so depends
on the decimal point locale settings...it should not.
sql always takes "." for decimal point. So bad luck for Germans.
GetDatabaseString() returns the complete String /Number...as string
(correct with . as decimal seperator).
GetDatabaseColumnType() also returns correct value(3).
But now I know the origin:
-if locale is set to use "," as decimal seperator PB, floats are not retrieved.
-if locale is set to use "." as decimal seperator PB, floats are retrieved correctly.
In MacOS it does not matter on the locale settings.
So the Linux PB GetDatabaseFloat() or the libmariadb.so depends
on the decimal point locale settings...it should not.
sql always takes "." for decimal point. So bad luck for Germans.
Re: PB V6 Beta08 mysql bug on Ubuntu 20.04
Then you can use
as a tempory solution.
Code: Select all
ValD(GetDabaseString())
Re: PB V6 Beta08 mysql bug on Ubuntu 20.04
I switched all my linux PCs to C.UTF8 , that avoids problems like this (also in python)