User tests: Successful: Unsuccessful:
Pull Request for Issue #7970.
unionAll element in the select query, previously it was always being ignored.union, unionAll, order to render a valid query when all these three are used together in a query.JDatabaseQuery using various database types.union or unionAll or both of them.union or unionAll as well as order.You can use the following sample query as a hint what you need to test.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('a.id')
->from('#__content AS a')
->union('SELECT c.id FROM #__content AS c')
->unionAll('SELECT d.id FROM #__content AS d')
->order('id');should give
SELECT a.id
FROM is2_content AS a
UNION (SELECT c.id FROM is2_content AS c)
UNION ALL (SELECT d.id FROM is2_content AS d)
ORDER BY idWithout this patch you get
SELECT a.id
FROM is2_content AS a
ORDER BY id
UNION (SELECT c.id FROM is2_content AS c)Please note that the UNION ALL (SELECT d.id FROM is2_content AS d) is missing also the order by clause comes before union which is wrong.
Fixes #7970
| Status | New | ⇒ | Pending |
| Labels |
Added:
?
?
|
||
| Category | ⇒ | Libraries |
| Labels | |||
| Category | Libraries | ⇒ | Libraries Unit Tests |
I have tested this item
I tested the query, patch resolves issue mentioned here.
| Rel_Number | 0 | ⇒ | 7970 |
| Relation Type | ⇒ | Pull Request for |
We have two successful tests but I suggest there should be more test as it contains changes in JDatabase queries.
I am going to set it RTC
Committer please do an extra test
| Status | Pending | ⇒ | Ready to Commit |
| Labels | |||
| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-10-01 09:16:00 |
| Closed_By | ⇒ | rdeutz |
| Labels |
Removed:
?
|
||
I have tested this item✅ successfully on 79d435a
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10817.