Commit d3f9ea0c authored by msvensson@pilot.mysql.com's avatar msvensson@pilot.mysql.com
Browse files

Merge bk-internal:/home/bk/mysql-5.0-build

into  pilot.mysql.com:/data/msvensson/mysql/mysql-5.0-build
parents 5339afdb e1cb925b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@ EXTRA_DIST = FINISH.sh \
			compile-alpha-cxx \
			compile-alpha-debug \
			compile-amd64-debug-max \
			compile-amd64-gcov \
			compile-amd64-gprof \
			compile-amd64-max \
			compile-amd64-max-sci \
			compile-darwin-mwcc \
@@ -54,6 +56,8 @@ EXTRA_DIST = FINISH.sh \
			compile-pentium-valgrind-max \
			compile-pentium64-debug \
			compile-pentium64-debug-max \
			compile-pentium64-gcov \
			compile-pentium64-gprof \
			compile-pentium64-max-sci \
			compile-pentium64-valgrind-max \
			compile-ppc \
@@ -61,6 +65,10 @@ EXTRA_DIST = FINISH.sh \
			compile-ppc-debug-max \
			compile-ppc-debug-max-no-ndb \
			compile-ppc-max \
			compile-solaris-amd64 \
			compile-solaris-amd64-debug \
			compile-solaris-amd64-forte \
			compile-solaris-amd64-forte-debug \
			compile-solaris-sparc \
			compile-solaris-sparc-debug \
			compile-solaris-sparc-forte \
+4 −0
Original line number Diff line number Diff line
@@ -78,6 +78,10 @@ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDBUG_OFF")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")

#TODO: update the code and remove the disabled warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805")

IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
    SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996")
    SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996")
+20 −5
Original line number Diff line number Diff line
@@ -1125,6 +1125,7 @@ int main(int argc,char *argv[])
  }
  if (mysql_server_init(emb_argc, emb_argv, (char**) server_default_groups))
  {
    put_error(NULL);
    free_defaults(defaults_argv);
    my_end(0);
    exit(1);
@@ -1215,21 +1216,35 @@ 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);
    goto err;

  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);
    goto err;
  /* 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");

  return;

err:
#ifdef _WIN32
  /*
   When SIGINT is raised on Windows, the OS creates a new thread to handle the
   interrupt. Once that thread completes, the main thread continues running 
   only to find that it's resources have already been free'd when the sigint 
   handler called mysql_end(). 
  */
  mysql_thread_end();
  return;
#else
  mysql_end(sig);
#endif
}

sig_handler mysql_end(int sig)
@@ -1270,7 +1285,7 @@ sig_handler mysql_end(int sig)
  my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR));
  mysql_server_end();
  free_defaults(defaults_argv);
  my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
  my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
  exit(status.exit_status);
}

+1 −1
Original line number Diff line number Diff line
@@ -1474,7 +1474,7 @@ int main(int argc, char** argv)
  DBUG_ENTER("main");
  DBUG_PROCESS(argv[0]);

  init_time(); // for time functions
  my_init_time(); // for time functions

  parse_args(&argc, (char***)&argv);
  defaults_argv=argv;
+25 −3
Original line number Diff line number Diff line
@@ -109,6 +109,8 @@ static char *opt_password=0,*current_user=0,
             *log_error_file= NULL;
static char **defaults_argv= 0;
static char compatible_mode_normal_str[255];
/* Server supports character_set_results session variable? */
static my_bool server_supports_switching_charsets= TRUE;
static ulong opt_compatible_mode= 0;
#define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1
#define MYSQL_OPT_MASTER_DATA_COMMENTED_SQL 2
@@ -1011,11 +1013,27 @@ static int mysql_query_with_error_report(MYSQL *mysql_con, MYSQL_RES **res,
}


/**
  Switch charset for results to some specified charset.  If the server does not
  support character_set_results variable, nothing can be done here.  As for
  whether something should be done here, future new callers of this function
  should be aware that the server lacking the facility of switching charsets is
  treated as success.

  @note  If the server lacks support, then nothing is changed and no error
         condition is returned.

  @returns  whether there was an error or not
*/
static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
{
  char query_buffer[QUERY_LENGTH];
  size_t query_length;

  /* Server lacks facility.  This is not an error, by arbitrary decision . */
  if (!server_supports_switching_charsets)
    return FALSE;

  query_length= my_snprintf(query_buffer,
                            sizeof (query_buffer),
                            "SET SESSION character_set_results = '%s'",
@@ -1111,11 +1129,14 @@ static int connect_to_db(char *host, char *user,char *passwd)
    DB_error(&mysql_connection, "when trying to connect");
    DBUG_RETURN(1);
  }
  /*
    Don't dump SET NAMES with a pre-4.1 server (bug#7997).
  */
  if (mysql_get_server_version(&mysql_connection) < 40100)
  {
    /* Don't dump SET NAMES with a pre-4.1 server (bug#7997).  */
    opt_set_charset= 0;

    /* Don't switch charsets for 4.1 and earlier.  (bug#34192). */
    server_supports_switching_charsets= FALSE;
  } 
  /*
    As we're going to set SQL_MODE, it would be lost on reconnect, so we
    cannot reconnect.
@@ -3285,6 +3306,7 @@ static int do_show_master_status(MYSQL *mysql_con)
      my_printf_error(0, "Error: Binlogging on server not active",
                      MYF(0));
      mysql_free_result(master);
      maybe_exit(EX_MYSQLERR);
      return 1;
    }
    mysql_free_result(master);
Loading