Changeset 6285

Show
Ignore:
Timestamp:
10/23/07 16:43:15 (1 year ago)
Author:
ryan
Message:

Remove unnecessary GROUP BY when getting max term_group. Props michelwp. fixes #5240

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/taxonomy.php

    r6284 r6285  
    10461046        } else { 
    10471047            // The alias isn't in a group, so let's create a new one and firstly add the alias term to it. 
    1048             $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms GROUP BY term_group") + 1; 
     1048            $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1; 
    10491049            $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->terms SET term_group = %d WHERE term_id = %d", $term_group, $alias->term_id ) ); 
    10501050        } 
     
    12561256        } else { 
    12571257            // The alias isn't in a group, so let's create a new one and firstly add the alias term to it. 
    1258             $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms GROUP BY term_group") + 1; 
     1258            $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1; 
    12591259            $wpdb->update( $wpdb->terms, compact('term_group'), array( 'term_id' => $alias->term_id ) ); 
    12601260        }