Skip to content

Commit

Permalink
Follow-up to a2294e9 and 8ed85ce6: Fix tag SQL to work on all databas…
Browse files Browse the repository at this point in the history
…e types while removing duplication.
  • Loading branch information
amyreese committed Jan 12, 2009
1 parent d5b6cf2 commit e41119d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/tag_api.php
Expand Up @@ -413,9 +413,8 @@ function tag_get_candidates_for_bug( $p_bug_id ) {
$t_params = array();
if ( 0 != $p_bug_id ) {
$t_bug_tag_table = db_get_table( 'mantis_bug_tag_table' );
$query = 'SELECT DISTINCT t.id, t.name, t.description FROM ' .
$t_bug_tag_table .
' t2 LEFT JOIN ' . $t_tag_table . ' t ON t.id = t2.tag_id WHERE NOT bug_id = ' . db_param();
$query = "SELECT t.id, t.name, t.description FROM $t_tag_table t
WHERE t.id IN ( SELECT tag_id FROM $t_bug_tag_table WHERE bug_id != " . db_param() . ' )';
$t_params[] = $p_bug_id;
} else {
$query = 'SELECT id, name, description FROM ' . $t_tag_table;
Expand Down

0 comments on commit e41119d

Please sign in to comment.