Commit 4b0264df authored by unknown's avatar unknown
Browse files

Merge mysql.com:/usr/local/bk/mysql-5.0

into mysql.com:/home/pem/work/mysql-5.0


mysql-test/r/sp.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_rcontext.cc:
  Auto merged
parents 03949f8c 846d6be7
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ Makefile.in
Makefile.in'
PENDING/*
TAGS
VC++Files/client/mysql_amd64.dsp
ac_available_languages_fragment
acinclude.m4
aclocal.m4
@@ -274,6 +275,8 @@ client/mysqlmanager-pwgen
client/mysqlmanagerc
client/mysqlshow
client/mysqltest
client/mysqltestmanager-pwgen
client/mysqltestmanagerc
client/mysys_priv.h
client/select_test
client/ssl_test
@@ -284,10 +287,12 @@ cmd-line-utils/libedit/common.h
cmd-line-utils/libedit/makelist
comon.h
config.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
configure.lineno
core
@@ -355,6 +360,7 @@ innobase/ib_config.h.in
innobase/stamp-h1
insert_test
install
install-sh
isam/isamchk
isam/isamlog
isam/pack_isam
@@ -519,7 +525,9 @@ linked_libmysqldex_sources
linked_server_sources
linked_tools_sources
locked
ltmain.sh
man/*.1
missing
mit-pthreads/config.flags
mit-pthreads/include/bits
mit-pthreads/include/pthread/machdep.h
@@ -936,6 +944,7 @@ scripts/mysqld_multi
scripts/mysqld_safe
scripts/mysqldumpslow
scripts/mysqlhotcopy
scripts/mysqlhotcopy.sh.rej
scripts/safe_mysqld
select_test
server-tools/instance-manager/client.c
@@ -1100,18 +1109,10 @@ tmp/*
tools/my_vsnprintf.c
tools/mysqlmanager
tools/mysqlmngd
tools/mysqltestmanager
tools/mysys_priv.h
vi.h
vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
VC++Files/client/mysql_amd64.dsp
client/mysqltestmanager-pwgen
client/mysqltestmanagerc
tools/mysqltestmanager
config.guess
config.sub
install-sh
ltmain.sh
missing
+131 −44
Original line number Diff line number Diff line
@@ -6,113 +6,200 @@
#

if test -r /proc/cpuinfo ; then
  # on Linux (and others?) we can get detailed CPU information out of /proc
  cpuinfo="cat /proc/cpuinfo"

  # detect CPU family
  cpu_family=`$cpuinfo | grep 'family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
  if test -z "$cpu_family" ; then
    cpu_family=`$cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
  fi

  # detect CPU vendor and model
  cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
  model_name=`$cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1`
  if test -z "$model_name" ; then
    model_name=`$cpuinfo | grep 'cpu model' | cut -d ':' -f 2 | head -1`
  fi

  # fallback: get CPU model from uname output
  if test -z "$model_name" ; then
    model_name=`uname -m`
  fi

  # parse CPU flags
  for flag in `$cpuinfo | grep '^flags' | sed -e 's/^flags.*: //'`; do 
	eval cpu_flag_$flag=yes
  done
else
  # Fallback when there is no /proc/cpuinfo
  case "`uname -s`" in
    FreeBSD)
    FreeBSD|OpenBSD)
      cpu_family=`uname -m`;
      model_name=`sysctl -b hw.model`
      model_name=`sysctl -n hw.model`
      ;;
    Darwin)
      cpu_family=`uname -p`
      model_name=`machine`
      ;;
    *)
      cpu_family=`uname -m`;
      model_name="unknown";
      model_name=`uname -p`;
      ;;
  esac
fi

cpu_flag=""
cpu_flag_old=""

# detect CPU shortname as used by gcc options 
# this list is not complete, feel free to add further entries
cpu_arg=""
case "$cpu_family--$model_name" in
  # DEC Alpha
  Alpha*EV6*)
    cpu_flag="ev6";
    cpu_arg="ev6";
    ;;

  # Intel ia32
  *Xeon*)
    cpu_flag="nocona";
    # a Xeon is just another pentium4 ...
    # ... unless it has the "lm" (long-mode) flag set, 
    # in that case it's a Xeon with EM64T support 
	if [ -z "$cpu_flag_lm" ]; then
      cpu_arg="pentium4";
	else
      cpu_arg="nocona";
    fi
    ;;
  *Pentium*4*Mobile*CPU*)
    cpu_flag="pentium4m";
  *Pentium*4*Mobile*)
    cpu_arg="pentium4m";
  ;;
  *Pentium*4*CPU*)
    cpu_flag="pentium4";
  *Pentium*4*)
    cpu_arg="pentium4";
    ;;
  *Pentium*III*Mobile*CPU*)
    cpu_flag="pentium3m";
  *Pentium*III*Mobile*)
    cpu_arg="pentium3m";
  ;;
  *Pentium*III*CPU*)
    cpu_flag="pentium3";
  *Pentium*III*)
    cpu_arg="pentium3";
  ;;
  *Pentium*M*pro*)
    cpu_flag="pentium-m";
    cpu_flag_old="pentium";
    cpu_arg="pentium-m";
  ;;
  *Athlon*64*)
    cpu_flag="athlon64";
    cpu_flag_old="athlon";
    cpu_arg="athlon64";
    ;;
  *Athlon*)
    cpu_flag="athlon";
    cpu_arg="athlon";
    ;;

  # Intel ia64
  *Itanium*)
    # Don't need to set any flags for itanium(at the moment)
    cpu_flag="";
    cpu_arg="";
    ;;

  #
  *ppc*)
    cpu_arg='powerpc'
    ;;
  *ppc)
    cpu_flag="powerpc";
    no_march=1;
 
  *powerpc*)
    cpu_arg='powerpc'
    ;;

  # unknown
  *)
    cpu_flag="";
    cpu_arg="";
    ;;
esac

if test -z "$cpu_flag"; then

if test -z "$cpu_arg"; then
  echo "BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using."
  check_cpu_flags=""
  check_cpu_cflags=""
  return
fi

echo "cpu_flag: $cpu_flag"

# different compiler versions have different option names
# for CPU specific command line options
if test -z "$CC" ; then
  cc="gcc";
else
  cc=$CC

fi

cc_ver=`$cc --version | sed 1q`
cc_verno=`echo $cc_ver | sed -e 's/[^0-9. ]//g;	 s/^ *//g; s/ .*//g'`

case "$cc_ver--$cc_verno" in
  *GCC*--3.4*|*GCC*--3.5*|*GCC*--4.*)
    check_cpu_cflags="-mtune=$cpu_flag -march=$cpu_flag"
    ;;
  *GCC*)
    # Fix for older compiler versions
    if test -n "$cpu_flag_old"; then
      cpu_flag="$cpu_flag_old"
    fi
    check_cpu_cflags="-mcpu=$cpu_flag -march=$cpu_flag"
    if test -n "$no_march"; then
      check_cpu_cflags="-mcpu=$cpu_flag"
    fi
      # different gcc backends (and versions) have different CPU flags
      case `gcc -dumpmachine` in
        i?86-*)
   	      case "$cc_verno" in
		    3.4*|3.5*|4.*)
			  check_cpu_args='-mtune=$cpu_arg -march=$cpu_arg'
			  ;;
		    *)
			  check_cpu_args='-mcpu=$cpu_arg -march=$cpu_arg'
			  ;;
          esac
          ;;
        ppc-*)
		  check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg'
          ;;
        *)
          check_cpu_cflags=""
          return
          ;;
      esac
    ;;
  2.95.*)
    # GCC 2.95 doesn't expose its name in --version output
    check_cpu_args='-m$cpu_arg'
    ;;
  *)
    check_cpu_cflags=""
    return
    ;;
esac
echo $check_cpu_cflags

# now we check whether the compiler really understands the cpu type
touch __test.c

while [ "$cpu_arg" ] ; do
  echo -n testing $cpu_arg "... "
	
  # compile check
  check_cpu_cflags=`eval echo $check_cpu_args`
  if $cc -c $check_cpu_cflags __test.c 2>/dev/null; then
	  echo ok
      break;
  fi

  echo failed
  check_cpu_cflags=""

  # if compile failed: check whether it supports a predecessor of this CPU
  # this list is not complete, feel free to add further entries
  case "$cpu_arg" in
    # Intel ia32
    nocona)     cpu_arg=pentium4    ;; 
    prescott)   cpu_arg=pentium4    ;;
    pentium4m)  cpu_arg=pentium4    ;;
    pentium4)   cpu_arg=pentium3    ;;
    pentium3m)  cpu_arg=pentium3    ;;
    pentium3)   cpu_arg=pentium2    ;;
    pentium2)   cpu_arg=pentiumpro  ;;
    pentiumpro) cpu_arg=pentium     ;;
    pentium)    cpu_arg=i486        ;;
    i486)       cpu_arg=i386        ;;

	# power / powerPC
	7450)       cpu_arg=7400        ;;

    *)          cpu_arg=""          ;;
  esac
done

rm __test.*
+2 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ dlenev@build.mysql.com
dlenev@jabberwock.localdomain
dlenev@mysql.com
ejonore@mc03.ndb.mysql.com
elliot@mysql.com
evgen@moonbone.(none)
evgen@moonbone.local
gbichot@bk-internal.mysql.com
@@ -201,6 +202,7 @@ ndbdev@ndbmaster.mysql.com
ndbdev@shark.
nick@mysql.com
nick@nick.leippe.com
obarnir@mysql.com
papa@gbichot.local
patg@krsna.
patg@krsna.patg.net
+0 −4
Original line number Diff line number Diff line
@@ -147,10 +147,6 @@ SOURCE="..\strings\ctype-czech.c"
# End Source File
# Begin Source File

SOURCE="..\strings\ctype-cp932.c"
# End Source File
# Begin Source File

SOURCE="..\strings\ctype-euc_kr.c"
# End Source File
# Begin Source File
+102 −24
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@
#include <locale.h>
#endif

const char *VER= "14.10";
const char *VER= "14.11";

/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH	     1024
@@ -1657,9 +1657,10 @@ int mysql_real_query_for_lazy(const char *buf, int length)
{
  for (uint retry=0;; retry++)
  {
    int error;
    if (!mysql_real_query(&mysql,buf,length))
      return 0;
    int error= put_error(&mysql);
    error= put_error(&mysql);
    if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR || retry > 1 ||
        !opt_reconnect)
      return error;
@@ -1917,7 +1918,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
      time_buff[0]=0;
    if (result)
    {
      if (!mysql_num_rows(result) && ! quick)
      if (!mysql_num_rows(result) && ! quick && !info_flag)
      {
	strmov(buff, "Empty set");
      }
@@ -2049,18 +2050,93 @@ com_ego(String *buffer,char *line)
  return result;
}

static char *fieldtype2str(enum enum_field_types type) {
  switch(type) {
    case FIELD_TYPE_BIT:         return "BIT";
    case FIELD_TYPE_BLOB:        return "BLOB";
    case FIELD_TYPE_DATE:        return "DATE";
    case FIELD_TYPE_DATETIME:    return "DATETIME";
    case FIELD_TYPE_NEWDECIMAL:  return "NEWDECIMAL";
    case FIELD_TYPE_DECIMAL:     return "DECIMAL";
    case FIELD_TYPE_DOUBLE:      return "DOUBLE";
    case FIELD_TYPE_ENUM:        return "ENUM";
    case FIELD_TYPE_FLOAT:       return "FLOAT";
    case FIELD_TYPE_GEOMETRY:    return "GEOMETRY";
    case FIELD_TYPE_INT24:       return "INT24";
    case FIELD_TYPE_LONG:        return "LONG";
    case FIELD_TYPE_LONGLONG:    return "LONGLONG";
    case FIELD_TYPE_LONG_BLOB:   return "LONG_BLOB";
    case FIELD_TYPE_MEDIUM_BLOB: return "MEDIUM_BLOB";
    case FIELD_TYPE_NEWDATE:     return "NEWDATE";
    case FIELD_TYPE_NULL:        return "NULL";
    case FIELD_TYPE_SET:         return "SET";
    case FIELD_TYPE_SHORT:       return "SHORT";
    case FIELD_TYPE_STRING:      return "STRING";
    case FIELD_TYPE_TIME:        return "TIME";
    case FIELD_TYPE_TIMESTAMP:   return "TIMESTAMP";
    case FIELD_TYPE_TINY:        return "TINY";
    case FIELD_TYPE_TINY_BLOB:   return "TINY_BLOB";
    case FIELD_TYPE_VAR_STRING:  return "VAR_STRING";
    case FIELD_TYPE_YEAR:        return "YEAR";
    default:                     return "?-unknown-?";
  }
}

static char *fieldflags2str(uint f) {
  static char buf[1024];
  char *s=buf;
  *s=0;
#define ff2s_check_flag(X) \
                if (f & X ## _FLAG) { s=strmov(s, # X " "); f &= ~ X ## _FLAG; }
  ff2s_check_flag(NOT_NULL);
  ff2s_check_flag(PRI_KEY);
  ff2s_check_flag(UNIQUE_KEY);
  ff2s_check_flag(MULTIPLE_KEY);
  ff2s_check_flag(BLOB);
  ff2s_check_flag(UNSIGNED);
  ff2s_check_flag(ZEROFILL);
  ff2s_check_flag(BINARY);
  ff2s_check_flag(ENUM);
  ff2s_check_flag(AUTO_INCREMENT);
  ff2s_check_flag(TIMESTAMP);
  ff2s_check_flag(SET);
  ff2s_check_flag(NO_DEFAULT_VALUE);
  ff2s_check_flag(NUM);
  ff2s_check_flag(PART_KEY);
  ff2s_check_flag(GROUP);
  ff2s_check_flag(UNIQUE);
  ff2s_check_flag(BINCMP);
#undef ff2s_check_flag
  if (f)
    sprintf(s, " unknows=0x%04x", f);
  return buf;
}

static void
print_field_types(MYSQL_RES *result)
{
  MYSQL_FIELD   *field;
  uint i=0;

  while ((field = mysql_fetch_field(result)))
  {
    tee_fprintf(PAGER,"Catalog:    '%s'\nDatabase:   '%s'\nTable:      '%s'\nName:       '%s'\nType:       %d\nLength:     %ld\nMax length: %ld\nIs_null:    %d\nFlags:      %u\nDecimals:   %u\n\n",
		field->catalog, field->db, field->table, field->name,
		(int) field->type,
		field->length, field->max_length,
		!IS_NOT_NULL(field->flags),
		field->flags, field->decimals);
    tee_fprintf(PAGER, "Field %3u:  `%s`\n"
                       "Catalog:    `%s`\n"
                       "Database:   `%s`\n"
                       "Table:      `%s`\n"
                       "Org_table:  `%s`\n"
                       "Type:       %s\n"
                       "Collation:  %s (%u)\n"
                       "Length:     %lu\n"
                       "Max_length: %lu\n"
                       "Decimals:   %u\n"
                       "Flags:      %s\n\n",
                ++i,
                field->name, field->catalog, field->db, field->table,
                field->org_table, fieldtype2str(field->type),
                get_charset_name(field->charsetnr), field->charsetnr,
                field->length, field->max_length, field->decimals,
                fieldflags2str(field->flags));
  }
  tee_puts("", PAGER);
}
@@ -2078,6 +2154,8 @@ print_table_data(MYSQL_RES *result)
  if (info_flag)
  {
    print_field_types(result);
    if (!mysql_num_rows(result))
      return;
    mysql_field_seek(result,0);
  }
  separator.copy("+",1,charset_info);
@@ -2237,22 +2315,23 @@ print_table_data_vertically(MYSQL_RES *result)
  }
}


/* print_warnings should be called right after executing a statement */
static void
print_warnings()

static void print_warnings()
{
  char query[30];
  const char   *query;
  MYSQL_RES    *result;
  MYSQL_ROW    cur;
  my_ulonglong num_rows;

  /* Get the warnings */
  strmov(query,"show warnings");
  query= "show warnings";
  mysql_real_query_for_lazy(query, strlen(query));
  mysql_store_result_for_lazy(&result);

  /* Bail out when no warnings */
  my_ulonglong num_rows = mysql_num_rows(result);
  if (num_rows == 0) 
  if (!(num_rows= mysql_num_rows(result)))
  {
    mysql_free_result(result);
    return;
@@ -2266,13 +2345,12 @@ print_warnings()
  mysql_free_result(result);
}

static const char
*array_value(const char **array, char key)

static const char *array_value(const char **array, char key)
{
  int x;
  for (x= 0; array[x]; x+= 2)
    if (*array[x] == key)
      return array[x + 1];
  for (; *array; array+= 2)
    if (**array == key)
      return array[1];
  return 0;
}

Loading