diff --git a/query.class.php b/query.class.php index 718ba4a..b3b1d39 100644 --- a/query.class.php +++ b/query.class.php @@ -286,7 +286,7 @@ class PDOSQLiteDriver { * @return void */ private function _delete_index_hints(){ - $pattern = '/use\s+index\s*\(.*?\)/i'; + $pattern = '/\\s*(use|ignore|force)\\s+index\\s*\(.*?\)/i'; $this->_query = preg_replace($pattern, '', $this->_query); } diff --git a/query_alter.class.php b/query_alter.class.php index cd0f814..1321c5c 100644 --- a/query_alter.class.php +++ b/query_alter.class.php @@ -84,7 +84,11 @@ class AlterQuery { $tokens['column_name'] = '('.trim($col_name).')'; } elseif (in_array($match_2, array('index', 'key'))) { $tokens['command'] = $match_1.' '.$match_2; - $tokens['index_name'] = $match_3; + if ($match_3 == '') { + $tokens['index_name'] = str_replace(array('(', ')'), '', $the_rest); + } else { + $tokens['index_name'] = $match_3; + } $tokens['column_name'] = trim($the_rest); } else { $tokens['command'] = $match_1.' column'; diff --git a/readme.txt b/readme.txt index 4ebe687..d356370 100644 --- a/readme.txt +++ b/readme.txt @@ -46,7 +46,7 @@ Please contact us with the methods below: Post to [Support Forum](http://wordpress.org/support/plugin/sqlite-integration/). -Notes: WordPress.org doesn't officially support using any other database than MySQL. So there will be no supports from WordPress.org. Even if you post to the general Forum, you have few chances to get the answer. And if you use patched plugins, you will have be no support from the plugin authors, eithter. +Notes: WordPress.org doesn't officially support using any other database than MySQL. So there will be no supports from WordPress.org. Even if you post to the general Forum, you have few chances to get the answer. And if you use patched plugins, you will have no support from the plugin authors, eithter. = Translation =