From 2fa58ee7b864b52f7799064a2e78c2d2c55f6cad Mon Sep 17 00:00:00 2001 From: beberlei Date: Mon, 1 Feb 2010 19:20:37 +0000 Subject: [PATCH] [2.0] DDC-296 - Fix in quoting --- lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php | 4 ++-- tests/Doctrine/Tests/DBAL/Events/MysqlSessionInitTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php b/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php index e38536469..9d0ff684e 100644 --- a/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php +++ b/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php @@ -64,8 +64,8 @@ class MysqlSessionInit implements EventSubscriber */ public function postConnect(ConnectionEventArgs $args) { - $collation = ($this->_collation) ? " COLLATE '".$this->_collation : "'"; - $args->getConnection()->executeUpdate("SET NAMES '".$this->_charset . "'" . $collation); + $collation = ($this->_collation) ? " COLLATE ".$this->_collation : ""; + $args->getConnection()->executeUpdate("SET NAMES ".$this->_charset . $collation); } public function getSubscribedEvents() diff --git a/tests/Doctrine/Tests/DBAL/Events/MysqlSessionInitTest.php b/tests/Doctrine/Tests/DBAL/Events/MysqlSessionInitTest.php index f64fbb870..1ef47dd53 100644 --- a/tests/Doctrine/Tests/DBAL/Events/MysqlSessionInitTest.php +++ b/tests/Doctrine/Tests/DBAL/Events/MysqlSessionInitTest.php @@ -16,7 +16,7 @@ class MysqlSessionInitTest extends DbalTestCase $connectionMock = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false); $connectionMock->expects($this->once()) ->method('executeUpdate') - ->with($this->equalTo("SET NAMES 'foo' COLLATE 'bar")); + ->with($this->equalTo("SET NAMES foo COLLATE bar")); $eventArgs = new ConnectionEventArgs($connectionMock);