summaryrefslogtreecommitdiffstats
path: root/3rdparty
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-01-17 15:57:29 +0100
committerGeorg Ehrke <dev@georgswebsite.de>2012-01-17 15:57:29 +0100
commit6e86b3458694f22748de977c702e3c7fe3435e30 (patch)
tree11cdbe07e30b3f6cb89c7ed0b3cee486c4ef26ef /3rdparty
parent21794377260d483141f4bd5a9bb90b49ee83486b (diff)
parent91016e37d45a6ea05b0e9e3578dd8b0943798630 (diff)
downloadnextcloud-server-6e86b3458694f22748de977c702e3c7fe3435e30.tar.gz
nextcloud-server-6e86b3458694f22748de977c702e3c7fe3435e30.zip
Merge branch 'master' into calendar
Diffstat (limited to '3rdparty')
-rw-r--r--3rdparty/MDB2/Driver/Manager/pgsql.php37
-rw-r--r--3rdparty/MDB2/Driver/Reverse/pgsql.php10
2 files changed, 25 insertions, 22 deletions
diff --git a/3rdparty/MDB2/Driver/Manager/pgsql.php b/3rdparty/MDB2/Driver/Manager/pgsql.php
index a2e80caa5ce..44a611d399d 100644
--- a/3rdparty/MDB2/Driver/Manager/pgsql.php
+++ b/3rdparty/MDB2/Driver/Manager/pgsql.php
@@ -68,7 +68,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function createDatabase($name, $options = array())
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -95,7 +95,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function alterDatabase($name, $options = array())
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -122,7 +122,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function dropDatabase($name)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -181,7 +181,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function truncateTable($name)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -209,7 +209,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function vacuum($table = null, $options = array())
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -326,7 +326,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function alterTable($name, $changes, $check)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -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, since serials arent a real type
+ $type='INTEGER';//use integer instead
+ }
$query = "ALTER $field_name TYPE $type USING CAST($field_name AS $type)";
$result = $db->exec("ALTER TABLE $name $query");
if (PEAR::isError($result)) {
@@ -441,7 +444,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function listDatabases()
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -474,7 +477,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function listUsers()
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -501,7 +504,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function listViews($database = null)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -680,7 +683,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function listTableFields($table)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -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;
}
@@ -716,7 +719,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function listTableIndexes($table)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -769,7 +772,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function dropConstraint($table, $name, $primary = false)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -817,7 +820,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function listTableConstraints($table)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -882,7 +885,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function createSequence($seq_name, $start = 1)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -904,7 +907,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function dropSequence($seq_name)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -924,7 +927,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
*/
function listSequences($database = null)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
diff --git a/3rdparty/MDB2/Driver/Reverse/pgsql.php b/3rdparty/MDB2/Driver/Reverse/pgsql.php
index 649c1cad9ee..8669c2b919b 100644
--- a/3rdparty/MDB2/Driver/Reverse/pgsql.php
+++ b/3rdparty/MDB2/Driver/Reverse/pgsql.php
@@ -69,7 +69,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
*/
function getTableFieldDefinition($table_name, $field_name)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -198,7 +198,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
*/
function getTableIndexDefinition($table_name, $index_name)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -256,7 +256,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
*/
function getTableConstraintDefinition($table_name, $constraint_name)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -443,7 +443,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
*/
function getTriggerDefinition($trigger)
{
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
@@ -517,7 +517,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
return parent::tableInfo($result, $mode);
}
- $db =& $this->getDBInstance();
+ $db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}