vieten / sequel-pro

Automatically exported from code.google.com/p/sequel-pro
Other
0 stars 0 forks source link

Switching Databases doesn't run "USE [DB]" command #1247

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Select a database
2. Select a different database
3. Run an update query

What is the expected output? What do you see instead?

Should update the second database, but updates the first database. May not 
happen every time.  Might be some weird situation that causes the new DB not to 
be selected.

What version of Sequel Pro are you using? What version of MySQL are you
connecting to on the server?

0.9.8, 5

Please provide any additional information below.

Don't see a "use DB" command in the logs, just pulls from information_schema

Original issue reported on code.google.com by llewhin...@llewhinkes.org on 12 Dec 2011 at 7:49

GoogleCodeExporter commented 9 years ago
There is no "USE x" command as that is only used on the mysql cli.
Applications which use the mysql client libraries use the mysql_select_db() 
function to switch databases.

However I'm wondering if we should include something in the console log as a 
user might use the output to "replay" something - and that can be used for 
debugging the described issue.

Original comment by schlabbe...@gmail.com on 3 Mar 2012 at 7:08

GoogleCodeExporter commented 9 years ago
We're in the progress of migrating to a new MySQL Framework, which has been 
written to use "USE x" statements instead of mysql_select_db() for clarity in 
cases just like this one.

Original comment by rowanb@gmail.com on 4 Mar 2012 at 1:05

GoogleCodeExporter commented 9 years ago
Sorry, I responded largely to schlabberdog's comments there.  The original bug 
does sound rather serious but I can't easily reproduce it. Looking through the 
code, even a loss of connection should result in the database being correctly 
re-selected if the connection is restored.

I do see that was with 0.9.8 - we rewrote a *lot* of code for 0.9.9, and I 
think that included improved reconnection, so I wonder if that fix wasn't in 
the version you're running?  Do update to 0.9.9.1 and see if that improves 
reproducability at all.

Original comment by rowanb@gmail.com on 4 Mar 2012 at 1:29

GoogleCodeExporter commented 9 years ago
Seems to be fixed with 0.9.9.1.  Thanks.  Keep up the good work.

Original comment by llewhin...@llewhinkes.org on 5 Mar 2012 at 5:32

GoogleCodeExporter commented 9 years ago
Thanks for confirming that!

The next release should also log "USE" statements, to aid in debugging and so 
the logged SQL can be played back; I'll leave this issue open to track when 
that's in place.

Original comment by rowanb@gmail.com on 5 Mar 2012 at 5:36

GoogleCodeExporter commented 9 years ago
r3511 improves the underlying database framework, which includes logging of USE 
statements for a more complete transcript.

Thanks for the report!

Original comment by rowanb@gmail.com on 17 Mar 2012 at 4:27