Query result export bug
- Sequel Ace Version: 4.0.1 (build 20039)
- Sequel Ace Source: App Store
- macOS Version: 12.6.1
- Processor Type: Intel
Steps to reproduce:
- Select a table in the left-hand Tables pane (call it Table X in Database A)
- Select a different database (call it Database B) at the top (in the same window/tab) that does not contain Table X
- Select the Query view and run any SELECT query
- Try to export the result using the icon with three dots in a circle (below the result)
For me this throws an error saying that Table X does not exist in Database B, which is certainly true but not relevant!
Please try the latest beta and confirm it's all good - the fix for this issue is included in the latest 4.0.5+ beta!
https://github.com/Sequel-Ace/Sequel-Ace/releases
@Jason-Morcos I've tested the beta and I'm afraid it's still happening.
Alrighty, thanks for checking! Well I think this is a pretty small issue so I'm not gonna worry about it more but if someone else wants to PR a fix I'm happy to review.
@Jason-Morcos I noticed that the fix sets selectedTableName to nil and selectedTableType to SPTableTypeNone. I was looking at the location where the error happens which appears to be in loadTableValues inside SPTableContent.m. At the start of this method, it has:
// If no table is selected, return
if (!selectedTable) return;
So I'm not sure if selectedTable needs to be set to nil as well. But I wasn't sure how to add this in because if try to add this where your code amend is, it can't access that variable. Any ideas?
I've found another way of reproducing it, which I imagine will be more common:
- Create any table
- Delete that table
- Select the Query view and run any SELECT query
- Try to export the result using the icon with three dots in a circle (below the result)
Furthermore, the issue seems to persist whenever you try to do an export, until you either select a different table or close the connection.
On a related note, if the connection label, database and table name are short enough so that the table name is visible in the path at the top of the connection window/tab, then when you delete the table or change its name, the path doesn't update (i.e. the old table name is still there).