-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Fix DBAL deprecations #50507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cache] Fix DBAL deprecations #50507
Conversation
2c6dd3b
to
bec5302
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The remaining deprecation should be fixed on doctrine/dbal I guess...
Indirect deprecation triggered by Symfony\Component\Cache\Tests\Adapter\DoctrineDbalAdapterTest::testConfigureSchemaDecoratedDbalDriver:
Doctrine\DBAL\Schema\Table::getPrimaryKeyColumns is deprecated. Use getPrimaryKey() and Index::getColumns() instead. (Table.php:816 called by Table.php:708, https://github.com/doctrine/dbal/pull/5731, package doctrine/dbal)
Stack trace:
#0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(16384, '...', '...', 195)
#1 vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php(195): trigger_error('...', 16384)
#2 vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php(99): Doctrine\Deprecations\Deprecation::delegateTriggerToBackend('...', Array, '...', '...')
#3 vendor/doctrine/dbal/src/Schema/Table.php(816): Doctrine\Deprecations\Deprecation::trigger('...', '...', '...', '...')
#4 vendor/doctrine/dbal/src/Schema/Table.php(708): Doctrine\DBAL\Schema\Table->getPrimaryKeyColumns()
#5 vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php(2066): Doctrine\DBAL\Schema\Table->getColumns()
#6 vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php(2040): Doctrine\DBAL\Platforms\AbstractPlatform->buildCreateTableSQL(Object(Doctrine\DBAL\Schema\Table), true, true)
#7 vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php(979): Doctrine\DBAL\Platforms\AbstractPlatform->getCreateTableSQL(Object(Doctrine\DBAL\Schema\Table), 3)
#8 vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php(915): Doctrine\DBAL\Platforms\SqlitePlatform->getCreateTableSQL(Object(Doctrine\DBAL\Schema\Table))
#9 vendor/doctrine/dbal/src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php(65): Doctrine\DBAL\Platforms\SqlitePlatform->getCreateTablesSQL(Array)
#10 vendor/doctrine/dbal/src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php(32): Doctrine\DBAL\SQL\Builder\CreateSchemaObjectsSQLBuilder->buildTableStatements(Array)
#11 vendor/doctrine/dbal/src/Schema/Schema.php(433): Doctrine\DBAL\SQL\Builder\CreateSchemaObjectsSQLBuilder->buildSQL(Object(Doctrine\DBAL\Schema\Schema))
#12 src/Symfony/Component/Cache/Adapter/DoctrineDbalAdapter.php(125): Doctrine\DBAL\Schema\Schema->toSql(Object(Doctrine\DBAL\Platforms\SqlitePlatform))
#13 src/Symfony/Component/Cache/Tests/Adapter/DoctrineDbalAdapterTest.php(70): Symfony\Component\Cache\Adapter\DoctrineDbalAdapter->createTable()
Thank you @MatTheCat. |
Hello! Today, my colleague @samsonradu and I noticed an issue regarding the Basically, by making some parameters lazily injected, the order of those parameters are no more preserved, and we end up with totally broken SQL queries. Here are more details:
The introduction of a lazy loading mechanism in this PR has led to issues with the ordering of bound values in SQL statements. New keys added by the lazy loading process are appended at the end of the parameters array, disrupting the intended logical order. See it here:
In here, you can see that the IMHO, I think this issue should be fixed in From the doctrine/dbal doc, I see:
Maybe this is something to fix somewhere else? I created a draft PR to show you what I have in mind at: #54172, just let me know what you think. |
Hey all, I wanted to provide an update regarding the issue I reported. After further investigation and numerous attempts to reproduce the issue in doctrine/dbal#6328, including starting from a blank application state and trying to replicate the conditions under which the issue was initially observed, my colleague and I have come to a conclusion that we are now unable to reproduce the issue in any form. Perhaps, this indicates that the problem may have been influenced by factors or states within our specific project setup that we could not accurately replicate in isolated testing, but as of today, we are totally unable to reproduce it. Edit: We've discovered a rational explanation for the behaviour we observed. The root cause of the confusion stems from the Given this, the issue I reported is a false alarm. The I believe it is now appropriate to close the associated PRs (#54172 and doctrine/dbal#6328), unless you think replacing positional parameters with named parameters worth it. Thanks. |
Unfortunately calling
Table::getColumns
will still produce deprecations π€