Commit eec84895 authored by unknown's avatar unknown
Browse files

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

into serg.mylan:/usr/home/serg/Abk/mysql-5.0


sql/item.cc:
  Auto merged
parents e66af8ad 94c3958e
Loading
Loading
Loading
Loading
+41 −15
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_su
$opt_tmp=$opt_version_suffix="";
$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
$opt_skip_embedded_test=$opt_skip_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_with_federated=0;
$global_step="";

GetOptions(
	"bdb",
@@ -179,7 +180,8 @@ info("Compiling MySQL$opt_version_suffix at $host$opt_suffix, stage: $opt_stage\
info("LD_LIBRARY_PATH is $ENV{LD_LIBRARY_PATH}");
info("PATH is $ENV{PATH}");

log_timestamp();
$global_step= "Check MD5, shutdown";
log_timestamp("START");

$md5_result= safe_system("perl $ENV{HOME}/my_md5sum -c ${opt_distribution}.md5");

@@ -207,9 +209,10 @@ kill_all("mysqlmanager");
kill_all("$pwd/host/mysql");
kill_all("$pwd/host/test");

$global_step= "directory cleanup";
if ($opt_stage == 0)
{
  log_timestamp();
  log_timestamp("START");
  print "$host: Removing old distribution\n" if ($opt_debug);
  if (!$opt_use_old_distribution)
  {
@@ -255,10 +258,11 @@ safe_cd("$pwd/$host/$ver");
#
# Configure the sources
#
$global_step= "configure";
if ($opt_stage <= 1)
{
  # Fix files if this is in another timezone than the build host
  log_timestamp();
  log_timestamp("START");
  unlink("config.cache");
  unlink("bdb/build_unix/config.cache");
  unlink("innobase/config.cache");
@@ -312,29 +316,33 @@ if ($opt_stage <= 1)
  {
    safe_system("cp -r $pwd/$host/include-mysql/* $pwd/$host/$ver/include");
  }
  log_timestamp("DONE ");
}

#
# Compile the binaries
#
$global_step= "compile + link";
if ($opt_stage <= 2)
{
  my ($command);
  log_timestamp();
  log_timestamp("START");
  unlink($opt_distribution) if ($opt_delete && !$opt_use_old_distribution);
  $command=$make;
  $command.= " $opt_make_options" if (defined($opt_make_options) && $opt_make_options ne "");
  safe_system($command);
  print LOG "Do-compile: Build successful\n";
  log_timestamp("DONE ");
}

#
# Create the binary distribution
#
$global_step= "pack binary distribution";
if ($opt_stage <= 3)
{
  log_timestamp("START");
  my $flags= "";
  log_timestamp();
  log_system("rm -fr mysql-{3,4,5}* $pwd/$host/mysql*.t*gz");
  # No need to add the debug symbols, if the binaries are not stripped (saves space)
  unless ($opt_with_debug || $opt_no_strip)
@@ -355,6 +363,7 @@ if ($opt_stage <= 3)
    safe_system("cp client/mysqladmin $pwd/$host/bin");
  }  
  safe_system("$make clean") if ($opt_with_small_disk);
  log_timestamp("DONE ");
}

$tar_file=<$pwd/$host/mysql*.t*gz>;
@@ -369,11 +378,13 @@ system("cd $pwd/$host; perl $ENV{HOME}/my_md5sum $tar_file_lite > ${tar_file_lit
# Unpack the binary distribution
#
if ($opt_stage <= 4 && !$opt_no_test)
$global_step= "extract binary distribution";
{
  log_timestamp();
  log_timestamp("START");
  rm_all(<$pwd/$host/test/*>);
  safe_cd("$pwd/$host/test");
  safe_system("gunzip < $tar_file | $tar xf -");
  log_timestamp("DONE ");
}

$tar_file =~ /(mysql[^\/]*)\.(tar\.gz|tgz)/;
@@ -386,30 +397,36 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" .
# Run the test suite
#
if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
$global_step= "tests in default mode";
{
  log_timestamp("START");
  my $flags= "";
  $flags.= " --with-ndbcluster" if ($opt_with_cluster);
  $flags.= " --force" if (!$opt_one_error);
  log_timestamp();
  info("Running test suite");
  system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
  safe_cd("${test_dir}/mysql-test");
  check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "were successful");
  log_timestamp("DONE ");

  $global_step= "tests using prepared statements";
  unless ($opt_skip_ps_test)
  {
    log_timestamp();
    log_timestamp("START");
    info("Running test suite using prepared statements");
    check_system("./mysql-test-run $flags --ps-protocol --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "were successful");
    log_timestamp("DONE ");
  }
  
  $global_step= "tests using embedded server";
  unless ($opt_skip_embedded_test)
  {
    log_timestamp();
    log_timestamp("START");
    info("Running embedded server test suite");
    # Embedded server and NDB don't jive
    $flags=~ s/ --with-ndbcluster//;
    check_system("./mysql-test-run $flags --embedded-server --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "were successful");
    log_timestamp("DONE ");
  }
  # 'mysql-test-run' writes its own final message for log evaluation.
}
@@ -441,10 +458,11 @@ if (!$opt_no_test && !$opt_no_benchmark)
#
# Compile and install the required Perl modules
#
$global_step= "installing Perl modules";
if ($opt_stage <= 7 && $opt_perl_files && !$opt_no_perl && !$opt_no_test &&
    !$opt_no_benchmark)
{
  log_timestamp();
  log_timestamp("START");
  safe_cd($test_dir);
  rm_all("perl");
  safe_system("mkdir perl");
@@ -473,25 +491,29 @@ if ($opt_stage <= 7 && $opt_perl_files && !$opt_no_perl && !$opt_no_test &&
    safe_system($opt_static_perl ? "perl Makefile.PL -static $options" : "perl Makefile.PL $options");
    safe_system("$make ; $sur $make install");
  }
  log_timestamp("DONE ");
}

#
# Run crash-me test
#
$global_step= "crash-me checks";
if ($opt_stage <= 8 && !$opt_no_test && !$opt_no_crash_me)
{
  log_timestamp();
  log_timestamp("START");
  safe_cd("$test_dir/sql-bench");
  log_system("rm -f limits/mysql.cfg");
  safe_system("perl ./crash-me --force --batch-mode $connect_option");
  log_timestamp("DONE ");
}

#
# Run sql-bench Benchmarks
#
$global_step= "benchmarks";
if ($opt_stage <= 9 && !$opt_no_test && !$opt_no_benchmark)
{
  log_timestamp();
  log_timestamp("START");
  safe_cd("$test_dir/sql-bench");
  log_system("rm -f output/*");
  $tmp= $opt_fast_benchmark ? "--fast --user root --small-test" : "";
@@ -506,6 +528,7 @@ if ($opt_stage <= 9 && !$opt_no_test && !$opt_no_benchmark)
  {
    check_system("perl ./run-all-tests --log --suffix=\"_bdb\" --die-on-errors $connect_option $tmp --create-options=\"type=bdb\"","RUN-mysql");
  }
  log_timestamp("DONE ");
}

rm_all($bench_tmpdir);
@@ -690,7 +713,7 @@ sub abort
  my($mail_header_file);
  print LOG "\n$message\n";
  print "$host: $message\n" if ($opt_debug);
  print LOG "Aborting\n";
  log_timestamp("ABORT");
  close LOG;

  if ($opt_user)
@@ -866,6 +889,7 @@ sub kill_all
  if (!open(PS, "$pscmd|"))
  {
    print "Warning: Can't run $pscmd: $!\n";
    log_timestamp("ABORT");
    exit;
  }

@@ -904,8 +928,10 @@ sub killpid
#
sub log_timestamp
{
  my ($message) = @_;
  my @ta=localtime(time());
  print LOG sprintf("%4d-%02d-%02d %02d:%02d:%02d\n",
		    $ta[5]+1900, $ta[4]+1, $ta[3], $ta[2], $ta[1], $ta[0]);
  print LOG sprintf("%4d-%02d-%02d %02d:%02d:%02d  %s %s\n",
		    $ta[5]+1900, $ta[4]+1, $ta[3], $ta[2], $ta[1], $ta[0], 
		    $message, $global_step);

}
+60 −35
Original line number Diff line number Diff line
@@ -875,7 +875,7 @@ static int dbConnect(char *host, char *user,char *passwd)
    cannot reconnect.
  */
  sock->reconnect= 0;
  sprintf(buff, "/*!40100 SET @@SQL_MODE='%s' */",
  my_snprintf(buff, sizeof(buff), "/*!40100 SET @@SQL_MODE='%s' */",
	      compatible_mode_normal_str);
  if (mysql_query_with_error_report(sock, 0, buff))
  {
@@ -1111,7 +1111,8 @@ static uint getTableStructure(char *table, char* db)
  if (verbose)
    fprintf(stderr, "-- Retrieving table structure for table %s...\n", table);

  sprintf(insert_pat,"SET OPTION SQL_QUOTE_SHOW_CREATE=%d",
  my_snprintf(insert_pat, sizeof(insert_pat), 
	      "SET OPTION SQL_QUOTE_SHOW_CREATE=%d",
	      (opt_quoted || opt_keywords));
  if (!create_options)
    strmov(strend(insert_pat), "/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */");
@@ -1131,7 +1132,7 @@ static uint getTableStructure(char *table, char* db)
      char buff[20+FN_REFLEN];
      MYSQL_FIELD *field;

      sprintf(buff,"show create table %s", result_table);
      my_snprintf(buff, sizeof(buff), "show create table %s", result_table);
      if (mysql_query_with_error_report(sock, 0, buff))
      {
        safe_exit(EX_MYSQLERR);
@@ -1177,7 +1178,8 @@ static uint getTableStructure(char *table, char* db)
      check_io(sql_file);
      mysql_free_result(tableRes);
    }
    sprintf(insert_pat,"show fields from %s", result_table);
    my_snprintf(insert_pat, sizeof(insert_pat), "show fields from %s", 
		result_table);
    if (mysql_query_with_error_report(sock, &tableRes, insert_pat))
    {
      if (path)
@@ -1187,11 +1189,12 @@ static uint getTableStructure(char *table, char* db)
    }

    if (cFlag)
      sprintf(insert_pat, "INSERT %sINTO %s (", delayed, opt_quoted_table);
      my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s (", 
		  delayed, opt_quoted_table);
    else
    {
      sprintf(insert_pat, "INSERT %sINTO %s VALUES ", delayed,
	      opt_quoted_table);
      my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s VALUES ", 
		  delayed, opt_quoted_table);
      if (!extended_insert)
        strcat(insert_pat,"(");
    }
@@ -1218,7 +1221,8 @@ static uint getTableStructure(char *table, char* db)
              "%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n",
              my_progname, mysql_error(sock));

    sprintf(insert_pat,"show fields from %s", result_table);
    my_snprintf(insert_pat, sizeof(insert_pat), "show fields from %s", 
		result_table);
    if (mysql_query_with_error_report(sock, &tableRes, insert_pat))
    {
      safe_exit(EX_MYSQLERR);
@@ -1253,10 +1257,12 @@ static uint getTableStructure(char *table, char* db)
      check_io(sql_file);
    }
    if (cFlag)
      sprintf(insert_pat, "INSERT %sINTO %s (", delayed, result_table);
      my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s (", 
		  delayed, result_table);
    else
    {
      sprintf(insert_pat, "INSERT %sINTO %s VALUES ", delayed, result_table);
      my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s VALUES ",
		  delayed, result_table);
      if (!extended_insert)
        strcat(insert_pat,"(");
    }
@@ -1313,7 +1319,7 @@ static uint getTableStructure(char *table, char* db)
      /* Make an sql-file, if path was given iow. option -T was given */
      char buff[20+FN_REFLEN];
      uint keynr,primary_key;
      sprintf(buff,"show keys from %s", result_table);
      my_snprintf(buff, sizeof(buff), "show keys from %s", result_table);
      if (mysql_query_with_error_report(sock, &tableRes, buff))
      {
        if (mysql_errno(sock) == ER_WRONG_OBJECT)
@@ -1391,8 +1397,12 @@ static uint getTableStructure(char *table, char* db)
      if (create_options)
      {
	char show_name_buff[FN_REFLEN];
        sprintf(buff,"show table status like %s",

	/* Check memory for quote_for_like() */
	DBUG_ASSERT(2*sizeof(table) < sizeof(show_name_buff));
        my_snprintf(buff, sizeof(buff), "show table status like %s",
		    quote_for_like(table, show_name_buff));

        if (mysql_query_with_error_report(sock, &tableRes, buff))
        {
	  if (mysql_errno(sock) != ER_PARSE_ERROR)
@@ -1553,7 +1563,8 @@ static void dumpTable(uint numFields, char *table)
    my_delete(filename, MYF(0)); /* 'INTO OUTFILE' doesn't work, if
				    filename wasn't deleted */
    to_unix_path(filename);
    sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * INTO OUTFILE '%s'",
    my_snprintf(query, QUERY_LENGTH, 
		"SELECT /*!40001 SQL_NO_CACHE */ * INTO OUTFILE '%s'",
		filename);
    end= strend(query);

@@ -1566,7 +1577,7 @@ static void dumpTable(uint numFields, char *table)
    end= add_load_option(end, lines_terminated, " LINES TERMINATED BY");
    *end= '\0';

    sprintf(buff," FROM %s", result_table);
    my_snprintf(buff, sizeof(buff), " FROM %s", result_table);
    end= strmov(end,buff);
    if (where || order_by)
    {
@@ -1594,7 +1605,8 @@ static void dumpTable(uint numFields, char *table)
	      result_table);
      check_io(md_result_file);
    }
    sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * FROM %s",
    my_snprintf(query, QUERY_LENGTH,
		"SELECT /*!40001 SQL_NO_CACHE */ * FROM %s",
		result_table);
    if (where || order_by)
    {
@@ -1693,7 +1705,8 @@ static void dumpTable(uint numFields, char *table)
        int is_blob;
	if (!(field = mysql_fetch_field(res)))
	{
	  sprintf(query,"%s: Not enough fields from table %s! Aborting.\n",
	  my_snprintf(query, QUERY_LENGTH,
		      "%s: Not enough fields from table %s! Aborting.\n",
		      my_progname, result_table);
	  fputs(query,stderr);
	  error= EX_CONSCHECK;
@@ -1896,7 +1909,8 @@ static void dumpTable(uint numFields, char *table)
    check_io(md_result_file);
    if (mysql_errno(sock))
    {
      sprintf(query,"%s: Error %d: %s when dumping table %s at row: %ld\n",
      my_snprintf(query, QUERY_LENGTH,
		  "%s: Error %d: %s when dumping table %s at row: %ld\n",
		  my_progname,
		  mysql_errno(sock),
		  mysql_error(sock),
@@ -2045,7 +2059,8 @@ static int init_dumping(char *database)
        MYSQL_ROW row;
        MYSQL_RES *dbinfo;

        sprintf(qbuf,"SHOW CREATE DATABASE IF NOT EXISTS %s",
        my_snprintf(qbuf, sizeof(qbuf), 
		    "SHOW CREATE DATABASE IF NOT EXISTS %s",
		    qdatabase);

        if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock)))
@@ -2141,6 +2156,7 @@ static int dump_all_tables_in_db(char *database)
  return 0;
} /* dump_all_tables_in_db */


/*
   dump structure of views of database

@@ -2195,6 +2211,7 @@ static my_bool dump_all_views_in_db(char *database)
  return 0;
} /* dump_all_tables_in_db */


/*
  get_actual_table_name -- executes a SHOW TABLES LIKE '%s' to get the actual 
  table name from the server for the table name given on the command line.  
@@ -2211,10 +2228,15 @@ static void get_actual_table_name(const char *old_table_name,
{
  MYSQL_RES  *tableRes;
  MYSQL_ROW  row;
  char query[ NAME_LEN + 50 ];
  char query[50 + 2*NAME_LEN];
  char show_name_buff[FN_REFLEN];
  DBUG_ENTER("get_actual_table_name");

  sprintf( query, "SHOW TABLES LIKE '%s'", old_table_name);
  /* Check memory for quote_for_like() */
  DBUG_ASSERT(2*sizeof(old_table_name) < sizeof(show_name_buff));
  my_snprintf(query, sizeof(query), "SHOW TABLES LIKE %s", 
	      quote_for_like(old_table_name, show_name_buff));

  if (mysql_query_with_error_report(sock, 0, query))
  {
    safe_exit(EX_MYSQLERR);
@@ -2464,7 +2486,9 @@ static const char *check_if_ignore_table(const char *table_name)
  MYSQL_ROW row;
  const char *result= 0;

  sprintf(buff,"show table status like %s",
  /* Check memory for quote_for_like() */
  DBUG_ASSERT(2*sizeof(table_name) < sizeof(show_name_buff));
  my_snprintf(buff, sizeof(buff), "show table status like %s",
	      quote_for_like(table_name, show_name_buff));
  if (mysql_query_with_error_report(sock, &res, buff))
  {
@@ -2523,7 +2547,8 @@ static char *primary_key_fields(const char *table_name)
  uint result_length = 0;
  char *result = 0;

  sprintf(show_keys_buff, "SHOW KEYS FROM %s", table_name);
  my_snprintf(show_keys_buff, sizeof(show_keys_buff), 
	      "SHOW KEYS FROM %s", table_name);
  if (mysql_query(sock, show_keys_buff) ||
      !(res = mysql_store_result(sock)))
  {
+1 −0
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
    share->keys= keys;
    share->max_key_length= max_length;
    share->changed= 0;
    share->auto_key= create_info->auto_key;
    share->auto_key_type= create_info->auto_key_type;
    share->auto_increment= create_info->auto_increment;
    /* Must be allocated separately for rename to work */
+2 −0
Original line number Diff line number Diff line
@@ -181,8 +181,10 @@ typedef struct st_heap_info
  LIST open_list;
} HP_INFO;


typedef struct st_heap_create_info
{
  uint auto_key;                        /* keynr [1 - maxkey] for auto key */
  uint auto_key_type;
  ulong max_table_size;
  ulonglong auto_increment;
+3 −3
Original line number Diff line number Diff line
@@ -432,10 +432,10 @@ while test $# -gt 0; do
      TMP=`$ECHO "$1" | $SED -e "s;--valgrind-options=;;"`
      VALGRIND="$VALGRIND $TMP"
      ;;
    --skip-ndbcluster)
    --skip-ndbcluster | --skip-ndb)
      USE_NDBCLUSTER=""
      EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $1"
      EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT $1"
      EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-ndbcluster"
      EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-ndbcluster"
      ;;
    --skip-*)
      EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $1"
Loading