diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-03-17 17:00:07 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-03-17 17:00:07 +0100 |
commit | 947e03aab51493a860778a541b31f991006bf6ff (patch) | |
tree | 623fd445c555756adad04a0a06f76981132c244e /lib/db/mdb2schemareader.php | |
parent | 2866376f344b83d3aa6f1692b571a359c880909d (diff) | |
download | nextcloud-server-947e03aab51493a860778a541b31f991006bf6ff.tar.gz nextcloud-server-947e03aab51493a860778a541b31f991006bf6ff.zip |
Quote index columns that need it
Diffstat (limited to 'lib/db/mdb2schemareader.php')
-rw-r--r-- | lib/db/mdb2schemareader.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/db/mdb2schemareader.php b/lib/db/mdb2schemareader.php index 1d71af1700c..827323a5512 100644 --- a/lib/db/mdb2schemareader.php +++ b/lib/db/mdb2schemareader.php @@ -9,10 +9,12 @@ class OC_DB_MDB2SchemaReader { static protected $DBNAME; static protected $DBTABLEPREFIX; + static protected $platform; - public static function loadSchemaFromFile($file) { + public static function loadSchemaFromFile($file, $platform) { self::$DBNAME = OC_Config::getValue( "dbname", "owncloud" ); self::$DBTABLEPREFIX = OC_Config::getValue( "dbtableprefix", "oc_" ); + self::$platform = $platform; $schema = new \Doctrine\DBAL\Schema\Schema(); $xml = simplexml_load_file($file); foreach($xml->children() as $child) { @@ -173,6 +175,10 @@ class OC_DB_MDB2SchemaReader { switch($field->getName()) { case 'name': $field_name = (string)$field; + $keywords = self::$platform->getReservedKeywordsList(); + if ($keywords->isKeyword($field_name)) { + $field_name = self::$platform->quoteIdentifier($field_name); + } $fields[] = $field_name; break; case 'sorting': |