Opened 16 years ago

Closed 15 years ago

#179 closed defect (fixed)

auth_mysql reuses same connection handle

Reported by: dmorton Owned by: rjl
Priority: normal Milestone: 1.0.1
Component: PHP scripts Version: 1.0.0
Severity: normal Keywords:


If auth_mysql uses the same username and password as the maia dsn, then the $auth_dbh->disconnect() disconnects the Maia DSN too, resulting in an error when logging in. Somehow we need to detect this and not disconnect, use different credentials, or reconnect as needed.

Change History (3)

comment:1 Changed 15 years ago by anonymous

  • Component changed from General to PHP scripts
  • Milestone set to 1.0.1
  • Version set to 1.0.0

comment:2 Changed 15 years ago by dmorton

Here's an idea: DB::connect takes an optional array as a second parmaeter, in which we can specify persistance, and win the case of mysql, whether to reuse an existing connection or to make a new one.

I think if we use a persistant connection, then the disconnect will not matter, as it will never truly disconnect. The documentation for mysql_close() says:

Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution.

and later:

Note: mysql_close() will not close persistent links created by mysql_pconnect().

The same appears to be true of postgresql. In light of this, I think removing the disconnect from auth_sql is the easiest fix, though it would also be good to allow a config option to turn on persistant connections.

comment:3 Changed 15 years ago by dmorton

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in trunk: [941], [946] and merged into 1.0 branch in [947]

Note: See TracTickets for help on using tickets.