Commit 204af030 authored by Vasil Dimov's avatar Vasil Dimov

Merge mysql-5.1-bugteam -> mysql-5.1-innodb

parents ee321e80 6a84582c
...@@ -73,6 +73,10 @@ ...@@ -73,6 +73,10 @@
#define QUERY_SEND_FLAG 1 #define QUERY_SEND_FLAG 1
#define QUERY_REAP_FLAG 2 #define QUERY_REAP_FLAG 2
#ifndef HAVE_SETENV
static int setenv(const char *name, const char *value, int overwrite);
#endif
enum { enum {
OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION, OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION,
OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
...@@ -219,7 +223,6 @@ typedef struct ...@@ -219,7 +223,6 @@ typedef struct
int alloced_len; int alloced_len;
int int_dirty; /* do not update string if int is updated until first read */ int int_dirty; /* do not update string if int is updated until first read */
int alloced; int alloced;
char *env_s;
} VAR; } VAR;
/*Perl/shell-like variable registers */ /*Perl/shell-like variable registers */
...@@ -1088,8 +1091,8 @@ void handle_command_error(struct st_command *command, uint error) ...@@ -1088,8 +1091,8 @@ void handle_command_error(struct st_command *command, uint error)
int i; int i;
if (command->abort_on_error) if (command->abort_on_error)
die("command \"%.*s\" failed with error %d", die("command \"%.*s\" failed with error %d. my_errno=%d",
command->first_word_len, command->query, error); command->first_word_len, command->query, error, my_errno);
i= match_expected_error(command, error, NULL); i= match_expected_error(command, error, NULL);
...@@ -1100,8 +1103,8 @@ void handle_command_error(struct st_command *command, uint error) ...@@ -1100,8 +1103,8 @@ void handle_command_error(struct st_command *command, uint error)
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
if (command->expected_errors.count > 0) if (command->expected_errors.count > 0)
die("command \"%.*s\" failed with wrong error: %d", die("command \"%.*s\" failed with wrong error: %d. my_errno=%d",
command->first_word_len, command->query, error); command->first_word_len, command->query, error, my_errno);
} }
else if (command->expected_errors.err[0].type == ERR_ERRNO && else if (command->expected_errors.err[0].type == ERR_ERRNO &&
command->expected_errors.err[0].code.errnum != 0) command->expected_errors.err[0].code.errnum != 0)
...@@ -1962,7 +1965,7 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val, ...@@ -1962,7 +1965,7 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
val_len = strlen(val) ; val_len = strlen(val) ;
val_alloc_len = val_len + 16; /* room to grow */ val_alloc_len = val_len + 16; /* room to grow */
if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var) if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var)
+ name_len+1, MYF(MY_WME)))) + name_len+2, MYF(MY_WME))))
die("Out of memory"); die("Out of memory");
tmp_var->name = (name) ? (char*) tmp_var + sizeof(*tmp_var) : 0; tmp_var->name = (name) ? (char*) tmp_var + sizeof(*tmp_var) : 0;
...@@ -1971,7 +1974,12 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val, ...@@ -1971,7 +1974,12 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
if (!(tmp_var->str_val = (char*)my_malloc(val_alloc_len+1, MYF(MY_WME)))) if (!(tmp_var->str_val = (char*)my_malloc(val_alloc_len+1, MYF(MY_WME))))
die("Out of memory"); die("Out of memory");
if (name)
{
memcpy(tmp_var->name, name, name_len); memcpy(tmp_var->name, name, name_len);
tmp_var->name[name_len]= 0;
}
if (val) if (val)
{ {
memcpy(tmp_var->str_val, val, val_len); memcpy(tmp_var->str_val, val, val_len);
...@@ -1982,7 +1990,6 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val, ...@@ -1982,7 +1990,6 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
tmp_var->alloced_len = val_alloc_len; tmp_var->alloced_len = val_alloc_len;
tmp_var->int_val = (val) ? atoi(val) : 0; tmp_var->int_val = (val) ? atoi(val) : 0;
tmp_var->int_dirty = 0; tmp_var->int_dirty = 0;
tmp_var->env_s = 0;
return tmp_var; return tmp_var;
} }
...@@ -2110,20 +2117,15 @@ void var_set(const char *var_name, const char *var_name_end, ...@@ -2110,20 +2117,15 @@ void var_set(const char *var_name, const char *var_name_end,
if (env_var) if (env_var)
{ {
char buf[1024], *old_env_s= v->env_s;
if (v->int_dirty) if (v->int_dirty)
{ {
sprintf(v->str_val, "%d", v->int_val); sprintf(v->str_val, "%d", v->int_val);
v->int_dirty= 0; v->int_dirty= 0;
v->str_val_len= strlen(v->str_val); v->str_val_len= strlen(v->str_val);
} }
my_snprintf(buf, sizeof(buf), "%.*s=%.*s", /* setenv() expects \0-terminated strings */
v->name_len, v->name, DBUG_ASSERT(v->name[v->name_len] == 0);
v->str_val_len, v->str_val); setenv(v->name, v->str_val, 1);
if (!(v->env_s= my_strdup(buf, MYF(MY_WME))))
die("Out of memory");
putenv(v->env_s);
my_free(old_env_s, MYF(MY_ALLOW_ZERO_PTR));
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -7644,6 +7646,16 @@ void init_re(void) ...@@ -7644,6 +7646,16 @@ void init_re(void)
int match_re(my_regex_t *re, char *str) int match_re(my_regex_t *re, char *str)
{ {
while (my_isspace(charset_info, *str))
str++;
if (str[0] == '/' && str[1] == '*')
{
char *comm_end= strstr (str, "*/");
if (! comm_end)
die("Statement is unterminated comment");
str= comm_end + 2;
}
int err= my_regexec(re, str, (size_t)0, NULL, 0); int err= my_regexec(re, str, (size_t)0, NULL, 0);
if (err == 0) if (err == 0)
...@@ -9908,3 +9920,18 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input) ...@@ -9908,3 +9920,18 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input)
delete_dynamic(&lines); delete_dynamic(&lines);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
#ifndef HAVE_SETENV
static int setenv(const char *name, const char *value, int overwrite)
{
size_t buflen= strlen(name) + strlen(value) + 2;
char *envvar= (char *)malloc(buflen);
if(!envvar)
return ENOMEM;
strcpy(envvar, name);
strcat(envvar, "=");
strcat(envvar, value);
putenv(envvar);
return 0;
}
#endif
...@@ -15,8 +15,11 @@ AC_DEFUN([MY_MAINTAINER_MODE], [ ...@@ -15,8 +15,11 @@ AC_DEFUN([MY_MAINTAINER_MODE], [
# Set warning options required under maintainer mode. # Set warning options required under maintainer mode.
AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [ AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [
# Detect ICC posing as GCC.
AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
[INTEL_COMPILER=no], [INTEL_COMPILER=yes])
# Setup GCC warning options. # Setup GCC warning options.
AS_IF([test "$GCC" = "yes"], [ AS_IF([test "$GCC" = "yes" -a "$INTEL_COMPILER" = "no"], [
C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror" C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror"
CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter" CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
C_WARNINGS="${C_WARNINGS} -Wdeclaration-after-statement" C_WARNINGS="${C_WARNINGS} -Wdeclaration-after-statement"
......
...@@ -64,7 +64,8 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */ ...@@ -64,7 +64,8 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EE_FILE_NOT_CLOSED 30 #define EE_FILE_NOT_CLOSED 30
#define EE_CHANGE_OWNERSHIP 31 #define EE_CHANGE_OWNERSHIP 31
#define EE_CHANGE_PERMISSIONS 32 #define EE_CHANGE_PERMISSIONS 32
#define EE_ERROR_LAST 32 /* Copy last error nr */ #define EE_CANT_SEEK 33
#define EE_ERROR_LAST 33 /* Copy last error nr */
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */ /* Add error numbers before EE_ERROR_LAST and change it accordingly. */
/* exit codes for all MySQL programs */ /* exit codes for all MySQL programs */
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
# Please, remove this test case after pushing WL#2687. # Please, remove this test case after pushing WL#2687.
################################################################################ ################################################################################
RESET MASTER;
--echo ################################################################################### --echo ###################################################################################
--echo # CONFIGURATION --echo # CONFIGURATION
......
...@@ -864,7 +864,7 @@ sub command_line_setup { ...@@ -864,7 +864,7 @@ sub command_line_setup {
my $opt_list_options; my $opt_list_options;
# Read the command line options # Read the command line options
# Note: Keep list, and the order, in sync with usage at end of this file # Note: Keep list in sync with usage at end of this file
Getopt::Long::Configure("pass_through"); Getopt::Long::Configure("pass_through");
my %options=( my %options=(
# Control what engine/variation to run # Control what engine/variation to run
...@@ -900,6 +900,7 @@ sub command_line_setup { ...@@ -900,6 +900,7 @@ sub command_line_setup {
'combination=s' => \@opt_combinations, 'combination=s' => \@opt_combinations,
'skip-combinations' => \&collect_option, 'skip-combinations' => \&collect_option,
'experimental=s' => \@opt_experimentals, 'experimental=s' => \@opt_experimentals,
# skip-im is deprecated and silently ignored
'skip-im' => \&ignore_option, 'skip-im' => \&ignore_option,
# Specify ports # Specify ports
...@@ -992,6 +993,7 @@ sub command_line_setup { ...@@ -992,6 +993,7 @@ sub command_line_setup {
'max-connections=i' => \$opt_max_connections, 'max-connections=i' => \$opt_max_connections,
'help|h' => \$opt_usage, 'help|h' => \$opt_usage,
# list-options is internal, not listed in help
'list-options' => \$opt_list_options, 'list-options' => \$opt_list_options,
); );
...@@ -5467,7 +5469,7 @@ Options to control what engine/variation to run ...@@ -5467,7 +5469,7 @@ Options to control what engine/variation to run
defaults-file=<config template> Use fixed config template for all defaults-file=<config template> Use fixed config template for all
tests tests
defaults_extra_file=<config template> Extra config template to add to defaults-extra-file=<config template> Extra config template to add to
all generated configs all generated configs
combination=<opt> Use at least twice to run tests with specified combination=<opt> Use at least twice to run tests with specified
options to mysqld options to mysqld
...@@ -5558,7 +5560,7 @@ Options for debugging the product ...@@ -5558,7 +5560,7 @@ Options for debugging the product
test(s) test(s)
manual-ddd Let user manually start mysqld in ddd, before running manual-ddd Let user manually start mysqld in ddd, before running
test(s) test(s)
strace-client=[path] Create strace output for mysqltest client, optionally strace-client[=path] Create strace output for mysqltest client, optionally
specifying name and path to the trace program to use. specifying name and path to the trace program to use.
Example: $0 --strace-client=ktrace Example: $0 --strace-client=ktrace
max-save-core Limit the number of core files saved (to avoid filling max-save-core Limit the number of core files saved (to avoid filling
...@@ -5591,7 +5593,7 @@ Options for valgrind ...@@ -5591,7 +5593,7 @@ Options for valgrind
Misc options Misc options
user=USER User for connecting to mysqld(default: $opt_user) user=USER User for connecting to mysqld(default: $opt_user)
comment=STR Write STR to the output comment=STR Write STR to the output
notimer Don't show test case execution time timer Show test case execution time.
verbose More verbose output(use multiple times for even more) verbose More verbose output(use multiple times for even more)
verbose-restart Write when and why servers are restarted verbose-restart Write when and why servers are restarted
start Only initialize and start the servers, using the start Only initialize and start the servers, using the
...@@ -5631,6 +5633,7 @@ Misc options ...@@ -5631,6 +5633,7 @@ Misc options
actions. Disable facility with NUM=0. actions. Disable facility with NUM=0.
gcov Collect coverage information after the test. gcov Collect coverage information after the test.
The result is a gcov file per source and header file. The result is a gcov file per source and header file.
gprof Collect profiling information using gprof.
experimental=<file> Refer to list of tests considered experimental; experimental=<file> Refer to list of tests considered experimental;
failures will be marked exp-fail instead of fail. failures will be marked exp-fail instead of fail.
report-features First run a "test" that reports mysql features report-features First run a "test" that reports mysql features
...@@ -5639,6 +5642,10 @@ Misc options ...@@ -5639,6 +5642,10 @@ Misc options
*previous* test started *previous* test started
max-connections=N Max number of open connection to server in mysqltest max-connections=N Max number of open connection to server in mysqltest
Some options that control enabling a feature for normal test runs,
can be turned off by prepending 'no' to the option, e.g. --notimer.
This applies to reorder, timer, check-testcases and warnings.
HERE HERE
exit(1); exit(1);
......
...@@ -591,7 +591,7 @@ if things work as expected ...@@ -591,7 +591,7 @@ if things work as expected
Some data Some data
for cat_file command for cat_file command
of mysqltest of mysqltest
mysqltest: At line 1: command "cat_file" failed with error 1 mysqltest: At line 1: command "cat_file" failed with error 1. (my_errno)
mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists' mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists'
mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file' mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file'
mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file' mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file'
......
RESET MASTER;
################################################################################### ###################################################################################
# CONFIGURATION # CONFIGURATION
################################################################################### ###################################################################################
......
RESET MASTER;
################################################################################### ###################################################################################
# CONFIGURATION # CONFIGURATION
################################################################################### ###################################################################################
......
...@@ -1936,6 +1936,7 @@ EOF ...@@ -1936,6 +1936,7 @@ EOF
cat_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; cat_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
--replace_regex /my_errno=[0-9]*/(my_errno)/
--error 1 --error 1
--exec echo "cat_file non_existing_file;" | $MYSQL_TEST 2>&1 --exec echo "cat_file non_existing_file;" | $MYSQL_TEST 2>&1
......
...@@ -52,6 +52,7 @@ const char * NEAR globerrs[GLOBERRS]= ...@@ -52,6 +52,7 @@ const char * NEAR globerrs[GLOBERRS]=
"File '%s' (fileno: %d) was not closed", "File '%s' (fileno: %d) was not closed",
"Can't change ownership of the file '%s' (Errcode: %d)", "Can't change ownership of the file '%s' (Errcode: %d)",
"Can't change permissions of the file '%s' (Errcode: %d)", "Can't change permissions of the file '%s' (Errcode: %d)",
"Can't seek in file '%s' (Errcode: %d)"
}; };
void init_glob_errs(void) void init_glob_errs(void)
...@@ -94,6 +95,7 @@ void init_glob_errs() ...@@ -94,6 +95,7 @@ void init_glob_errs()
EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed"; EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed";
EE(EE_CHANGE_OWNERSHIP) = "Can't change ownership of the file '%s' (Errcode: %d)"; EE(EE_CHANGE_OWNERSHIP) = "Can't change ownership of the file '%s' (Errcode: %d)";
EE(EE_CHANGE_PERMISSIONS) = "Can't change permissions of the file '%s' (Errcode: %d)"; EE(EE_CHANGE_PERMISSIONS) = "Can't change permissions of the file '%s' (Errcode: %d)";
EE(EE_CANT_SEEK) = "Can't seek in file '%s' (Errcode: %d)";
} }
#endif #endif
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysys_priv.h" #include "mysys_priv.h"
#include "mysys_err.h"
/* /*
Seek to a position in a file. Seek to a position in a file.
...@@ -42,8 +43,7 @@ ...@@ -42,8 +43,7 @@
actual error. actual error.
*/ */
my_off_t my_seek(File fd, my_off_t pos, int whence, my_off_t my_seek(File fd, my_off_t pos, int whence, myf MyFlags)
myf MyFlags __attribute__((unused)))
{ {
reg1 os_off_t newpos= -1; reg1 os_off_t newpos= -1;
DBUG_ENTER("my_seek"); DBUG_ENTER("my_seek");
...@@ -69,6 +69,8 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, ...@@ -69,6 +69,8 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
if (newpos == (os_off_t) -1) if (newpos == (os_off_t) -1)
{ {
my_errno=errno; my_errno=errno;
if (MyFlags & MY_WME)
my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_errno);
DBUG_PRINT("error",("lseek: %lu errno: %d", (ulong) newpos,errno)); DBUG_PRINT("error",("lseek: %lu errno: %d", (ulong) newpos,errno));
DBUG_RETURN(MY_FILEPOS_ERROR); DBUG_RETURN(MY_FILEPOS_ERROR);
} }
...@@ -83,7 +85,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, ...@@ -83,7 +85,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
/* Tell current position of file */ /* Tell current position of file */
/* ARGSUSED */ /* ARGSUSED */
my_off_t my_tell(File fd, myf MyFlags __attribute__((unused))) my_off_t my_tell(File fd, myf MyFlags)
{ {
os_off_t pos; os_off_t pos;
DBUG_ENTER("my_tell"); DBUG_ENTER("my_tell");
...@@ -95,7 +97,12 @@ my_off_t my_tell(File fd, myf MyFlags __attribute__((unused))) ...@@ -95,7 +97,12 @@ my_off_t my_tell(File fd, myf MyFlags __attribute__((unused)))
pos=lseek(fd, 0L, MY_SEEK_CUR); pos=lseek(fd, 0L, MY_SEEK_CUR);
#endif #endif
if (pos == (os_off_t) -1) if (pos == (os_off_t) -1)
{
my_errno=errno; my_errno=errno;
if (MyFlags & MY_WME)
my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_errno);
DBUG_PRINT("error", ("tell: %lu errno: %d", (ulong) pos, my_errno));
}
DBUG_PRINT("exit",("pos: %lu", (ulong) pos)); DBUG_PRINT("exit",("pos: %lu", (ulong) pos));
DBUG_RETURN((my_off_t) pos); DBUG_RETURN((my_off_t) pos);
} /* my_tell */ } /* my_tell */
...@@ -118,8 +118,7 @@ int my_is_symlink(const char *filename __attribute__((unused))) ...@@ -118,8 +118,7 @@ int my_is_symlink(const char *filename __attribute__((unused)))
'to' may be equal to 'filename' 'to' may be equal to 'filename'
*/ */
int my_realpath(char *to, const char *filename, int my_realpath(char *to, const char *filename, myf MyFlags)
myf MyFlags __attribute__((unused)))
{ {
#if defined(HAVE_REALPATH) && !defined(HAVE_BROKEN_REALPATH) #if defined(HAVE_REALPATH) && !defined(HAVE_BROKEN_REALPATH)
int result=0; int result=0;
......
...@@ -948,9 +948,6 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) ...@@ -948,9 +948,6 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
remove_db_from_cache(db); remove_db_from_cache(db);
pthread_mutex_unlock(&LOCK_open); pthread_mutex_unlock(&LOCK_open);
Drop_table_error_handler err_handler(thd->get_internal_handler());
thd->push_internal_handler(&err_handler);
error= -1; error= -1;
/* /*
We temporarily disable the binary log while dropping the objects We temporarily disable the binary log while dropping the objects
...@@ -983,8 +980,8 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) ...@@ -983,8 +980,8 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
error = 0; error = 0;
reenable_binlog(thd); reenable_binlog(thd);
} }
thd->pop_internal_handler();
} }
if (!silent && deleted>=0) if (!silent && deleted>=0)
{ {
const char *query; const char *query;
...@@ -1213,16 +1210,34 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, ...@@ -1213,16 +1210,34 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
else else
{ {
strxmov(filePath, org_path, "/", file->name, NullS); strxmov(filePath, org_path, "/", file->name, NullS);
if (my_delete_with_symlink(filePath,MYF(MY_WME))) /*
We ignore ENOENT error in order to skip files that was deleted
by concurrently running statement like REAPIR TABLE ...
*/
if (my_delete_with_symlink(filePath, MYF(0)) &&
my_errno != ENOENT)
{ {
my_error(EE_DELETE, MYF(0), filePath, my_errno);
goto err; goto err;
} }
} }
} }
if (thd->killed ||
(tot_list && mysql_rm_table_part2(thd, tot_list, 1, 0, 1, 1))) if (thd->killed)
goto err; goto err;
if (tot_list)
{
int res= 0;
Drop_table_error_handler err_handler(thd->get_internal_handler());
thd->push_internal_handler(&err_handler);
res= mysql_rm_table_part2(thd, tot_list, 1, 0, 1, 1);
thd->pop_internal_handler();
if (res)
goto err;
}
/* Remove RAID directories */ /* Remove RAID directories */
{ {
List_iterator<String> it(raid_dirs); List_iterator<String> it(raid_dirs);
......
...@@ -590,7 +590,11 @@ int ha_myisam::net_read_dump(NET* net) ...@@ -590,7 +590,11 @@ int ha_myisam::net_read_dump(NET* net)
int data_fd = file->dfile; int data_fd = file->dfile;
int error = 0; int error = 0;
my_seek(data_fd, 0L, MY_SEEK_SET, MYF(MY_WME)); if (my_seek(data_fd, 0L, MY_SEEK_SET, MYF(MY_WME)) == MY_FILEPOS_ERROR)
{
error= my_errno;
goto err;
}
for (;;) for (;;)
{ {
ulong packet_len = my_net_read(net); ulong packet_len = my_net_read(net);
...@@ -626,7 +630,11 @@ int ha_myisam::dump(THD* thd, int fd) ...@@ -626,7 +630,11 @@ int ha_myisam::dump(THD* thd, int fd)
return ENOMEM; return ENOMEM;
int error = 0; int error = 0;
my_seek(data_fd, 0L, MY_SEEK_SET, MYF(MY_WME)); if (my_seek(data_fd, 0L, MY_SEEK_SET, MYF(MY_WME)) == MY_FILEPOS_ERROR)
{
error= my_errno;
goto err;
}
for (; bytes_to_read > 0;) for (; bytes_to_read > 0;)
{ {
size_t bytes = my_read(data_fd, buf, blocksize, MYF(MY_WME)); size_t bytes = my_read(data_fd, buf, blocksize, MYF(MY_WME));
......
...@@ -1741,6 +1741,8 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info, ...@@ -1741,6 +1741,8 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) || MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1)) mi_open_datafile(info,share,name,-1))
got_error=1; got_error=1;
param->retry_repair= 0;
} }
} }
if (got_error) if (got_error)
......
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