Sequel-Ace icon indicating copy to clipboard operation
Sequel-Ace copied to clipboard

Query result export bug

Open nexbridge opened this issue 3 years ago • 5 comments

  • Sequel Ace Version: 4.0.1 (build 20039)
  • Sequel Ace Source: App Store
  • macOS Version: 12.6.1
  • Processor Type: Intel

Steps to reproduce:

  1. Select a table in the left-hand Tables pane (call it Table X in Database A)
  2. Select a different database (call it Database B) at the top (in the same window/tab) that does not contain Table X
  3. Select the Query view and run any SELECT query
  4. 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!

nexbridge avatar Nov 07 '22 11:11 nexbridge

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 avatar Dec 31 '22 03:12 Jason-Morcos

@Jason-Morcos I've tested the beta and I'm afraid it's still happening.

nexbridge avatar Dec 31 '22 20:12 nexbridge

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 avatar Dec 31 '22 21:12 Jason-Morcos

@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?

DannyJJK avatar Jan 15 '23 21:01 DannyJJK

I've found another way of reproducing it, which I imagine will be more common:

  1. Create any table
  2. Delete that table
  3. Select the Query view and run any SELECT query
  4. 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).

nexbridge avatar Jan 18 '23 15:01 nexbridge