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
Fix the parameter conversion for non-loaded metadata #6210
base: 2.6
Are you sure you want to change the base?
Conversation
2 things here:
|
@stof a decent way to test this could be to use generated entity class names, which change at each test execution, with:
This would need to go through |
@Ocramius that would not help, as we would not have a hit on the DQL parser cache then (as the class name is part of the DQL). |
The root cause of the issue is that |
@stof my suggestion to use generated class names is exactly because you want to have both scenarios of |
@Ocramius but if I have a cache miss on the DQL parser, I won't have the issue, because the parsing will load metadata before the parameter processing happens (and so metadata will be loaded at this point if the mapped class is involved in any place related to the query) |
@stof that's why two generated classes are needed: one to be loaded by the driver, one to be ignored. |
@Ocramius But for it to represent an actual case (and not a hacky meaningless usage just to trigger the bug), I would have to write a query which involves the class of the object (you would use this object parameter in a place checking a relation to its class, not a relation to another one). The only way to create such case then would be to have the DQL being already parsed in the cache (parsing DQL loads metadata to validate the fields being used and to convert the DQL to SQL). Btw, there is no need to use eval'd class. The issue is not for the class not being loaded by the autoloader (if you pass an object here, its class is always loaded), but about metadata being loaded in memory already. |
The generated class is just forcing the system to create a new symbol that isn't yet known to the metadata factory, nothing to do with autoloading. I misunderstood that this is related to caching - not sure how to create a cache for a (later on) unknown metadata symbol. |
96e9e1a
to
7cf2591
Compare
Closes #6209