Skip to content

Commit

Permalink
#4882 Fixed Rows Affected counter for huge numbers (over 2 trillion).
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelsalawa committed Dec 20, 2024
1 parent 287c38e commit bf46b3a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### 3.4.11
- CHANGE: SQLite updated to 3.47.2
- BUGFIX: #5161 An ultimate fix for dialog windows positioning, so they no longer can appear outside of visible screen.
- BUGFIX: #4882 Fixed Rows Affected counter for huge numbers (over 2 trillion).

### 3.4.10
- CHANGE: #5160 The taskbar has been improved to make the currently active task more distinct from the others.
Expand Down
4 changes: 2 additions & 2 deletions SQLiteStudio3/coreSQLiteStudio/db/abstractdb3.h
Original file line number Diff line number Diff line change
Expand Up @@ -1205,14 +1205,14 @@ int AbstractDb3<T>::Query::fetchFirst()
for (int i = 0; i < colCount; i++)
colNames << QString::fromUtf8(T::column_name(stmt, i));

int changesBefore = T::total_changes(db->dbHandle);
qint64 changesBefore = T::total_changes64(db->dbHandle);
rowAvailable = true;
int res = fetchNext();

affected = 0;
if (res == T::OK)
{
affected = T::total_changes(db->dbHandle) - changesBefore;
affected = T::total_changes64(db->dbHandle) - changesBefore;
insertRowId["ROWID"] = T::last_insert_rowid(db->dbHandle);
}

Expand Down
2 changes: 1 addition & 1 deletion SQLiteStudio3/coreSQLiteStudio/db/sqlquery.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class API_EXPORT SqlQuery
*/
QList<SqlResultsRowPtr> preloadedData;

int affected = 0;
qint64 affected = 0;

QString query;
QVariant queryArgs;
Expand Down
1 change: 1 addition & 0 deletions SQLiteStudio3/coreSQLiteStudio/db/stdsqlite3driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
static const char *column_origin_name(stmt* arg1, int arg2) {return Prefix##sqlite3_column_origin_name(arg1, arg2);} \
static int changes(handle* arg) {return Prefix##sqlite3_changes(arg);} \
static int total_changes(handle* arg) {return Prefix##sqlite3_total_changes(arg);} \
static int64 total_changes64(handle* arg) {return Prefix##sqlite3_total_changes(arg);} \
static int64 last_insert_rowid(handle* arg) {return Prefix##sqlite3_last_insert_rowid(arg);} \
static int step(stmt* arg) {return Prefix##sqlite3_step(arg);} \
static int reset(stmt* arg) {return Prefix##sqlite3_reset(arg);} \
Expand Down

0 comments on commit bf46b3a

Please sign in to comment.