Correctly detect numbers up to 64 bits when detecting data type

This fixes commit 74e0df376a for integers
and floats of more than 32 bits length.

See comment by @mgrojo here:
74e0df376a (r34532732)
This commit is contained in:
Martin Kleusberg
2019-08-01 14:07:47 +02:00
parent 74e0df376a
commit 7d85d7a41b
2 changed files with 2 additions and 2 deletions

View File

@@ -1444,7 +1444,7 @@ bool DBBrowserDB::updateRecord(const sqlb::ObjectIdentifier& table, const std::s
if(sqlite3_bind_blob(stmt, 1, rawValue, value.length(), SQLITE_STATIC))
success = -1;
} else if(force_type == SQLITE_INTEGER) {
if(sqlite3_bind_int(stmt, 1, value.toInt()))
if(sqlite3_bind_int64(stmt, 1, value.toLongLong()))
success = -1;
} else if(force_type == SQLITE_FLOAT) {
if(sqlite3_bind_double(stmt, 1, value.toDouble()))

View File

@@ -475,7 +475,7 @@ bool SqliteTableModel::setTypedData(const QModelIndex& index, bool isBlob, const
type = SQLITE_BLOB;
} else if(m_vDataTypes.at(column) == SQLITE_INTEGER) {
bool ok;
newValue.toInt(&ok);
newValue.toLongLong(&ok);
if(ok)
type = SQLITE_INTEGER;
} else if(m_vDataTypes.at(column) == SQLITE_FLOAT) {