From 281090320fbab5befd2707a5eff0e422b9ec11c3 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 26 Aug 2014 14:03:35 +0000 Subject: [PATCH] * PostgreSQL/Admin/Setup: backup stopped with SQL error --- phpgwapi/inc/class.db_backup.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.db_backup.inc.php b/phpgwapi/inc/class.db_backup.inc.php index e17bfdd8e6..1a3a6b1ea7 100644 --- a/phpgwapi/inc/class.db_backup.inc.php +++ b/phpgwapi/inc/class.db_backup.inc.php @@ -849,7 +849,8 @@ class db_backup $num_rows = 0; // querying only chunks for 10000 rows, to not run into memory limit on huge tables foreach($this->db->select($table, '*', - empty($pk) ? false : $pk.' > '.$max, // limit by maximum primary key already received + // limit by maximum primary key already received + empty($pk) || !$max ? false : $pk.' > '.$this->db->quote($max, $schema['fd'][$pk]['type']), __LINE__, __FILE__, empty($pk) ? $total : 0, // if no primary limit by number of received rows empty($pk) ? '' : 'ORDER BY '.$pk.' ASC', // order by primary key