Commit 9a8f8497 authored by unknown's avatar unknown
Browse files

Merge bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/home/my/mysql-5.0


mysys/my_thr_init.c:
  Auto merged
ndb/include/util/OutputStream.hpp:
  Auto merged
ndb/src/common/debugger/EventLogger.cpp:
  Auto merged
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  Auto merged
ndb/src/kernel/blocks/dbdih/Dbdih.hpp:
  Auto merged
ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
  Auto merged
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
  Auto merged
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
  Auto merged
ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp:
  Auto merged
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
  Auto merged
ndb/src/kernel/blocks/qmgr/Qmgr.hpp:
  Auto merged
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
  Auto merged
ndb/src/mgmapi/mgmapi.cpp:
  Auto merged
ndb/src/mgmsrv/InitConfigFileParser.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.hpp:
  Auto merged
ndb/src/mgmsrv/Services.cpp:
  Auto merged
ndb/src/ndbapi/ClusterMgr.hpp:
  Auto merged
ndb/src/ndbapi/SignalSender.cpp:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
parents e128a436 77db9754
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -49,11 +49,14 @@ SSL_LIBRARY=--with-yassl

# If you are not using codefusion add "-Wpointer-arith" to WARNINGS
# The following warning flag will give too many warnings:
# -Wshadow -Wunused  -Winline (The later isn't usable in C++ as
# -Wunused  -Winline (The later isn't usable in C++ as
# __attribute()__ doesn't work with gnu C++)

global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings"
#debug_extra_warnings="-Wuninitialized"
global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable"
#
# For more warnings, uncomment the following line
# global_warnings="$global_warnings -Wshadow"

c_warnings="$global_warnings -Wunused"
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
base_max_configs="--with-innodb --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine $SSL_LIBRARY"
+3 −1
Original line number Diff line number Diff line
@@ -14,7 +14,9 @@ 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"
extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM $debug_cflags $max_cflags -DMYSQL_SERVER_SUFFIX=-gcov"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs --disable-shared $static_link"
extra_configs="$extra_configs $max_configs"

+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,
@@ -585,7 +585,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},
@@ -888,7 +889,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;
@@ -1768,15 +1769,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;
}

@@ -2941,7 +2944,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));
@@ -2965,13 +2968,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)
  {
@@ -3133,7 +3139,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
  }

@@ -3287,7 +3293,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;
}
@@ -3332,8 +3338,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);
@@ -3359,9 +3365,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);
@@ -3420,23 +3426,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)
@@ -3456,7 +3459,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] = "";

@@ -3466,11 +3469,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])
@@ -3560,10 +3563,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));
}  


@@ -3822,8 +3825,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;
+2 −2
Original line number Diff line number Diff line
@@ -449,7 +449,7 @@ 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 *defaults_to_use= NULL;
@@ -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);

+33 −29
Original line number Diff line number Diff line
@@ -91,15 +91,14 @@ static bool stop_passed= 0;
  This is because the event will be created (alloced) in read_log_event()
  (which returns a pointer) in check_header().
*/
Format_description_log_event* description_event; 
Format_description_log_event* glob_description_event; 

static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
                                  const char* logname);
static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
                                   const char* logname);
static int dump_log_entries(const char* logname);
static int dump_remote_file(NET* net, const char* fname);
static void die(const char* fmt, ...);
static void die(const char* fmt, ...)  __attribute__ ((__noreturn__));
static MYSQL* safe_connect();


@@ -560,7 +559,7 @@ int process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
      ce->print(result_file, print_event_info, TRUE);

      // If this binlog is not 3.23 ; why this test??
      if (description_event->binlog_version >= 3)
      if (glob_description_event->binlog_version >= 3)
      {
	if (load_processor.process(ce))
	  break;				// Error
@@ -595,9 +594,9 @@ Create_file event for file_id: %u\n",exv->file_id);
      break;
    }
    case FORMAT_DESCRIPTION_EVENT:
      delete description_event;
      description_event= (Format_description_log_event*) ev;
      print_event_info->common_header_len= description_event->common_header_len;
      delete glob_description_event;
      glob_description_event= (Format_description_log_event*) ev;
      print_event_info->common_header_len= glob_description_event->common_header_len;
      ev->print(result_file, print_event_info);
      /*
        We don't want this event to be deleted now, so let's hide it (I
@@ -803,7 +802,7 @@ static void die(const char* fmt, ...)

static void print_version()
{
  printf("%s Ver 3.1 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
  printf("%s Ver 3.2 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
  NETWARE_SET_SCREEN_MODE(1);
}

@@ -974,7 +973,7 @@ static int dump_log_entries(const char* logname)
  This is not as smart as check_header() (used for local log); it will not work
  for a binlog which mixes format. TODO: fix this.
*/
static int check_master_version(MYSQL* mysql,
static int check_master_version(MYSQL *mysql_arg,
                                Format_description_log_event
                                **description_event)
{
@@ -982,26 +981,31 @@ static int check_master_version(MYSQL* mysql,
  MYSQL_ROW row;
  const char* version;

  if (mysql_query(mysql, "SELECT VERSION()") ||
      !(res = mysql_store_result(mysql)))
  if (mysql_query(mysql_arg, "SELECT VERSION()") ||
      !(res = mysql_store_result(mysql_arg)))
  {
    /* purecov: begin inspected */
    char errmsg[256];
    strmake(errmsg, mysql_error(mysql), sizeof(errmsg)-1);
    mysql_close(mysql);
    strmake(errmsg, mysql_error(mysql_arg), sizeof(errmsg)-1);
    mysql_close(mysql_arg);
    die("Error checking master version: %s", errmsg);
    /* purecov: end */
  }
  if (!(row = mysql_fetch_row(res)))
  {
    /* purecov: begin inspected */
    mysql_free_result(res);
    mysql_close(mysql);
    die("Master returned no rows for SELECT VERSION()");
    return 1;
    /* purecov: end */
  }
  if (!(version = row[0]))
  {
    /* purecov: begin inspected */
    mysql_free_result(res);
    mysql_close(mysql);
    mysql_close(mysql_arg);
    die("Master reported NULL for the version");
    /* purecov: end */
  }

  switch (*version) {
@@ -1020,11 +1024,11 @@ static int check_master_version(MYSQL* mysql,
    *description_event= new Format_description_log_event(3);
    break;
  default:
    sql_print_error("Master reported unrecognized MySQL version '%s'",
		    version);
    /* purecov: begin inspected */
    mysql_free_result(res);
    mysql_close(mysql);
    return 1;
    mysql_close(mysql_arg);
    die("Master reported unrecognized MySQL version '%s'", version);
    /* purecov: end */
  }
  mysql_free_result(res);
  return 0;
@@ -1052,12 +1056,12 @@ static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
  mysql= safe_connect();
  net= &mysql->net;

  if (check_master_version(mysql, &description_event))
  if (check_master_version(mysql, &glob_description_event))
  {
    fprintf(stderr, "Could not find server version");
    DBUG_RETURN(1);
  }
  if (!description_event || !description_event->is_valid())
  if (!glob_description_event || !glob_description_event->is_valid())
  {
    fprintf(stderr, "Invalid Format_description log event; \
could be out of memory");
@@ -1107,7 +1111,7 @@ could be out of memory");
			len, net->read_pos[5]));
    if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 ,
                                        len - 1, &error_msg,
                                        description_event)))
                                        glob_description_event)))
    {
      fprintf(stderr, "Could not construct log event object\n");
      error= 1;
@@ -1115,7 +1119,7 @@ could be out of memory");
    }   

    Log_event_type type= ev->get_type_code();
    if (description_event->binlog_version >= 3 ||
    if (glob_description_event->binlog_version >= 3 ||
        (type != LOAD_EVENT && type != CREATE_FILE_EVENT))
    {
      /*
@@ -1321,7 +1325,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
      my_close(fd, MYF(MY_WME));
      return 1;
    }
    check_header(file, &description_event);
    check_header(file, &glob_description_event);
  }
  else // reading from stdin;
  {
@@ -1347,7 +1351,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
    if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
		      0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
      return 1;
    check_header(file, &description_event);
    check_header(file, &glob_description_event);
    if (start_position)
    {
      /* skip 'start_position' characters from stdin */
@@ -1365,7 +1369,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
    }
  }

  if (!description_event || !description_event->is_valid())
  if (!glob_description_event || !glob_description_event->is_valid())
    die("Invalid Format_description log event; could be out of memory");

  if (!start_position && my_b_read(file, tmp_buff, BIN_LOG_HEADER_SIZE))
@@ -1378,14 +1382,14 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
    char llbuff[21];
    my_off_t old_off = my_b_tell(file);

    Log_event* ev = Log_event::read_log_event(file, description_event);
    Log_event* ev = Log_event::read_log_event(file, glob_description_event);
    if (!ev)
    {
      /*
        if binlog wasn't closed properly ("in use" flag is set) don't complain
        about a corruption, but treat it as EOF and move to the next binlog.
      */
      if (description_event->flags & LOG_EVENT_BINLOG_IN_USE_F)
      if (glob_description_event->flags & LOG_EVENT_BINLOG_IN_USE_F)
        file->error= 0;
      else if (file->error)
      {
@@ -1410,7 +1414,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
  if (fd >= 0)
    my_close(fd, MYF(MY_WME));
  end_io_cache(file);
  delete description_event;
  delete glob_description_event;
  return error;
}

Loading