Commit 126e9b55 authored by unknown's avatar unknown

Portability & build fixes


Build-tools/Do-compile:
  Fix for new mysqlmanager
Build-tools/Do-rpm:
  Make build safer
Docs/manual.texi:
  Cleanup limitations section
tools/mysqlmanager.c:
  Cleanup used include files
parent fe576bde
...@@ -19,7 +19,7 @@ if ($opt_innodb || $opt_bdb) ...@@ -19,7 +19,7 @@ if ($opt_innodb || $opt_bdb)
chomp($host=`hostname`); chomp($host=`hostname`);
$full_host_name=$host; $full_host_name=$host;
info("Compiling MySQL$version_suffix at $host$suffix, stage: $opt_stage\n"); info("Compiling MySQL$version_suffix at $host, stage: $opt_stage\n");
$connect_option= ($opt_tcpip ? "--host=$host" : ""); $connect_option= ($opt_tcpip ? "--host=$host" : "");
$host =~ /^([^.-]*)/; $host =~ /^([^.-]*)/;
$host=$1 . $opt_suffix; $host=$1 . $opt_suffix;
...@@ -65,10 +65,11 @@ $sendmail=find("/usr/lib/sendmail","/usr/sbin/sendmail"); ...@@ -65,10 +65,11 @@ $sendmail=find("/usr/lib/sendmail","/usr/sbin/sendmail");
$sur= $opt_sur ? "/my/local/bin/sur" : ""; $sur= $opt_sur ? "/my/local/bin/sur" : "";
delete $ENV{'MYSQL_PWD'}; # Reset possibly password delete $ENV{'MYSQL_PWD'}; # Reset possibly password
delete $ENV{'MY_BASEDIR_VERSION'}; delete $ENV{'MY_BASEDIR_VERSION'};
$ENV{'MYSQL_TCP_PORT'}= $mysql_tcp_port= 3334 + $opt_build_thread; $ENV{'MYSQL_TCP_PORT'}= $mysql_tcp_port= 3334 + $opt_build_thread*2;
$ENV{'MYSQL_UNIX_PORT'}=$mysql_unix_port="$opt_tmp/mysql$opt_suffix.build"; $ENV{'MYSQL_UNIX_PORT'}=$mysql_unix_port="$opt_tmp/mysql$opt_suffix.build";
$ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl"; $ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl";
$slave_port=$mysql_tcp_port+16; $slave_port=$mysql_tcp_port+16;
$manager_port=$mysql_tcp_port+1;
if (-x "$host/bin/mysqladmin") if (-x "$host/bin/mysqladmin")
{ {
...@@ -78,6 +79,7 @@ if (-x "$host/bin/mysqladmin") ...@@ -78,6 +79,7 @@ if (-x "$host/bin/mysqladmin")
log_system("$host/bin/mysqladmin --no-defaults -u root -P 9306 -h $host -s shutdown"); log_system("$host/bin/mysqladmin --no-defaults -u root -P 9306 -h $host -s shutdown");
log_system("$host/bin/mysqladmin --no-defaults -u root -P 9307 -h $host -s shutdown"); log_system("$host/bin/mysqladmin --no-defaults -u root -P 9307 -h $host -s shutdown");
} }
kill_all("mysqlmanager");
if ($opt_stage == 0) if ($opt_stage == 0)
{ {
...@@ -110,7 +112,7 @@ if ($opt_stage == 0 && ! $opt_use_old_distribution) ...@@ -110,7 +112,7 @@ if ($opt_stage == 0 && ! $opt_use_old_distribution)
# Fix file times; This is needed because the time for files may be # Fix file times; This is needed because the time for files may be
# in the future # in the future
system("touch timestamp; find $var -newer timestamp -print | xargs touch; rm -f timestamp"); system("touch timestamp; find . -newer timestamp -print | xargs touch; rm -f timestamp");
sleep(2); sleep(2);
# Ensure that files we don't want to rebuild are newer than other files # Ensure that files we don't want to rebuild are newer than other files
foreach $name ("configure", foreach $name ("configure",
...@@ -207,13 +209,13 @@ if ($opt_stage <= 4 && !$opt_no_test) ...@@ -207,13 +209,13 @@ if ($opt_stage <= 4 && !$opt_no_test)
$tar_file =~ /(mysql-[^\/]*)\.tar/; $tar_file =~ /(mysql-[^\/]*)\.tar/;
$ver=$1; $ver=$1;
$test_dir="$pwd/$host/test/$ver"; $test_dir="$pwd/$host/test/$ver";
$ENV{"LD_LIBRARY_PATH"}= "$testdir/lib:" . $ENV{"LD_LIBRARY_PATH"}; $ENV{"LD_LIBRARY_PATH"}= "$test_dir/lib:" . $ENV{"LD_LIBRARY_PATH"};
if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
{ {
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir); system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
safe_cd("${test_dir}/mysql-test"); safe_cd("${test_dir}/mysql-test");
check_system("./mysql-test-run --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --sleep=10", "tests were successful"); check_system("./mysql-test-run --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --sleep=10", "tests were successful");
} }
# Start the server if we are going to run any of the benchmarks # Start the server if we are going to run any of the benchmarks
...@@ -235,7 +237,7 @@ if (!$opt_no_test) ...@@ -235,7 +237,7 @@ if (!$opt_no_test)
{ {
$extra.=" --innodb_data_file_path=ibdata1:100M"; $extra.=" --innodb_data_file_path=ibdata1:100M";
} }
safe_system("./bin/mysqld --no-defaults --basedir . --datadir ./data --skip-l\ocking $extra >> $log 2>&1 &"); safe_system("./bin/mysqld --no-defaults --basedir . --datadir ./data --skip-locking $extra >> $log 2>&1 &");
sleep(2); sleep(2);
} }
...@@ -315,7 +317,7 @@ exit 0; ...@@ -315,7 +317,7 @@ exit 0;
sub usage sub usage
{ {
print <<EOF; print <<EOF;
$0 version 1.2 $0 version 1.3
$0 takes the following options: $0 takes the following options:
...@@ -329,7 +331,7 @@ Compile with support for Innodb tables ...@@ -329,7 +331,7 @@ Compile with support for Innodb tables
Compile with support for Berkeley DB tables Compile with support for Berkeley DB tables
--user 'user_name' --user 'user_name'
Mail 'user_name'\@analytikerna.se if something went wrong. Mail 'user_name'\@mysql.com if something went wrong.
If user is empty then no mail is sent. If user is empty then no mail is sent.
--distribution 'distribution_file' --distribution 'distribution_file'
...@@ -528,3 +530,43 @@ sub rm_all ...@@ -528,3 +530,43 @@ sub rm_all
} }
} }
} }
sub kill_all
{
my ($pattern) = @_;
my ($USER,$BSD,$LINUX,$pscmd, $user, $pid);
$user=$ENV{'USER'};
$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4";
$LINUX = $^O eq 'linux';
$pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef";
open(PS, "$pscmd|") || die "can't run $pscmd: $!";
# Catch any errors with eval. A bad pattern, for instance.
process:
while ($cand = <PS>)
{
chop($cand);
($pid_user, $pid) = split(' ', $cand);
next if $pid == $$;
next process if (! ($cand =~ $pattern) || $pid_user ne $user)
&killpid($pid);
}
}
sub killpid
{
local($pid) = @_;
kill 15, $pid;
for (1..5)
{
sleep 2;
return if kill(0, $pid) == 0;
}
kill 9, $pid;
for (1..5) {
sleep 2;
return if kill(0, $pid) == 0;
}
print LOG "$pid will not die!\n";
}
...@@ -90,10 +90,7 @@ while test $# -gt 0; do ...@@ -90,10 +90,7 @@ while test $# -gt 0; do
done done
echo "Removing old MySQL packages" echo "Removing old MySQL packages"
rm -rf $rpmdir/BUILD/mysql-* rm -f $bpath/NEW-RPMS/MySQL-*rpm
rm -f $rpmdir/SOURCES/mysql-*
rm -f $rpmdir/SRPMS/MySQL-*
rm -f $rpmdir/SPEC/mysql-*
if [ ! -d "$logdir" ]; then if [ ! -d "$logdir" ]; then
echo "$logdir does not exist, creating" echo "$logdir does not exist, creating"
...@@ -111,6 +108,12 @@ log=$logdir/Log-RPM-`date +%y%m%d-%H%M` ...@@ -111,6 +108,12 @@ log=$logdir/Log-RPM-`date +%y%m%d-%H%M`
( (
set -x set -x
# remove old stuff
rm -rf $rpmdir/BUILD/mysql-*
rm -f $rpmdir/SOURCES/mysql-*
rm -f $rpmdir/SRPMS/MySQL-*
rm -f $rpmdir/SPEC/mysql-*
# Copy MySQL source and spec files # Copy MySQL source and spec files
#Sasha: I left the scp stuff commented out instead of deleted to make it #Sasha: I left the scp stuff commented out instead of deleted to make it
......
...@@ -24206,17 +24206,11 @@ for most systems, but one should be aware of it. ...@@ -24206,17 +24206,11 @@ for most systems, but one should be aware of it.
@cindex design, limitations @cindex design, limitations
@cindex limitations, design @cindex limitations, design
Because MySQL uses extremely fast table locking (multiple readers / When using the MyISAM table handler, MySQL uses extremely fast table
single writers) the biggest remaining problem is a mix of a steady stream of locking (multiple readers / single writers). The biggest problem with
inserts and slow selects on the same table. this table type is a if you have a mix of a steady stream of updates and
slow selects on the same table. If this is a problem with some tables,
We believe that for a huge number of systems the extremely fast you can use another table type for these. @xref{Table types}.
performance in other cases make this choice a win. This case is usually
also possible to solve by having multiple copies of the table, but it
takes more effort and hardware.
We are also working on some extensions to solve this problem for some
common application niches.
MySQL can work with both transactional and not transactional tables. To MySQL can work with both transactional and not transactional tables. To
be able to work smoothly with not transactional tables (which can't be able to work smoothly with not transactional tables (which can't
...@@ -21,27 +21,25 @@ ...@@ -21,27 +21,25 @@
**/ **/
#include <my_global.h> #include <my_global.h>
#include <my_sys.h> #include <my_pthread.h>
#include <m_string.h>
#include <mysql.h> #include <mysql.h>
#include <mysql_version.h> #include <mysql_version.h>
#include <m_ctype.h> #include <mysqld_error.h>
#include <my_config.h> #include <my_sys.h>
#include <my_dir.h> #include <my_dir.h>
#include <m_string.h>
#include <m_ctype.h>
#include <hash.h> #include <hash.h>
#include <mysqld_error.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h> #include <getopt.h>
#include <stdarg.h> #include <stdarg.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <errno.h> #include <errno.h>
#include <violite.h> #include <violite.h>
#include <my_pthread.h>
#include <md5.h> #include <md5.h>
#include <signal.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#define MANAGER_VERSION "1.0" #define MANAGER_VERSION "1.0"
#define MANAGER_GREETING "MySQL Server Management Daemon v. 1.0" #define MANAGER_GREETING "MySQL Server Management Daemon v. 1.0"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment