WordPress.org

Make WordPress Core

Changeset 6285


Ignore:
Timestamp:
10/23/2007 04:43:15 PM (14 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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        }
Note: See TracChangeset for help on using the changeset viewer.