? ? Success
Pull Request for # 7970
Referenced as Related to: # 6693

User tests: Successful: Unsuccessful:

avatar izharaazmi
izharaazmi
14 Jun 2016

Pull Request for Issue #7970.

Summary of Changes

  • Utilise unionAll element in the select query, previously it was always being ignored.
  • Rearrange the order of appending union, unionAll, order to render a valid query when all these three are used together in a query.
  • Fix return type in method doc blocks.
  • Update test case for the JDatabaseQuery::toString method to test all the element for select query.

Testing Instructions

  1. Build any sql query using instances of JDatabaseQuery using various database types.
  2. Build query which also uses union or unionAll or both of them.
  3. Build query which uses 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 id

Without 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

avatar izharaazmi izharaazmi - open - 14 Jun 2016
avatar izharaazmi izharaazmi - change - 14 Jun 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jun 2016
Labels Added: ? ?
avatar izharaazmi izharaazmi - change - 14 Jun 2016
The description was changed
avatar RonakParmar RonakParmar - test_item - 22 Jun 2016 - Tested successfully
avatar RonakParmar
RonakParmar - comment - 22 Jun 2016

I have tested this item successfully on 79d435a


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10817.

avatar brianteeman brianteeman - change - 24 Jun 2016
Category Libraries
avatar brianteeman brianteeman - change - 24 Jun 2016
Labels
avatar brianteeman brianteeman - change - 12 Jul 2016
Category Libraries Libraries Unit Tests
avatar hardiktailored hardiktailored - test_item - 14 Jul 2016 - Tested successfully
avatar hardiktailored
hardiktailored - comment - 14 Jul 2016

I have tested this item successfully on 79d435a

I tested the query, patch resolves issue mentioned here.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10817.

avatar gunjanpatel gunjanpatel - change - 15 Jul 2016
Rel_Number 0 7970
Relation Type Pull Request for
avatar gunjanpatel
gunjanpatel - comment - 15 Jul 2016

We have two successful tests but I suggest there should be more test as it contains changes in JDatabase queries.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10817.

avatar brianteeman
brianteeman - comment - 2 Aug 2016

I am going to set it RTC
Committer please do an extra test


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10817.

avatar brianteeman brianteeman - change - 2 Aug 2016
Status Pending Ready to Commit
Labels
avatar brianteeman
brianteeman - comment - 2 Aug 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10817.

avatar rdeutz rdeutz - close - 1 Oct 2016
avatar rdeutz rdeutz - merge - 1 Oct 2016
avatar zero-24 zero-24 - close - 1 Oct 2016
avatar rdeutz rdeutz - change - 1 Oct 2016
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
avatar zero-24 zero-24 - change - 3 Oct 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment