diff options
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_iocache.c | 7 | ||||
-rw-r--r-- | mysys/mf_pack.c | 15 | ||||
-rw-r--r-- | mysys/my_context.c | 23 | ||||
-rw-r--r-- | mysys/my_getopt.c | 5 | ||||
-rw-r--r-- | mysys/stacktrace.c | 1 |
5 files changed, 36 insertions, 15 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index f9e51e48189..02e5c5373ae 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -1527,8 +1527,13 @@ int _my_b_get(IO_CACHE *info) int _my_b_write(register IO_CACHE *info, const uchar *Buffer, size_t Count) { size_t rest_length,length; + my_off_t pos_in_file= info->pos_in_file; - if (info->pos_in_file+info->buffer_length > info->end_of_file) + DBUG_EXECUTE_IF("simulate_huge_load_data_file", + { + pos_in_file=(my_off_t)(5000000000ULL); + }); + if (pos_in_file+info->buffer_length > info->end_of_file) { my_errno=errno=EFBIG; return info->error = -1; diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c index 18c9a38f0db..a51d94f8e73 100644 --- a/mysys/mf_pack.c +++ b/mysys/mf_pack.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2012, 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 @@ -30,7 +31,7 @@ void pack_dirname(char * to, const char *from) int cwd_err; size_t d_length,length,UNINIT_VAR(buff_length); char * start; - char buff[FN_REFLEN]; + char buff[FN_REFLEN + 1]; DBUG_ENTER("pack_dirname"); (void) intern_filename(to,from); /* Change to intern name */ @@ -127,7 +128,7 @@ size_t cleanup_dirname(register char *to, const char *from) reg3 char * from_ptr; reg4 char * start; char parent[5], /* for "FN_PARENTDIR" */ - buff[FN_REFLEN+1],*end_parentdir; + buff[FN_REFLEN + 1],*end_parentdir; #ifdef BACKSLASH_MBTAIL CHARSET_INFO *fs= fs_character_set(); #endif @@ -241,7 +242,7 @@ my_bool my_use_symdir=0; /* Set this if you want to use symdirs */ #ifdef USE_SYMDIR void symdirget(char *dir) { - char buff[FN_REFLEN+1]; + char buff[FN_REFLEN + 1]; char *pos=strend(dir); if (dir[0] && pos[-1] != FN_DEVCHAR && my_access(dir, F_OK)) { @@ -291,7 +292,7 @@ void symdirget(char *dir) size_t normalize_dirname(char *to, const char *from) { size_t length; - char buff[FN_REFLEN]; + char buff[FN_REFLEN + 1]; DBUG_ENTER("normalize_dirname"); /* @@ -418,7 +419,7 @@ static char * expand_tilde(char **path) size_t unpack_filename(char * to, const char *from) { size_t length, n_length, buff_length; - char buff[FN_REFLEN]; + char buff[FN_REFLEN + 1]; DBUG_ENTER("unpack_filename"); length=dirname_part(buff, from, &buff_length);/* copy & convert dirname */ @@ -448,7 +449,7 @@ size_t system_filename(char *to, const char *from) char *intern_filename(char *to, const char *from) { size_t length, to_length; - char buff[FN_REFLEN]; + char buff[FN_REFLEN + 1]; if (from == to) { /* Dirname may destroy from */ strmov(buff,from); diff --git a/mysys/my_context.c b/mysys/my_context.c index d2374391a39..08dc0920f21 100644 --- a/mysys/my_context.c +++ b/mysys/my_context.c @@ -206,7 +206,7 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d) ( "movq %%rsp, (%[save])\n\t" "movq %[stack], %%rsp\n\t" -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 && !defined(__INTEL_COMPILER) /* This emits a DWARF DW_CFA_undefined directive to make the return address undefined. This indicates that this is the top of the stack frame, and @@ -437,6 +437,8 @@ my_context_destroy(struct my_context *c) int my_context_spawn(struct my_context *c, void (*f)(void *), void *d) { + void (*tmp_f)(void *)= f; + void *tmp_d= d; int ret; DBUG_SWAP_CODE_STATE(&c->dbug_state); @@ -454,6 +456,15 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d) ( "movl %%esp, (%[save])\n\t" "movl %[stack], %%esp\n\t" +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 && !defined(__INTEL_COMPILER) + /* + This emits a DWARF DW_CFA_undefined directive to make the return address + undefined. This indicates that this is the top of the stack frame, and + helps tools that use DWARF stack unwinding to obtain stack traces. + (I use numeric constant to avoid a dependency on libdwarf includes). + */ + ".cfi_escape 0x07, 8\n\t" +#endif /* Push the parameter on the stack. */ "pushl %[d]\n\t" "movl %%ebp, 4(%[save])\n\t" @@ -483,13 +494,13 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d) "3:\n\t" "movl $1, %[ret]\n" "4:\n" - : [ret] "=a" (ret) + : [ret] "=a" (ret), + [f] "+c" (tmp_f), + [d] "+d" (tmp_d) : [stack] "a" (c->stack_top), /* Need this in callee-save register to preserve across function call. */ - [save] "D" (&c->save[0]), - [f] "m" (f), - [d] "m" (d) - : "ecx", "edx", "memory", "cc" + [save] "D" (&c->save[0]) + : "memory", "cc" ); DBUG_SWAP_CODE_STATE(&c->dbug_state); diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index c1b0a129a30..7905ad90877 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -720,6 +720,11 @@ static int setval(const struct my_option *opts, void *value, char *argument, } *(ulong*)value= arg; } + else if (type < 0) + { + res= EXIT_AMBIGUOUS_OPTION; + goto ret; + } else *(ulong*)value= type - 1; } diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 846a90cc127..402520990b6 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -654,7 +654,6 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) &(package.sym)); have_source= SymGetLineFromAddr64(hProcess, addr, &line_offset, &line); - my_safe_printf_stderr("%p ", (uintptr_t)addr); if(have_module) { const char *base_image_name= my_basename(module.ImageName); |