Commit 2fa58ee7 authored by beberlei's avatar beberlei

[2.0] DDC-296 - Fix in quoting

parent 310d98cf
...@@ -64,8 +64,8 @@ class MysqlSessionInit implements EventSubscriber ...@@ -64,8 +64,8 @@ class MysqlSessionInit implements EventSubscriber
*/ */
public function postConnect(ConnectionEventArgs $args) public function postConnect(ConnectionEventArgs $args)
{ {
$collation = ($this->_collation) ? " COLLATE '".$this->_collation : "'"; $collation = ($this->_collation) ? " COLLATE ".$this->_collation : "";
$args->getConnection()->executeUpdate("SET NAMES '".$this->_charset . "'" . $collation); $args->getConnection()->executeUpdate("SET NAMES ".$this->_charset . $collation);
} }
public function getSubscribedEvents() public function getSubscribedEvents()
......
...@@ -16,7 +16,7 @@ class MysqlSessionInitTest extends DbalTestCase ...@@ -16,7 +16,7 @@ class MysqlSessionInitTest extends DbalTestCase
$connectionMock = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false); $connectionMock = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false);
$connectionMock->expects($this->once()) $connectionMock->expects($this->once())
->method('executeUpdate') ->method('executeUpdate')
->with($this->equalTo("SET NAMES 'foo' COLLATE 'bar")); ->with($this->equalTo("SET NAMES foo COLLATE bar"));
$eventArgs = new ConnectionEventArgs($connectionMock); $eventArgs = new ConnectionEventArgs($connectionMock);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment