The information_schema database is no longer included when backing up all databases, as it really just contains metadata.
---- Changes since 1.500 ----
Added a collation order field to the database creation form.
+Added an option to the backup form to do backup in a single transaction, for InnoDB tables.
$config{'backup_charset_'.$sf},
\@compat,
\@tables,
- "root");
+ "root",
+ $config{'backup_single_'.$sf});
if ($err) {
print "Backup of database $db to file $file failed:\n";
print $out;
join(" ", split(/\0/, $in{'options'}));
$userconfig{'backup_compress_'.$in{'db'}} = $in{'compress'};
$userconfig{'backup_drop_'.$in{'db'}} = $in{'drop'};
+ $userconfig{'backup_single_'.$in{'db'}} = $in{'single'};
$userconfig{'backup_tables_'.$in{'db'}} = join(" ", @tables);
&write_file("$user_module_config_directory/config", \%userconfig);
}
join(" ", split(/\0/, $in{'options'}));
$config{'backup_compress_'.$in{'db'}} = $in{'compress'};
$config{'backup_drop_'.$in{'db'}} = $in{'drop'};
+ $config{'backup_single_'.$in{'db'}} = $in{'single'};
$config{'backup_tables_'.$in{'db'}} = join(" ", @tables);
&write_file("$module_config_directory/config", \%config);
}
local $err = &backup_database($db, $file, $in{'compress'},
$in{'drop'}, $in{'where_def'} ? undef : $in{'where'},
$in{'charset_def'} ? undef : $in{'charset'},
- \@compat, \@tables, $access{'buser'});
+ \@compat, \@tables, $access{'buser'}, $in{'single'});
if ($err) {
print "$main::whatfailed : ",
&text('backup_ebackup',"<pre>$err</pre>"),"<p>\n";
[ 1, $text{'backup_gzip'} ],
[ 2, $text{'backup_bzip2'} ] ]));
+# Show single-transaction option
+$s = $c{'backup_single_'.$in{'db'}};
+print &ui_table_row($text{'backup_single'},
+ &ui_yesno_radio("single", $s ? 1 : 0));
+
if ($cron) {
# Show before/after commands
$b = $c{'backup_before_'.$in{'db'}};
backup_where=Only backup rows matching <tt>where</tt> clause
backup_none=All rows
backup_drop=Add <tt>drop table</tt> statements to backup?
+backup_single=Backup within a transaction?
backup_charset=Character set for backup
backup_ok=Backup Now
backup_ok1=Save and Backup Now
}
# backup_database(db, dest-file, compress-mode, drop-flag, where-clause,
-# charset, &compatible, &only-tables, run-as-user)
+# charset, &compatible, &only-tables, run-as-user,
+# single-transaction-flag)
# Backs up a database to the given file, optionally with compression. Returns
# undef on success, or an error message on failure.
sub backup_database
{
local ($db, $file, $compress, $drop, $where, $charset, $compatible,
- $tables, $user) = @_;
+ $tables, $user, $single) = @_;
if ($compress == 0) {
$writer = ">$file";
}
$writer = "| bzip2 -c >$file";
}
local $dropsql = $drop ? "--add-drop-table" : "";
+local $singlesql = $single ? "--single-transaction" : "";
local $wheresql = $where ? "\"--where=$in{'where'}\"" : "";
local $charsetsql = $charset ?
"--default-character-set=".quotemeta($charset) : "";
local $quotingsql = &supports_quoting() ? "--quote-names" : "";
local $routinessql = &supports_routines() ? "--routines" : "";
local $tablessql = join(" ", map { quotemeta($_) } @$tables);
-local $cmd = "$config{'mysqldump'} $authstr $dropsql $wheresql $charsetsql $compatiblesql $quotingsql $routinessql ".quotemeta($db)." $tablessql 2>&1 $writer";
+local $cmd = "$config{'mysqldump'} $authstr $dropsql $singlesql $wheresql $charsetsql $compatiblesql $quotingsql $routinessql ".quotemeta($db)." $tablessql 2>&1 $writer";
if ($user && $user ne "root") {
$cmd = &command_as_user($user, undef, $cmd);
}