Commit 89cbfdd7 authored by Matty Driessen's avatar Matty Driessen

Fixed an issue where column case was forced to lowercase.

When using a PDOConnection and the Portability wrapper, the default value \PDO::CASE_NATURAL int(0) and PHP constant CASE_LOWER int(0) got mixed up.
parent e692ab66
...@@ -46,7 +46,7 @@ class Connection extends \Doctrine\DBAL\Connection ...@@ -46,7 +46,7 @@ class Connection extends \Doctrine\DBAL\Connection
/** /**
* @var int * @var int
*/ */
private $case = \PDO::CASE_NATURAL; private $case;
public function connect() public function connect()
{ {
......
...@@ -118,7 +118,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement ...@@ -118,7 +118,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
$row = $this->fixRow($row, $row = $this->fixRow($row,
$this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM), $this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM),
($fetchStyle == PDO::FETCH_ASSOC || $fetchStyle == PDO::FETCH_BOTH) && ($this->portability & Connection::PORTABILITY_FIX_CASE) !is_null($this->case) && ($fetchStyle == PDO::FETCH_ASSOC || $fetchStyle == PDO::FETCH_BOTH) && ($this->portability & Connection::PORTABILITY_FIX_CASE)
); );
return $row; return $row;
...@@ -133,7 +133,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement ...@@ -133,7 +133,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
} }
$iterateRow = $this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM); $iterateRow = $this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM);
$fixCase = ($fetchStyle == PDO::FETCH_ASSOC || $fetchStyle == PDO::FETCH_BOTH) && ($this->portability & Connection::PORTABILITY_FIX_CASE); $fixCase = !is_null($this->case) && ($fetchStyle == PDO::FETCH_ASSOC || $fetchStyle == PDO::FETCH_BOTH) && ($this->portability & Connection::PORTABILITY_FIX_CASE);
if (!$iterateRow && !$fixCase) { if (!$iterateRow && !$fixCase) {
return $rows; return $rows;
} }
......
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