mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
NativeQuery#execute() processes parameters for object parameters, even if a type is specified during setParameter() calls
#6666
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 @Ocramius on GitHub (Mar 26, 2021).
Similar to https://github.com/doctrine/orm/issues/7527
Calling
NativeQuery#setParameter('foo', new \stdClass(), MyType::NAME)will lead to the ORM attempting to load class metadata forstdClass.c8f2f61ea1/lib/Doctrine/ORM/NativeQuery.php (L72)This is avoidable by short-circuiting this logic, and calling
NativeQuery#processParameterValue()only when$parameter->getType()is not provided.c8f2f61ea1/lib/Doctrine/ORM/NativeQuery.php (L70-L79)@beberlei commented on GitHub (Mar 28, 2021):
This whole parameter processing code got way out hand, this code block should execute the same logic that
Queryhas forresolveParameterValue. This checks if a type is used before and short circuits the whole logic correctly.@dreis2211 commented on GitHub (Jan 16, 2026):
Hi 👋 Is there any plan to address this inconsistency? :)