Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

"Run Current Query" doesn't work after semicolon

biao's profile image biao posted 7 months ago in Running SQL scripts Permalink

Hello

If I put cursor after ; and click "Run Current Query", the query won't run.

SHOW PROCESSLIST;|

If I put cursor before ; and click "Run Current Query", query is executed as expected.

SHOW PROCESSLIST|;

It's not convenient sometimes as I have to move the cursor to run the statement. Is it by design?

Thanks

Biao

ansgar's profile image ansgar posted 7 months ago Permalink

Placing the cursor behind the semicolon shifts the current query to the one behind it. This is intentionally.

biao's profile image biao posted 7 months ago Permalink

I prefer the query console to follow the convention of mysql cli :)

biao's profile image biao posted 7 months ago Permalink

select 1; | select 2;

select 1; select 2;|

both run the all statements

ansgar's profile image ansgar posted 7 months ago Permalink

both run the all statements

If you want to run all queries, just press F9, or click "Run".

maoanz's profile image maoanz posted 3 months ago Permalink

I just discovered HeidiSQL one week ago, it is just a great tool. But for I was also misunderstanding for me why the run current sql didn't work for me. It's less logical to cut the current sql after ; I think the best way is to test if the current selection is empty, then move to one ; before.

Because when we type many sql in the editor, people often type a ; and the end, if we want to run the short cut Ctrl + Shift + Enter, we have to type a back one or serveral time to move the cursor, and later we need to move the cursor again to the end. We need to press many time the cursor before and back.

@biao Now I just find a workaround, so every time I want to insert a new sql, I start the line with ; and don't end the line with ; something like this. And the shortcut Ctrl + Shift + Enter works wherever the cursor is, on this sql text.

1 attachment(s):
  • Image-713
maoanz's profile image maoanz posted 3 months ago Permalink

something wrong with the previous screenshot.

1 attachment(s):
  • Image-714

Please login to leave a reply, or register at first.




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.