mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-24 22:48:23 -05:00
Fix executing selected SQL text when there are multi-byte characters
Fix executing the selected SQL statement(s) when there are multi-byte characters before the selection. Because QScintilla gives us the start position of the selection in bytes and we used the value for counting characters, the executed part of the text was off by a few characters. See issue #2311.
This commit is contained in:
+1
-1
@@ -1115,7 +1115,7 @@ void MainWindow::executeQuery()
|
||||
// no chance to execute any further.
|
||||
QString sql = sqlWidget->getSql();
|
||||
if(mode == Selection)
|
||||
sql = sql.left(execute_to_position);
|
||||
sql = sql.toUtf8().left(execute_to_position); // We have to convert to a QByteArray here because QScintilla gives us the position in bytes, not in characters.
|
||||
|
||||
// Prepare the SQL worker to run the query. We set the context of each signal-slot connection to the current SQL execution area.
|
||||
// This means that if the tab is closed all these signals are automatically disconnected so the lambdas won't be called for a not
|
||||
|
||||
Reference in New Issue
Block a user