[Bug] - Export SQL DELETEs/INSERT

[expired user #9793]'s profile image [expired user #9793] posted 8 years ago in General Permalink

Hi,

I've the latest nightly build of HeidiSQL 9.3.0.5072.

When I try to export to clipboard a resultset, with SQL DELETEs/INSERTs option the application crashes.

The problem is that the query is not from a table, but is a derived from a Union, so the table name is "Ignote".

SELECT * FROM table_a
UNION
SELECT * FROM table_a_bak

Should fix this bug like in other options "SQL INSERT" and "SQL REPLACEs":

REPLACE INTO `UnknownTable`

Regards

ansgar's profile image ansgar posted 8 years ago Permalink

Confirmed. That's a problem with the new DELETE/INSERT format, which requires an appropriate WHERE clause in the DELETE query. While composing that WHERE clause, HeidiSQL searches for the right table name and fails here for non-table queries, which is good when the user edits data in a grid, but renders the export option useless here.

Code modification/commit from ansgarbecker, 8 years ago, revision 5075
Wrap grid export code in a try/except block, so we can catch a potential "Cannot determine name of table" error, occurring while trying to get the WHERE clause for DELETEs. See http://www.heidisql.com/forum.php?t=21168
ansgar's profile image ansgar posted 8 years ago Permalink

r5075 now shows a normal error box instead of the crash in such cases.

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