#1090 db statement separator not used

All
open
nobody
None
5
2013-06-18
2013-06-17
Jamie
No

Affects 3.5.0

I noticed a few problems in the SQL editor area, and using the MySQL plugin with the Statement Separator set to ";".

  1. Clicking the next and previous SQL buttons causes the cursor to jump between the first section of the query and the second based upon a blank line (double \n\n), not the ";" character from an opened sql text file (simplified example below)

  2. When attempting to run a sql statement such as:

"SELECT
col1,col2
FROM table1
WHERE col1 > 11

-- AND col3 IS('not used')

AND col2 < 22
LIMIT 15;"

The full statement up to the ";" is not sent, resulting in a large number of result data to be returned causing an out of memory exception as the latter clauses are not sent.

I'm not sure where the DB specific Statement Separator is used, but it seems to be just using the BaseSQLEntryPanel SQL_STMT_SEP of two line breaks..

Discussion

  • Jamie
    Jamie
    2013-06-18

    So after looking at the code, it's clearer to me what is going to be executed:
    - Anything within a new lines block IF nothing is selected manually.

    However, for new users working with single long queries it may not be clear especially if the partially executed query never finishes or causes an out of memory error.

    I see now that if I highlight the whole block including the extra spaces given above then it will execute as one block.

    Maybe if the "Run SQL" action highlighted the block of text that was actually executed, if there was no original selection would help to make it more clear? Or highlight after cancelling a query execution?