mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
Correctly detect numbers up to 64 bits when detecting data type
This fixes commit74e0df376afor integers and floats of more than 32 bits length. See comment by @mgrojo here:74e0df376a (r34532732)
This commit is contained in:
@@ -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()))
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user