?
avatar oasisfleeting
oasisfleeting
2 May 2014

This issue has been added to the bug tracker, but it's apparently down right now.
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33691&start=0

Steps to reproduce the issue

$query1 = $db->getQuery(true);
$query2 = $db->getQuery(true);

$query1->select('block');
$query1->from('#__users AS u');
$query1->group('u.id');

$query2->select('user_id');
$query2->from('#__user_usergroup_map AS uum');
$query2->group('uum.user_id');

$query1->union($query2);
echo $query1->dump();
return $query1;

Expected result

SELECT block
FROM kscr_users AS u
GROUP BY u.id
UNION
( SELECT user_id
FROM kscr_user_usergroup_map AS uum
GROUP BY uum.user_id)

Actual result

Syntax error check manual for correct syntax near GROUP BY u.id

SELECT block
FROM kscr_users AS u
UNION
( SELECT user_id
FROM kscr_user_usergroup_map AS uum
GROUP BY uum.user_id)
GROUP BY u.id

System information (as much as possible)

PHP Built On Linux ds2.sbthosting.com 2.6.18-348.3.1.el5PAE #1 SMP Mon Mar 11 20:30:57 EDT 2013 i686
Database Version 5.1.73-cll
Database Collation utf8_general_ci
PHP Version 5.3.28
Web Server Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/0.9.8i mod_bwlimited/1.4
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 3.3.0 Stable [ Ember ] 30-April-2014 14:00 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

Additional comments

union is so close, but so far away

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar oasisfleeting oasisfleeting - open - 2 May 2014
avatar oasisfleeting oasisfleeting - change - 2 May 2014
The description was changed
Description <h4>Steps to reproduce the issue</h4> <p>$query1 = $db-&gt;getQuery(true);<br> $query2 = $db-&gt;getQuery(true);</p> <p>$query1-&gt;select('block');<br> $query1-&gt;from('#__users AS u');<br> $query1-&gt;group('u.id');</p> <p>$query2-&gt;select('user_id');<br> $query2-&gt;from('#__user_usergroup_map AS uum');<br> $query2-&gt;group('uum.user_id');</p> <p>$query1-&gt;union($query2);<br> echo $query1-&gt;dump();<br> return $query1;</p> <h4>Expected result</h4> <p>SELECT block <br> FROM kscr_users AS u<br> GROUP BY u.id <br> UNION <br> ( SELECT user_id <br> FROM kscr_user_usergroup_map AS uum <br> GROUP BY uum.user_id) </p> <h4>Actual result</h4> <p>Syntax error check manual for correct syntax near GROUP BY u.id</p> <p>SELECT block <br> FROM kscr_users AS u <br> UNION <br> ( SELECT user_id <br> FROM kscr_user_usergroup_map AS uum <br> GROUP BY uum.user_id) <br> GROUP BY u.id</p> <h4>System information (as much as possible)</h4> <p>PHP Built On Linux ds2.sbthosting.com 2.6.18-348.3.1.el5PAE <a href="https://github.com/joomla/joomla-cms/pull/1" class="issue-link" title="Test">#1</a> SMP Mon Mar 11 20:30:57 EDT 2013 i686<br> Database Version 5.1.73-cll<br> Database Collation utf8_general_ci<br> PHP Version 5.3.28<br> Web Server Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/0.9.8i mod_bwlimited/1.4<br> WebServer to PHP Interface cgi-fcgi<br> Joomla! Version Joomla! 3.3.0 Stable [ Ember ] 30-April-2014 14:00 GMT<br> Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT</p> <h4>Additional comments</h4> <p>union is so close, but so far away</p> <p>This issue has been added to the bug tracker, but it's apparently down right now.<br><a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33691&amp;start=0">http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33691&amp;start=0</a></p> <h4>Steps to reproduce the issue</h4> <p>$query1 = $db-&gt;getQuery(true);<br> $query2 = $db-&gt;getQuery(true);</p> <p>$query1-&gt;select('block');<br> $query1-&gt;from('#__users AS u');<br> $query1-&gt;group('u.id');</p> <p>$query2-&gt;select('user_id');<br> $query2-&gt;from('#__user_usergroup_map AS uum');<br> $query2-&gt;group('uum.user_id');</p> <p>$query1-&gt;union($query2);<br> echo $query1-&gt;dump();<br> return $query1;</p> <h4>Expected result</h4> <p>SELECT block <br> FROM kscr_users AS u<br> GROUP BY u.id <br> UNION <br> ( SELECT user_id <br> FROM kscr_user_usergroup_map AS uum <br> GROUP BY uum.user_id) </p> <h4>Actual result</h4> <p>Syntax error check manual for correct syntax near GROUP BY u.id</p> <p>SELECT block <br> FROM kscr_users AS u <br> UNION <br> ( SELECT user_id <br> FROM kscr_user_usergroup_map AS uum <br> GROUP BY uum.user_id) <br> GROUP BY u.id</p> <h4>System information (as much as possible)</h4> <p>PHP Built On Linux ds2.sbthosting.com 2.6.18-348.3.1.el5PAE <a href="https://github.com/joomla/joomla-cms/pull/1" class="issue-link" title="Test">#1</a> SMP Mon Mar 11 20:30:57 EDT 2013 i686<br> Database Version 5.1.73-cll<br> Database Collation utf8_general_ci<br> PHP Version 5.3.28<br> Web Server Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/0.9.8i mod_bwlimited/1.4<br> WebServer to PHP Interface cgi-fcgi<br> Joomla! Version Joomla! 3.3.0 Stable [ Ember ] 30-April-2014 14:00 GMT<br> Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT</p> <h4>Additional comments</h4> <p>union is so close, but so far away</p>
avatar Kixo
Kixo - comment - 31 May 2014

I will try to handle this one
You may blame the J!Tracker Application for transmitting this comment.

avatar Kixo
Kixo - comment - 31 May 2014

fixed here: #3687
You may blame the J!Tracker Application for transmitting this comment.

avatar brianteeman
brianteeman - comment - 28 Jul 2014

I am closing this as it has been fixed elsewhere.

avatar zero-24 zero-24 - close - 28 Jul 2014
avatar brianteeman brianteeman - change - 28 Jul 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-07-28 18:53:48
avatar brianteeman brianteeman - close - 28 Jul 2014
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?
Removed: ?

Add a Comment

Login with GitHub to post a comment