diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-02-28 09:58:39 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-02-28 09:58:39 +0100 |
commit | 08ba257846e75641304e530b7a4a4ab21b1714d7 (patch) | |
tree | 5152c8e758f3b566dda4bf07bf5aad1607910eda /mysys | |
parent | 65831bca6f516db383c1bc04884b65b9fa7b6926 (diff) | |
parent | 40bbd1862376fa634e42b4e0197e22f5633f0c21 (diff) | |
download | mariadb-git-08ba257846e75641304e530b7a4a4ab21b1714d7.tar.gz |
mysql-5.1 merge
mysys/errors.c:
revert upstream's fix. use a much simpler one
mysys/my_write.c:
revert upstream's fix. use a simpler one
sql/item_xmlfunc.cc:
useless, but ok
sql/mysqld.cc:
simplify upstream's fix
storage/heap/hp_delete.c:
remove upstream's fix.
we'll use a much less expensive approach.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/errors.c | 4 | ||||
-rw-r--r-- | mysys/mf_pack.c | 10 | ||||
-rw-r--r-- | mysys/my_lib.c | 10 | ||||
-rw-r--r-- | mysys/my_write.c | 2 |
4 files changed, 15 insertions, 11 deletions
diff --git a/mysys/errors.c b/mysys/errors.c index 6ff118fd81f..a2f4ce298f1 100644 --- a/mysys/errors.c +++ b/mysys/errors.c @@ -108,12 +108,12 @@ void init_glob_errs() void wait_for_free_space(const char *filename, int errors) { if (errors == 0) - my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH), + my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH | ME_JUST_WARNING), filename,my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC); if (!(errors % MY_WAIT_GIVE_USER_A_MESSAGE)) my_printf_error(EE_DISK_FULL, "Retry in %d secs. Message reprinted in %d secs", - MYF(ME_BELL | ME_NOREFRESH), + MYF(ME_BELL | ME_NOREFRESH | ME_JUST_WARNING), MY_WAIT_FOR_USER_TO_FIX_PANIC, MY_WAIT_GIVE_USER_A_MESSAGE * MY_WAIT_FOR_USER_TO_FIX_PANIC ); VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC)); diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c index e6b576b6d96..4521216cdc7 100644 --- a/mysys/mf_pack.c +++ b/mysys/mf_pack.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2012, 2013, Monty Program Ab. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,7 +12,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ #include "mysys_priv.h" #include <m_string.h> @@ -519,10 +521,10 @@ char *intern_filename(char *to, const char *from) char buff[FN_REFLEN + 1]; if (from == to) { /* Dirname may destroy from */ - strmov(buff,from); + (void) strnmov(buff, from, FN_REFLEN); from=buff; } length= dirname_part(to, from, &to_length); /* Copy dirname & fix chars */ - (void) strmov(to + to_length,from+length); + (void) strnmov(to + to_length, from + length, FN_REFLEN - to_length); return (to); } /* intern_filename */ diff --git a/mysys/my_lib.c b/mysys/my_lib.c index c18d14fb549..8bd9a289176 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,7 +11,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ /* TODO: check for overun of memory for names. */ /* Convert MSDOS-TIME to standar time_t (still needed?) */ @@ -103,7 +104,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags) MEM_ROOT *names_storage; DIR *dirp; struct dirent *dp; - char tmp_path[FN_REFLEN+1],*tmp_file; + char tmp_path[FN_REFLEN + 2], *tmp_file; #ifdef THREAD char dirent_tmp[sizeof(struct dirent)+_POSIX_PATH_MAX+1]; #endif @@ -215,10 +216,11 @@ char * directory_file_name (char * dst, const char *src) /* Process as Unix format: just remove test the final slash. */ char * end; + DBUG_ASSERT(strlen(src) < (FN_REFLEN + 1)); if (src[0] == 0) src= (char*) "."; /* Use empty as current */ - end=strmov(dst, src); + end= strnmov(dst, src, FN_REFLEN + 1); if (end[-1] != FN_LIBCHAR) { end[0]=FN_LIBCHAR; /* Add last '/' */ diff --git a/mysys/my_write.c b/mysys/my_write.c index 11708d8f10e..14d16955a0a 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -44,7 +44,7 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags) and the number pf written bytes to -1. */ DBUG_EXECUTE_IF ("simulate_file_write_error", - { + if (!errors) { errno= ENOSPC; writenbytes= (size_t) -1; }); |