Commit 7c81a515 authored by Michael Widenius's avatar Michael Widenius Committed by Michael Widenius

Make copy_up_file_and_fill() safe for disk full

Fixed use-copy option to mysql-test-run

mysql-test/mysql-test-run.pl:
  Fixed use-copy and added comment
sql/log.cc:
  Make copy_up_file_and_fill() safe for disk full
parent 9aac5468
...@@ -2686,7 +2686,7 @@ sub setup_vardir() { ...@@ -2686,7 +2686,7 @@ sub setup_vardir() {
{ {
$plugindir="$opt_vardir/plugins"; $plugindir="$opt_vardir/plugins";
mkpath($plugindir); mkpath($plugindir);
if (IS_WINDOWS && !$opt_embedded_server || $opt_use_copy) if (IS_WINDOWS && !$opt_embedded_server)
{ {
for (<$bindir/storage/*$opt_vs_config/*.dll>, for (<$bindir/storage/*$opt_vs_config/*.dll>,
<$bindir/plugin/*$opt_vs_config/*.dll>, <$bindir/plugin/*$opt_vs_config/*.dll>,
...@@ -2708,7 +2708,14 @@ sub setup_vardir() { ...@@ -2708,7 +2708,14 @@ sub setup_vardir() {
<$bindir/sql/*.so>) <$bindir/sql/*.so>)
{ {
my $pname=basename($_); my $pname=basename($_);
if ($opt_use_copy)
{
copy rel2abs($_), "$plugindir/$pname";
}
else
{
symlink rel2abs($_), "$plugindir/$pname"; symlink rel2abs($_), "$plugindir/$pname";
}
set_plugin_var($pname); set_plugin_var($pname);
} }
} }
...@@ -6416,6 +6423,9 @@ Options to control what test suites or cases to run ...@@ -6416,6 +6423,9 @@ Options to control what test suites or cases to run
skip-test-list=FILE Skip the tests listed in FILE. Each line in the file skip-test-list=FILE Skip the tests listed in FILE. Each line in the file
is an entry and should be formatted as: is an entry and should be formatted as:
<TESTNAME> : <COMMENT> <TESTNAME> : <COMMENT>
use-copy Copy plugins instead of symlinking them. This is
only useful when running on a system that doesn't
support symlinks.
Options that specify ports Options that specify ports
......
...@@ -3590,7 +3590,8 @@ static bool copy_up_file_and_fill(IO_CACHE *index_file, my_off_t offset) ...@@ -3590,7 +3590,8 @@ static bool copy_up_file_and_fill(IO_CACHE *index_file, my_off_t offset)
if (!bytes_read) if (!bytes_read)
break; // end of file break; // end of file
mysql_file_seek(file, offset-init_offset, MY_SEEK_SET, MYF(0)); mysql_file_seek(file, offset-init_offset, MY_SEEK_SET, MYF(0));
if (mysql_file_write(file, io_buf, bytes_read, MYF(MY_WME | MY_NABP))) if (mysql_file_write(file, io_buf, bytes_read,
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)))
goto err; goto err;
} }
/* The following will either truncate the file or fill the end with \n' */ /* The following will either truncate the file or fill the end with \n' */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment