Unverified Commit 95b40a13 authored by Sergei Morozov's avatar Sergei Morozov Committed by GitHub

Merge pull request #4192 from morozov/pdo-sqlsrv-quote

Remove workaround in PDO\SQLSrv\Connection::quote()
parents 9eb02192 95191ee8
......@@ -9,10 +9,6 @@ use Doctrine\DBAL\Driver\Statement as StatementInterface;
use Doctrine\DBAL\ParameterType;
use PDO;
use function is_string;
use function strpos;
use function substr;
final class Connection implements ServerInfoAwareConnection
{
/** @var PDOConnection */
......@@ -40,14 +36,7 @@ final class Connection implements ServerInfoAwareConnection
*/
public function quote($value, $type = ParameterType::STRING)
{
$val = $this->connection->quote($value, $type);
// Fix for a driver version terminating all values with null byte
if (is_string($val) && strpos($val, "\0") !== false) {
$val = substr($val, 0, -1);
}
return $val;
return $this->connection->quote($value, $type);
}
public function exec(string $sql): int
......
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