diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-03 03:23:13 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-03 03:23:13 +0100 |
commit | 4cc726913b7a8696dc5cff7456b6a95926b6816b (patch) | |
tree | 007b553ac062bb9827f8469cde5e2f4ecf2c67ad | |
parent | a6a1496b27c87718106645b6f1438023a18ad40c (diff) | |
parent | a19beb0c580ac78c4b75548a046240a85f30cb29 (diff) |
Merge upstream branch
-rw-r--r-- | system/database/DB_driver.php | 2 | ||||
-rw-r--r-- | system/database/drivers/postgre/postgre_utility.php | 6 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 6 |
3 files changed, 6 insertions, 8 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index b41a42051..15195b20a 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -651,7 +651,7 @@ class CI_DB_driver { */ public function is_write_type($sql) { - return (bool) preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD DATA|COPY|ALTER|RENAME|GRANT|REVOKE|LOCK|UNLOCK|OPTIMIZE)\s+/i', $sql); + return (bool) preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|TRUNCATE|LOAD DATA|COPY|ALTER|RENAME|GRANT|REVOKE|LOCK|UNLOCK|OPTIMIZE|REINDEX)\s+/i', $sql); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php index c175a382b..1e9580389 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.php @@ -49,14 +49,12 @@ class CI_DB_postgre_utility extends CI_DB_utility { /** * Optimize table query * - * Is table optimization supported in Postgre? - * * @param string the table name * @return string */ public function _optimize_table($table) { - return 'REINDEX TABLE '.$table; + return 'REINDEX TABLE '.$this->db->protect_identifiers($table); } // -------------------------------------------------------------------- @@ -64,8 +62,6 @@ class CI_DB_postgre_utility extends CI_DB_utility { /** * Repair table query * - * Are table repairs supported in Postgre? - * * @param string the table name * @return bool */ diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 6f3b030a0..cb33336a1 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -58,8 +58,10 @@ Release Date: Not Released - Added an optional database name parameter to db_select(). - Replaced the _error_message() and _error_number() methods with error(), that returns an array containing the last database error code and message. - Improved version() implementation so that drivers that have a native function to get the version number don't have to be defined in the core DB_driver class. - - PostgreSQL driver now uses pg_version() to get the database version number, when possible. - - Added db_set_charset() support for PostgreSQL. + - Improved support of the PostgreSQL driver, including: + - pg_version() is now used to get the database version number, when possible. + - Added db_set_charset() support. + - Added _optimize_table() support for the :doc:`Database Utility Class <database/utilities>` (rebuilds table indexes). - Libraries |