We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This issue is related to #2983. Currently, DATE_ADD & DATE_SUB with interpolated interval is only available for DATE.
Exemple code :
<?php $rp ->createQueryBuilder('s') ->select('s') ->leftJoin('s.agency', 'sAg') ->where("s.endAt < DATE_ADD(NOW(), sAg.utcOffset, 'minute')") ;
The previous exemple produce the following SQL query :
SELECT s0_.id AS id_0, s0_.end_at AS end_at_6 FROM services s0_ LEFT JOIN companies c1_ ON s0_.agency_id = c1_.id WHERE s0_.end_at < DATETIME(?,'+c1_.utc_offset MINUTE')
And won't return any result (invalid DATETIME comparison)
Run the exemple in any database.
Inspired from the mentionned issue #2983 and related merge request, doctrine may have produce the following SQL with concat operator :
SELECT s0_.id AS id_0, s0_.end_at AS end_at_6 FROM services s0_ LEFT JOIN companies c1_ ON s0_.agency_id = c1_.id WHERE s0_.end_at < DATETIME(?,'+' || c1_.utc_offset || ' MINUTE')
I will create a merge request to introduce a fix.
Thanks for your great work.
The text was updated successfully, but these errors were encountered:
🐛 bugfix/doctrine#6261 - Allow (also for DATETIME) dynamic intervals …
3dc634b
…in DATE_ADD & DATE_SUB for SQLite - 🐛 Fix code divergence - ✅ Add related tests
843719c
1a09101
…in DATE_ADD & DATE_SUB for SQLite - ✅ Add related functional test
40a44fd
…in DATE_ADD & DATE_SUB for SQLite - 👌 Code review from @derrabus
No branches or pull requests
Bug Report
This issue is related to #2983.
Currently, DATE_ADD & DATE_SUB with interpolated interval is only available for DATE.
Summary
Exemple code :
Current behaviour
The previous exemple produce the following SQL query :
And won't return any result (invalid DATETIME comparison)
How to reproduce
Run the exemple in any database.
Expected behaviour
Inspired from the mentionned issue #2983 and related merge request, doctrine may have produce the following SQL with concat operator :
I will create a merge request to introduce a fix.
Thanks for your great work.
The text was updated successfully, but these errors were encountered: