DBAL-309: MasterSlaveConnection with mysql "charset: "UTF8" forces use of master #1492

Closed
doctrinebot opened this Issue Jul 23, 2012 · 5 comments

2 participants

@doctrinebot

Jira issue originally created by user daniel.sippel:

In a mysql master/slave environment with "charset:" set to "UTF8" an Event "postConnect" is dispatched after establishing the connection.

MysqlSessionInit->postConnect() uses MasterSlaveConnection->executeUpdate() to submit this information to the current connection. executeUpdate() always connects to the master and the slaves won't be used (as documentated: "3. If master was picked once during the lifetime of the connection it will always get picked afterwards.").

We suggest to use executeQuery() in postConnect() instead.

@doctrinebot

Comment created by @beberlei:

MysqlInitListener is deprecated, because SET NAMES UTF8 is not a safe operation. Use the "charset" option of the PDO MySQL driver instead.

@doctrinebot

Comment created by stof:

Then we need to fix DoctrineBundle to stop using the init listener for mysql.

@doctrinebot

Comment created by daniel.sippel:

I agree with Christophe and reopened this issue.

@doctrinebot

Comment created by stof:

Please close the issue Benjamin. This has been fixed in DoctrineBundle: doctrine/DoctrineBundle#111
I don't have enough rights in JIRA to close it myself.

@doctrinebot

Issue was closed with resolution "Invalid"

@doctrinebot doctrinebot added the Bug label Dec 6, 2015
@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment