Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove workaround in PDOSqlsrv\Connection::quote() #4148

Merged
merged 1 commit into from
Jul 5, 2020

Conversation

morozov
Copy link
Member

@morozov morozov commented Jul 4, 2020

Q A
Type bug
BC Break no

The workaround for PDOSqlsrv\Connection::quote() added in fdcae5d w/o any tests is no longer needed and breaks valid code:

$conn = DriverManager::getConnection([
    'driver' => 'pdo_sqlsrv',
    'user' => 'sa',
    'password' => 'Passw0rd',
]);

var_dump(
    $conn->fetchColumn('SELECT ' . $conn->quote("\0"))
);

// SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Unclosed quotation mark after the character string '.'.

The expected result is:

string(1) "\000"

The workaround looks related to microsoft/msphpsql#538 which was fixed by microsoft/msphpsql#550 in pdo_sqlsrv 5.1.1. The oldest pdo_sqlsrv version that supports PHP 7.2 is 5.2.1.

No test provided since this is not a special case from the DBAL perspective and should be handled by the underlying driver.

@morozov morozov added this to the 2.10.3 milestone Jul 4, 2020
@morozov morozov requested a review from greg0ire July 4, 2020 22:52
@morozov morozov merged commit 7dc2138 into doctrine:2.10.x Jul 5, 2020
@morozov morozov self-assigned this Jul 5, 2020
@morozov morozov deleted the pdo-sqlsrv-quote branch July 10, 2020 19:02
@joelharkes
Copy link

Thanks for the fix! this fixed our bug too :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants