summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-01-16 02:06:19 +0100
committerRobin Appelman <icewind@owncloud.com>2012-01-16 02:06:19 +0100
commitebe10870cfe3c59edb4b2924297b6e495977eea0 (patch)
tree0e8d56bcd4c17dab3ad4461fcba271954a4d01a7
parent907dd4d24da80fa4f4ad5d6d469cd11d7c215f02 (diff)
downloadnextcloud-server-ebe10870cfe3c59edb4b2924297b6e495977eea0.tar.gz
nextcloud-server-ebe10870cfe3c59edb4b2924297b6e495977eea0.zip
fix database upgrading for pgsql
-rw-r--r--3rdparty/MDB2/Driver/Manager/pgsql.php5
-rw-r--r--lib/db.php2
2 files changed, 5 insertions, 2 deletions
diff --git a/3rdparty/MDB2/Driver/Manager/pgsql.php b/3rdparty/MDB2/Driver/Manager/pgsql.php
index a61821ef053..c99dd08e8ef 100644
--- a/3rdparty/MDB2/Driver/Manager/pgsql.php
+++ b/3rdparty/MDB2/Driver/Manager/pgsql.php
@@ -396,6 +396,9 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
}
$db->loadModule('Datatype', null, true);
$type = $db->datatype->getTypeDeclaration($field['definition']);
+ if($type=='SERIAL PRIMARY KEY'){//not correct when altering a table
+ $type='integer';//use this instead
+ }
$query = "ALTER $field_name TYPE $type USING CAST($field_name AS $type)";
$result = $db->exec("ALTER TABLE $name $query");
if (PEAR::isError($result)) {
@@ -692,7 +695,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
$table = $db->quoteIdentifier($schema, true) . '.' .$table;
}
$db->setLimit(1);
- $result2 = $db->query("SELECT * FROM $table");
+ $result2 = $db->query("SELECT * FROM $table LIMIT 1");
if (PEAR::isError($result2)) {
return $result2;
}
diff --git a/lib/db.php b/lib/db.php
index 1a5f9874bd5..4860651b323 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -144,7 +144,7 @@ class OC_DB {
// Prepare options array
$options = array(
- 'portability' => MDB2_PORTABILITY_ALL,
+ 'portability' => MDB2_PORTABILITY_ALL & (!MDB2_PORTABILITY_FIX_CASE),
'log_line_break' => '<br>',
'idxname_format' => '%s',
'debug' => true,