mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3400: Wrong result using php-cli #4197
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 @doctrinebot on GitHub (Nov 19, 2014).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user globetrotter77a:
Same query produces different results. With apache module everything works like expected. With php-cli the join condition to i18n table is ignored and calling
getCountries()returns all and not only that entity that is matched by join condition.Country Entity:
CountryI18nEntity:
@doctrinebot commented on GitHub (Nov 19, 2014):
Comment created by @ocramius:
Looks like a caching issue. The amount of information provided is insufficient as it is. I'd suggest verifying if the generated SQL is the same, and checking that all caches were cleared both in CLI and in WEB sapis.
@doctrinebot commented on GitHub (Nov 20, 2014):
Comment created by globetrotter77a:
O.k. here some further information.
No caching like Xcache or APC is enabled. PHP 5.5 integrated opcache ist not enabled. All Doctrine caches are set to Array. The sql queries are in both cases exactly the same:
The sql result is correct
Running the console script a ZF2 Initializer runs before that performs this query builder query:
That results in following SQL:
@doctrinebot commented on GitHub (Nov 20, 2014):
Comment created by @ocramius:
What happens if you run those SQL statements via CLI (
dbal:run-sql) or WEB? Same results?@doctrinebot commented on GitHub (Nov 20, 2014):
Comment created by globetrotter77a:
The sql result is correct. Can I attach it to the ticket? I have exported it to csv.
@doctrinebot commented on GitHub (Nov 20, 2014):
Comment created by @ocramius:
If the same results are produced on CLI and WEB APIs then I suggest trying to insulate the issue in a functional test to be run in both context. You probably have a different ORM bootstrap for CLI and WEB.
Attaching a CSV for same results makes no real difference here.
@doctrinebot commented on GitHub (Nov 20, 2014):
Comment created by globetrotter77a:
No, I didn't want to attach two times the same result. Wanted to attach it one time to show that those entitites that are wrong in the result doesn't appear in the sql result at all. I don't have different bootstraps. After a few short tests I think it is an error in th ArrayCache mechanism. The difference was that using Apache one initializer was not called. Calling this initializer in both cases leads now to wrong results in CLI and WEB API.
When the second query is not executed everything is fine. But when the second longer query runs and selects all i18n entities and after it the first query runs then the issue appears.