From 720e7d376ffe0fb625d0b1e250121823a71da094 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 29 Apr 2014 11:34:43 +0200 Subject: Fix varius db_prefix issues (#1489839) - Move DDL script execution code to rcube_db class(es). - Improve prefix replacement code, so index names are also modified --- program/lib/Roundcube/rcube_db_mssql.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'program/lib/Roundcube/rcube_db_mssql.php') diff --git a/program/lib/Roundcube/rcube_db_mssql.php b/program/lib/Roundcube/rcube_db_mssql.php index 726e4b421..4138b1489 100644 --- a/program/lib/Roundcube/rcube_db_mssql.php +++ b/program/lib/Roundcube/rcube_db_mssql.php @@ -167,4 +167,24 @@ class rcube_db_mssql extends rcube_db return $result; } + + /** + * Parse SQL file and fix table names according to table prefix + */ + protected function fix_table_names($sql) + { + if (!$this->options['table_prefix']) { + return $sql; + } + + // replace sequence names, and other postgres-specific commands + $sql = preg_replace_callback( + '/((TABLE|(?