HeidiSQL only ever uses a single connection to the database, and thus if a query is running in one tab, and you switch to another tab and run another query, that query will not run. this creates problems for trying to stop long running queries, because you can't query to see which process to kill in MySQL for example. But, it gets worse. If you are typing in a new SQL statement in another tab while a query is running, that typing may result in the editor attempting to enumerate columns in a table reference when you type a 'alias.', before typing the column name. this will lock up HeidiSQL and cause complete loss of all the queries and state you have in your other tabs.
This is getting really frustrating that we still don't have an automatic tab save feature for these kinds of problems..