Commit 0652902a authored by monty@work.mysql.com's avatar monty@work.mysql.com
Browse files

merge

parents 23c049e3 a2e9e16f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -314,11 +314,15 @@ sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686
sql-bench/bench-count-distinct
sql-bench/bench-init.pl
sql-bench/compare-results
sql-bench/compare-results-all
sql-bench/copy-db
sql-bench/crash-me
sql-bench/gif/*
sql-bench/graph-compare-results
sql-bench/output/*
sql-bench/run-all-tests
sql-bench/server-cfg
sql-bench/template.html
sql-bench/test-ATIS
sql-bench/test-alter-table
sql-bench/test-big-tables
+18 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
#shift
TO=dev-public@mysql.com
FROM=$USER@mysql.com
INTERNALS=internals@lists.mysql.com
LIMIT=10000

if [ "$REAL_EMAIL" = "" ]
@@ -24,6 +25,23 @@ From: $FROM
To: $TO
Subject: bk commit - 4.0 tree

EOF
  bk changes -v -r+
  bk cset -r+ -d
 ) | head -n $LIMIT | /usr/sbin/sendmail -t
 echo "Notifying internals list at $INTERNALS"
 (
   cat <<EOF
List-ID: <bk.mysql>
From: $FROM
To: $INTERNALS
Subject: bk commit into 3.23 tree

Below is the list of changes that have just been pushed into main
3.23. repository. For information on how to access the repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
>>>>>>> BitKeeper/tmp/post-commit_sasha@1.8.1.3

EOF
  bk changes -v -r+
  bk cset -r+ -d
+14 −7
Original line number Diff line number Diff line
@@ -4,10 +4,10 @@ use Getopt::Long;
$opt_distribution=$opt_user=$opt_result=$opt_config_options=$opt_config_env="";
$opt_dbd_options=$opt_perl_options=$opt_suffix="";
$opt_tmp=$version_suffix="";
$opt_help=$opt_Information=$opt_no_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$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_no_mysqltest=$opt_use_old_distribution=0;
$opt_help=$opt_Information=$opt_no_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$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_no_mysqltest=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=0;
$opt_innodb=$opt_bdb=0;

GetOptions("Information","help","distribution=s","user=s","result=s","no-delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution") || usage();
GetOptions("Information","help","distribution=s","user=s","result=s","no-delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip") || usage();

usage() if ($opt_help || $opt_Information);
usage() if (!$opt_distribution);
@@ -19,7 +19,7 @@ if ($opt_innodb || $opt_bdb)

chomp($host=`hostname`);
$full_host_name=$host;
print "$host: Compiling MySQL$version_suffix at $host$suffix, stage: $opt_stage\n"  if ($opt_debug);
info("Compiling MySQL$version_suffix at $host$suffix, stage: $opt_stage\n");
$connect_option= ($opt_tcpip ? "--host=$host" : "");
$host =~ /^([^.-]*)/;
$host=$1 . $opt_suffix;
@@ -119,7 +119,10 @@ if ($opt_stage <= 1)
  {
    $opt_config_options.=" --with-client-ldflags=-all-static";
  }
  if (!$opt_enable_shared)
  {
    $opt_config_options.= " --disable-shared"; # Default for binary versions
  }
  if ($opt_bdb)
  {
    $opt_config_options.= " --with-berkeley-db"
@@ -146,10 +149,13 @@ if ($opt_stage <= 2)
#
if ($opt_stage <= 3)
{
  my ($flags);
  log_system("rm -fr mysql-3* mysql-4* $pwd/$host/*.tar.gz");
  log_system("nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz | cat");
  log_system("strip sql/mysqld extra/comp_err client/mysql sql/mysqld client/mysqlshow extra/replace isam/isamchk client/mysqladmin client/mysqldump extra/perror");
  check_system("scripts/make_binary_distribution $opt_tmp $opt_suffix",".tar.gz created");

  $flags="";
  $flags.="--no-strip" if ($opt_no_strip);
  check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created");
  safe_system("mv mysql*.tar.gz $pwd/$host");
  safe_system("cp client/mysqladmin $pwd/$host/bin");
  safe_system("$make clean") if ($opt_with_small_disk);
@@ -174,6 +180,7 @@ if ($opt_stage <= 4 && !$opt_no_test)
$tar_file =~ /(mysql-[^\/]*)\.tar/;
$ver=$1;
$test_dir="$pwd/$host/test/$ver";
$ENV{"LD_LIBRARY_PATH"}= "$testdir/lib:" . $ENV{"LD_LIBRARY_PATH"};

if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
{
@@ -237,7 +244,7 @@ if ($opt_stage <= 7 && $opt_perl_files && !$opt_no_perl && !$opt_no_test)
}


if ($opt_stage <= 8 && !$opt_no_test)
if ($opt_stage <= 8 && !$opt_no_test && !$opt_no_crash_me)
{
  safe_cd("$test_dir/sql-bench");
  log_system("rm -f limits/mysql.cfg");
+815 −184

File changed.

Preview size limit exceeded, changes collapsed.

+159 −12
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

/* Show databases, tables or columns */

#define SHOW_VERSION "8.2"
#define SHOW_VERSION "8.3"

#include <global.h>
#include <my_sys.h>
@@ -30,6 +30,7 @@

static my_string host=0,opt_password=0,user=0;
static my_bool opt_show_keys=0,opt_compress=0,opt_status=0;
static uint opt_verbose=0;

static void get_options(int *argc,char ***argv);
static uint opt_mysql_port=0;
@@ -140,6 +141,7 @@ static struct option long_options[] =
#ifndef DONT_ALLOW_USER_CHANGE
  {"user",	required_argument, 0, 'u'},
#endif
  {"verbose",	no_argument,	   0, 'v'},
  {"version",	no_argument,	   0, 'V'},
  {0, 0, 0, 0}
};
@@ -181,6 +183,8 @@ static void usage(void)
  -u, --user=#		user for login if not current user\n");
#endif
  printf("\
  -v, --verbose		more verbose output; You can use this multiple times\n\
                        to get even more verbose output.\n\
  -V, --version		output version information and exit\n");

  puts("\n\
@@ -200,7 +204,7 @@ get_options(int *argc,char ***argv)
  int c,option_index;
  my_bool tty_password=0;

  while ((c=getopt_long(*argc,*argv,"c:h:p::u:#::P:S:Ck?VWi",long_options,
  while ((c=getopt_long(*argc,*argv,"c:h:p::u:#::P:S:Ck?vVWi",long_options,
			&option_index)) != EOF)
  {
    switch(c) {
@@ -210,6 +214,9 @@ get_options(int *argc,char ***argv)
    case 'c':
      charsets_dir= optarg;
      break;
    case 'v':
      opt_verbose++;
      break;
    case 'h':
      host = optarg;
      break;
@@ -277,10 +284,13 @@ static int
list_dbs(MYSQL *mysql,const char *wild)
{
  const char *header;
  uint length;
  uint length, counter = 0;
  ulong rowcount = 0L;
  char tables[NAME_LEN+1], rows[NAME_LEN+1];
  char query[255];
  MYSQL_FIELD *field;
  MYSQL_RES *result;
  MYSQL_ROW row;
  MYSQL_ROW row, trow, rrow;

  if (!(result=mysql_list_dbs(mysql,wild)))
  {
@@ -297,10 +307,79 @@ list_dbs(MYSQL *mysql,const char *wild)
  if (length < field->max_length)
    length=field->max_length;

  if (!opt_verbose)
    print_header(header,length,NullS);
  else if (opt_verbose == 1)
    print_header(header,length,"Tables",6,NullS);
  else
    print_header(header,length,"Tables",6,"Total Rows",12,NullS);

  while ((row = mysql_fetch_row(result)))
  {
    counter++;

    if (opt_verbose)
    {
      /*
       *  Original code by MG16373;  Slightly modified by Monty.
       *  Print now the count of tables and rows for each database.
       */

      if (!(mysql_select_db(mysql,row[0])))
      {
	MYSQL_RES *tresult = mysql_list_tables(mysql,(char*)NULL);
	if (mysql_affected_rows(mysql) > 0)
	{
	  sprintf(tables,"%6lu",(ulong) mysql_affected_rows(mysql));
	  rowcount = 0;
	  if (opt_verbose > 1)
	  {
	    while ((trow = mysql_fetch_row(tresult)))
	    {
	      sprintf(query,"SELECT COUNT(*) FROM `%s`",trow[0]);
	      if (!(mysql_query(mysql,query)))
	      {
		MYSQL_RES *rresult;
		if ((rresult = mysql_store_result(mysql)))
		{
		  rrow = mysql_fetch_row(rresult);
		  rowcount += (ulong) strtoull(rrow[0], (char**) 0, 10);
		  mysql_free_result(rresult);
		}
	      }
	    }
	    sprintf(rows,"%12lu",rowcount);
	  }
	}
	else
	{
	  sprintf(tables,"%6d",0);
	  sprintf(rows,"%12d",0);
	}
	mysql_free_result(tresult);
      }
      else
      {
	strmov(tables,"N/A");
	strmov(rows,"N/A");
      }
    }

    if (!opt_verbose)
      print_row(row[0],length,0);
  print_trailer(length,0);
    else if (opt_verbose == 1)
      print_row(row[0],length,tables,6,NullS);
    else
      print_row(row[0],length,tables,6,rows,12,NullS);
  }

  print_trailer(length,
		(opt_verbose > 0 ? 6 : 0),
		(opt_verbose > 1 ? 12 :0),
		0);

  if (counter && opt_verbose)
    printf("%u row%s in set.\n",counter,(counter > 1) ? "s" : "");
  mysql_free_result(result);
  return 0;
}
@@ -310,10 +389,11 @@ static int
list_tables(MYSQL *mysql,const char *db,const char *table)
{
  const char *header;
  uint head_length;
  uint head_length, counter = 0;
  char query[255], rows[64], fields[16];
  MYSQL_FIELD *field;
  MYSQL_RES *result;
  MYSQL_ROW row;
  MYSQL_ROW row, rrow;

  if (mysql_select_db(mysql,db))
  {
@@ -338,14 +418,81 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
  if (head_length < field->max_length)
    head_length=field->max_length;

  if (!opt_verbose)
    print_header(header,head_length,NullS);
  else if (opt_verbose == 1)
    print_header(header,head_length,"Columns",8,NullS);
  else
    print_header(header,head_length,"Columns",8, "Total Rows",10,NullS);

  while ((row = mysql_fetch_row(result)))
    print_row(row[0],head_length,0);
  print_trailer(head_length,0);
  {
    /*
     *   Modified by MG16373
     *   Print now the count of rows for each table.
     */
    counter++;
    if (opt_verbose > 0)
    {
      if (!(mysql_select_db(mysql,db)))
      {
	MYSQL_RES *rresult = mysql_list_fields(mysql,row[0],NULL);
	ulong rowcount=0L;
	if (!rresult)
	{
	  strmov(fields,"N/A");
	  strmov(rows,"N/A");
	}
	else
	{
	  sprintf(fields,"%8u",(uint) mysql_num_fields(rresult));
	  mysql_free_result(rresult);

	  if (opt_verbose > 1)
	  {
	    sprintf(query,"SELECT COUNT(*) FROM `%s`",row[0]);
	    if (!(mysql_query(mysql,query)))
	    {
	      if ((rresult = mysql_store_result(mysql)))
	      {
		rrow = mysql_fetch_row(rresult);
		rowcount += (unsigned long) strtoull(rrow[0], (char**) 0, 10);
		mysql_free_result(rresult);
	      }
	      sprintf(rows,"%10lu",rowcount);
	    }
	    else
	      sprintf(rows,"%10d",0);
	  }
	}
      }
      else
      {
	strmov(fields,"N/A");
	strmov(rows,"N/A");
      }
    }
    if (!opt_verbose)
      print_row(row[0],head_length,NullS);
    else if (opt_verbose == 1)
      print_row(row[0],head_length, fields,8, NullS);
    else 
      print_row(row[0],head_length, fields,8, rows,10, NullS);
  }

  print_trailer(head_length,
		(opt_verbose > 0 ? 8 : 0),
		(opt_verbose > 1 ? 10 :0),
		0);

  if (counter && opt_verbose)
    printf("%u row%s in set.\n\n",counter,(counter > 1) ? "s" : "");

  mysql_free_result(result);
  return 0;
}


static int
list_table_status(MYSQL *mysql,const char *db,const char *wild)
{
Loading