forked from extern/egroupware
disable transaction for mysql for restore, as a failure during restore may lead to an empty database, as drop table is not transactional for mysql
This commit is contained in:
parent
1d0dc9fd59
commit
0d458c8119
@ -359,7 +359,7 @@ class db_backup
|
|||||||
$system_config[] = $row;
|
$system_config[] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->db->transaction_begin();
|
if (substr($this->db->Type,0,5) != 'mysql') $this->db->transaction_begin();
|
||||||
|
|
||||||
// drop all existing tables
|
// drop all existing tables
|
||||||
foreach($this->adodb->MetaTables('TABLES') as $table)
|
foreach($this->adodb->MetaTables('TABLES') as $table)
|
||||||
@ -616,9 +616,12 @@ class db_backup
|
|||||||
unlink($name);
|
unlink($name);
|
||||||
rmdir($dir.'/database_backup');
|
rmdir($dir.'/database_backup');
|
||||||
}
|
}
|
||||||
if (!$this->db->transaction_commit())
|
if (substr($this->db->Type,0,5) != 'mysql')
|
||||||
{
|
{
|
||||||
return lang('Restore failed');
|
if (!$this->db->transaction_commit())
|
||||||
|
{
|
||||||
|
return lang('Restore failed');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// flush instance cache
|
// flush instance cache
|
||||||
egw_cache::flush(egw_cache::INSTANCE);
|
egw_cache::flush(egw_cache::INSTANCE);
|
||||||
@ -1026,4 +1029,4 @@ echo "<p>line='$line'</p>\n";
|
|||||||
$fields = db_backup::csv_split($line);
|
$fields = db_backup::csv_split($line);
|
||||||
echo "<pre>".print_r($fields,true)."</pre>\n";
|
echo "<pre>".print_r($fields,true)."</pre>\n";
|
||||||
//echo count($fields)." fields\n";
|
//echo count($fields)." fields\n";
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user