U++ framework
Do not panic. Ask here before giving up.

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 previous 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

 
Read Message
Read Message
Previous Topic: Implementing PostgreSql returning statement
Next Topic: Image in QLITE3 database
Goto Forum:
  


Current Time: Sun Apr 26 17:28:25 GMT+2 2026

Total time taken to generate the page: 0.00522 seconds