Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » PostgreSQL NaN fetching from DB
PostgreSQL NaN fetching from DB [message #50095] Thu, 26 July 2018 16:33 Go to next message
shutalker is currently offline  shutalker
Messages: 15
Registered: November 2017
Location: Moscow
Promising Member
Hi!
I've noticed that NaN floating point values fetches from DB as zero values because of using Atof(). There is no possibility to check whether the value is NaN or not via such functions like IsNaN() or IsNull(). Also I have a question about fetching integers: why atoi() call is used in this code, and not ScanInt()?
void PostgreSQLConnection::GetColumn(int i, Ref f) const
{
    ...

    switch(info[i].type)
    {
        ...

        case INT_V:
            f.SetValue(atoi(s));
            break;

        ...
    }

    ...
}


Here is a patch in attachments. Could you check and comment it?

[Updated on: Sat, 04 August 2018 11:31]

Report message to a moderator

Re: PostgreSQL NaN fetching from DB [message #50189 is a reply to message #50095] Mon, 20 August 2018 09:51 Go to previous message
mirek is currently offline  mirek
Messages: 13995
Registered: November 2005
Ultimate Member
Uhm, ok, somehow I am not even sure that you are supposed to store Nans into SQL database... But your fix is otherwise harmless, so...

The only thing - I am afraid that it is not really possible to store Nans using U++ right now.
Previous Topic: Implementing PostgreSql returning statement
Next Topic: Image in QLITE3 database
Goto Forum:
  


Current Time: Mon Jul 22 07:53:51 CEST 2024

Total time taken to generate the page: 0.02063 seconds