Added a hack so that wp_terms_seq is updated on installation

git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@546556 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
hawk__
2012-05-20 12:30:56 +00:00
parent 943887362c
commit 21754d862d

View File

@ -328,6 +328,11 @@
// This will avoid modifications to anything following ' VALUES' // This will avoid modifications to anything following ' VALUES'
list($sql,$end) = explode( ' VALUES', $sql, 2); list($sql,$end) = explode( ' VALUES', $sql, 2);
$end = ' VALUES'.$end; $end = ' VALUES'.$end;
// When installing, the sequence for table terms has to be updated
if( defined('WP_INSTALLING') && WP_INSTALLING && false !== strpos($sql, 'INSERT INTO `'.$wpdb->terms.'`'))
$end .= ';SELECT setval(\''.$wpdb->terms.'_seq\', (SELECT MAX(term_id) FROM '.$wpdb->terms.')+1);';
} // INSERT } // INSERT
elseif( 0 === strpos( $sql, 'DELETE' )) elseif( 0 === strpos( $sql, 'DELETE' ))
{ {