Restore last used database on startup
| User, date | Message |
|---|---|
|
Written by kalvaro
3 months ago Category: Running SQL scripts 442 posts since Thu, 29 Nov 07 |
Is the "Restore last used database on startup" setting still functional? I get a "SQL Error (1046): No database selected" error every time that I start a new connection and I forget to click on the database node. |
|
Written by ansgar
3 months ago 3973 posts since Fri, 07 Apr 06 |
Yes, still works here, although I must admit I was sceptical after reading your post. Does HeidiSQL select a database in the tree or is the root node selected after connecting? |
|
Written by jfalch
3 months ago 224 posts since Sat, 17 Oct 09 |
works here, too. |
|
Written by kalvaro
3 months ago 442 posts since Thu, 29 Nov 07 |
The root node is selected. I've made some tests and if I select a DB, disconnect and connect again, it remains selected. It only happens when I switch connections—perhaps it's the intended behaviour. |
|
Written by ansgar
3 months ago 3973 posts since Fri, 07 Apr 06 |
Yes, when you disconnect, the last selected DB is remembered for the next connect. Isn't that what this setting should do? |
|
Written by kalvaro
3 months ago 442 posts since Thu, 29 Nov 07 |
Hmmm... Shouldn't it be a per-connection value? What's the point of storing a database name and trying to load it in any random server? |
|
Written by ansgar
3 months ago 3973 posts since Fri, 07 Apr 06 |
Yes, it is a connection value. When I'm connecting to my "Local" session, and connect to a second one, let's say it's named "Live", both have their own "last database" stored and restored, anyway how I disconnect or reconnect. Or do you use one single session to connect to different servers, by modifying the hostname each time? |
|
Written by kalvaro
3 months ago 442 posts since Thu, 29 Nov 07 |
I have several stored sessions. I simply hit the "Disconnect" toolbar button and double click on another session to open it. I've just checked the Windows registry and I can see a "lastUsedDB" key on every stored connection with the correct value. The value is stored just fine but it isn't restored :( I've enabled debug logging in case it helps: /* DBtreeFocusChanged without node. */ |
|
Written by ansgar
3 months ago 3973 posts since Fri, 07 Apr 06 |
Hey, you're right, I can reproduce that now. Thanks for insisting here. It's only reproducible when you open a different session as you had just disconnected. That's why I failed to reproduce it earlier. Will check that. |
|
Written by ansgar
3 months ago 3973 posts since Fri, 07 Apr 06 |
Fixed in r4328 |
|
Written by kalvaro
3 months ago 442 posts since Thu, 29 Nov 07 |
No issues so far. Thanks a lot, Anse. |
|
Please login to leave a reply, or register at first. |