1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Creation of mysql-trunk = {summit + "Innodb plugin replacing the builtin"}:

bzr branch mysql-5.1-performance-version mysql-trunk # Summit
cd mysql-trunk
bzr merge mysql-5.1-innodb_plugin # which is 5.1 + Innodb plugin 
bzr rm innobase # remove the builtin
Next step: build, test fixes.
This commit is contained in:
Guilhem Bichot
2009-08-04 13:25:19 +02:00
1102 changed files with 135685 additions and 71431 deletions

View File

@ -23,18 +23,30 @@ $opt_help=$opt_version=$opt_verbose=$opt_force=0;
$opt_user=$opt_database=$opt_password=undef;
$opt_host="localhost";
$opt_socket="";
$opt_type="MYISAM";
$opt_engine="MYISAM";
$opt_port=0;
$exit_status=0;
GetOptions("force","help","host=s","password=s","user=s","type=s","verbose","version","socket=s", "port=i") ||
usage(0);
GetOptions(
"e|engine|type=s" => \$opt_type,
"f|force" => \$opt_force,
"help|?" => \$opt_help,
"h|host=s" => \$opt_host,
"p|password=s" => \$opt_password,
"u|user=s" => \$opt_user,
"v|verbose" => \$opt_verbose,
"V|version" => \$opt_version,
"S|socket=s" => \$opt_socket,
"P|port=i" => \$opt_port
) || usage(0);
usage($opt_version) if ($#ARGV < 0 || $opt_help || $opt_version);
$opt_database=shift(@ARGV);
if (uc($opt_type) eq "HEAP")
if (grep { /^$opt_engine$/i } qw(HEAP MEMORY BLACKHOLE))
{
print "Converting to type HEAP would delete your tables; aborting\n";
print "Converting to '$opt_engine' would delete your data; aborting\n";
exit(1);
}
@ -54,21 +66,29 @@ $dbh = DBI->connect("DBI:mysql:$opt_database:${opt_host}$connect_opt",
{ PrintError => 0})
|| die "Can't connect to database $opt_database: $DBI::errstr\n";
if ($#ARGV < 0)
my @tables;
push(@ARGV, "%") if(!@ARGV);
foreach $pattern (@ARGV)
{
# Fetch all table names from the database
my ($sth,$row);
$sth=$dbh->prepare("show tables");
$sth->execute || die "Can't get tables from $opt_database; $DBI::errstr\n";
$sth=$dbh->prepare("SHOW TABLES LIKE ?");
$rv= $sth->execute($pattern);
if(!int($rv))
{
warn "Can't get tables matching '$pattern' from $opt_database; $DBI::errstr\n";
exit(1) unless $opt_force;
}
while (($row = $sth->fetchrow_arrayref))
{
push(@ARGV,$row->[0]);
push(@tables, $row->[0]);
}
$sth->finish;
}
print "Converting tables:\n" if ($opt_verbose);
foreach $table (@ARGV)
foreach $table (@tables)
{
my ($sth,$row);
@ -76,14 +96,15 @@ foreach $table (@ARGV)
$sth=$dbh->prepare("show table status like '$table'");
if ($sth->execute && ($row = $sth->fetchrow_arrayref))
{
if (uc($row->[1]) eq uc($opt_type))
if (uc($row->[1]) eq uc($opt_engine))
{
print "$table is already of type $opt_type; Ignored\n";
print "$table already uses the '$opt_engine' engine; Ignored\n";
next;
}
}
print "converting $table\n" if ($opt_verbose);
if (!$dbh->do("ALTER TABLE $table ENGINE=$opt_type"))
$table=~ s/`/``/g;
if (!$dbh->do("ALTER TABLE `$table` ENGINE=$opt_engine"))
{
print STDERR "Can't convert $table: Error $DBI::errstr\n";
exit(1) if (!$opt_force);
@ -103,43 +124,43 @@ sub usage
print <<EOF;
Conversion of a MySQL tables to other table types.
Conversion of a MySQL tables to other storage engines
Usage: $0 database [tables]
Usage: $0 database [table[ table ...]]
If no tables has been specifed, all tables in the database will be converted.
You can also use wildcards, ie "my%"
The following options are available:
--force
-f, --force
Continue even if there is some error.
--help or --Information
-?, --help
Shows this help
--host='host name' (Default $opt_host)
Host name where the database server is located.
-e, --engine=ENGINE
Converts tables to the given storage engine (Default: $opt_engine)
--password='password'
-h, --host=HOST
Host name where the database server is located. (Default: $opt_host)
-p, --password=PASSWORD
Password for the current user.
--port=port
-P, --port=PORT
TCP/IP port to connect to if host is not "localhost".
--socket='/path/to/socket'
-S, --socket=SOCKET
Socket to connect with.
--ENGINE='table-type'
Converts tables to the given table type (Default: $opt_type)
MySQL 3.23 supports at least the BDB, ISAM and MYISAM types.
--user='user_name'
-u, --user=USER
User name to log into the SQL server.
--verbose
-v, --verbose
This is a test specific option that is only used when debugging a test.
Print more information about what is going on.
--version
-V, --version
Shows the version of this program.
EOF
exit(1);

View File

@ -1,4 +1,4 @@
#!@PERL@
#!/usr/bin/perl
# Copyright (C) 2000, 2004 MySQL AB
#
# This program is free software; you can redistribute it and/or modify

View File

@ -1,4 +1,4 @@
#!@PERL@
#!/usr/bin/perl
# This is a utility for MySQL. It is not needed by any standard part
# of MySQL.

View File

@ -1,4 +1,4 @@
#!@PERL@
#!/usr/bin/perl
## Emacs, this is -*- perl -*- mode? :-)
##
## Permission setter for MySQL

View File

@ -1,4 +1,4 @@
#!@PERL@
#!/usr/bin/perl
# Copyright (C) 2000-2002, 2004 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
@ -27,8 +27,8 @@ $opt_f= 0;
$opt_t= 0;
$opt_a = "";
$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4" || $^O eq 'darwin';
$LINUX = $^O eq 'linux';
$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4";
$LINUX = $^O eq 'linux' || $^O eq 'darwin';
$pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef";
open(TTYIN, "</dev/tty") || die "can't read /dev/tty: $!";

View File

@ -1,4 +1,4 @@
#!@PERL@
#!/usr/bin/perl
# ****************************
package MySQLaccess;
#use strict;

View File

@ -1,7 +1,7 @@
#!/usr/bin/perl
use Getopt::Long;
use POSIX qw(strftime);
use POSIX qw(strftime getcwd);
$|=1;
$VER="2.16";
@ -295,6 +295,7 @@ sub start_mysqlds()
{
@options = defaults_for_group($groups[$i]);
$basedir_found= 0; # The default
$mysqld_found= 1; # The default
$mysqld_found= 0 if (!length($mysqld));
$com= "$mysqld";
@ -310,17 +311,25 @@ sub start_mysqlds()
$com= $options[$j];
$mysqld_found= 1;
}
elsif ("--basedir=" eq substr($options[$j], 0, 10))
{
$basedir= $options[$j];
$basedir =~ s/^--basedir=//;
$basedir_found= 1;
$options[$j]= quote_shell_word($options[$j]);
$tmp.= " $options[$j]";
}
else
{
$options[$j]= quote_shell_word($options[$j]);
$tmp.= " $options[$j]";
}
}
if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent)
if ($opt_verbose && $com =~ m/\/(safe_mysqld|mysqld_safe)$/ && !$info_sent)
{
print "WARNING: safe_mysqld is being used to start mysqld. In this case you ";
print "WARNING: $1 is being used to start mysqld. In this case you ";
print "may need to pass\n\"ledir=...\" under groups [mysqldN] to ";
print "safe_mysqld in order to find the actual mysqld binary.\n";
print "$1 in order to find the actual mysqld binary.\n";
print "ledir (library executable directory) should be the path to the ";
print "wanted mysqld binary.\n\n";
$info_sent= 1;
@ -337,7 +346,16 @@ sub start_mysqlds()
print "group [$groups[$i]] separately.\n";
exit(1);
}
if ($basedir_found)
{
$curdir=getcwd();
chdir($basedir) or die "Can't change to datadir $basedir";
}
system($com);
if ($basedir_found)
{
chdir($curdir) or die "Can't change back to original dir $curdir";
}
}
if (!$i && !$opt_no_log)
{
@ -670,9 +688,9 @@ language = @datadir@/mysql/english
user = unix_user1
[mysqld3]
mysqld = /path/to/safe_mysqld/safe_mysqld
mysqld = /path/to/mysqld_safe
ledir = /path/to/mysqld-binary/
mysqladmin = /path/to/mysqladmin/mysqladmin
mysqladmin = /path/to/mysqladmin
socket = /tmp/mysql.sock3
port = 3308
pid-file = @localstatedir@3/hostname.pid3

View File

@ -67,7 +67,7 @@ my_which ()
ret=0
for file
do
for dir in "$PATH"
for dir in $PATH
do
if [ -f "$dir/$file" ]
then
@ -391,8 +391,8 @@ then
fi
# Change the err log to the right user, if it is in use
if [ $want_syslog -eq 0 ]; then
touch $err_log
chown $user $err_log
touch "$err_log"
chown $user "$err_log"
fi
if test -n "$open_files"
then
@ -509,9 +509,9 @@ fi
#
# If there exists an old pid file, check if the daemon is already running
# Note: The switches to 'ps' may depend on your operating system
if test -f $pid_file
if test -f "$pid_file"
then
PID=`cat $pid_file`
PID=`cat "$pid_file"`
if @CHECK_PID@
then
if @FIND_PROC@
@ -520,8 +520,8 @@ then
exit 1
fi
fi
rm -f $pid_file
if test -f $pid_file
rm -f "$pid_file"
if test -f "$pid_file"
then
log_error "Fatal error: Can't remove the pid file:
$pid_file
@ -563,11 +563,11 @@ test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null"
log_notice "Starting $MYSQLD daemon with databases from $DATADIR"
while true
do
rm -f $safe_mysql_unix_port $pid_file # Some extra safety
rm -f $safe_mysql_unix_port "$pid_file" # Some extra safety
eval_log_error "$cmd"
if test ! -f $pid_file # This is removed if normal shutdown
if test ! -f "$pid_file" # This is removed if normal shutdown
then
break
fi

View File

@ -20,7 +20,7 @@ GetOptions(\%opt,
'v|verbose+',# verbose
'help+', # write usage info
'd|debug+', # debug
's=s', # what to sort by (t, at, l, al, r, ar etc)
's=s', # what to sort by (al, at, ar, c, t, l, r)
'r!', # reverse the sort order (largest last instead of first)
't=i', # just show the top n queries
'a!', # don't abstract all numbers to N and strings to 'S'
@ -163,7 +163,14 @@ Parse and summarize the MySQL slow query log. Options are
-v verbose
-d debug
-s ORDER what to sort by (t, at, l, al, r, ar etc), 'at' is default
-s ORDER what to sort by (al, at, ar, c, l, r, t), 'at' is default
al: average lock time
ar: average rows sent
at: average query time
c: count
l: lock time
r: rows sent
t: query time
-r reverse the sort order (largest last instead of first)
-t NUM just show the top n queries
-a don't abstract all numbers to N and strings to 'S'