mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Changing the hydration mode doesn't give the same type of result for BigInt #7389
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 @VincentLanglet on GitHub (Jun 26, 2024).
Bug Report
Summary
Hi.
I'm note sure if it's a bug or a wanted behavior (and for what reason) but the type of a bigint value is return by a query is different when changing the Hydration mode. Let's take
Current behavior
With
HYDRATE_OBJECTorHYDRATE_ARRAYI'm getting["42"],but with
HYDRATE_SCALARorHYDRATE_SINGLE_SCALAR, I'm getting[42]and withHYDRATE_SCALAR_COLUMNI'm getting42`.How to reproduce
Expected behavior
I would expect to get
"42"everytime (in DBAL 3).This is kinda fixed by DBAL 4 where
intwill be the type of value inHYDRATE_OBJECTorHYDRATE_ARRAYif think for bigInt.But I wonder, if this happen for bigint in DBAL 3, this might happen for some other value/type. This would require investigation but I prefer first to know if it's considered as a bug or done by design.
Is there a valid reason for not having basically