Skip to content

Commit

Permalink
Only run selected SQL code
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondnijssen committed Nov 9, 2023
1 parent 4cd08ee commit 6b7df88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/qgsqueryresultwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ void QgsQueryResultWidget::executeQuery()
cancelRunningQuery();
if ( mConnection )
{
const QString sql { mSqlEditor->text( ) };
QString sql { mSqlEditor->text() };
if ( mSqlEditor->hasSelectedText() )
{
sql = mSqlEditor->selectedText();
}

bool ok = false;
mCurrentHistoryEntryId = QgsGui::historyProviderRegistry()->addEntry( QStringLiteral( "dbquery" ),
Expand Down

0 comments on commit 6b7df88

Please sign in to comment.