* Backup: fixed broken backup of tables without an auto index

This commit is contained in:
Ralf Becker 2015-01-15 16:34:57 +00:00
parent 5c36b0b810
commit 791e03b44a

View File

@ -920,7 +920,7 @@ class db_backup
// 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']), empty($pk) || !$max ? false : $pk.' > '.$this->db->quote($max, $schema['fd'][$pk]['type']),
__LINE__, __FILE__, __LINE__, __FILE__,
empty($pk) ? $total : 0, // if no primary limit by number of received rows empty($pk) ? false : 0, // if no primary key, query all rows
empty($pk) ? '' : 'ORDER BY '.$pk.' ASC', // order by primary key empty($pk) ? '' : 'ORDER BY '.$pk.' ASC', // order by primary key
false, self::ROW_CHUNK) as $row) false, self::ROW_CHUNK) as $row)
{ {
@ -933,7 +933,7 @@ class db_backup
++$num_rows; ++$num_rows;
} }
} }
while(!($total % self::ROW_CHUNK) && $num_rows); while(!empty($pk) && !($total % self::ROW_CHUNK) && $num_rows);
} }
if(!$zippresent) // save without files if(!$zippresent) // save without files
{ {