From d56313b9e5fb5db3b670aed4fd7fcccfd6f76a23 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Thu, 7 Nov 2024 02:41:52 -0300 Subject: [PATCH] fix: lenghts scope --- src/database/database.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/database/database.cpp b/src/database/database.cpp index b55fc5c30a9..d64e54aaa6a 100644 --- a/src/database/database.cpp +++ b/src/database/database.cpp @@ -139,10 +139,8 @@ void Database::createDatabaseBackup() const { int numFields = mysql_num_fields(tableData); MYSQL_FIELD* fields = mysql_fetch_fields(tableData); MYSQL_ROW rowData; - unsigned long* lengths; - while ((rowData = mysql_fetch_row(tableData))) { - lengths = mysql_fetch_lengths(tableData); + auto lengths = mysql_fetch_lengths(tableData); backupFile << "INSERT INTO " << tableName << " VALUES("; for (int i = 0; i < numFields; ++i) {