mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-02-09 04:58:27 -06:00
Fix running ALTER TABLE statements in Execute SQL tab
This fixes a bug introduced in 73efa11680.
Because SQLite reports ALTER TABLE statements to return one column worth
of data, DB4S assumed they are close to a SELECT statement and therefore
did not fully execute them.
See issues #2563 and #2622.
This commit is contained in:
@@ -165,8 +165,8 @@ bool RunSql::executeNextStatement()
|
||||
// Get type
|
||||
StatementType query_part_type = getQueryType(queryPart.trimmed());
|
||||
|
||||
// Check if this statement returned any data
|
||||
if(sqlite3_column_count(vm))
|
||||
// Check if this statement returned any data. We skip this check if this is an ALTER TABLE statement which, for some reason, are reported to return one column.
|
||||
if(query_part_type != AlterStatement && sqlite3_column_count(vm))
|
||||
{
|
||||
// It did. So it is definitely some SELECT statement or similar and we don't need to actually execute it here
|
||||
sql3status = SQLITE_ROW;
|
||||
|
||||
Reference in New Issue
Block a user