Commit 13312cda authored by jani@hynda.mysql.fi's avatar jani@hynda.mysql.fi
Browse files

Added mysqlcheck.c, removed mistakenly added script mysqlcheck

parent f218c6d5
Loading
Loading
Loading
Loading

client/mysqlcheck

deleted100755 → 0
+0 −120
Original line number Diff line number Diff line
#! /bin/sh

# mysqlcheck - temporary wrapper script for .libs/mysqlcheck
# Generated by ltmain.sh - GNU libtool 1.3.5 (1.385.2.206 2000/05/27 11:12:27)
#
# The mysqlcheck program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.

# Sed substitution that helps us do robust quoting.  It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed='sed -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'

# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi

relink_command="gcc -g -O -DDBUG_ON -DSAFE_MUTEX -Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -Wuninitialized -mpentiumpro -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DSAFE_MUTEX -O2 -rdynamic -o \$progdir/\$file mysqlcheck.o ../libmysql/.libs/libmysqlclient.so -lz -lcrypt -lnsl -lm -lz -lcrypt -lnsl -lm -Wl,--rpath -Wl,/my/bk/mysql/libmysql/.libs -Wl,--rpath -Wl,/usr/local/mysql/lib/mysql"

# This environment variable determines our operation mode.
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
  # install mode needs the following variable:
  link_against_libtool_libs=' ../libmysql/libmysqlclient.la'
else
  # When we are sourced in execute mode, $file and $echo are already set.
  if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
    echo="echo"
    file="$0"
    # Make sure echo works.
    if test "X$1" = X--no-reexec; then
      # Discard the --no-reexec flag, and continue.
      shift
    elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
      # Yippee, $echo works!
      :
    else
      # Restart under the correct shell, and then maybe $echo will work.
      exec /bin/sh "$0" --no-reexec ${1+"$@"}
    fi
  fi

  # Find the directory that this script lives in.
  thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  test "x$thisdir" = "x$file" && thisdir=.

  # Follow symbolic links until we get to the real thisdir.
  file=`ls -ld "$file" | sed -n 's/.*-> //p'`
  while test -n "$file"; do
    destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`

    # If there was a directory component, then change thisdir.
    if test "x$destdir" != "x$file"; then
      case "$destdir" in
      [\/]* | [A-Za-z]:[\/]*) thisdir="$destdir" ;;
      *) thisdir="$thisdir/$destdir" ;;
      esac
    fi

    file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
    file=`ls -ld "$thisdir/$file" | sed -n 's/.*-> //p'`
  done

  # Try to get the absolute directory name.
  absdir=`cd "$thisdir" && pwd`
  test -n "$absdir" && thisdir="$absdir"

  program=lt-'mysqlcheck'
  progdir="$thisdir/.libs"
  
  if test ! -f "$progdir/$program" || \
     { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | sed 1q`; \
       test "X$file" != "X$progdir/$program"; }; then

    file="$$-$program"

    if test ! -d "$progdir"; then
      mkdir "$progdir"
    else
      rm -f "$progdir/$file"
    fi

    # relink executable if necessary
    if test -n "$relink_command"; then
      if (cd "$thisdir" && eval $relink_command); then :
      else
	rm -f "$progdir/$file"
	exit 1
      fi
    fi

    mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
    { rm -f "$progdir/$program";
      mv -f "$progdir/$file" "$progdir/$program"; }
    rm -f "$progdir/$file"
  fi

  if test -f "$progdir/$program"; then
    if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
      # Run the actual program with our arguments.

      # Export the path to the program.
      PATH="$progdir:$PATH"
      export PATH

      exec $program ${1+"$@"}

      $echo "$0: cannot exec $program ${1+"$@"}"
      exit 1
    fi
  else
    # The program doesn't exist.
    $echo "$0: error: $progdir/$program does not exist" 1>&2
    $echo "This script is just a wrapper for $program." 1>&2
    echo "See the libtool documentation for more information." 1>&2
    exit 1
  fi
fi
+13 −6
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ static MYSQL mysql_connection, *sock = 0;
static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
               opt_compress = 0, opt_databases = 0, opt_fast = 0,
               opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0,
               ignore_errors = 0;
               opt_silent = 0, ignore_errors = 0;
static uint verbose = 0, opt_mysql_port=0;
static my_string opt_mysql_unix_port = 0;
static char *opt_password = 0, *current_user = 0, *default_charset = 0,
@@ -78,6 +78,7 @@ static struct option long_options[] =
  {"port",    		    required_argument, 0, 'P'},
  {"quick",    		    no_argument,       0, 'q'},
  {"repair",	            no_argument,       0, 'r'},
  {"silent",                no_argument,       0, 's'},
  {"socket",   		    required_argument, 0, 'S'},
#include "sslopt-longopts.h"
  {"tables",                no_argument,       0, OPT_TABLES},
@@ -183,6 +184,7 @@ static void usage(void)
                        the fastest repair method for a table.\n\
  -r, --repair          Can fix almost anything except unique keys that aren't\n\
                        unique.\n\
  -s, --silent          Print only error messages.\n\
  -S, --socket=...	Socket file to use for connection.\n\
  --tables              Overrides option --databases (-B).\n");
#include "sslopt-usage.h"
@@ -203,7 +205,7 @@ static int get_options(int *argc, char ***argv)
  my_bool tty_password = 0;

  load_defaults("my", load_default_groups, argc, argv);
  while ((c = getopt_long(*argc, *argv, "#::p::h:u:P:S:BaAcCdeFfmqorvVw:?I1",
  while ((c = getopt_long(*argc, *argv, "#::p::h:u:P:S:BaAcCdeFfmqorsvVw:?I1",
			long_options, &option_index)) != EOF)
  {
    switch(c) {
@@ -289,6 +291,9 @@ static int get_options(int *argc, char ***argv)
    case 'S':
      opt_mysql_unix_port = optarg;
     break;
    case 's':
      opt_silent = 1;
      break;
    case 'W':
#ifdef __WIN__
      opt_mysql_unix_port = MYSQL_NAMEDPIPE;
@@ -522,6 +527,8 @@ static void print_result()
  {
    int changed = strcmp(prev, row[0]);
    int status = !strcmp(row[2], "status");
    if (opt_silent && status)
      continue;
    if (status && changed)
      printf("%-50s %s", row[0], row[3]);
    else if (!status && changed)
@@ -529,7 +536,7 @@ static void print_result()
    else
      printf("%-9s: %s", row[2], row[3]);
    strmov(prev, row[0]);
    printf("\n");
    putchar('\n');
  }
  mysql_free_result(res);
}