You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I usually use $queryBuilder->createNamedParameter($value) to create queries with prepared statements. Even for boolean values.
It was never a problem in mysql, mariadb and mssql in my cases years ago. Sometimes I had to add a type as second parameter.
pgsql now fails when the value ist false.
Current behavior
When I run one of following code, and the value is false
Doctrine\DBAL\Exception\DriverException:
An exception occurred while executing a query: invalid input syntax for type boolean: ""
at vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php:87
at Doctrine\DBAL\Driver\API\PostgreSQL\ExceptionConverter->convert(object(Exception), object(Query))
(vendor/doctrine/dbal/src/Connection.php:1939)
at Doctrine\DBAL\Connection->handleDriverException(object(Exception), object(Query))
(vendor/doctrine/dbal/src/Connection.php:1881)
...
After some debugging, I worked around to pass a literal 'false' string.
Bug Report
Summary
I usually use
$queryBuilder->createNamedParameter($value)
to create queries with prepared statements. Even for boolean values.It was never a problem in mysql, mariadb and mssql in my cases years ago. Sometimes I had to add a type as second parameter.
pgsql now fails when the value ist
false
.Current behavior
When I run one of following code, and the value is
false
Following happens
After some debugging, I worked around to pass a literal
'false'
string.Expected behavior
The Query should succeed with one of these (without having to do an own conversion).
How to reproduce
See the code snippets.
Further
I searched for this issue and found some related issues, but they didn't talk directly about
createNamedParameter
: #1847, #564, #625,The text was updated successfully, but these errors were encountered: