diff options
author | Michael Widenius <monty@askmonty.org> | 2012-06-17 15:34:39 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2012-06-17 15:34:39 +0300 |
commit | 9ebda8764d2e94096924c0a0181f5773d836114a (patch) | |
tree | 30b2fa62dd8b15f7cca809a59f2d8399584bea41 /strings | |
parent | 82942260972de9a7416064c177c3bce3512a984a (diff) | |
download | mariadb-git-9ebda8764d2e94096924c0a0181f5773d836114a.tar.gz |
Fixes after Serg's review of %M extenstions
- Changed output to be error "error-text" instead of error - error-text
extra/perror.c:
Move my_handler_errors.h into include
include/my_handler_errors.h:
Move my_handler_errors.h into include
mysql-test/r/errors.result:
Updated result
mysql-test/r/innodb_mysql_sync.result:
Updated result
mysql-test/r/myisam-system.result:
Updated result
mysql-test/r/myisampack.result:
Updated result
mysql-test/r/partition_innodb_plugin.result:
Updated result
mysql-test/r/ps_1general.result:
Updated result
mysql-test/r/trigger.result:
Updated result
mysql-test/r/type_bit.result:
Updated result
mysql-test/r/type_bit_innodb.result:
Updated result
mysql-test/r/type_blob.result:
Updated result
mysql-test/suite/archive/archive.result:
Updated result
mysql-test/suite/binlog/r/binlog_index.result:
Updated result
mysql-test/suite/binlog/r/binlog_ioerr.result:
Updated result
mysql-test/suite/csv/csv.result:
Updated result
mysql-test/suite/engines/iuds/r/type_bit_iuds.result:
Updated result
mysql-test/suite/federated/federated_bug_35333.result:
Updated result
mysql-test/suite/innodb/r/innodb-create-options.result:
Updated result
mysql-test/suite/innodb/r/innodb-index.result:
Updated result
mysql-test/suite/innodb/r/innodb-zip.result:
Updated result
mysql-test/suite/innodb/r/innodb.result:
Updated result
mysql-test/suite/innodb/r/innodb_bug13635833.result:
Updated result
mysql-test/suite/innodb/r/innodb_bug21704.result:
Updated result
mysql-test/suite/innodb/r/innodb_bug46000.result:
Updated result
mysql-test/suite/parts/r/partition_bit_innodb.result:
Updated result
mysql-test/suite/parts/r/partition_bit_myisam.result:
Updated result
mysql-test/suite/percona/percona_innodb_fake_changes.result:
Updated result
mysql-test/suite/perfschema/r/misc.result:
Updated result
mysql-test/suite/perfschema/r/privilege.result:
Updated result
mysql-test/suite/rpl/r/rpl_EE_err.result:
Updated result
mysql-test/suite/rpl/r/rpl_binlog_errors.result:
Updated result
mysql-test/suite/rpl/r/rpl_drop_db.result:
Updated result
sql/share/errmsg-utf8.txt:
Removed 'column' from error text that was used in different context
strings/my_vsnprintf.c:
Move my_handler_errors.h into include
Minor cleanups
Changed output of %M to be error "error-text" instead of error - error-text
unittest/mysys/my_vsnprintf-t.c:
Updated error text
Diffstat (limited to 'strings')
-rw-r--r-- | strings/my_vsnprintf.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index 7ace577130f..7ef0ebf7a12 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -19,7 +19,7 @@ #include <stdarg.h> #include <my_sys.h> #include <my_base.h> -#include <../mysys/my_handler_errors.h> +#include <my_handler_errors.h> #define MAX_ARGS 32 /* max positional args count*/ @@ -132,7 +132,7 @@ static const char *check_longlong(const char *fmt, uint *have_longlong) fmt++; *have_longlong= (sizeof(size_t) == sizeof(longlong)); } - if (*fmt == 'p') + else if (*fmt == 'p') *have_longlong= (sizeof(void *) == sizeof(longlong)); return fmt; } @@ -358,17 +358,17 @@ start: if (*fmt == '.') { - uint flags= 0; + uint unused_flags= 0; fmt++; /* Get print width */ if (*fmt == '*') { fmt= get_length_arg(fmt, args_arr, &arg_count, &print_arr[idx].width, - &flags); + &unused_flags); print_arr[idx].flags|= WIDTH_ARG; } else - fmt= get_length(fmt, &print_arr[idx].width, &flags); + fmt= get_length(fmt, &print_arr[idx].width, &unused_flags); } else print_arr[idx].width= MAX_WIDTH; @@ -494,11 +494,11 @@ start: if (width <= 4) break; *to++= ' '; - *to++= '-'; - *to++= ' '; + *to++= '"'; my_strerror(errmsg_buff, sizeof(errmsg_buff), (int) larg); - to= process_str_arg(cs, to, end, width, errmsg_buff, + to= process_str_arg(cs, to, end, width-3, errmsg_buff, print_arr[i].flags); + *to++= '"'; break; } default: @@ -520,14 +520,14 @@ start: } else { - uint flags= 0; + uint unused_flags= 0; /* Process next positional argument*/ DBUG_ASSERT(*fmt == '%'); print_arr[idx].end= fmt - 1; idx++; fmt++; arg_index= 0; - fmt= get_length(fmt, &arg_index, &flags); + fmt= get_length(fmt, &arg_index, &unused_flags); DBUG_ASSERT(*fmt == '$'); fmt++; arg_count= max(arg_count, arg_index); @@ -605,7 +605,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, if (*fmt == '.') { - uint flags= 0; + uint unused_flags= 0; fmt++; if (*fmt == '*') { @@ -613,7 +613,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, width= va_arg(ap, int); } else - fmt= get_length(fmt, &width, &flags); + fmt= get_length(fmt, &width, &unused_flags); } else width= MAX_WIDTH; @@ -673,11 +673,10 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, { char errmsg_buff[MYSYS_STRERROR_SIZE]; *to++= ' '; - *to++= '-'; - *to++= ' '; - width-= 3; + *to++= '"'; my_strerror(errmsg_buff, sizeof(errmsg_buff), larg); - to= process_str_arg(cs, to, end, width, errmsg_buff, print_type); + to= process_str_arg(cs, to, end, width-3, errmsg_buff, print_type); + *to++= '"'; } continue; } |