Commit 3f3d9093 authored by unknown's avatar unknown
Browse files

Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1

into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1


BUILD/SETUP.sh:
  Auto merged
client/mysql.cc:
  Auto merged
configure.in:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
storage/archive/ha_archive.cc:
  Auto merged
plugin/daemon_example/daemon_example.cc:
  Merged with main 5.1
sql/mysqld.cc:
  Merged with main 5.1
parents 13390deb 6e501e65
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2080,6 +2080,7 @@ storage/archive/.deps/ha_archive_la-azio.Plo
storage/archive/.deps/ha_archive_la-ha_archive.Plo
storage/archive/.deps/libarchive_a-azio.Po
storage/archive/.deps/libarchive_a-ha_archive.Po
storage/archive/archive_reader
storage/archive/archive_test
storage/bdb/*.ds?
storage/bdb/*.vcproj
+10 −0
Original line number Diff line number Diff line
@@ -93,6 +93,10 @@ if [ "x$warning_mode" != "xpedantic" ]; then
  warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W"
  warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
  warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable"

# For more warnings, uncomment the following line
# warnings="$global_warnings -Wshadow"

# C warnings
  c_warnings="$warnings -Wunused-parameter"
# C++ warnings
@@ -191,6 +195,12 @@ fi
# (http://samba.org/ccache) is installed, use it.
# We use 'grep' and hope 'grep' will work as expected
# (returns 0 if finds lines)
if test "$USING_GCOV" != "1"
then
  # Not using gcov; Safe to use ccache
  CCACHE_GCOV_VERSION_ENABLED=1
fi

if ccache -V > /dev/null 2>&1 && test "$CCACHE_GCOV_VERSION_ENABLED" = "1"
then
  echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC"
+4 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

# Need to disable ccache, or we loose the gcov-needed compiler output files.

USING_GCOV=1
CCACHE_GCOV_VERSION_ENABLED=0
if ccache -V > /dev/null 2>&1
then
@@ -26,8 +27,10 @@ export LDFLAGS="-fprofile-arcs -ftest-coverage"
# The  -fprofile-arcs and -ftest-coverage options cause GCC to instrument the
# code with profiling information used by gcov.
# the -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl.
extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM -DHAVE_MUTEX_THREAD_ONLY $debug_extra_flags"
extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM -DHAVE_MUTEX_THREAD_ONLY $debug_extra_flags $debug_cflags $max_cflags -DMYSQL_SERVER_SUFFIX=-gcov"
extra_configs="$pentium_configs $debug_configs --disable-shared $static_link"
extra_configs="$extra_configs $max_configs"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"

. "$path/FINISH.sh"
+34 −33
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ typedef enum enum_info_type INFO_TYPE;
static MYSQL mysql;			/* The connection */
static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
               connected=0,opt_raw_data=0,unbuffered=0,output_tables=0,
	       rehash=1,skip_updates=0,safe_updates=0,one_database=0,
	       opt_rehash=1,skip_updates=0,safe_updates=0,one_database=0,
	       opt_compress=0, using_opt_local_infile=0,
	       vertical=0, line_numbers=1, column_names=1,opt_html=0,
               opt_xml=0,opt_nopager=1, opt_outfile=0, named_cmds= 0,
@@ -591,7 +591,8 @@ static struct my_option my_long_options[] =
#endif
  {"auto-rehash", OPT_AUTO_REHASH,
   "Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.",
   (gptr*) &rehash, (gptr*) &rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   (gptr*) &opt_rehash, (gptr*) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
   0, 0},
  {"no-auto-rehash", 'A',
   "No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options deprecated; use --disable-auto-rehash instead.",
   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -898,7 +899,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
  }
  break;
  case 'A':
    rehash= 0;
    opt_rehash= 0;
    break;
  case 'N':
    column_names= 0;
@@ -1756,15 +1757,17 @@ char *rindex(const char *s,int c)

static int reconnect(void)
{
  /* purecov: begin tested */
  if (opt_reconnect)
  {
    put_info("No connection. Trying to reconnect...",INFO_INFO);
    (void) com_connect((String *) 0, 0);
    if (rehash)
    if (opt_rehash)
      com_rehash(NULL, NULL);
  }
  if (!connected)
    return put_info("Can't connect to the server\n",INFO_ERROR);
  /* purecov: end */
  return 0;
}

@@ -2933,7 +2936,7 @@ static int
com_connect(String *buffer, char *line)
{
  char *tmp, buff[256];
  bool save_rehash= rehash;
  bool save_rehash= opt_rehash;
  int error;

  bzero(buff, sizeof(buff));
@@ -2957,13 +2960,16 @@ com_connect(String *buffer, char *line)
      }
    }
    else
      rehash= 0;				// Quick re-connect
    {
      /* Quick re-connect */
      opt_rehash= 0;                            /* purecov: tested */
    }
    buffer->length(0);				// command used
  }
  else
    rehash= 0;
    opt_rehash= 0;
  error=sql_connect(current_host,current_db,current_user,opt_password,0);
  rehash= save_rehash;
  opt_rehash= save_rehash;

  if (connected)
  {
@@ -3125,7 +3131,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
    current_db=my_strdup(tmp,MYF(MY_WME));
#ifdef HAVE_READLINE
    if (select_db > 1)
      build_completion_hash(rehash, 1);
      build_completion_hash(opt_rehash, 1);
#endif
  }

@@ -3279,7 +3285,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
  mysql.reconnect= 1;
#endif
#ifdef HAVE_READLINE
  build_completion_hash(rehash, 1);
  build_completion_hash(opt_rehash, 1);
#endif
  return 0;
}
@@ -3324,8 +3330,8 @@ static int
com_status(String *buffer __attribute__((unused)),
	   char *line __attribute__((unused)))
{
  const char *status;
  char buff[22];
  const char *status_str;
  char buff[40];
  ulonglong id;
  MYSQL_RES *result;
  LINT_INIT(result);
@@ -3351,9 +3357,9 @@ com_status(String *buffer __attribute__((unused)),
      mysql_free_result(result);
    } 
#ifdef HAVE_OPENSSL
    if ((status= mysql_get_ssl_cipher(&mysql)))
    if ((status_str= mysql_get_ssl_cipher(&mysql)))
      tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n",
		  status);
		  status_str);
    else
#endif /* HAVE_OPENSSL */
      tee_puts("SSL:\t\t\tNot in use", stdout);
@@ -3412,23 +3418,20 @@ com_status(String *buffer __attribute__((unused)),
    tee_fprintf(stdout, "Protocol:\t\tCompressed\n");
#endif

  if ((status=mysql_stat(&mysql)) && !mysql_error(&mysql)[0])
  if ((status_str= mysql_stat(&mysql)) && !mysql_error(&mysql)[0])
  {
    ulong sec;
    char buff[40];
    const char *pos= strchr(status,' ');
    const char *pos= strchr(status_str,' ');
    /* print label */
    tee_fprintf(stdout, "%.*s\t\t\t", (int) (pos-status), status);
    if ((status=str2int(pos,10,0,LONG_MAX,(long*) &sec)))
    tee_fprintf(stdout, "%.*s\t\t\t", (int) (pos-status_str), status_str);
    if ((status_str= str2int(pos,10,0,LONG_MAX,(long*) &sec)))
    {
      nice_time((double) sec,buff,0);
      tee_puts(buff, stdout);			/* print nice time */
      while (*status == ' ') status++;		/* to next info */
    }
    if (status)
    {
      while (*status_str == ' ')
        status_str++;  /* to next info */
      tee_putc('\n', stdout);
      tee_puts(status, stdout);
      tee_puts(status_str, stdout);
    }
  }
  if (safe_updates)
@@ -3448,7 +3451,7 @@ select_limit, max_join_size);
}

static const char *
server_version_string(MYSQL *mysql)
server_version_string(MYSQL *con)
{
  static char buf[MAX_SERVER_VERSION_LENGTH] = "";

@@ -3458,11 +3461,11 @@ server_version_string(MYSQL *mysql)
    char *bufp = buf;
    MYSQL_RES *result;

    bufp = strnmov(buf, mysql_get_server_info(mysql), sizeof buf);
    bufp= strnmov(buf, mysql_get_server_info(con), sizeof buf);

    /* "limit 1" is protection against SQL_SELECT_LIMIT=0 */
    if (!mysql_query(mysql, "select @@version_comment limit 1") &&
        (result = mysql_use_result(mysql)))
    if (!mysql_query(con, "select @@version_comment limit 1") &&
        (result = mysql_use_result(con)))
    {
      MYSQL_ROW cur = mysql_fetch_row(result);
      if (cur && cur[0])
@@ -3552,10 +3555,10 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)


static int
put_error(MYSQL *mysql)
put_error(MYSQL *con)
{
  return put_info(mysql_error(mysql), INFO_ERROR, mysql_errno(mysql),
		  mysql_sqlstate(mysql));
  return put_info(mysql_error(con), INFO_ERROR, mysql_errno(con),
		  mysql_sqlstate(con));
}  


@@ -3802,8 +3805,6 @@ static const char* construct_prompt()
	break;
      case 'D':
	char* dateTime;
	time_t lclock;
	lclock = time(NULL);
	dateTime = ctime(&lclock);
	processed_prompt.append(strtok(dateTime,"\n"));
	break;
+3 −3
Original line number Diff line number Diff line
@@ -449,9 +449,9 @@ int main(int argc, char **argv)
  
  char *forced_defaults_file;
  char *forced_extra_defaults;
  char *defaults_group_suffix;
  char *local_defaults_group_suffix;
  const char *script_line;
  char *upgrade_defaults_path; 
  char *upgrade_defaults_path= 0;
  char *defaults_to_use= NULL;
  int upgrade_defaults_created= 0;
  
@@ -466,7 +466,7 @@ int main(int argc, char **argv)
  /* Check if we are forced to use specific defaults */
  get_defaults_options(argc, argv,
                       &forced_defaults_file, &forced_extra_defaults,
                       &defaults_group_suffix);
                       &local_defaults_group_suffix);
  
  load_defaults("my", load_default_groups, &argc, &argv);

Loading