mirror of
https://github.com/doctrine/orm.git
synced 2026-04-26 16:08:03 +02:00
Doctrine\DBAL\Driver\Exception\UnknownParameterType: Unknown parameter type, 105 given. #7151
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @brian-n-millar on GitHub (May 8, 2023).
Bug Report
Summary
When using findBy method I am using an array of values to check for which previously worked but now gives this error.
The code is basically as follows (I've altered it a bit for posting here):
The issue comes from
deletedcolumn, it is a boolean type in the DB, here I want to check if it is eitherNULLor0(false in MySQL).This did work fine previously, now I am getting the error in the title.
I traced it through and traced down to this in file
doctrine\orm\lib\Doctrine\ORM\Persisters\Entity\BasicEntityPersister.phpin functiongetTypeson line1960:It checks if the value is an array which it is, then gets the type of the column with is Boolean which resolves to integer
5then adds thisARRAY_PARAM_OFFSETwhich adds integer100to the value resulting in105as the parameter type whereas others resolve to a string like "integer". This leads to the failure as later code doesn't understand this105type.Am I doing something wrong? Is this way of using an array in a findBy deprecated or something?
@derrabus commented on GitHub (May 8, 2023):
Thanks for this thorough analysis. To me, this looks like the issue is on the ORM's side, so we should transfer the issue there. Can you tell us which ORM version you're using?
@brian-n-millar commented on GitHub (May 8, 2023):
doctrine/orm 2.14.3 and I'm using doctrine-orm-module 5.3.0 with Laminas
@brian-n-millar commented on GitHub (Jul 4, 2023):
Any update?
@derrabus commented on GitHub (Jul 5, 2023):
Not from my side. Feel free to work on a fix.
@Quiesss commented on GitHub (Nov 1, 2023):
up
@bystro commented on GitHub (Nov 27, 2023):
I think I have the same issue when switch to EAGER fetch mode for a
ManytoOnerelation* @ORM\ManyToOne(targetEntity="App\Area\Entity\Area", fetch="EAGER")or
$qb->getQuery()->setFetchMode(Place::class, "area", ClassMetadataInfo::FETCH_EAGER)[Doctrine\DBAL\Exception\DriverException] An exception occurred while executing a query: Unknown parameter type, 105 given.doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:117
[Doctrine\DBAL\Exception\DriverException]
An exception occurred while executing a query: Unknown parameter type, 105 given.
Exception trace:
at /var/www/html/modern-content-parser/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:117
Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert() at /var/www/html/modern-content-parser/vendor/doctrine/dbal/src/Connection.php:1938
Doctrine\DBAL\Connection->handleDriverException() at /var/www/html/modern-content-parser/vendor/doctrine/dbal/src/Connection.php:1880
Doctrine\DBAL\Connection->convertExceptionDuringQuery() at /var/www/html/modern-content-parser/vendor/doctrine/dbal/src/Connection.php:1105
Doctrine\DBAL\Connection->executeQuery() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:939
Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:3147
Doctrine\ORM\UnitOfWork->triggerEagerLoads() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:126
Doctrine\ORM\Internal\Hydration\ObjectHydrator->cleanup() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php:272
Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateAll() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1225
Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1166
Doctrine\ORM\AbstractQuery->execute() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:991
In UnknownParameterType.php line 21:
[Doctrine\DBAL\Driver\Exception\UnknownParameterType]
Unknown parameter type, 105 given.
Exception trace:
at /var/www/html/modern-content-parser/vendor/doctrine/dbal/src/Driver/Exception/UnknownParameterType.php:21
Doctrine\DBAL\Driver\Exception\UnknownParameterType::new() at /var/www/html/modern-content-parser/vendor/doctrine/dbal/src/Driver/PDO/ParameterTypeMap.php:36
Doctrine\DBAL\Driver\PDO\ParameterTypeMap::convertParamType() at /var/www/html/modern-content-parser/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:45
Doctrine\DBAL\Driver\PDO\Statement->bindValue() at /var/www/html/modern-content-parser/vendor/doctrine/dbal/src/Connection.php:1804
Doctrine\DBAL\Connection->bindParameters() at /var/www/html/modern-content-parser/vendor/doctrine/dbal/src/Connection.php:1096
Doctrine\DBAL\Connection->executeQuery() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:939
Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:3147
Doctrine\ORM\UnitOfWork->triggerEagerLoads() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:126
Doctrine\ORM\Internal\Hydration\ObjectHydrator->cleanup() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php:272
Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateAll() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1225
Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1166
Doctrine\ORM\AbstractQuery->execute() at /var/www/html/modern-content-parser/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:991
@derrabus commented on GitHub (Nov 27, 2023):
Do you want to investigate the issue or work on a fix? If not, a reproducer or even a full stack trace would be helpful for anyone who wants to contribute a fix.
@bystro commented on GitHub (Nov 27, 2023):
The issue was with a
booleantype on PRIMARY KEY. It works when changed tointeger* @ORM\Column(name="id", type="integer", nullable=false)@derrabus commented on GitHub (Nov 30, 2023):
Since you're addressing me directly, I will try to answer your questions as politely as I'm able to.
The short answer is: The bug does neither affects me personally nor anyone who pays me for my work. Believe it or not, my day only has 24 hours like everyone else's. I have a day job and a family. So, my personal priorities are (in that order):
Nobody's disputing the the existence of this bug.
Now, do you.
Really.
Then, don't use it. Write and maintain your own ORM. Please. I have no intention to fix stuff for some freeloaders that complain about me not aligning my priorities with theirs.
So, if anyone wants to help getting this bug fixed, I'm happy to provide all the support I can.