Closed (fixed)
Project:
Drupal core
Version:
4.7.x-dev
Component:
database system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Aug 2007 at 21:16 UTC
Updated:
24 Jan 2008 at 19:03 UTC
Jump to comment: Most recent file
Comments
Comment #1
schuyler1d commentedsorry, this one's better
Comment #2
drummI don't think this is critical since not many people connect to more than two databases.
Please use diff -uF. For more information, see http://drupal.org/patch/create.
I think the code might be okay, but I'm not used to reading patches formatted this way.
Comment #3
schuyler1d commentedsorry for the badly formatted patch. This one should be better.
Comment #4
schuyler1d commentedjust for the record, I had marked it critical, because it came up using module Multisite Manager--basically any time something switches active_db and makes a call to watchdog() or anything that calls watchdog() ends up losing its db context.
Comment #5
schuyler1d commentedoops, forgot to change the status
Comment #6
nedjoThis indeed looks like a bug. The problem if I understand it correctly is that the array of connections we're caching is really an array of resource db link identifiers. Assuming two schemas on the same db server, the resource is the same; it's the same connection to a db server, all we've done is switch active databases.
The proposed solution looks good.
This line is now superfluous and so should be deleted:
Comment #7
schuyler1d commentedtrue, updated patch removes superfluous line.
Nedjo's description is correct as I understand it, as well.
Comment #8
schuyler1d commentedtrying to ping core...
Comment #9
gábor hojtsyschuyler1d also opened an issue for 6.x, which I marked as duplicate of this one.
I looked into this as well, and what the current code does is basically looking for the resource identifier in the resource list, looking up the key used for that. So the question is when new database connection resource identifiers are created in PHP. This could be database dependent even, a new connection with the same user/pass might return a new resource ID, but it is more likely that it will return the same.
Comment #10
drummThe initial $active_name should be set to FALSE to match the documentation.
Otherwise, I think this is okay.
Comment #11
schuyler1d commentedthanks for that catch, fixed.
Comment #12
gábor hojtsyCommitted to 6.x. Still needs to be committed to 5.x.
Comment #13
drummCommitted to 5.x.
Cleanly applies to 4.7.x.
Comment #14
killes@www.drop.org commentedapplied
Comment #15
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.