Commit 7547a3f1 authored by unknown's avatar unknown
Browse files

Merge salvation.intern.azundris.com:/home/tnurnberg/mysql-5.1

into  salvation.intern.azundris.com:/home/tnurnberg/mysql-5.1-maint


BitKeeper/deleted/.del-openssl.m4~41cebd0ba8281769:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/grant.test:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/mysql_client_test.test:
  Auto merged
server-tools/instance-manager/listener.cc:
  Auto merged
server-tools/instance-manager/portability.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
client/mysql.cc:
  manual merge
mysql-test/r/grant.result:
  manual merge
parents 2efd625f fd989054
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1170,6 +1170,7 @@ sql/*.ds?
sql/*.vcproj
sql/.gdbinit
sql/client.c
sql/f.c
sql/gen_lex_hash
sql/gmon.out
sql/handlerton.cc
+2 −33
Original line number Diff line number Diff line
@@ -338,7 +338,7 @@ static void end_timer(ulong start_time,char *buff);
static void mysql_end_timer(ulong start_time,char *buff);
static void nice_time(double sec,char *buff,bool part_second);
static sig_handler mysql_end(int sig);
static sig_handler mysql_sigint(int sig);
static sig_handler handle_sigint(int sig);

int main(int argc,char *argv[])
{
@@ -420,8 +420,7 @@ int main(int argc,char *argv[])
  if (opt_sigint_ignore)
    signal(SIGINT, SIG_IGN);
  else
    signal(SIGINT, mysql_sigint);		// Catch SIGINT to clean up

    signal(SIGINT, handle_sigint);              // Catch SIGINT to clean up
  signal(SIGQUIT, mysql_end);			// Catch SIGQUIT to clean up

  /*
@@ -489,28 +488,6 @@ int main(int argc,char *argv[])
#endif
}

sig_handler mysql_sigint(int sig)
{
  char kill_buffer[40];
  MYSQL *kill_mysql= NULL;

  signal(SIGINT, mysql_sigint);

  /* terminate if no query being executed, or we already tried interrupting */
  if (!executing_query || interrupted_query++)
    mysql_end(sig);

  kill_mysql= mysql_init(kill_mysql);
  if (!mysql_real_connect(kill_mysql,current_host, current_user, opt_password,
                          "", opt_mysql_port, opt_mysql_unix_port,0))
    mysql_end(sig);
  /* kill_buffer is always big enough because max length of %lu is 15 */
  sprintf(kill_buffer, "KILL /*!50000 QUERY */ %lu", mysql_thread_id(&mysql));
  mysql_real_query(kill_mysql, kill_buffer, strlen(kill_buffer));
  mysql_close(kill_mysql);
  tee_fprintf(stdout, "Query aborted by Ctrl+C\n");
}

sig_handler mysql_end(int sig)
{
  mysql_close(&mysql);
@@ -1058,8 +1035,6 @@ static int read_and_execute(bool interactive)
      if (opt_outfile && glob_buffer.is_empty())
	fflush(OUTFILE);

      interrupted_query= 0;

#if defined( __WIN__) || defined(__NETWARE__)
      tee_fputs(prompt, stdout);
#if defined(__NETWARE__)
@@ -2041,9 +2016,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
  }

  timer=start_timer();

  executing_query= 1;

  error= mysql_real_query_for_lazy(buffer->ptr(),buffer->length());

#ifdef HAVE_READLINE
@@ -2059,7 +2032,6 @@ com_go(String *buffer,char *line __attribute__((unused)))
  {
    executing_query= 0;
    buffer->length(0); // Remove query on error
    executing_query= 0;
    return error;
  }
  error=0;
@@ -2143,9 +2115,6 @@ com_go(String *buffer,char *line __attribute__((unused)))
      fflush(stdout);
    mysql_free_result(result);
  } while (!(err= mysql_next_result(&mysql)));

  executing_query= 0;

  if (err >= 1)
    error= put_error(&mysql);

+14 −2
Original line number Diff line number Diff line
@@ -157,17 +157,29 @@ static int create_defaults_file(const char *path, const char *our_defaults_path)
  File our_defaults_file, defaults_file;
  char buffer[512];
  char *buffer_end;
  int failed_to_open_count= 0;
  int error;

  /* check if the defaults file is needed at all */
  if (!opt_password)
    return 0;

  defaults_file= my_open(path, O_BINARY | O_CREAT | O_WRONLY,
retry_open:
  defaults_file= my_open(path, O_BINARY | O_CREAT | O_WRONLY | O_EXCL,
                         MYF(MY_FAE | MY_WME));

  if (defaults_file < 0)
  {
    if (failed_to_open_count == 0)
    {
      remove(path);
      failed_to_open_count+= 1;
      goto retry_open;
    }
    else
      return 1;
  }

  upgrade_defaults_created= 1;
  if (our_defaults_path)
  {
+6 −9
Original line number Diff line number Diff line
@@ -1530,20 +1530,17 @@ AC_ARG_WITH(debug,
if test "$with_debug" = "yes"
then
  # Medium debug.
  AC_DEFINE([DBUG_ON], [1], [Use libdbug])
  CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DSAFE_MUTEX $CFLAGS"
  CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS"
  CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS"
  CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DDBUG_ON -DSAFE_MUTEX $CXXFLAGS"
elif test "$with_debug" = "full"
then
  # Full debug. Very slow in some cases
  AC_DEFINE([DBUG_ON], [1], [Use libdbug])
  CFLAGS="$DEBUG_CFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS"
  CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS"
  CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS"
  CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS"
else
  # Optimized version. No debug
  AC_DEFINE([DBUG_OFF], [1], [Don't use libdbug])
  CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
  CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS"
  CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS"
fi

# If we should allow error injection tests
+1 −4
Original line number Diff line number Diff line
@@ -71,13 +71,10 @@
 *
 */

#include <my_global.h>

/* This file won't compile unless DBUG_OFF is undefined locally */
#ifdef DBUG_OFF
#undef DBUG_OFF
#endif

#include <my_global.h>
#include <m_string.h>
#include <errno.h>
#if defined(MSDOS) || defined(__WIN__)
Loading