dbal: [BC Break] 2.10.1 to v2.10.2: PDOStatement::convertParamType() must be of the type int, null given
BC Break Report
Hello, here is my bug report, after upgrading locally doctrine/dbal
from v2.10.1
to v2.10.2
(patch upgrade
)
Q | A |
---|---|
BC Break | yes |
Version | 2.10.2 |
Summary
$countryCode = $conn->executeQuery(
'SELECT country_code FROM core_town WHERE id = ?;',
[$townId]
)->fetchColumn(0);
info:
int $townId
$conn is $conn = $this->_em->getConnection();
code lives inside a class extending Doctrine\ORM\EntityRepository
- ✅ works on 2.10.1
- ❌ fatal on 2.10.2
Previous behaviour
Working (yes i know not the best way to write prepared query with ?
param, but not the point here 😒 ))
Current behavior
An exception occurred while executing 'SELECT country_code FROM core_town WHERE id = ?;' with params [36548]:
Argument 1 passed to Doctrine\DBAL\Driver\PDOStatement::convertParamType() must be of the type int, null given, called in /Users/antoine/Sites/api/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 78
How to reproduce
More info</summary
Symfony 4.3.latest
PHP 7.3.17
while doing:
composer upgrade doctrine/dbal
other doctrine component updated are
- Updating doctrine/annotations (v1.8.0 => 1.10.2): Loading from cache
- Updating doctrine/reflection (v1.1.0 => 1.2.1): Loading from cache
- Updating doctrine/persistence (1.3.6 => 1.3.7): Loading from cache
- Updating doctrine/orm (v2.7.0 => v2.7.2): Loading from cache
I’ve checked the doc, this part https://www.doctrine-project.org/projects/doctrine-dbal/en/2.10/reference/data-retrieval-and-manipulation.html#doctrine-dbal-types-conversion
but my issue is more on the bc breack
more than the doc and code rewrite
</detaisl>
Symfony 4.3.latest
PHP 7.3.17
composer upgrade doctrine/dbal
- Updating doctrine/annotations (v1.8.0 => 1.10.2): Loading from cache
- Updating doctrine/reflection (v1.1.0 => 1.2.1): Loading from cache
- Updating doctrine/persistence (1.3.6 => 1.3.7): Loading from cache
- Updating doctrine/orm (v2.7.0 => v2.7.2): Loading from cache
bc breack
more than the doc and code rewriteAbout this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 34 (17 by maintainers)
I will review it carefuly 😃
edit:
@greg0ire indeed, when disabling the bundle, code works fine I need to investigate more here (link with the patch release and the other lib) anyway, thank you for your time here
i will open an issue to the other repo soon, pointing to this one cc @wuchen90
Closing in favor of the issue mentioned above, thanks
Ok sure i will try on monday and report here
Your first message contains 2 exceptions, but not the stack trace, so it doesn’t really help. When in cli, use
bin/console -vvv
and then you will have stack trace. The second message (http context) contains just 1 out of 2 exception (see the[2/2]
?). I think exception[1/2]
might be more interesting, please include it.@greg0ire here you are
CLI
WEB
friendly ping @greg0ire here are both stack traces, thank you for your time
It is an array when we get into this method, will trace further back
/Users/marc.ingram/checkouts/hosting-api/docroot/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:215: array(2) { [0] => string(1) "s" [1] => string(1) "s" }
Doctrine\DBAL\DBALException: An exception occurred while executing 'UPDATE site SET vcs_path = '?' WHERE sitegroup = '?'' with params ["VCS_CHANGED_TO_PATH_UNKNOWN", "stargatesg1"]:
mysqli_stmt::bind_param()
expects parameter 1 to be string, array givenThis of help?