diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-07-19 21:31:09 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-07-19 21:31:09 +0000 |
commit | 103346f2f4c2b9df01012e9ce919a63734088e68 (patch) | |
tree | b00541992cbe7772f38cde47d4a6d3d87f7c140b /modules/taxonomy/taxonomy.module | |
parent | b6cdead1641b081fb1d9bd37ea8f6fd7e6603131 (diff) | |
download | brdo-103346f2f4c2b9df01012e9ce919a63734088e68.tar.gz brdo-103346f2f4c2b9df01012e9ce919a63734088e68.tar.bz2 |
- Patch #26683 by matteo: added missing DISTINCT()s
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index a3ae3cac8..e4dab2989 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -965,8 +965,8 @@ function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $p $joins .= ' INNER JOIN {term_node} tn'. $index .' ON n.nid = tn'. $index .'.nid'; $wheres .= ' AND tn'. $index .'.tid IN ('. implode(',', $tids) .')'; } - $sql = 'SELECT n.nid, n.sticky, n.title, n.created FROM {node} n '. $joins .' WHERE n.status = 1 '. $wheres .' ORDER BY '. $order; - $sql_count = 'SELECT COUNT(n.nid) FROM {node} n '. $joins .' WHERE n.status = 1 ' . $wheres; + $sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n '. $joins .' WHERE n.status = 1 '. $wheres .' ORDER BY '. $order; + $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n '. $joins .' WHERE n.status = 1 ' . $wheres; } $sql = db_rewrite_sql($sql); $sql_count = db_rewrite_sql($sql_count); |