From 959263d68d4aa95d97786b669da8d9fe55f367a5 Mon Sep 17 00:00:00 2001 From: hawk__ Date: Tue, 2 Aug 2011 00:00:07 +0000 Subject: [PATCH] git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@418100 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- pg4wp/driver_pgsql.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pg4wp/driver_pgsql.php b/pg4wp/driver_pgsql.php index 0312449..cc0341c 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -277,6 +277,12 @@ $logto = 'SHOWTABLES'; $sql = 'SELECT tablename FROM pg_tables WHERE schemaname = \'public\';'; } + // Rewriting optimize table + elseif( 0 === strpos($sql, 'OPTIMIZE TABLE')) + { + $logto = 'OPTIMIZE'; + $sql = str_replace( 'OPTIMIZE TABLE', 'VACUUM', $sql); + } elseif( defined('WP_INSTALLING') && WP_INSTALLING) $sql = pg4wp_installing( $sql, $logto); @@ -293,6 +299,9 @@ // Remove illegal characters $sql = str_replace('`', '', $sql); + // Akismet sometimes doesn't write 'comment_ID' with 'ID' in capitals ... + $sql = str_replace(' comment_id ', ' comment_ID ', $sql); + // Field names with CAPITALS need special handling if( false !== strpos($sql, 'ID')) {