Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-27482

wrong conversion to qlonglong

    XMLWordPrintable

    Details

    • Commits:
      7a34e88edcc8b05744cede732f79f99acaad75ef

      Description

      I read data from a database table. In the database table the number (hmilanguageid) is stored as 258059710618920545.
      My statement is:

      QSharedPointer<QSqlQuery> pQuery("SELECT hmilanguageid, to_char(hmilanguageid) FROM hmilanguage");
      int fieldNo = pQuery->record().indexOf("hmilanguageid");
      while(pQuery->next())
      {
          qlonglong langid = pQuery->value(fieldNo).toLongLong();
          QString text = pQuery->value(fieldNo+1).toString();
          __int64 v = _atoi64(text.toStdString().c_str());
      }
      

      I got under Windows 7, VS 2008 the following result:

      • langid = 258059710618920512
      • text = "258059710618920545"
      • v = 258059710618920545

      There must be an bug into the method toLongLong();

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            bilking Bill King
            Reporter:
            spacer2012 Ulrich Heinicke
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes