Bug #98162 Execute the Current Statement Under Keyboard Cursor Ignores Highlight
Submitted: 8 Jan 2020 19:37 Modified: 28 Jan 2020 11:16
Reporter: Jeff Brown Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:8.0.18 OS:Windows (Microsoft Windows 10 Pro)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[8 Jan 2020 19:37] Jeff Brown
Description:
Execute the current statement under the keyboard cursor bug.  It seems to be ignoring the highlighted selection where in previous versions, it would execute only the highlighted selection.

How to repeat:
Example:
SELECT COUNT(*) FROM <table> WHERE <column>=<something>

Highlight only "SELECT COUNT(*) FROM <table>" and click "execute the current statement under keyboard cursor" and you'll get the count of all rows that match the condition.

Add a # (comment) after the highlight range and repeat.  Highlight only "SELECT COUNT(*) from <table>" and click again.  This time, you'll get all of the rows in the table.  This suggests the function is ignoring the highlight.
SELECT COUNT(*) FROM <table> # WHERE <column>=<something>

Suggested fix:
Check the logic that observes the highlight for this function.  Thanks!
[28 Jan 2020 11:16] MySQL Verification Team
Hello Jeff Brown,

Thank you for the report, but this is not a bug. Since you are clicking "execute the current statement under keyboard cursor", this will execute the statement under keyboard cursor irrespective of the query selection made. If you want to execute part of the query then try to use "execute the selected portion of the script or everything, if there is no selection".

Regards,
Ashwini Patil