- Patch #22469 by mathias: added missing DISTINCT()s to two SQL queries.
parent
cdec2f7e3e
commit
4bedad588c
|
@ -965,8 +965,8 @@ function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $p
|
|||
|
||||
if ($operator == 'or') {
|
||||
$str_tids = implode(',', call_user_func_array('array_merge', $descendant_tids));
|
||||
$sql = 'SELECT n.nid, n.sticky, n.title, n.created FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC';
|
||||
$sql_count = 'SELECT COUNT(n.nid) FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1';
|
||||
$sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC';
|
||||
$sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1';
|
||||
}
|
||||
else {
|
||||
$joins = '';
|
||||
|
|
|
@ -965,8 +965,8 @@ function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $p
|
|||
|
||||
if ($operator == 'or') {
|
||||
$str_tids = implode(',', call_user_func_array('array_merge', $descendant_tids));
|
||||
$sql = 'SELECT n.nid, n.sticky, n.title, n.created FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC';
|
||||
$sql_count = 'SELECT COUNT(n.nid) FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1';
|
||||
$sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC';
|
||||
$sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid IN ('. $str_tids .') AND n.status = 1';
|
||||
}
|
||||
else {
|
||||
$joins = '';
|
||||
|
|
Loading…
Reference in New Issue