Commit ec45c88d authored by unknown's avatar unknown
Browse files

Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-push

parents 9ca07a42 da0f9ece
Loading
Loading
Loading
Loading
+34 −11
Original line number Diff line number Diff line
@@ -98,6 +98,10 @@
#define DEFAULT_DELIMITER ";"
#define MAX_DELIMITER 16

#define RESULT_OK 0
#define RESULT_CONTENT_MISMATCH 1
#define RESULT_LENGTH_MISMATCH 2

enum {OPT_MANAGER_USER=256,OPT_MANAGER_HOST,OPT_MANAGER_PASSWD,
      OPT_MANAGER_PORT,OPT_MANAGER_WAIT_TIMEOUT, OPT_SKIP_SAFEMALLOC,
      OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA, OPT_SSL_CAPATH,
@@ -679,7 +683,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
    DBUG_PRINT("info",("Size differs:  result size: %u  file size: %u",
		       ds->length, stat_info.st_size));
    DBUG_PRINT("info",("result: '%s'", ds->str));
    DBUG_RETURN(2);
    DBUG_RETURN(RESULT_LENGTH_MISMATCH);
  }
  if (!(tmp = (char*) my_malloc(stat_info.st_size + 1, MYF(MY_WME))))
    die(NullS);
@@ -696,7 +700,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
    res_ptr = res_ds.str;
    if ((res_len = res_ds.length) != ds->length)
    {
      res = 2;
      res= RESULT_LENGTH_MISMATCH;
      goto err;
    }
  }
@@ -706,7 +710,8 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
    res_len = stat_info.st_size;
  }

  res = (memcmp(res_ptr, ds->str, res_len)) ?  1 : 0;
  res= (memcmp(res_ptr, ds->str, res_len)) ?
    RESULT_CONTENT_MISMATCH : RESULT_OK;

err:
  if (res && eval_result)
@@ -723,22 +728,23 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
static int check_result(DYNAMIC_STRING* ds, const char *fname,
			my_bool require_option)
{
  int error = 0;
  int error= RESULT_OK;
  int res= dyn_string_cmp(ds, fname);

  DBUG_ENTER("check_result");

  if (res && require_option)
    abort_not_supported_test();
  switch (res) {
  case 0:
  case RESULT_OK:
    break; /* ok */
  case 2:
  case RESULT_LENGTH_MISMATCH:
    verbose_msg("Result length mismatch");
    error = 1;
    error= RESULT_LENGTH_MISMATCH;
    break;
  case 1:
  case RESULT_CONTENT_MISMATCH:
    verbose_msg("Result content mismatch");
    error = 1;
    error= RESULT_CONTENT_MISMATCH;
    break;
  default: /* impossible */
    die("Unknown error code from dyn_string_cmp()");
@@ -3944,8 +3950,10 @@ int main(int argc, char **argv)
{
  int error = 0;
  struct st_query *q;
  my_bool require_file=0, q_send_flag=0, abort_flag= 0;
  my_bool require_file=0, q_send_flag=0, abort_flag= 0,
          query_executed= 0;
  char save_file[FN_REFLEN];
  MY_STAT res_info;
  MY_INIT(argv[0]);

  /* Use all time until exit if no explicit 'start_timer' */
@@ -4141,6 +4149,7 @@ int main(int argc, char **argv)
	  save_file[0]=0;
	}
	error |= run_query(&cur_con->mysql, q, flags);
	query_executed= 1;
        q->last_argument= q->end;
	break;
      }
@@ -4161,6 +4170,7 @@ int main(int argc, char **argv)
	  is given on this connection.
	 */
	error |= run_query(&cur_con->mysql, q, QUERY_SEND);
	query_executed= 1;
        q->last_argument= q->end;
	break;
      case Q_RESULT:
@@ -4201,6 +4211,7 @@ int main(int argc, char **argv)
	break;
      case Q_EXEC:
	do_exec(q);
	query_executed= 1;
	break;
      case Q_START_TIMER:
	/* Overwrite possible earlier start of timer */
@@ -4280,6 +4291,18 @@ int main(int argc, char **argv)
    parser.current_line += current_line_inc;
  }

  if (!query_executed && result_file && my_stat(result_file, &res_info, 0))
  {
    /*
      my_stat() successful on result file. Check if we have not run a
      single query, but we do have a result file that contains data.
      Note that we don't care, if my_stat() fails. For example for
      non-existing or non-readable file we assume it's fine to have
      no query output from the test file, e.g. regarded as no error.
    */
    if (res_info.st_size)
      error|= (RESULT_CONTENT_MISMATCH | RESULT_LENGTH_MISMATCH);
  }
  if (result_file && ds_res.length && !error)
  {
    if (!record)
+1 −0
Original line number Diff line number Diff line
@@ -409,6 +409,7 @@ my_bool check_scramble(const char *reply, const char *message,
                       const unsigned char *hash_stage2);
void get_salt_from_password(unsigned char *res, const char *password);
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
void octet2hex(char *to, const unsigned char *str, unsigned int len);

/* end of password.c */

man/which.2

deleted100644 → 0
+0 −54
Original line number Diff line number Diff line
.TH WHICH 1 "20 December 2000" 
.SH NAME 
which - Jani please supply one. 
.SH USAGE 
which [options] [--] programname [...]
.SH SYNOPSIS 
.B which 
.RB [ \-\-version | \-[vV] ] 
.RB [ \-\-skip\-dot ] 
.RB [ \-\-skip\-tilde ] 
.RB [ \-\-show\-dot ] 
.RB [ \-\-show\-tilde ] 
.RB [ \-\-tty\-only ] 
.RB [ \-\-all | \-a ] 
.RB [ \-\-read\-alias | \-i ] 
.RB [ \-\-skip\-alias ] 
.SH DESCRIPTION 
.TP
.BR which
supports by executing
.TP
.BR \-\-version | \-[vV]
Print version and exit successfully.
.TP
.BR \-\-skip\-dot
Skip directories in PATH that start with a dot.
.TP
.BR \-\-skip\-tilde
Skip directories in PATH that start with a tilde.
.TP
.BR \-\-show\-dot
Don\'t expand a dot to current directory in output.
.TP
.BR \-\-show\-tilde
Output a tilde for HOME directory for non-root.
.TP
.BR \-\-tty\-only 
Stop processing options on the right if not on tty.
.TP
.BR \-\-all | \-a 
Print all matches in PATH, not just the first
.TP
.BR \-\-read\-alias | \-i
Read list of aliases from stdin.
.TP
.BR \-\-skip\-alias
Ignore option 
.BR --read-alias; 
don\'t read stdin.
.SH "SEE ALSO" 
isamchk (1), isamlog (1), mysqlaccess (1), mysqladmin (1), mysqlbug (1), mysqld (1), mysqldump (1), mysqlshow (1), msql2mysql (1), perror (1), replace (1), mysqld_safe (1), which1 (1), zap (1),
.SH AUTHOR 
Ver 1.0, distribution 3.23.29a Michael (Monty) Widenius (monty@tcx.se), TCX Datakonsult AB (http://www.tcx.se). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com) 
.\" end of man page 
 No newline at end of file
+85 −50
Original line number Diff line number Diff line
@@ -241,8 +241,10 @@ our $opt_ps_protocol;

our $opt_sleep_time_after_restart=  1;
our $opt_sleep_time_for_delete=    10;
our $opt_testcase_timeout=          5; # 5 min max
our $opt_suite_timeout=           120; # 2 hours max
our $opt_testcase_timeout;
our $opt_suite_timeout;
my  $default_testcase_timeout=     10; # 10 min max
my  $default_suite_timeout=       120; # 2 hours max

our $opt_socket;

@@ -260,6 +262,7 @@ our $opt_user;
our $opt_user_test;

our $opt_valgrind;
our $opt_valgrind_mysqltest;
our $opt_valgrind_all;
our $opt_valgrind_options;

@@ -521,8 +524,9 @@ sub command_line_setup () {
             # Coverage, profiling etc
             'gcov'                     => \$opt_gcov,
             'gprof'                    => \$opt_gprof,
             'valgrind'                 => \$opt_valgrind,
             'valgrind-all'             => \$opt_valgrind_all,
             'valgrind:s'               => \$opt_valgrind,
             'valgrind-mysqltest:s'     => \$opt_valgrind_mysqltest,
             'valgrind-all:s'           => \$opt_valgrind_all,
             'valgrind-options=s'       => \$opt_valgrind_options,

             # Misc
@@ -700,29 +704,42 @@ sub command_line_setup () {
    $opt_with_ndbcluster= 0;
  }

  # FIXME
  # The ":s" in the argument spec, means we have three different cases
  #
  #   undefined    option not set
  #   ""           option set with no argument
  #   "somestring" option is name/path of valgrind executable

  #if ( $opt_valgrind or $opt_valgrind_all )
  #{
    # VALGRIND=`which valgrind` # this will print an error if not found FIXME
    # Give good warning to the user and stop
  #  if ( ! $VALGRIND )
  #  {
  #    print "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://valgrind.kde.org.\n"
  #    exit 1
  #  }
  # Take executable path from any of them, if any
  $opt_valgrind= $opt_valgrind_mysqltest if $opt_valgrind_mysqltest;
  $opt_valgrind= $opt_valgrind_all       if $opt_valgrind_all;

  # If valgrind flag not defined, define if other valgrind flags are
  unless ( defined $opt_valgrind )
  {
    $opt_valgrind= ""
      if defined $opt_valgrind_mysqltest or defined $opt_valgrind_all;
  }

  if ( ! $opt_testcase_timeout )
  {
    $opt_testcase_timeout= $default_testcase_timeout;
    $opt_testcase_timeout*= 10 if defined $opt_valgrind;
  }

  if ( ! $opt_suite_timeout )
  {
    $opt_suite_timeout= $default_suite_timeout;
    $opt_suite_timeout*= 4 if defined $opt_valgrind;
  }

  if ( defined $opt_valgrind )
  {
    $opt_sleep_time_after_restart= 10;
    $opt_sleep_time_for_delete= 60;
    # >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr
    #  valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && VALGRIND="$VALGRIND --tool=memcheck"
  #  VALGRIND="$VALGRIND --alignment=8 --leak-check=yes --num-callers=16"
  #  $opt_extra_mysqld_opt.= " --skip-safemalloc --skip-bdb";
  #  SLEEP_TIME_AFTER_RESTART=10
  #  $opt_sleep_time_for_delete=  60
  #  $glob_use_running_server= ""
  #  if ( "$1"=  "--valgrind-all" )
  #  {
  #    VALGRIND="$VALGRIND -v --show-reachable=yes"
  #  }
  #}
  }

  if ( ! $opt_user )
  {
@@ -1883,7 +1900,7 @@ sub mysqld_arguments ($$$$$) {
  mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
  mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);

  if ( $opt_valgrind )
  if ( defined $opt_valgrind )
  {
    mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
    mtr_add_arg($args, "%s--skip-bdb", $prefix);
@@ -2109,29 +2126,9 @@ sub mysqld_start ($$$$) {

  mtr_init_args(\$args);

  if ( $opt_valgrind )
  {

    mtr_add_arg($args, "--tool=memcheck");
    mtr_add_arg($args, "--alignment=8");
    mtr_add_arg($args, "--leak-check=yes");
    mtr_add_arg($args, "--num-callers=16");

    if ( $opt_valgrind_all )
    {
      mtr_add_arg($args, "-v");
      mtr_add_arg($args, "--show-reachable=yes");
    }

    if ( $opt_valgrind_options )
  if ( defined $opt_valgrind )
  {
      # FIXME split earlier and put into @glob_valgrind_*
      mtr_add_arg($args, split(' ', $opt_valgrind_options));
    }

    mtr_add_arg($args, $exe);

    $exe=  $opt_valgrind;
    valgrind_arguments($args, \$exe);
  }

  mysqld_arguments($args,$type,$idx,$extra_opt,$slave_master_info);
@@ -2403,6 +2400,11 @@ sub run_mysqltest ($) {

  mtr_init_args(\$args);

  if ( defined $opt_valgrind_mysqltest )
  {
    valgrind_arguments($args, \$exe);
  }

  mtr_add_arg($args, "--no-defaults");
  mtr_add_arg($args, "--silent");
  mtr_add_arg($args, "-v");
@@ -2498,6 +2500,36 @@ sub run_mysqltest ($) {
  return mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,"");
}


sub valgrind_arguments {
  my $args= shift;
  my $exe=  shift;

  mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option
  mtr_add_arg($args, "--alignment=8");
  mtr_add_arg($args, "--leak-check=yes");
  mtr_add_arg($args, "--num-callers=16");
  mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)
    if -f "$glob_mysql_test_dir/valgrind.supp";

  if ( defined $opt_valgrind_all )
  {
    mtr_add_arg($args, "-v");
    mtr_add_arg($args, "--show-reachable=yes");
  }

  if ( $opt_valgrind_options )
  {
    # FIXME split earlier and put into @glob_valgrind_*
    mtr_add_arg($args, split(' ', $opt_valgrind_options));
  }

  mtr_add_arg($args, $$exe);

  $$exe= $opt_valgrind || "valgrind";
}


##############################################################################
#
#  Usage
@@ -2562,8 +2594,11 @@ Options for coverage, profiling etc

  gcov                  FIXME
  gprof                 FIXME
  valgrind              FIXME
  valgrind-all          FIXME
  valgrind[=EXE]        Run the "mysqltest" executable as well as the "mysqld"
                        server using valgrind, optionally specifying the
                        executable path/name
  valgrind-mysqltest[=EXE] In addition, run the "mysqltest" executable with valgrind
  valgrind-all[=EXE]    Adds verbose flag, and --show-reachable to valgrind
  valgrind-options=ARGS Extra options to give valgrind

Misc options
+39 −0
Original line number Diff line number Diff line
@@ -1028,6 +1028,45 @@ xxx
yyy
DROP TABLE t1;
set names utf8;
select hex(char(1));
hex(char(1))
01
select char(0xd1,0x8f);
char(0xd1,0x8f)
я
select char(0xd18f);
char(0xd18f)
я
select char(53647);
char(53647)
я
select char(0xff,0x8f);
char(0xff,0x8f)

Warnings:
Warning	1300	Invalid utf8 character string: 'FF8F'
set sql_mode=traditional;
select char(0xff,0x8f);
char(0xff,0x8f)
NULL
Warnings:
Error	1300	Invalid utf8 character string: 'FF8F'
select char(195);
char(195)
NULL
Warnings:
Error	1300	Invalid utf8 character string: 'C3'
select char(196);
char(196)
NULL
Warnings:
Error	1300	Invalid utf8 character string: 'C4'
select char(2557);
char(2557)
NULL
Warnings:
Error	1300	Invalid utf8 character string: 'FD'
set names utf8;
create table t1 (a char(1)) default character set utf8;
create table t2 (a char(1)) default character set utf8;
insert into t1 values('a'),('a'),(0xE38182),(0xE38182);
Loading