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
Ensure a parameter mapping entry exists for InstanceOf DQL expressions #429
Conversation
Please add some testcase to avoid regressions |
I'd planned on it, but unable to install Doctrine's dependencies through Composer ATM. Getting 'The requested package doctrine/dbal >=2.3-dev,<2.5-dev could not be found.'. Any ideas? :) |
The doctrine testsuite is not setup using composer currently but submodules, as you can see by looking at the way the travis config file does it |
Ah, of course. Right. I added a test case, and my 'fix' caused an SQLite exception so I removed it. I'll take another look when I've time, if nobody else gets chance first. |
in fact, I'm simply not sure this is possible. INSTANCE OF is handled by using the discriminator map. It cannot be done if the type uses a placeholder bound only in SQL. |
I see. If it's mapped then presumably I don't have to worry about escaping it through a parameter anyway, but this (https://groups.google.com/forum/#!msg/doctrine-user/IomnY_RhPz4/elBFbwVgEzAJ) seems to indicate that it used to work; if it's a regression it may cause problems for people upgrading? |
I think a better fix would be to remove the parameter which is not used anymore |
I assigned the issue to @guilhermeblanco - I don't know what the procedure here should be. |
I can only see a test case here. So... just added test coverage? |
@guilhermeblanco this PR is about adding a failing testcase showing the issue. there is no fix for the issue here (which is why @beberlei assigned it to you) |
btw, the latest travis comment shows that it does not work as expected by this test |
@guilhermeblanco I would just have expected to be able to provide the fully qualified class name as a parameter, so queries can be reused, and to be consistent. The test case I added illustrates that it doesn't work at the moment - I did originally commit a fix which worked on MySQL but caused an exception on SQLite so I reverted it. |
I'm having issues to fix this issue. Attempted 2 different ways without any luck. |
ping @guilhermeblanco |
close in favor of #689 |
Hi,
This is a possible fix for http://www.doctrine-project.org/jira/browse/DDC-1995, in that it resolves the issue for me but I'm afraid I haven't had time to test it extensively with more complex queries than the use case I gave in that ticket.
Cheers,
Craig