Remove old cruft from the tree: mysqltestmanager, mysql_test_run_new,

and various stuff in Docs/. Also move the certificates used for testing
into mysql-test/std_data from the top-level SSL directory (now gone).


BitKeeper/deleted/.del-init_db.sql~af2dfeabaa348dd7:
  Delete: mysql-test/init_db.sql
BitKeeper/deleted/.del-my_create_tables.c~c121a0c4c427ebb:
  Delete: mysql-test/my_create_tables.c
BitKeeper/deleted/.del-my_manage.c~4de50e721d227d19:
  Delete: mysql-test/my_manage.c
BitKeeper/deleted/.del-my_manage.h~9d2cbc1e8bc894f:
  Delete: mysql-test/my_manage.h
BitKeeper/deleted/.del-mysql_test_run_new.c~a23ab2c4b28b25ad:
  Delete: mysql-test/mysql_test_run_new.c
mysql-test/mysql-test-run.sh:
  Remove code that uses old mysqltestmanager
BitKeeper/deleted/.del-Makefile.am~abb265028eb9b6a7:
  Delete: tools/Makefile.am
BitKeeper/deleted/.del-managertest1.nc~96a5c1c5c2d33085:
  Delete: tools/managertest1.nc
BitKeeper/deleted/.del-mysqlmanager-sample.pwd~712b89f01aaad84a:
  Delete: tools/mysqlmanager-sample.pwd
BitKeeper/deleted/.del-mysqlmanager.c~e97636d71145a0b:
  Delete: tools/mysqlmanager.c
BitKeeper/deleted/.del-client-req.pem~efd482e1d290d4d8:
  Delete: SSL/client-req.pem
BitKeeper/deleted/.del-run-client~e683192d4f3821e0:
  Delete: SSL/run-client
BitKeeper/deleted/.del-server-req.pem~16301893cacf1be4:
  Delete: SSL/server-req.pem
BitKeeper/deleted/.del-run-server~55426778bc206c48:
  Delete: SSL/run-server
BitKeeper/deleted/.del-Makefile.am~de166d6fcac3b9b6:
  Delete: SSL/Makefile.am
BitKeeper/deleted/.del-NOTES~e926d3e6929ac052:
  Delete: SSL/NOTES
BitKeeper/deleted/.del-mysqlmanager-pwgen.c~d8f5f91ec54432b9:
  Delete: client/mysqlmanager-pwgen.c
BitKeeper/deleted/.del-mysqlmanagerc.c~4f6e3499e68508f6:
  Delete: client/mysqlmanagerc.c
BitKeeper/deleted/.del-algor.eps~1a57aff065918206:
  Delete: Docs/Books/algor.eps
BitKeeper/deleted/.del-bk.txt~ffd510fa9531f87c:
  Delete: Docs/bk.txt
BitKeeper/deleted/.del-algor.gif~72c40c3bad198f2f:
  Delete: Docs/Books/algor.gif
BitKeeper/deleted/.del-algor.txt~37d2b5c1290e3cfa:
  Delete: Docs/Books/algor.txt
BitKeeper/deleted/.del-dbi.eps~7b1032f98de7736d:
  Delete: Docs/Books/dbi.eps
BitKeeper/deleted/.del-dbi.gif~8f6861147437298b:
  Delete: Docs/Books/dbi.gif
BitKeeper/deleted/.del-dbi.txt~f5cf3fe321168fd5:
  Delete: Docs/Books/dbi.txt
BitKeeper/deleted/.del-dubois.eps~f24e09a7fa420436:
  Delete: Docs/Books/dubois.eps
BitKeeper/deleted/.del-dubois.gif~e02d361b13b1c4a4:
  Delete: Docs/Books/dubois.gif
BitKeeper/deleted/.del-dubois.txt~998581cf9040fcc:
  Delete: Docs/Books/dubois.txt
BitKeeper/deleted/.del-ecomm.eps~17833026ebd7656:
  Delete: Docs/Books/ecomm.eps
BitKeeper/deleted/.del-ecomm.gif~f9bce6949b171613:
  Delete: Docs/Books/ecomm.gif
BitKeeper/deleted/.del-ecomm.txt~27494674104ee9db:
  Delete: Docs/Books/ecomm.txt
BitKeeper/deleted/.del-in_21.eps~8150d06653dab178:
  Delete: Docs/Books/in_21.eps
BitKeeper/deleted/.del-in_21.gif~4a0b14f6d76458a9:
  Delete: Docs/Books/in_21.gif
BitKeeper/deleted/.del-in_21.txt~448fb4b3d8c0b34e:
  Delete: Docs/Books/in_21.txt
BitKeeper/deleted/.del-manual.eps~1c2ebcea50b4840c:
  Delete: Docs/Books/manual.eps
BitKeeper/deleted/.del-manual.gif~657cf08119b1b3fc:
  Delete: Docs/Books/manual.gif
BitKeeper/deleted/.del-manual.txt~4702af61ea5e3c29:
  Delete: Docs/Books/manual.txt
BitKeeper/deleted/.del-msql.eps~f3801b9d166ae4fc:
  Delete: Docs/Books/msql.eps
BitKeeper/deleted/.del-msql.gif~72ea7c6d307b9108:
  Delete: Docs/Books/msql.gif
BitKeeper/deleted/.del-msql.txt~235ae568824f4073:
  Delete: Docs/Books/msql.txt
BitKeeper/deleted/.del-prof.eps~1f54d9a56eb2b908:
  Delete: Docs/Books/prof.eps
BitKeeper/deleted/.del-prof.gif~2fa8ed201d9d05fe:
  Delete: Docs/Books/prof.gif
BitKeeper/deleted/.del-prof.txt~9fc04ec3e5ce8361:
  Delete: Docs/Books/prof.txt
BitKeeper/deleted/.del-pthreads.eps~2ca8ff2d1181b2c0:
  Delete: Docs/Books/pthreads.eps
BitKeeper/deleted/.del-pthreads.gif~2d9460dec2577859:
  Delete: Docs/Books/pthreads.gif
BitKeeper/deleted/.del-pthreads.txt~fc9e17d021335a39:
  Delete: Docs/Books/pthreads.txt
BitKeeper/deleted/.del-realmen.eps~cc022325d3cb045:
  Delete: Docs/Books/realmen.eps
BitKeeper/deleted/.del-realmen.gif~86113e3b1fcbd597:
  Delete: Docs/Books/realmen.gif
BitKeeper/deleted/.del-realmen.txt~81c30565a8f06539:
  Delete: Docs/Books/realmen.txt
BitKeeper/deleted/.del-sql-99.eps~f85c06de7a016c7d:
  Delete: Docs/Books/sql-99.eps
BitKeeper/deleted/.del-sql-99.gif~df369376884a5689:
  Delete: Docs/Books/sql-99.gif
BitKeeper/deleted/.del-sql-99.txt~eff316adac3dd5b8:
  Delete: Docs/Books/sql-99.txt
BitKeeper/deleted/.del-Tutorial-MySQL-final.txt~6e5b88fe4217504d:
  Delete: Docs/Tutorial-MySQL-final.txt
BitKeeper/deleted/.del-mysql-01.gif~6f3f2e474b834ac6:
  Delete: Docs/MySQL-logos/mysql-01.gif
BitKeeper/deleted/.del-mysql-02.gif~5e03e2ffa6bd060f:
  Delete: Docs/MySQL-logos/mysql-02.gif
BitKeeper/deleted/.del-mysql-03.gif~a510e3599346cd5f:
  Delete: Docs/MySQL-logos/mysql-03.gif
BitKeeper/deleted/.del-mysql-04.gif~6c3fdc91da64574:
  Delete: Docs/MySQL-logos/mysql-04.gif
BitKeeper/deleted/.del-mysql-05.gif~230c28315136655:
  Delete: Docs/MySQL-logos/mysql-05.gif
BitKeeper/deleted/.del-mysql-06.gif~8bb16461fd45634e:
  Delete: Docs/MySQL-logos/mysql-06.gif
BitKeeper/deleted/.del-mysql-07.gif~b86f918998a2114e:
  Delete: Docs/MySQL-logos/mysql-07.gif
BitKeeper/deleted/.del-mysql-08.gif~50fb4d886f82e8bc:
  Delete: Docs/MySQL-logos/mysql-08.gif
BitKeeper/deleted/.del-mysql-09.gif~17604ce9d92cd94a:
  Delete: Docs/MySQL-logos/mysql-09.gif
BitKeeper/deleted/.del-mysql-10.gif~a8b5306c4d911f8e:
  Delete: Docs/MySQL-logos/mysql-10.gif
BitKeeper/deleted/.del-mysql-11.gif~8495404458978524:
  Delete: Docs/MySQL-logos/mysql-11.gif
BitKeeper/deleted/.del-mysql-12.gif~18d47c1ad5aef481:
  Delete: Docs/MySQL-logos/mysql-12.gif
BitKeeper/deleted/.del-mysql-13.gif~1ad2eedf58da3aaa:
  Delete: Docs/MySQL-logos/mysql-13.gif
BitKeeper/deleted/.del-mysql-14.gif~a11e7df8653ad1b1:
  Delete: Docs/MySQL-logos/mysql-14.gif
BitKeeper/deleted/.del-mysql-15.gif~64c998fdd6fc1ae1:
  Delete: Docs/MySQL-logos/mysql-15.gif
BitKeeper/deleted/.del-mysql-16.gif~6a6c86de2f85f0f5:
  Delete: Docs/MySQL-logos/mysql-16.gif
BitKeeper/deleted/.del-mysql-17.gif~b07962578d0952b1:
  Delete: Docs/MySQL-logos/mysql-17.gif
BitKeeper/deleted/.del-mysql_anim-01.gif~d27d4f0c1a2a6da9:
  Delete: Docs/MySQL-logos/mysql_anim-01.gif
BitKeeper/deleted/.del-mysql_anim-02.gif~476224d724007343:
  Delete: Docs/MySQL-logos/mysql_anim-02.gif
BitKeeper/deleted/.del-mysql_anim-03.gif~470dd9c9a8bd55fc:
  Delete: Docs/MySQL-logos/mysql_anim-03.gif
BitKeeper/deleted/.del-mysql_anim-04.gif~14f429c87c0c718:
  Delete: Docs/MySQL-logos/mysql_anim-04.gif
BitKeeper/deleted/.del-mysql_anim-05.gif~e63e7f003b77ad95:
  Delete: Docs/MySQL-logos/mysql_anim-05.gif
BitKeeper/deleted/.del-mysql_anim-06.gif~d9cffaf35d9d4719:
  Delete: Docs/MySQL-logos/mysql_anim-06.gif
BitKeeper/deleted/.del-mysql-compatible.jpg~56ecc684688a7382:
  Delete: Docs/MySQL-logos/mysql-compatible.jpg
BitKeeper/deleted/.del-docbook-fixup.pl~46cf3bdef147084e:
  Delete: Docs/Support/docbook-fixup.pl
BitKeeper/deleted/.del-docbook-prefix.pl~876c7d33c68c224a:
  Delete: Docs/Support/docbook-prefix.pl
BitKeeper/deleted/.del-docbook-split~be931c3922898d0:
  Delete: Docs/Support/docbook-split
BitKeeper/deleted/.del-make-docbook~ccac1eb717e92ac9:
  Delete: Docs/Support/make-docbook
BitKeeper/deleted/.del-make-makefile~39fd454b487126e8:
  Delete: Docs/Support/make-makefile
BitKeeper/deleted/.del-test-make-manual~5da458f958a424ec:
  Delete: Docs/Support/test-make-manual
BitKeeper/deleted/.del-test-make-manual-de~33cad2886311b8a:
  Delete: Docs/Support/test-make-manual-de
BitKeeper/deleted/.del-trivial-makeinfo-4.0c.patch~40d336454ecf98db:
  Delete: Docs/Support/trivial-makeinfo-4.0c.patch
BitKeeper/deleted/.del-xwf~76b97805d9146b80:
  Delete: Docs/Support/xwf
BitKeeper/deleted/.del-colspec-fix.pl~6c78d3332330b19e:
  Delete: Docs/Support/colspec-fix.pl
Docs/generate-text-files.pl:
  Rename: Docs/Support/generate-text-files.pl -> Docs/generate-text-files.pl
BitKeeper/deleted/.del-.cvsignore~250f630140b90042:
  Delete: Docs/Support/.cvsignore
BitKeeper/deleted/.del-changelog-4.0.xml~8f56ee8a913e848b:
  Delete: Docs/changelog-4.0.xml
BitKeeper/deleted/.del-changelog-4.1.xml~8aa496ebed09d868:
  Delete: Docs/changelog-4.1.xml
BitKeeper/deleted/.del-changelog-5.0.xml~f4c50926ccdd7434:
  Delete: Docs/changelog-5.0.xml
BitKeeper/deleted/.del-sp-implemented.txt~15f5c0033d848288:
  Delete: Docs/sp-implemented.txt
mysql-test/std_data/cacert.pem:
  Rename: SSL/cacert.pem -> mysql-test/std_data/cacert.pem
mysql-test/std_data/client-cert.pem:
  Rename: SSL/client-cert.pem -> mysql-test/std_data/client-cert.pem
mysql-test/std_data/client-key.pem:
  Rename: SSL/client-key.pem -> mysql-test/std_data/client-key.pem
mysql-test/std_data/server-cert.pem:
  Rename: SSL/server-cert.pem -> mysql-test/std_data/server-cert.pem
mysql-test/std_data/server-key.pem:
  Rename: SSL/server-key.pem -> mysql-test/std_data/server-key.pem
BitKeeper/etc/ignore:
  added client/mysql_upgrade
Docs/Makefile.am:
  Move generate-text-files.pl up a level, since it is the only Support file
Makefile.am:
  Remove tools and SSL directories
client/Makefile.am:
  Remove mysqltestmanager clients
configure.in:
  Remove old tools directory
mysql-test/Makefile.am:
  Don't need to copy .pem files any more, they're now in std_data.
scripts/make_binary_distribution.sh:
  Don't package up mysqltestmanager
support-files/mysql.spec.sh:
  Don't package mysqltestmanager
This commit is contained in:
unknown 2006-04-11 18:54:24 -07:00
parent 087cae1a1e
commit a56e488ac0
106 changed files with 35 additions and 22588 deletions

View file

@ -1759,3 +1759,4 @@ vio/viotest.cpp
zlib/*.ds?
zlib/*.vcproj
mysql-test/r/*.log
client/mysql_upgrade

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View file

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View file

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

View file

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View file

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View file

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View file

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

View file

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

View file

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

View file

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View file

View file

@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
noinst_SCRIPTS = Support/generate-text-files.pl
noinst_SCRIPTS = generate-text-files.pl
EXTRA_DIST = $(noinst_SCRIPTS) mysql.info INSTALL-BINARY
@ -42,7 +42,7 @@ DISTCLEANFILES = $(TXT_FILES)
CLEAN_FILES: $(TXT_FILES)
touch $(TXT_FILES)
GT = $(srcdir)/Support/generate-text-files.pl
GT = $(srcdir)/generate-text-files.pl
../INSTALL-SOURCE: mysql.info $(GT)
perl -w $(GT) mysql.info "installing-source" "windows-source-build" > $@

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

View file

@ -1,2 +0,0 @@
manual.html
manual_toc.html

View file

@ -1,78 +0,0 @@
#!/usr/bin/perl -w
#
# Script to rewrite colspecs from relative values to absolute values
#
# arjen 2002-03-14 append "cm" specifier to colwidth field.
use strict;
my $table_width = 12.75; # Specify the max width of the table in cm
my $gutter_width = 0.55; # Specify the width of the gutters in cm
my $str = join '', <>; # Push stdin (or file)
$str =~ s{([\t ]*(<colspec colwidth=\".+?\" />\s*)+)}
{&rel2abs($1)}ges;
print STDOUT $str;
exit;
#
# Definitions for helper sub-routines
#
sub msg {
print STDERR shift, "\n";
}
sub rel2abs {
my $str = shift;
my $colnum = 1;
my @widths = ();
my $total = 0;
my $output = '';
my $gutters;
my $content_width;
my $total_width;
my @num_cache;
$str =~ /^(\s+)/;
my $ws = $1;
while ($str =~ m/<colspec colwidth="(\d+)\*" \/>/g) {
$total += $1;
push @widths, $1;
}
msg("!!! WARNING: Total Percent > 100%: $total%") if $total > 100;
if (! $total) {
die 'Something bad has happened - the script believes that there are no columns';
}
$gutters = $#widths * $gutter_width;
$content_width = $table_width - $gutters;
# Don't forget that $#... is the last offset not the count
foreach (@widths) {
my $temp = sprintf ("%0.2f", $_/100 * $content_width);
$total_width += $temp;
if ($total_width > $content_width) {
$temp -= $total_width - $content_width;
msg("!!! WARNING: Column width reduced from " .
($temp + ($total_width - $content_width)) . " to $temp !!!");
$total_width -= $total_width - $content_width;
}
$output .= $ws . '<colspec colnum="'. $colnum .'" colwidth="'. $temp .'cm" />' . "\n";
++$colnum;
push @num_cache, $temp;
}
return $output . "\n$ws";
}

View file

@ -1,200 +0,0 @@
#!/usr/bin/perl -w
# Fix the output of `makeinfo --docbook` version 4.0c
# Convert the broken docbook output to well-formed XML that conforms to the O'Reilly idiom
# See code for detailed comments
# Authors: Arjen Lentz and Zak Greant (original code by Jeremy Cole)
use strict;
my $data = '';
my @apx = ();
my $apx = '';
my @nodes = ();
my $nodes = '';
msg ("-- Post-processing `makeinfo --docbook` output --");
msg ("** Written to work with makeinfo version 4.0c **\n");
msg ("Discarding DTD - not required by subsequent scripts");
# <> is a magic filehandle - either reading lines from stdin or from file(s) specified on the command line
<>;
msg ("Create an XML PI with ISO-8859-1 character encoding");
$data = "<?xml version='1.0' encoding='ISO-8859-1'?>";
msg ("Get the rest of the data");
$data = $data . join "", <>;
msg ("Add missing <bookinfo> and <abstract> opening tags");
# Note the absence of the g (global) pattern modified. This situation can only happen once.
# ...as soon as we find the first instance, we can stop looking.
$data =~ s/<book lang="en">/<book lang="en"><bookinfo><abstract>/;
# arjen 2002-05-01
msg ("Processing docbook-prefix special strings");
$data =~ s/FIXUPmdashFIXUP/\&mdash\;/g;
$data =~ s/FIXUPdoubledashFIXUP/--/g;
$data =~ s/FIXUPstrongFIXUP/<emphasis\ role\=\"bold\">/g;
$data =~ s/FIXUPendstrongFIXUP/<\/emphasis>/g;
$data =~ s/FIXUPemphFIXUP/<emphasis>/g;
$data =~ s/FIXUPendemphFIXUP/<\/emphasis>/g;
$data =~ s/FIXUPfileFIXUP/<filename>/g;
$data =~ s/FIXUPendfileFIXUP/<\/filename>/g;
$data =~ s/FIXUPsampFIXUP/<literal>/g;
$data =~ s/FIXUPendsampFIXUP/<\/literal>/g;
msg ("Removing mailto: from email addresses...");
$data =~ s/mailto://g;
msg ("Removing INFORMALFIGURE...");
$data =~ s{<informalfigure>.+?</informalfigure>}
{}gs;
msg ("Convert ampersand to XML escape sequence...");
$data =~ s/&(?!\w+;)/&amp;/g;
# arjen 2002-05-01
msg ("Changing (TM) to XML escape sequence...");
$data =~ s/MySQL \(TM\)/MySQL&trade;/g;
$data =~ s{<command>TM</command>}
{&trade;}g;
# arjen 2002-05-01
msg ("Changing ' -- ' to XML escape sequence...");
$data =~ s/ -- /&mdash;/g;
msg ("Changing @@ to @...");
$data =~ s/@@/@/g;
msg ("Rework references of the notation '<n>'");
# Need to talk to Arjen about what the <n> bits are for
$data =~ s/<(\d)>/[$1]/g;
msg ("Changing '_' to '-' in references...");
$data =~ s{((?:id|linkend)=\".+?\")}
{&underscore2hyphen($1)}gex;
msg ("Changing ULINK to SYSTEMITEM...");
$data =~ s{<ulink url=\"(.+?)\">\s*</ulink>}
{<systemitem role=\"url\">$1</systemitem>}gs;
msg ("Adding PARA inside ENTRY...");
$data =~ s{<entry>(.*?)</entry>}
{<entry><para>$1</para></entry>}gs;
msg ("Fixing spacing problem with titles...");
$data =~ s{(</\w+>)(\w{2,})}
{$1 $2}gs;
msg ("Adding closing / to XREF and COLSPEC tags...");
$data =~ s{<(xref|colspec) (.+?)>}
{<$1 $2 />}gs;
# arjen 2002-04-26
msg ("Removing separate target titles from LINKs and make them XREFs...");
$data =~ s{<link (linkend=.+?)>.+?</link>}
{<xref $1 />}gs;
# Probably need to strip these
msg ('Adding "See " to XREFs that used to be @xref...');
$data =~ s{([.'!)])\s*<xref }
{$1 See <xref }gs;
msg ('Adding "see " to (XREFs) that used to be (@pxref)...');
$data =~ s{([([,;])(\s*)<xref }
{$1$2see <xref }gs;
msg ("Making first row in table THEAD...");
$data =~ s{( *)<tbody>(\s*<row>.+?</row>)}
{$1<thead>$2\n$1</thead>\n$1<tbody>}gs;
msg ("Removing EMPHASIS inside THEAD...");
$data =~ s{<thead>(.+?)</thead>}
{"<thead>".&strip_tag($1, 'emphasis')."</thead>"}gsex;
msg ("Removing empty PARA...");
$data =~ s{<para>\s*</para>}
{}gs;
msg ("Removing lf before /PARA in ENTRY...");
$data =~ s{\n(</para></entry>)}
{$1}gs;
msg ("Removing whitespace before /PARA if not on separate line...");
$data =~ s{(\S+)[\t ]+</para>}
{$1</para>}g;
msg ("Removing PARA around INDEXTERM if no text in PARA...");
$data =~ s{<para>((?:<indexterm role=\"[^"]+\">(?:<(primary|secondary)>[^>]+</\2>)+?</indexterm>)+?)\s*</para>}
{$1}gs;
@apx = ("Users", "MySQL Testimonials", "News", "GPL-license", "LGPL-license");
foreach $apx (@apx) {
msg ("Removing appendix $apx...");
$data =~ s{<appendix id=\"$apx\">(.+?)</appendix>}
{}gs;
# Skip to next appendix regex if the regex did not match anything
next unless (defined $&);
msg ("...Building list of removed nodes...");
# Split the last bracketed regex match into an array
# Extract the node names from the tags and push them into an array
foreach (split "\n", $&) {
push @nodes, $1 if /<\w+ id=\"(.+?)\">/
}
}
# 2002-02-22 arjen@mysql.com (added fix " /" to end of regex, to make it match)
msg ("Fixing references to removed nodes...");
# Merge the list of node names into a set of regex alternations
$nodes = join "|", @nodes;
# Find all references to removed nodes and convert them to absolute URLs
$data =~ s{<\w+ linkend="($nodes)" />}
{&xref2link($1)}ges;
print STDOUT $data;
exit;
#
# Definitions for helper sub-routines
#
sub msg {
print STDERR "docbook-fixup:", shift, "\n";
}
sub strip_tag($$) {
(my $str, my $tag) = @_;
$str =~ s{<$tag>(.+?)</$tag>}{$1}gs;
return $str;
}
sub underscore2hyphen($) {
my $str = shift;
$str =~ tr/_/-/;
return $str;
}
sub xref2link {
my $ref = shift;
$ref =~ tr/ /_/;
$ref =~ s{^((.)(.).+)$}{$2/$3/$1.html};
return "http://www.mysql.com/doc/" . $ref;
}
# We might need to encode the high-bit characters to ensure proper representation
# msg ("Converting high-bit characters to entities");
# $data =~ s/([\200-\400])/&get_entity($1)>/gs;
# There is no get_entity function yet - no point writing it til we need it :)

View file

@ -1,50 +0,0 @@
#!/usr/bin/perl -w
# Preprocess the input of `makeinfo --docbook` version 4.0c
# Authors: Arjen Lentz and Zak Greant (started by arjen 2002-05-01)
use strict;
my $data = '';
msg ("-- Pre-processing `makeinfo --docbook` input --");
msg ("** Written to work with makeinfo version 4.0c **\n");
# <> is a magic filehandle - either reading lines from stdin or from file(s) specified on the command line
msg ("Get the data");
$data = join "", <>;
msg ("Replacing '\@-' with FIXUPmdashFIXUP");
$data =~ s/\@-/FIXUPmdashFIXUP/g;
msg ("Replacing '--' with FIXUPdoubledashFIXUP");
$data =~ s/--/FIXUPdoubledashFIXUP/g;
msg ("Turning \@strong{} into LITERAL blocks");
$data =~ s/\@strong\{(.*?)\}/FIXUPstrongFIXUP$1FIXUPendstrongFIXUP/gs;
msg ("Turning \@emph{} into LITERAL blocks");
$data =~ s/\@emph\{(.*?)\}/FIXUPemphFIXUP$1FIXUPendemphFIXUP/gs;
msg ("Turning \@file{} into LITERAL blocks");
$data =~ s/\@file\{(.*?)\}/FIXUPfileFIXUP$1FIXUPendfileFIXUP/gs;
msg ("Turning \@samp{} into LITERAL blocks");
$data =~ s/\@samp\{\@\{\}/FIXUPsampFIXUP\@\{FIXUPendsampFIXUP/g;
$data =~ s/\@samp\{\@\}\}/FIXUPsampFIXUP\@\}FIXUPendsampFIXUP/g;
$data =~ s/\@samp\{\@\{n\@\}\}/FIXUPsampFIXUP\@\{n\@\}FIXUPendsampFIXUP/g;
$data =~ s/\@samp\{(.*?)\}/FIXUPsampFIXUP$1FIXUPendsampFIXUP/gs;
msg ("Write the data");
print STDOUT $data;
exit;
#
# Definitions for helper sub-routines
#
sub msg {
print STDERR "docbook-prefix: ", shift, "\n";
}

View file

@ -1,70 +0,0 @@
#! /usr/bin/perl -w
# O'Reilly's Perl script to chop mysql.xml into separate ch/apps/index files.
# The indexes are actually not used, they're created straight from the xrefs.
# Breaks the MySQL reference manual into chapters, appendices, and indexes.
use strict;
my $app_letter = "a"; # Start appendix letters at "a"
my $chap_num = 1; # Start chapter numbers at one (there is no preface)
my $directory = "mysql_refman_" . time;
my $ext = ".xml";
my $line = "";
my $output_name = "";
my $start_text = "";
mkdir $directory unless -d $directory;
while (defined $line) {
if ($line =~ /(<chapter.+)/i ) {
$start_text = $1;
$output_name = sprintf("ch%02d%s", $chap_num, $ext);
++$chap_num;
&process_file("chapter");
}
elsif ($line =~ /(<appendix.+)/i ) {
$start_text = $1 ;
$output_name = "app$app_letter$ext";
++$app_letter;
&process_file("appendix");
}
elsif ($line =~ /(<index\s+id=")(.*?)(">.*)/i ) {
$start_text = $1 . $2 . $3;
$output_name = lc($2) . $ext;
&process_file("index");
}
else {
# Skip junk in between chapters, appendices and indexes.
$line = <>;
}
}
sub process_file {
my $marker = shift;
my $path = "$directory/$output_name";
open (OUTPUT_FILE, ">$path") or die "Cannot open $path";
print STDERR "Creating $path\n";
# Print out XML PI
print OUTPUT_FILE "<?xml version='1.0' encoding='ISO-8859-1'?>\n";
# Print whatever happened to appear at the end of the previous chapter.
print OUTPUT_FILE "$start_text\n" if $start_text;
while (defined $line) {
$line = <>;
# Note: Anything after the terminating marker is lost, just like
# lines in between chapters.
if ($line =~ /(.*<\/\s*$marker\s*>)/i ) {
print OUTPUT_FILE "$1\n" if $1;
close OUTPUT_FILE;
return;
}
print OUTPUT_FILE $line;
}
}
exit 0;

View file

@ -1,29 +0,0 @@
#!/bin/sh
# 2002-01-30 arjen@mysql.com
# Use this to create mysql.xml (the DocBook XML format output of manual.texi)
# Requires makeinfo 4.0c
#create include.texi with version/port #
echo "@c This file is autogenerated by the Makefile" > include.texi
echo -n "@set mysql_version " >> include.texi
# grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \
# sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;' >> include.texi
# 2002-04-26 arjen - the below just picks #.# instead of #.#.#-alpha
# (code by mwagner - tnx)
grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \
perl -p -e 's/AM_INIT_AUTOMAKE\(mysql,\s(\d+\.\d+)\..+/$1/' >> include.texi
echo -n "@set default_port " >> include.texi
grep "MYSQL_TCP_PORT_DEFAULT=" ../configure.in | \
sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> include.texi
# produce DocBook XML
Support/docbook-prefix.pl < manual.texi |\
makeinfo --force --no-ifinfo --docbook -o - |\
Support/docbook-fixup.pl > mysql.xml
# See if the XML output is well-formed
xmlwf mysql.xml
# If all is well, keep processing
cat mysql.xml | Support/colspec-fix.pl | Support/docbook-split;

View file

@ -1,7 +0,0 @@
#!/bin/sh
# Use this when you have deleted Makefile and do not want to do a full
# build to get it back
cd ..
automake --gnu Docs/Makefile
CONFIG_FILES=Docs/Makefile CONFIG_HEADERS= sh ./config.status

View file

@ -1,137 +0,0 @@
#!/bin/sh
needed_flags=0
needed_texi2html=0
needed_texinfo_tex=0
needed_include_texi=0
if [ -z $BROWSER ]; then
BROWSER=netscape
echo "BROWSER not set, using $BROWSER"
fi
die ()
{
echo
echo $1
cleanup
exit 1
}
cleanup ()
{
echo "Cleaning up..."
if [ $needed_flags ]; then
bk clean Flags
fi
if [ $needed_texi2html ]; then
bk clean Support/texi2html
fi
if [ $needed_texinfo_tex ]; then
bk clean Support/texinfo.tex
fi
if [ $needed_include_texi ]; then
rm -f include.texi
fi
for file in \
manual.aux manual.cp manual.cps manual.dvi \
manual.fn manual.fns manual.ky manual.html \
manual.pg manual.toc manual.tp manual.vr \
mysql.info manual_toc.html ;
do
rm -f $file
done
}
if [ -e Flags/usa.txt ]; then
echo "Good, Flags are there."
else
echo -n "Checking out Flags..."
bk edit Flags >/dev/null 2>&1
echo " Done."
needed_flags=1
fi
if [ -e Support/texi2html ]; then
echo "Good, texi2html is there."
else
echo -n "Checking out texi2html..."
bk edit Support/texi2html >/dev/null 2>&1
echo " Done."
needed_texi2html=1
fi
if [ -e Support/texinfo.tex ]; then
echo "Good, texinfo.tex is there."
else
echo -n "Checking out texinfo.tex..."
bk edit Support/texinfo.tex >/dev/null 2>&1
echo " Done."
needed_texinfo_tex=1
fi
if [ -e include.texi ]; then
echo "Good, include.texi is there."
else
echo -n "Creating include.texi..."
bk edit ../configure.in >/dev/null 2>&1
echo "@c This file was generated by test-make-manual" > include.texi
echo -n "@set mysql_version " >> include.texi
grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \
sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;' >> include.texi
echo -n "@set default_port " >> include.texi
grep "MYSQL_TCP_PORT_DEFAULT=" ../configure.in | \
sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> include.texi
echo " Done."
needed_include_texi=1
fi
echo -n "Running makeinfo..."
makeinfo --no-split -I . manual.texi
if [ $? != 0 ]; then
die "Manual has errors - fix before you commit"
else
echo " Looks good."
fi
echo -n "Running texi2html..."
/usr/bin/perl ./Support/texi2html -iso -number manual.texi
if [ $? != 0 ]; then
die "Manual has errors - fix before you commit"
else
echo " Looks good."
fi
echo -n "Running texi2dvi..."
texi2dvi --batch manual.texi > texi2dvi.out
if [ $? != 0 ]; then
die "Manual has errors - fix before you commit (saved in texi2dvi.out)"
else
rm texi2dvi.out
echo " Looks good."
fi
echo
echo
echo "Please examine your modifications in \`manual.html'."
echo
echo "If you would like to use a different browser, set the 'BROWSER' environment"
echo "variable."
echo
$BROWSER file:`pwd`/manual_toc.html
echo "-- Press Enter to Continue --"
read junk
cleanup

View file

@ -1,137 +0,0 @@
#!/bin/sh
needed_flags=0
needed_texi2html=0
needed_texinfo_tex=0
needed_include_texi=0
if [ -z $BROWSER ]; then
BROWSER=netscape
echo "BROWSER not set, using $BROWSER"
fi
die ()
{
echo
echo $1
cleanup
exit 1
}
cleanup ()
{
echo "Cleaning up..."
if [ $needed_flags ]; then
bk clean Flags
fi
if [ $needed_texi2html ]; then
bk clean Support/texi2html
fi
if [ $needed_texinfo_tex ]; then
bk clean Support/texinfo.tex
fi
if [ $needed_include_texi ]; then
rm -f include.texi
fi
for file in \
manual.de.aux manual.de.cp manual.de.cps manual.de.dvi \
manual.de.fn manual.de.fns manual.de.ky manual.de.html \
manual.de.pg manual.de.toc manual.de.tp manual.de.vr \
mysql.de.info manual.de_toc.html ;
do
rm -f $file
done
}
if [ -e Flags/usa.txt ]; then
echo "Good, Flags are there."
else
echo -n "Checking out Flags..."
bk edit Flags >/dev/null 2>&1
echo " Done."
needed_flags=1
fi
if [ -e Support/texi2html ]; then
echo "Good, texi2html is there."
else
echo -n "Checking out texi2html..."
bk edit Support/texi2html >/dev/null 2>&1
echo " Done."
needed_texi2html=1
fi
if [ -e Support/texinfo.tex ]; then
echo "Good, texinfo.tex is there."
else
echo -n "Checking out texinfo.tex..."
bk edit Support/texinfo.tex >/dev/null 2>&1
echo " Done."
needed_texinfo_tex=1
fi
if [ -e include.texi ]; then
echo "Good, include.texi is there."
else
echo -n "Creating include.texi..."
bk edit ../configure.in >/dev/null 2>&1
echo "@c This file was generated by test-make-manual" > include.texi
echo -n "@set mysql_version " >> include.texi
grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \
sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;' >> include.texi
echo -n "@set default_port " >> include.texi
grep "MYSQL_TCP_PORT_DEFAULT=" ../configure.in | \
sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> include.texi
echo " Done."
needed_include_texi=1
fi
echo -n "Running makeinfo..."
makeinfo --no-split -I . manual.de.texi
if [ $? != 0 ]; then
die "Manual has errors - fix before you commit"
else
echo " Looks good."
fi
echo -n "Running texi2html..."
/usr/bin/perl ./Support/texi2html -iso -number manual.de.texi
if [ $? != 0 ]; then
die "Manual has errors - fix before you commit"
else
echo " Looks good."
fi
echo -n "Running texi2dvi..."
texi2dvi --batch manual.de.texi > texi2dvi.out
if [ $? != 0 ]; then
die "Manual has errors - fix before you commit (saved in texi2dvi.out)"
else
rm texi2dvi.out
echo " Looks good."
fi
echo
echo
echo "Please examine your modifications in \`manual.de.html'."
echo
echo "If you would like to use a different browser, set the 'BROWSER' environment"
echo "variable."
echo
$BROWSER file:`pwd`/manual.de_toc.html
echo "-- Press Enter to Continue --"
read junk
cleanup

View file

@ -1,11 +0,0 @@
--- alt-multi.c Sun Apr 14 10:03:19 2002
+++ multi.c Tue May 22 20:52:33 2001
@@ -287,7 +287,7 @@
&& *params != '\n' && *params != '@')
params++;
setup_output_environment (i,
- (int) ((columnfrac * 100.00) + 0.49));
+ (int) (columnfrac * (fill_column - current_indent) + .5));
}
}

View file

@ -1,67 +0,0 @@
#!/usr/bin/perl -w
#
# Parse document and report first syntax (well-formedness) error found.
#
use strict;
use XML::Parser;
use Getopt::Std;
my %opts;
getopts('e', \%opts);
my $ENTREFS = exists( $opts{'e'} ); # flag: check ent refs
my $parser = XML::Parser->new(
ErrorContext => 2, # output error context
);
# get input from files
if( @ARGV ) {
foreach( @ARGV ) {
my $file = $_;
unless( -r $file ) {
print STDERR "ERROR: Can't open '$file'.\n";
return;
}
my $input = '';
open( F, $file );
while( <F> ) { $input .= $_; }
close F;
# parse and report errors
if( &parse_string( $input )) {
print STDERR "ERROR in $file:\n$@\n";
} else {
print STDERR "'$file' is well-formed.\n";
}
}
print "All files checked.\n";
# get input from STDIN
} else {
my $input = "";
while( <STDIN> ) { $input .= $_; }
if( &parse_string( $input )) {
print STDERR "ERROR in stream:\n$@\n";
} else {
print STDERR "No syntax errors found in XML stream.\n";
}
}
# parse the string and return error message
#
# NOTE: By default, entity refs are not expanded. XML::Parser can be
# told not to expand entity refs, but will still try to find
# replacement text just in case, which we don't want. Therefore, we
# need to do a stupid regexp replacement, removing entities from input.
#
sub parse_string {
my $string = shift;
unless( $ENTREFS ) {
$string =~ s/\&[^\s;]+;//g; # remove entity references
}
eval { $parser->parse( $string ); };
$@ =~ s/at \/.*?$//s; # remove module line number
return $@;
}

File diff suppressed because it is too large Load diff

View file

@ -1,65 +0,0 @@
Mail by sasha, should be rewritten as a HOWTO sometimes
vva added point C) for Windows-project
-----------
I have set up a repository with BitKeeper on work. There are still some things
about it that I would like to learn, but I have gotten far enough with it to
replace CVS functionality were are currently using, so let's just go ahead and
get started on it. Please follow the instructions below (make sure to save the
message for future reference):
a) http://www.bitmover.com/download
user: beta
password: get bitkeeper
get the version appropriate for your platform - download it to a temp
directory, chmod +x and then run it. You will have to tell it which directory
to install, for consistency, let's use /usr/local/bin
b) we will take advantage of bk capablity of working with master/slave
repositories. The master will be on work.mysql.com, the slaves will be our
individual machines. The master repository has already been set up on work, so
you will need just to set up a slave repository on your machine:
mkdir bk
cd bk
bk clone yourusername@work:/home/bk/mysql mysql
cd mysql
bk -r edit
Now you have the entire source tree in the current directory. Let's compile it:
BUILD/compile-pentium-debug
C) Windows project.
- Compile Linux-project (see points above)
- run VC++Files/prepare
- make repository accessible for Windows (using samba)
- open VC++Files/mysql.dsw in Microsoft Visual Stidio (5.0 or above)
After you edit a file, you need to check it in using bk citool or bk ci
filename. Note that ci is different than commit - you ci a file, but you commit
a change set. This is a very nice concept - instead of thinking of each
individual file as CVS does, bk groups the changes you are making and allows you
to document what you actually did between the commits as a whole, rather than
just commenting on every file. When you commit, bk will ask you to comment on
the change set.
Commit is done just to your local repository. To make your changes global, you
will need to run bk push. Be careful with that - it is a good idea to run bk
push -l -n first too see what you are just about to push to the master
repository.
When somebody does a push, you will be getting a email ( I will set this up to
day). You will then need to execute bk pull to update your sources. If there are
any conflicts, bk will force you to resolve them by asking you questions on what
to do with each conflict.
To learn more about bk, use bk helptool - I will be doing this a lot in the next
couple of days :-) If you find bugs or have questions/feature
suggestions/comments for developers, feel free to e-mail dev@bitmover.com .
Their developers, and especially the president of the company Larry McVoy really
like MySQL and are very anxious to help us. Make sure it is obvious that you
work for MySQL, of course. And, of course, do not bug them with little things
that you can figure out on your own or with my help - they were nice to offer us
support, but we should not abuse it.

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<!--
This is a dummy changelog file. Don't use it yet.
It merges upward without conflict.
-->
<appendix id="news-4-0-x">
<title>
Changes in release 4.0.x
</title>
<para>
This is a dummy changelog file. Don't use it yet.
</para>
</appendix>

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<!--
This is a dummy changelog file. Don't use it yet.
It merges upward without conflict.
-->
<appendix id="news-4-1-x">
<title>
Changes in release 4.1.x
</title>
<para>
This is a dummy changelog file. Don't use it yet.
</para>
</appendix>

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<!--
This is a dummy changelog file. Don't use it yet.
It merges upward without conflict.
-->
<appendix id="news-5.0-x">
<title>
Changes in release 5.0.x
</title>
<para>
This is a dummy changelog file. Don't use it yet.
</para>
</appendix>

View file

@ -1,112 +0,0 @@
Stored Procedures implemented 2004-01-29:
Summary of what's implemented:
- SQL PROCEDUREs/FUNCTIONs (CREATE/DROP)
- CALL
- DECLARE of local variables
- BEGIN/END, SET, CASE, IF, LOOP, WHILE, REPEAT, ITERATE, LEAVE
- SELECT INTO local variables
- "Non-query" FUNCTIONs only
- Prepared SP caching
- CONDITIONs and HANDLERs
- Simple read-only CURSORs.
- SHOW CREATE PROCEDURE/FUNCTION and SHOW PROCEDURE/FUNCTION STATUS
Summary of Not Yet Implemented:
- SQL statements using tables (like SELECT, INSERT, UPDATE etc) in FUNCTIONs
- External languages
- Access control
- SQL-99 COMMIT (related to BEGIN/END)
- FOR-loops
- CASCADE/RESTRICT for ALTER and DROP
- ALTER/DROP METHOD (as it implies User Defined Types)
- SIGNAL and RESIGNAL, and UNDO handlers
List of what's implemented:
- CREATE PROCEDURE|FUNCTION name ( args ) characteristics body
where characteristics is:
LANGUAGE SQL |
[NOT] DETERMINISTIC |
SQL SECURITY [DEFINER|INVOKER] |
COMMENT string
However the DETERMINISTIC setting is not currently used.
- ALTER PROCEDURE|FUNCTION name characteristics
CASCADE/RESTRICT is not implemented.
characteristics is:
COMMENT string |
SQL SECURITY [DEFINER|INVOKER] |
NAME newname
- DROP PROCEDURE|FUNCTION [IF EXISTS] name
CASCADE/RESTRICT is not implemented.
- CALL name (args)
OUT and INOUT parameters are also works for user variables ("global"
variables) - i.e., if a procedure is defined as:
CREATE PROCEDURE foo(OUT p INT) ...;
a call like:
CALL foo(@x);
will set @x to the output value.
- Function/Procedure body:
- BEGIN/END
Is parsed, but not the real thing with (optional) transaction
control, it only serves as block syntax for multiple statements (and
local variable binding).
Note: Multiple statements requires a client that can send bodies
containing ";". This is handled in the CLI clients mysql and
mysqltest with the "delimiter" command. Changing the end-of-query
delimiter ";" to for instance "|" allows ";" to be used in the
routine body.
- SET of local variables
Implemented as part of the pre-existing SET syntax. This allows an
extended syntax of "SET a=x, b=y, ..." where different variable types
(SP local and global) can be mixed. This also allows combinations
of local variables and some options that only make sense for
global/system variables; in that case the options are accepted but
ignored.
- The flow control constructs: CASE, IF, LOOP, WHILE, ITERATE and LEAVE
are fully implemented.
- SELECT ... INTO local variables (as well as global session variables)
is implemented. (Note: This is not SQL-99 feature, but common in other
databases.)
- A FUNCTION can have flow control contructs, but must not contain
an SQL query/statement, like SELECT, INSERT, UPDATE, etc. The reason
is that it's hard to allow this is that a FUNCTION is executed as part
of another query (unlike a PROCEDURE, which is called as a statement).
The table locking scheme used makes it difficult to allow "subqueries"
during FUNCTION invokation.
- SPs are cached, but with a separate cache for each thread (THD).
There are still quite a few non-reentrant constructs in the lexical
context which makes sharing prepared SPs impossible. And, even when
this is resolved, it's not necessarily the case that it will be faster
than a cache per thread. A global cache requires locks, which might
become a bottleneck. (It would save memory though.)
- CONDITIONs and HANDLERs are implemented, but not the SIGNAL and
RESIGNAL statements. (It's unclear if these can be implemented.)
The semantics of CONDITIONs is expanded to allow catching MySQL error
codes as well. UNDO handlers are not implemented (since we don't have
SQL-99 style transaction control yet).
- Simple read-only CURSORs are implemented, but not yet any of the
optional arguments to DECLARE (SCROLL, SENSITIVE, etc) or FETCH
(NEXT, PRIOR, etc). Cursors are ASENSITIVE, READ-ONLY, non-SCROLLing.
(The additional syntax will be added for completeness, but for the
most part unsupported with the current underlying cursor mechanism.)
N.B. The current implementation is temporary and only works within a
stored procedure, and may not perform well for very large result sets.
A "real" cursor implementation is under development; this will replace
the current one when it's finished.
- SHOW procedures and functions
SHOW CREATE PROCEDURE|FUNCTION <name>
returns the definition of a routine.
SHOW PROCEDURE|FUNCTION STATUS [LIKE <pattern>]
returns characteristics of routines, like the name, type, creator,
creation and modification dates, etc.

View file

@ -36,9 +36,9 @@ DIST_SUBDIRS = . include @docs_dirs@ zlib \
@thread_dirs@ pstack \
strings mysys dbug extra regex storage \
vio sql libmysql_r libmysql client scripts \
@man_dirs@ tests SSL\
@man_dirs@ tests \
BUILD netware @libmysqld_dirs@\
@bench_dirs@ support-files server-tools tools \
@bench_dirs@ support-files server-tools \
plugin win
# Run these targets before any others, also make part of clean target,

View file

@ -1,24 +0,0 @@
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
## Process this file with automake to create Makefile.in
EXTRA_DIST= NOTES cacert.pem client-cert.pem client-key.pem \
client-req.pem run-client run-server server-cert.pem \
server-key.pem server-req.pem
# Don't update the files from bitkeeper
%::SCCS/s.%

376
SSL/NOTES
View file

@ -1,376 +0,0 @@
Quick notes:
--------------------------------------------
[tonu@x153 mysql-4.0]$ cat /etc/my.cnf
[mysqld]
ssl-ca=SSL/cacert.pem
ssl-cert=SSL/server-cert.pem
ssl-key=SSL/server-key.pem
[mysql]
ssl-ca=SSL/cacert.pem
ssl-cert=SSL/client-cert.pem
ssl-key=SSL/client-key.pem
[mysqldump]
ssl-ca=SSL/cacert.pem
ssl-cert=SSL/client-cert.pem
ssl-key=SSL/client-key.pem
[tonu@x153 mysql-4.0]$
--------------------------------------------
To remove passwords from keyfiles:
[tonu@x153 SSL]$ openssl rsa -inform pem < server-req.pem > server-key.pem
read RSA key
Enter PEM pass phrase:
writing RSA key
[tonu@x153 SSL]$
--------------------------------------------
To run server:
sql/mysqld --ssl-ca=SSL/cacert.pem --ssl-cert=SSL/server-cert.pem --ssl-key=SSL/server-key.pem --skip-grant --debug='d:t:O,-' > /tmp/mysqld.trace
--------------------------------------------
To run client:
client/mysql --ssl-ca=SSL/cacert.pem --ssl-cert=SSL/server-cert.pem --ssl-key=SSL/server-key.pem --debug='d:t:O,/tmp/client.trace' -h 127.0.0.1
--------------------------------------------
openssl s_client -host 127.0.0.1 -port 1111 -debug -verify 1 -cert ../SSL/client-cert.pem -key ../SSL/client-key.pem -CAfile ../SSL/cacert.pem -pause -showcerts -state
--------------------------------------------
openssl s_server -port 1111 -cert ../SSL/server-cert.pem -key ../SSL/server-key.pem
--------------------------------------------
CA stuff:
[tonu@x153 bin]$ pwd
/usr/local/ssl/bin
[tonu@x153 bin]$
[tonu@x153 bin]$ ./CA.sh
[tonu@x153 bin]$ ./CA.sh -h
usage: CA -newcert|-newreq|-newca|-sign|-verify
[tonu@x153 bin]$
[root@x153 bin]# ./CA.sh -newca
CA certificate filename (or enter to create)
Making CA certificate ...
Using configuration from /usr/lib/ssl/openssl.cnf
Generating a 1024 bit RSA private key
.++++++
................++++++
writing new private key to './demoCA/private/./cakey.pem'
Enter PEM pass phrase:
Verifying password - Enter PEM pass phrase:
phrase is too short, needs to be at least 4 chars
Enter PEM pass phrase:
Verifying password - Enter PEM pass phrase:
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
ountry Name (2 letter code) [AU]:FI
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:Helsinki
Organization Name (eg, company) [Internet Widgits Pty Ltd]:MySQL Finland AB
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:Tonu Samuel
Email Address []:tonu@mysql.com
[root@x153 bin]#
[root@x153 bin]# ls -la demoCA/
total 13
drwxr-xr-x 6 root root 232 Jun 24 18:50 ./
drwxr-xr-x 3 root root 2136 Jun 24 18:41 ../
-rw-r--r-- 1 root root 1241 Jun 24 18:50 cacert.pem
drwxr-xr-x 2 root root 48 Jun 24 18:41 certs/
drwxr-xr-x 2 root root 48 Jun 24 18:41 crl/
-rw-r--r-- 1 root root 0 Jun 24 18:44 index.txt
drwxr-xr-x 2 root root 48 Jun 24 18:41 newcerts/
drwxr-xr-x 2 root root 80 Jun 24 18:44 private/
-rw-r--r-- 1 root root 3 Jun 24 18:44 serial
[root@x153 bin]#
[root@x153 bin]# ls -la demoCA/private/
total 5
drwxr-xr-x 2 root root 80 Jun 24 18:44 ./
drwxr-xr-x 6 root root 232 Jun 24 18:50 ../
-rw-r--r-- 1 root root 963 Jun 24 18:50 cakey.pem
[root@x153 bin]#
[root@x153 bin]# ./CA.sh -newreq
Using configuration from /usr/lib/ssl/openssl.cnf
Generating a 1024 bit RSA private key
..................++++++
........................++++++
writing new private key to 'newreq.pem'
Enter PEM pass phrase: <- new key password, not CA
Verifying password - Enter PEM pass phrase:
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:EE
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:Tallinn
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Noname
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:Mr Noname
Email Address []:a@b.c
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Request (and private key) is in newreq.pem
[root@x153 bin]#
[root@x153 bin]# ls -la newreq.pem
-rw-r--r-- 1 root root 1623 Jun 24 18:54 newreq.pem
[root@x153 bin]#
[root@x153 bin]# ./CA.sh -sign
Using configuration from /usr/lib/ssl/openssl.cnf
Enter PEM pass phrase: <- CA's one!
Check that the request matches the signature
Signature ok
The Subjects Distinguished Name is as follows
countryName :PRINTABLE:'EE'
stateOrProvinceName :PRINTABLE:'Some-State'
localityName :PRINTABLE:'Tallinn'
organizationName :PRINTABLE:'Noname'
commonName :PRINTABLE:'Mr Noname'
emailAddress :IA5STRING:'a@b.c'
Certificate is to be certified until Jun 24 15:50:23 2002 GMT (365 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 1 (0x1)
Signature Algorithm: md5WithRSAEncryption
Issuer: C=FI, ST=Some-State, L=Helsinki, O=MySQL Finland AB, CN=Tonu Samuel/Email=tonu@mysql.com
Validity
Not Before: Jun 24 15:50:23 2001 GMT
Not After : Jun 24 15:50:23 2002 GMT
Subject: C=EE, ST=Some-State, L=Tallinn, O=Noname, CN=Mr Noname/Email=a@b.c
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (1024 bit)
Modulus (1024 bit):
00:ab:3b:7d:5b:6c:93:f6:46:1a:2c:46:73:6f:89:
8a:99:bb:e9:6b:94:0d:74:aa:aa:c4:5c:a2:61:cf:
56:bb:a1:a9:5a:37:c4:4e:b2:ec:5c:18:3a:a4:8d:
af:3d:23:66:7c:85:7f:d1:f2:e3:fc:16:a7:4c:a2:
d6:45:06:92:75:d8:a2:3b:f9:aa:77:da:26:b9:87:
e0:df:50:54:e4:36:9f:35:87:39:8e:a6:7c:3e:a8:
e4:49:1a:76:c2:6f:73:0b:22:93:2a:04:67:0d:7d:
ae:34:5c:fe:7c:29:b8:a2:fe:1e:ef:d1:0c:4d:dd:
5b:7a:67:b0:0a:22:88:a0:af
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
83:D1:0D:52:0F:DE:61:2D:A6:10:20:B8:46:0C:77:D5:D2:D0:BE:20
X509v3 Authority Key Identifier:
keyid:A5:0A:D6:72:B5:DF:E4:C2:2B:7B:07:5E:D3:4D:52:07:E1:83:6B:7F
DirName:/C=FI/ST=Some-State/L=Helsinki/O=MySQL Finland AB/CN=Tonu Samuel/Email=tonu@mysql.com
serial:00
Signature Algorithm: md5WithRSAEncryption
60:85:f7:d0:54:2a:67:88:0e:37:a6:a8:8e:fd:a0:c9:a1:d7:
c6:fc:4c:2e:59:8d:88:6d:69:0a:b8:b2:67:5f:81:94:39:0e:
ab:67:fc:8b:62:de:85:f6:b3:8c:2d:1a:e3:dc:28:fc:f5:99:
39:f0:3d:50:ca:88:c0:8e:f8:c2:02:5d:34:19:63:9f:c4:a2:
f6:a8:81:c9:8d:6d:bd:c4:42:4a:0c:49:5a:cc:24:ea:65:80:
dd:79:20:89:9e:ea:6b:80:7a:86:f9:bb:6d:24:3c:80:13:5b:
e6:16:fc:3d:8d:f6:16:ea:33:25:c6:90:20:81:a4:b0:15:2e:
9c:1c
-----BEGIN CERTIFICATE-----
MIIDfjCCAuegAwIBAgIBATANBgkqhkiG9w0BAQQFADCBhTELMAkGA1UEBhMCRkkx
EzARBgNVBAgTClNvbWUtU3RhdGUxETAPBgNVBAcTCEhlbHNpbmtpMRkwFwYDVQQK
ExBNeVNRTCBGaW5sYW5kIEFCMRQwEgYDVQQDEwtUb251IFNhbXVlbDEdMBsGCSqG
SIb3DQEJARYOdG9udUBteXNxbC5jb20wHhcNMDEwNjI0MTU1MDIzWhcNMDIwNjI0
MTU1MDIzWjBvMQswCQYDVQQGEwJFRTETMBEGA1UECBMKU29tZS1TdGF0ZTEQMA4G
A1UEBxMHVGFsbGlubjEPMA0GA1UEChMGTm9uYW1lMRIwEAYDVQQDEwlNciBOb25h
bWUxFDASBgkqhkiG9w0BCQEWBWFAYi5jMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
iQKBgQCrO31bbJP2RhosRnNviYqZu+lrlA10qqrEXKJhz1a7oalaN8ROsuxcGDqk
ja89I2Z8hX/R8uP8FqdMotZFBpJ12KI7+ap32ia5h+DfUFTkNp81hzmOpnw+qORJ
GnbCb3MLIpMqBGcNfa40XP58Kbii/h7v0QxN3Vt6Z7AKIoigrwIDAQABo4IBETCC
AQ0wCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQg
Q2VydGlmaWNhdGUwHQYDVR0OBBYEFIPRDVIP3mEtphAguEYMd9XS0L4gMIGyBgNV
HSMEgaowgaeAFKUK1nK13+TCK3sHXtNNUgfhg2t/oYGLpIGIMIGFMQswCQYDVQQG
EwJGSTETMBEGA1UECBMKU29tZS1TdGF0ZTERMA8GA1UEBxMISGVsc2lua2kxGTAX
BgNVBAoTEE15U1FMIEZpbmxhbmQgQUIxFDASBgNVBAMTC1RvbnUgU2FtdWVsMR0w
GwYJKoZIhvcNAQkBFg50b251QG15c3FsLmNvbYIBADANBgkqhkiG9w0BAQQFAAOB
gQBghffQVCpniA43pqiO/aDJodfG/EwuWY2IbWkKuLJnX4GUOQ6rZ/yLYt6F9rOM
LRrj3Cj89Zk58D1QyojAjvjCAl00GWOfxKL2qIHJjW29xEJKDElazCTqZYDdeSCJ
nuprgHqG+bttJDyAE1vmFvw9jfYW6jMlxpAggaSwFS6cHA==
-----END CERTIFICATE-----
Signed certificate is in newcert.pem
[root@x153 bin]# ls -la demoCA/newcerts/
total 5
drwxr-xr-x 2 root root 72 Jun 24 18:58 ./
drwxr-xr-x 6 root root 296 Jun 24 18:58 ../
-rw-r--r-- 1 root root 3533 Jun 24 18:58 01.pem
[root@x153 bin]#
[root@x153 mysql-4.0]# ./sql/mysqld --ssl-cert=SSL/server-cert.pem --ssl-ca=SSL/cacert.pem --ssl-ke
y=SSL/server-req.pem -L /home/tonu/mysql-4.0/sql/share/english/ -u root
Enter PEM pass phrase:
./sql/mysqld: ready for connections
[tonu@x153 mysql-4.0]$ client/mysql --ssl-key=SSL/client-req.pem --ssl-ca=SSL/cacert.pem --ssl-cert
=SSL/client-cert.pem
Enter PEM pass phrase:
ERROR:
[tonu@x153 mysql-4.0]$
-8<------------------------
SSL encrypts data between MySQL server and client.
You need openssl (formerly SSLeay) for MySQL SSL support. Development
and testing was done on openssl version 0.9.3a
To compile MySQL one must do:
./configure --with-openssl=/usr
or
./configure --with-openssl=yes
There are sample keys and certificates included with MySQL tarball in
directory ./SSL. They are meant to be for quick start and
testing only. Using them in production environment means same as not
using encryption. This is because private keys are publicly
accessible for everyone. You must use openssl distribution for new key
and certificate generation for both client and server.
----------- for manual: ---------------------
*New API calls:*
mysql_ssl_set() - Set SSL properties (key, certificate,
certificates authority certificate). Must be called before
mysql_real_connect();
mysql_ssl_clear() - Clear and free resources occupied by
mysql_ssl_set() API call.
char *mysql_ssl_cipher(MYSQL *) - returns cipher in use. For example
"DES-CDC3-SHA" means that you have combined triple DES symmetric
algorithm and SHA
hashing algorithm.
*New command line switches:*
--ssl Use SSL for connection (automatically set with
other flags. This means one can use encrypted connection without strong
cryptological authentication. Normally one must use all switches
together including ssl-key, ssl-cert and ssl-ca and never mind about
--ssl because this is assumed by defult if any of them (--ssl-...)
included.
--ssl-key X509 key in PEM format (implies --ssl)
--ssl-cert X509 cert in PEM format (implies --ssl)
--ssl-ca CA file in PEM format (check OpenSSL docs,
implies --ssl)
--ssl-capath CA directory (check OpenSSL docs, implies --ssl
----------------
This is about using SSL in MySQL privilege system. My idea is to make
possible use of x509 certificates and keys instead of MySQL native
passwords
Some basic theory about crypt, SSL and x509:
x509 is standard for certificates. SSL is standard for secure
communication. Certificates are issued by someone anyone can trust. This
trusted party is called "Certificate Authority" or "CA". This is
someone, we MUST trust. Everyone must have some "fingerprint" of CA (so
called "CA certificate" or "CA cert") using which one can verify
authenticity of other
certificates issued by this CA. CA uses his power to give certificates
to persons (they can be physical (like "monty") or logical (like some
process). Person is identified by "subject" like
"/C=EE/ST=Harjumaa/L=Tallinn/O=MySQL client bogus certificate/CN=Tonu
Samuel/Email=<EMAIL: PROTECTED>". and signed cryptologically. This sign can be
verified using CA-cert. So, if we trust CA, then we can trust identity
of user.
There can be many CA-s (usually not but who knows). Also there can be
some users we don`t trust or have different privileges. This means we
must have one table to hold CA-certs and other table to hold so called
"subjects" (users). I think it`s a good idea to use existing structure
of host/user/db/field and add some x509 relationship. Then we can
use usual simple user/host pair or x509 subject/CA pair.
So I think user must grant rights using old method GRANT blabla ON
blabla TO blabla IDENTIFIED BY blabla
or new way:
-----------8<---------------------------
GRANT blabla ON blabla TO blabla
IDENTIFIED BY X509 SUBJECT "/C=EE/ST=Harjumaa/L=Tallinn/O=MySQL client
bogus certificate/CN=Tonu Samuel/Email=<EMAIL: PROTECTED>" AND ISSUER
"/C=EE/ST=Harjumaa/L=Tallinn/O=TCX AB/CN=Tonu
Samuel/Email=<EMAIL: PROTECTED>";
-----------8<---------------------------
Please note the difference in Subject and Issuer. This command requests
user to authenticate itself with exact subject and exact certificate
issuer. Next possibility is just have any certificate of some good CA:
-----------8<---------------------------
GRANT blabla ON blabla TO blabla IDENTIFIED BY X509 ISSUER
"/C=EE/ST=Harjumaa/L=Tallinn/O=TCX
AB/CN=Tonu Samuel/Email=<EMAIL: PROTECTED>";
-----------8<---------------------------
or if any registered CA is good enough (usual case when only one CA is
registered)
but we care about exact user, then something like:
-----------8<---------------------------
GRANT blabla ON blabla TO blabla IDENTIFIED BY X509 SUBJECT
"/C=EE/ST=Harjumaa/L=Tallinn/O=MySQL client
bogus certificate/CN=Tonu Samuel/Email=<EMAIL: PROTECTED>";
-----------8<---------------------------
And case if user must authenticate itself but we don`t care about exact
person until he have some certificate issued by CA registered in our
system:
-----------8<---------------------------
GRANT blabla ON blabla TO blabla IDENTIFIED BY X509;
-----------8<---------------------------
Then additionally we need one exception. Let`s assume we need SSL
encryption
for preventing eavesdropping but we don`t care who it is at all. We need
privilege to exclude all non-SSL users but we accept anyone using SSL.
How
this must be done in GRANT syntax? Maybe:
-----------8<---------------------------
GRANT blabla ON blabla TO blabla
IDENTIFIED BY blabla AND USING SSL
-----------8<---------------------------
But maybe we want to add in future possibility to check different
algorithms and key lengths? Something like:
-----------8<---------------------------
GRANT blabla ON blabla TO blabla IDENTIFIED BY blabla AND USING SSL WITH
CIPHER "DES-CBC3-SHA" OR "DES-CBC3-MD5"
-----------8<---------------------------
Also we need some command to include/exclude CA certificates. This must
be some commands like INSERT/DELETE/UPDATE/REPLACE to do it.
All examples is given for clarify my problem. I asking for help because
I don`t know
any similar command in other SQL-s.
------------8<------------------------
So, at moment SSL communications is ready and working. I don`t have this
command iterface at moment yet and this can be changed a lot if someone
can suggest good idea or reason to change them. We are ready to listen
every opinion.
About Kerberos: I just don`t know much about it. I have to read this
again before I can comment. I never used it itself and forgot most of
theory. Sorry. Anyway now the problem/need is known and I will put
thinking about this in personal TODO.

View file

@ -1,12 +0,0 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIBvDCCASUCAQAwfDELMAkGA1UEBhMCU0UxEDAOBgNVBAcTB1VwcHNhbGExETAP
BgNVBAoTCE15U1FMIEFCMRUwEwYDVQQDEwxNeVNRTCBDbGllbnQxMTAvBgkqhkiG
9w0BCQEWImFic3RyYWN0Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb20wgZ8wDQYJ
KoZIhvcNAQEBBQADgY0AMIGJAoGBAMQDCu7jsRL87rQZ9OFgHeAow5Yt34JpzXR8
VFjQrrNZPwwZHJkQphLJzzpkBUOOv9JlNoCRC2WwJyY4ySPYNqJK8PfAL2g4cAEn
Kf+yxVLha/HI18Nc7vA3bCqblhoFnuszojlad2ZiJ3UfL2842uWfeK/KayI/Vyu8
po9H0ZlvAgMBAAGgADANBgkqhkiG9w0BAQQFAAOBgQAnKdk68dGJXvlj/GXwBUWN
oXWF7hq4fDmwyhmcFUqk8qZKPKFUxkcER0GLzYeUgvD2URSfaS3/YW0d7K7kXGwP
rB5edb+suaYf6mjm/w37xw/EJI9rdSKcB/3SSu8mALds7sUHDAO+MO0WkA/9d7t0
LOsUqcDvMkKpZuYwNILwLw==
-----END CERTIFICATE REQUEST-----

View file

@ -1,10 +0,0 @@
#! /bin/sh
cmd () {
echo $*
$*
}
client/mysql --port=4407 --socket=/tmp/test.mysql.sock --ssl-ca=SSL/cacert.pem --ssl-cert=SSL/client-cert.pem --ssl-key=SSL/client-key.pem --debug='d:t:O,/tmp/client.trace' -h 127.0.0.1 -u root
#--execute="select version();show status"

View file

@ -1,9 +0,0 @@
#! /bin/sh
cmd () {
echo $*
$*
}
cmd sql/mysqld --port=4407 --socket=/tmp/test.mysql.sock --ssl-ca=SSL/cacert.pem --ssl-cert=SSL/server-cert.pem --ssl-key=SSL/server-key.pem --debug='d:t:O,/tmp/mysqld.trace' -uroot >& /tmp/mysqld.output

View file

@ -1,12 +0,0 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIBvDCCASUCAQAwfDELMAkGA1UEBhMCU0UxEDAOBgNVBAcTB1VwcHNhbGExETAP
BgNVBAoTCE15U1FMIEFCMRUwEwYDVQQDEwxNeVNRTCBTZXJ2ZXIxMTAvBgkqhkiG
9w0BCQEWImFic3RyYWN0Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb20wgZ8wDQYJ
KoZIhvcNAQEBBQADgY0AMIGJAoGBAOmGelWEiEy+pPiSczASSQt6hYc5NDkNfQuN
GMIXlRNS0j9VEFfIP1r1svqL0GdJzKqC/J/OALRz8zbSOtPCsA4Uw9SyIXSh8DGB
YIeYc1wQwbEaTfHzsJg/8NeXmyv91SF5si/rZBXJm538ni3U+ARb6ql1S0LDPQ5N
Kqi4ypmNAgMBAAGgADANBgkqhkiG9w0BAQQFAAOBgQCagJxGHBC+G5aSh3OguFn6
z+qAC7u3B181kPBgNv20zMgLeq7YiAh3iNx4XO2+QXRGzMznFKx1tFr/mavCpgLs
p3+dCvQt5FHEFFK1D1pDeXy4146X07hOTtC9jc/jSWeVnH4ujuX5gMtZqisOyYWV
/gpw6dBtkTYlhS+y86kM/Q==
-----END CERTIFICATE REQUEST-----

View file

@ -38,7 +38,6 @@ LDADD= @CLIENT_EXTRA_LDFLAGS@ $(CLIENT_THREAD_LIBS) \
$(top_builddir)/libmysql/libmysqlclient.la
bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \
mysqldump mysqlimport mysqltest mysqlbinlog \
mysqltestmanagerc mysqltestmanager-pwgen \
mysqlslap mysql_upgrade
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
client_priv.h
@ -63,8 +62,6 @@ mysqlimport_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
@CLIENT_EXTRA_LDFLAGS@ \
$(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a
mysqltestmanager_pwgen_SOURCES = mysqlmanager-pwgen.c
mysqltestmanagerc_SOURCES= mysqlmanagerc.c $(yassl_dummy_link_fix)
mysqlcheck_SOURCES= mysqlcheck.c $(yassl_dummy_link_fix)
mysqlshow_SOURCES= mysqlshow.c $(yassl_dummy_link_fix)
mysqlslap_SOURCES= mysqlslap.c \

View file

@ -1,161 +0,0 @@
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#define MANAGER_PWGEN_VERSION "1.4"
#include <my_global.h>
#include <m_ctype.h>
#include <my_sys.h>
#include <m_string.h>
#include <mysql_version.h>
#include <errno.h>
#include <my_getopt.h>
#include <md5.h>
const char* outfile=0,*user="root";
static struct my_option my_long_options[] =
{
{"output-file", 'o', "Write the output to the file with the given name.",
(gptr*) &outfile, (gptr*) &outfile, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
{"user", 'u', "Put given user in the password file.", (gptr*) &user,
(gptr*) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this message and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
{"version", 'V', "Display version info.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
static void die(const char* fmt, ...)
{
va_list args;
DBUG_ENTER("die");
va_start(args, fmt);
if (fmt)
{
fprintf(stderr, "%s: ", my_progname);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
fflush(stderr);
}
va_end(args);
exit(1);
}
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,
MANAGER_PWGEN_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
}
void usage()
{
print_version();
printf("MySQL AB, by Sasha\n");
printf("This software comes with ABSOLUTELY NO WARRANTY\n\n");
printf("Generates a password file to be used by mysqltest.\n\n");
printf("Usage: %s [OPTIONS]\n", my_progname);
my_print_help(my_long_options);
my_print_variables(my_long_options);
}
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument __attribute__((unused)))
{
switch (optid) {
case '?':
usage();
exit(0);
case 'V':
print_version();
exit(0);
}
return 0;
}
int parse_args(int argc, char** argv)
{
int ho_error;
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
return 0;
}
void get_pass(char* pw, int len)
{
FILE* fp;
char* pw_end=pw+len;
/*
/dev/random is more secure than rand() because the seed is easy to
predict, so we resort to rand() only if /dev/random is not available
*/
if ((fp=fopen("/dev/random","r")))
{
fread(pw,len,1,fp);
fclose(fp);
while (pw<pw_end)
{
char tmp= 'a'+((uint)*pw % 26);
*pw++= tmp;
}
}
else
{
srand(time(NULL));
while (pw<pw_end)
{
char tmp= 'a'+((uint)*pw % 26);
*pw++= tmp;
}
}
*pw_end=0;
}
int main(int argc, char** argv)
{
FILE* fp;
my_MD5_CTX context;
uchar digest[16];
char pw[17];
uint i;
MY_INIT(argv[0]);
parse_args(argc,argv);
if (!outfile)
die("Missing --output-file");
if (!(fp=fopen(outfile,"w")))
die("Could not open '%s'(errno=%d)",outfile,errno);
get_pass(pw,sizeof(pw)-1);
my_MD5Init(&context);
my_MD5Update(&context,(uchar*) pw,sizeof(pw)-1);
my_MD5Final(digest,&context);
fprintf(fp,"%s:",user);
for (i=0;i<sizeof(digest);i++)
fprintf(fp,"%02x",digest[i]);
fprintf(fp,"\n");
fclose(fp);
printf("%s\n",pw);
return 0;
}

View file

@ -1,174 +0,0 @@
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#define MANAGER_CLIENT_VERSION "1.4"
#include <my_global.h>
#include <mysql.h>
#include <mysql_version.h>
#include <mysqld_error.h>
#include <my_sys.h>
#include <m_string.h>
#include <my_getopt.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <unistd.h>
#ifndef MYSQL_MANAGER_PORT
#define MYSQL_MANAGER_PORT 9305
#endif
static void die(const char* fmt, ...);
const char* user="root",*host="localhost";
char* pass=0;
my_bool quiet=0;
uint port=MYSQL_MANAGER_PORT;
static const char *load_default_groups[]= { "mysqlmanagerc",0 };
char** default_argv;
MYSQL_MANAGER *manager;
FILE* fp, *fp_out;
static struct my_option my_long_options[] =
{
{"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "User for login.", (gptr*) &user, (gptr*) &user, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p', "Password to use when connecting to server.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection.", (gptr*) &port,
(gptr*) &port, 0, GET_UINT, REQUIRED_ARG, MYSQL_MANAGER_PORT, 0, 0, 0, 0,
0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"quiet", 'q', "Suppress all normal output.", (gptr*) &quiet, (gptr*) &quiet,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
static void die(const char* fmt, ...)
{
va_list args;
DBUG_ENTER("die");
va_start(args, fmt);
if (fmt)
{
fprintf(stderr, "%s: ", my_progname);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
fflush(stderr);
}
va_end(args);
exit(1);
}
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,
MANAGER_CLIENT_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
}
void usage()
{
print_version();
printf("MySQL AB, by Sasha\n");
printf("This software comes with ABSOLUTELY NO WARRANTY\n\n");
printf("Command-line client for MySQL manager daemon.\n\n");
printf("Usage: %s [OPTIONS] < command_file\n", my_progname);
my_print_help(my_long_options);
printf(" --no-defaults Don't read default options from any options file.\n");
my_print_variables(my_long_options);
}
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
my_bool tty_password=0;
switch (optid) {
case 'p':
if (argument)
{
my_free(pass, MYF(MY_ALLOW_ZERO_PTR));
pass= my_strdup(argument, MYF(MY_FAE));
while (*argument) *argument++= 'x'; /* Destroy argument */
}
else
tty_password=1;
break;
case 'V':
print_version();
exit(0);
case '?':
usage();
exit(0);
}
return 0;
}
int parse_args(int argc, char **argv)
{
int ho_error;
load_defaults("my",load_default_groups,&argc,&argv);
default_argv= argv;
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
return 0;
}
int main(int argc, char** argv)
{
MY_INIT(argv[0]);
fp=stdin;
fp_out=stdout;
parse_args(argc,argv);
if (!(manager=mysql_manager_init(0)))
die("Failed in mysql_manager_init()");
if (!mysql_manager_connect(manager,host,user,pass,port))
die("Could not connect to MySQL manager: %s (%d)",manager->last_error,
manager->last_errno);
for (;!feof(fp);)
{
char buf[4096];
if (!fgets(buf,sizeof(buf),fp))
break;
if (!quiet)
fprintf(fp_out,"<<%s",buf);
if (mysql_manager_command(manager,buf,strlen(buf)))
die("Error in command: %s (%d)",manager->last_error,manager->last_errno);
while (!manager->eof)
{
if (mysql_manager_fetch_line(manager,buf,sizeof(buf)))
die("Error fetching result line: %s (%d)", manager->last_error,
manager->last_errno);
if (!quiet)
fprintf(fp_out,">>%s\n",buf);
}
}
mysql_manager_close(manager);
return 0;
}

View file

@ -2218,23 +2218,7 @@ then
[Access checks in embedded library])
fi
AC_ARG_WITH(extra-tools,
[ --without-extra-tools Skip building utilites in the tools directory.],
[with_tools=$withval],
[with_tools=yes]
)
tools_dirs=""
if test "$with_tools" = "yes"
then
if test "$THREAD_SAFE_CLIENT" = "no"
then
AC_MSG_WARN([extra-tools disabled because --enable-thread-safe-client wasn't used])
else
tools_dirs="tools"
AC_CONFIG_FILES(tools/Makefile)
fi
fi
AC_ARG_WITH([mysqlmanager],
AC_HELP_STRING([--with-mysqlmanager], [Build the mysqlmanager binary: yes/no (default: build if server is built.)]),
@ -2607,7 +2591,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
man/Makefile BUILD/Makefile vio/Makefile dnl
libmysql/Makefile client/Makefile dnl
pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile dnl
sql/handlerton.cc sql-common/Makefile SSL/Makefile dnl
sql/handlerton.cc sql-common/Makefile dnl
dbug/Makefile scripts/Makefile dnl
include/Makefile sql-bench/Makefile dnl
server-tools/Makefile server-tools/instance-manager/Makefile dnl

View file

@ -32,9 +32,6 @@ test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
CLEANFILES = $(GENSCRIPTS) $(test_DATA)
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
EXTRA_PROGRAMS = mysql_test_run_new
noinst_HEADERS = my_manage.h
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
dist-hook:
@ -106,17 +103,6 @@ install-data-local:
uninstall-local:
@RM@ -f -r $(DESTDIR)$(testdir)
std_data/client-key.pem:
@CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
std_data/client-cert.pem:
@CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
std_data/cacert.pem:
@CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
std_data/server-cert.pem:
@CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
std_data/server-key.pem:
@CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
SUFFIXES = .sh
.sh:

File diff suppressed because one or more lines are too long

View file

@ -1,673 +0,0 @@
#include <stdio.h>
#include <errno.h>
#ifndef __WIN__
#include <dirent.h>
#endif
#include <string.h>
#ifdef __NETWARE__
#include <screen.h>
#include <proc.h>
#else
#include <sys/types.h>
#ifndef __WIN__
#include <sys/wait.h>
#include <unistd.h>
#else
#include <direct.h>
#include <stdlib.h>
#include <stdio.h>
#endif
#endif
#include <ctype.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <assert.h>
#include "my_manage.h"
/*
Synopsis:
This function testes a exist file
Arguments:
mdata: path to data
file_name: name of file
Output:
A zero value indicates that file is exist.
*/
bool test_sys_file(const char *mdata,const char *file_name)
{
struct stat file;
char path_file_name[PATH_MAX];
snprintf(path_file_name, PATH_MAX, "%s/%s", mdata, file_name);
return(stat(path_file_name,&file));
}
/*
Synopsis:
This function creates a file with sql requstes for creating
system data files.
Arguments:
mdata: path to data
output_file: file name for output file
test: to create system files with test data
Output:
A zero value indicates a success.
*/
bool create_system_files(const char *mdata,const char *output_file, bool test)
{
FILE *out;
out = fopen(output_file, "w+");
if (!out)
return 1;
if (test_sys_file(mdata,"mysql"))
{
fprintf(out,"CREATE DATABASE mysql;\n");
}
if (test && test_sys_file(mdata,"test"))
{
fprintf(out,"CREATE DATABASE test;\n");
}
fprintf(out,"USE mysql;\n");
if (test_sys_file(mdata,"mysql/db.frm"))
{
fprintf(out,
"CREATE TABLE db ("
"Host char(60) binary DEFAULT '' NOT NULL,"
"Db char(64) binary DEFAULT '' NOT NULL,"
"User char(16) binary DEFAULT '' NOT NULL,"
"Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY Host (Host,Db,User),"
"KEY User (User))"
"engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Database privileges';\n");
if (test)
{
fprintf(out,"INSERT INTO db VALUES ('%%','test','','Y','Y','Y','Y'"
",'Y','Y','N','Y','Y','Y','Y','Y');\n");
fprintf(out,"INSERT INTO db VALUES ('%%','test\\_%%','','Y','Y','Y'"
",'Y','Y','Y','N','Y','Y','Y','Y','Y');\n");
}
}
if (test_sys_file(mdata,"mysql/host.frm"))
{
fprintf(out,
"CREATE TABLE host ("
"Host char(60) binary DEFAULT '' NOT NULL,"
"Db char(64) binary DEFAULT '' NOT NULL,"
"Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY Host (Host,Db))"
"engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Host privileges; Merged with database privileges';\n");
}
if (test_sys_file(mdata,"mysql/user.frm"))
{
#ifdef __WIN__
WSADATA wsa_data;
#endif
char hostname[FN_REFLEN];
#ifdef __WIN__
if (WSAStartup(MAKEWORD( 2, 2 ),&wsa_data))
return 1;
#endif
if (gethostname(hostname, FN_REFLEN))
return 1;
#ifdef __WIN__
WSACleanup( );
#endif
if (strchr(hostname, '.') == NULL)
strcat(hostname, "%");
fprintf(out,
"CREATE TABLE user ("
"Host char(60) binary DEFAULT '' NOT NULL,"
"User char(16) binary DEFAULT '' NOT NULL,"
"Password char(41) binary DEFAULT '' NOT NULL,"
"Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"File_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,"
"ssl_cipher BLOB NOT NULL,"
"x509_issuer BLOB NOT NULL,"
"x509_subject BLOB NOT NULL,"
"max_questions int(11) unsigned DEFAULT 0 NOT NULL,"
"max_updates int(11) unsigned DEFAULT 0 NOT NULL,"
"max_connections int(11) unsigned DEFAULT 0 NOT NULL,"
"PRIMARY KEY Host (Host,User)"
") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Users and global privileges';\n");
if (test)
{
fprintf(out,
"INSERT INTO user VALUES ('localhost','root',''"
",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'"
",'Y','Y','Y','Y','Y','','','','',0,0,0);\n");
fprintf(out,
"INSERT INTO user VALUES ('%s','root','','Y','Y',"
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"
"'Y','Y','Y','Y','','','','',0,0,0);\n",hostname);
fprintf(out,
"REPLACE INTO user VALUES ('127.0.0.1','root','',"
"'Y','Y','Y','Y','Y','Y',"
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'"
",'Y','','','','',0,0,0);\n");
fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n");
fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname);
}
else
{
fprintf(out,
"INSERT INTO user VALUES ('localhost','root','',"
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"
"'Y','Y','Y','Y','','','','',0,0,0);\n");
#ifndef __WIN__
fprintf(out,
"INSERT INTO user VALUES ('%s','root','','Y','Y',"
"'Y','Y','Y','Y','Y','Y'"
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','',''"
",'','',0,0,0);\n",hostname);
fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname);
fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n");
#else
fprintf(out,
"INSERT INTO user VALUES ('localhost','','','Y','Y','Y'"
",'Y','Y','Y','Y','Y','Y'"
",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','',"
"'','',0,0,0);\n");
#endif
}
}
if (test_sys_file(mdata,"mysql/func.frm"))
{
fprintf(out,
"CREATE TABLE func ("
"name char(64) binary DEFAULT '' NOT NULL,"
"ret tinyint(1) DEFAULT '0' NOT NULL,"
"dl char(128) DEFAULT '' NOT NULL,"
"type enum ('function','aggregate') NOT NULL,"
"PRIMARY KEY (name)"
") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='User defined functions';\n");
}
if (test_sys_file(mdata,"mysql/tables_priv.frm"))
{
fprintf(out,
"CREATE TABLE tables_priv ("
"Host char(60) binary DEFAULT '' NOT NULL,"
"Db char(64) binary DEFAULT '' NOT NULL,"
"User char(16) binary DEFAULT '' NOT NULL,"
"Table_name char(64) binary DEFAULT '' NOT NULL,"
"Grantor char(77) DEFAULT '' NOT NULL,"
"Timestamp timestamp(14),"
"Table_priv set('Select','Insert','Update','Delete',"
"'Create','Drop','Grant','References','Index','Alter')"
" DEFAULT '' NOT NULL,"
"Column_priv set('Select','Insert','Update','References')"
" DEFAULT '' NOT NULL,"
"PRIMARY KEY (Host,Db,User,Table_name),"
"KEY Grantor (Grantor)"
") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Table privileges';\n");
}
if (test_sys_file(mdata,"mysql/columns_priv.frm"))
{
fprintf(out,
"CREATE TABLE columns_priv ("
"Host char(60) binary DEFAULT '' NOT NULL,"
"Db char(64) binary DEFAULT '' NOT NULL,"
"User char(16) binary DEFAULT '' NOT NULL,"
"Table_name char(64) binary DEFAULT '' NOT NULL,"
"Column_name char(64) binary DEFAULT '' NOT NULL,"
"Timestamp timestamp(14),"
"Column_priv set('Select','Insert','Update','References')"
" DEFAULT '' NOT NULL,"
"PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Column privileges';\n");
}
if (test_sys_file(mdata,"mysql/help_topic.frm"))
{
fprintf(out,
"CREATE TABLE help_topic ("
"help_topic_id int unsigned not null,"
"name varchar(64) not null,"
"help_category_id smallint unsigned not null,"
"description text not null,"
"example text not null,"
"url varchar(128) not null,"
"primary key (help_topic_id),"
"unique index (name)"
") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='help topics';\n");
}
if (test_sys_file(mdata,"mysql/help_category.frm"))
{
fprintf(out,
"CREATE TABLE help_category ("
"help_category_id smallint unsigned not null,"
"name varchar(64) not null,"
"parent_category_id smallint unsigned null,"
"url varchar(128) not null,"
"primary key (help_category_id),"
"unique index (name)"
") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='help categories';\n");
}
if (test_sys_file(mdata,"mysql/help_keyword.frm"))
{
fprintf(out,
"CREATE TABLE help_keyword ("
"help_keyword_id int unsigned not null,"
"name varchar(64) not null,"
"primary key (help_keyword_id),"
"unique index (name)"
") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='help keywords';\n");
}
if (test_sys_file(mdata,"mysql/help_relation.frm"))
{
fprintf(out,
"CREATE TABLE help_relation ("
"help_topic_id int unsigned not null references help_topic,"
"help_keyword_id int unsigned not null references help_keyword,"
"primary key (help_keyword_id, help_topic_id)"
") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='keyword-topic relation';\n");
}
if (test_sys_file(mdata,"mysql/time_zone_name.frm"))
{
fprintf(out,
"CREATE TABLE time_zone_name ("
"Name char(64) NOT NULL,"
"Time_zone_id int unsigned NOT NULL,"
"PRIMARY KEY Name (Name)"
") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zone names';\n");
if (test)
{
fprintf(out,
"INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES"
"('MET', 1), ('UTC', 2), ('Universal', 2), "
"('Europe/Moscow',3), ('leap/Europe/Moscow',4),"
"('Japan', 5);\n");
}
}
if (test_sys_file(mdata,"mysql/time_zone.frm"))
{
fprintf(out,
"CREATE TABLE time_zone ("
"Time_zone_id int unsigned NOT NULL auto_increment,"
"Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY TzId (Time_zone_id)"
") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zones';\n");
if (test)
{
fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)"
"VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');\n");
}
}
if (test_sys_file(mdata,"mysql/time_zone_transition.frm"))
{
fprintf(out,
"CREATE TABLE time_zone_transition ("
"Time_zone_id int unsigned NOT NULL,"
"Transition_time bigint signed NOT NULL,"
"Transition_type_id int unsigned NOT NULL,"
"PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)"
") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zone transitions';\n");
if (test)
{
fprintf(out,
"INSERT INTO time_zone_transition"
"(Time_zone_id, Transition_time, Transition_type_id)"
"VALUES"
" (1, -1693706400, 0) ,(1, -1680483600, 1)"
",(1, -1663455600, 2) ,(1, -1650150000, 3)"
",(1, -1632006000, 2) ,(1, -1618700400, 3)"
",(1, -938905200, 2) ,(1, -857257200, 3)"
",(1, -844556400, 2) ,(1, -828226800, 3)"
",(1, -812502000, 2) ,(1, -796777200, 3)"
",(1, 228877200, 2) ,(1, 243997200, 3)"
",(1, 260326800, 2) ,(1, 276051600, 3)"
",(1, 291776400, 2) ,(1, 307501200, 3)"
",(1, 323830800, 2) ,(1, 338950800, 3)"
",(1, 354675600, 2) ,(1, 370400400, 3)"
",(1, 386125200, 2) ,(1, 401850000, 3)"
",(1, 417574800, 2) ,(1, 433299600, 3)"
",(1, 449024400, 2) ,(1, 465354000, 3)"
",(1, 481078800, 2) ,(1, 496803600, 3)"
",(1, 512528400, 2) ,(1, 528253200, 3)"
",(1, 543978000, 2) ,(1, 559702800, 3)"
",(1, 575427600, 2) ,(1, 591152400, 3)"
",(1, 606877200, 2) ,(1, 622602000, 3)"
",(1, 638326800, 2) ,(1, 654656400, 3)"
",(1, 670381200, 2) ,(1, 686106000, 3)"
",(1, 701830800, 2) ,(1, 717555600, 3)"
",(1, 733280400, 2) ,(1, 749005200, 3)"
",(1, 764730000, 2) ,(1, 780454800, 3)"
",(1, 796179600, 2) ,(1, 811904400, 3)"
",(1, 828234000, 2) ,(1, 846378000, 3)"
",(1, 859683600, 2) ,(1, 877827600, 3)"
",(1, 891133200, 2) ,(1, 909277200, 3)"
",(1, 922582800, 2) ,(1, 941331600, 3)"
",(1, 954032400, 2) ,(1, 972781200, 3)"
",(1, 985482000, 2) ,(1, 1004230800, 3)"
",(1, 1017536400, 2) ,(1, 1035680400, 3)"
",(1, 1048986000, 2) ,(1, 1067130000, 3)"
",(1, 1080435600, 2) ,(1, 1099184400, 3)"
",(1, 1111885200, 2) ,(1, 1130634000, 3)"
",(1, 1143334800, 2) ,(1, 1162083600, 3)"
",(1, 1174784400, 2) ,(1, 1193533200, 3)"
",(1, 1206838800, 2) ,(1, 1224982800, 3)"
",(1, 1238288400, 2) ,(1, 1256432400, 3)"
",(1, 1269738000, 2) ,(1, 1288486800, 3)"
",(1, 1301187600, 2) ,(1, 1319936400, 3)"
",(1, 1332637200, 2) ,(1, 1351386000, 3)"
",(1, 1364691600, 2) ,(1, 1382835600, 3)"
",(1, 1396141200, 2) ,(1, 1414285200, 3)"
",(1, 1427590800, 2) ,(1, 1445734800, 3)"
",(1, 1459040400, 2) ,(1, 1477789200, 3)"
",(1, 1490490000, 2) ,(1, 1509238800, 3)"
",(1, 1521939600, 2) ,(1, 1540688400, 3)"
",(1, 1553994000, 2) ,(1, 1572138000, 3)"
",(1, 1585443600, 2) ,(1, 1603587600, 3)"
",(1, 1616893200, 2) ,(1, 1635642000, 3)"
",(1, 1648342800, 2) ,(1, 1667091600, 3)"
",(1, 1679792400, 2) ,(1, 1698541200, 3)"
",(1, 1711846800, 2) ,(1, 1729990800, 3)"
",(1, 1743296400, 2) ,(1, 1761440400, 3)"
",(1, 1774746000, 2) ,(1, 1792890000, 3)"
",(1, 1806195600, 2) ,(1, 1824944400, 3)"
",(1, 1837645200, 2) ,(1, 1856394000, 3)"
",(1, 1869094800, 2) ,(1, 1887843600, 3)"
",(1, 1901149200, 2) ,(1, 1919293200, 3)"
",(1, 1932598800, 2) ,(1, 1950742800, 3)"
",(1, 1964048400, 2) ,(1, 1982797200, 3)"
",(1, 1995498000, 2) ,(1, 2014246800, 3)"
",(1, 2026947600, 2) ,(1, 2045696400, 3)"
",(1, 2058397200, 2) ,(1, 2077146000, 3)"
",(1, 2090451600, 2) ,(1, 2108595600, 3)"
",(1, 2121901200, 2) ,(1, 2140045200, 3)"
",(3, -1688265000, 2) ,(3, -1656819048, 1)"
",(3, -1641353448, 2) ,(3, -1627965048, 3)"
",(3, -1618716648, 1) ,(3, -1596429048, 3)"
",(3, -1593829848, 5) ,(3, -1589860800, 4)"
",(3, -1542427200, 5) ,(3, -1539493200, 6)"
",(3, -1525323600, 5) ,(3, -1522728000, 4)"
",(3, -1491188400, 7) ,(3, -1247536800, 4)"
",(3, 354920400, 5) ,(3, 370728000, 4)"
",(3, 386456400, 5) ,(3, 402264000, 4)"
",(3, 417992400, 5) ,(3, 433800000, 4)"
",(3, 449614800, 5) ,(3, 465346800, 8)"
",(3, 481071600, 9) ,(3, 496796400, 8)"
",(3, 512521200, 9) ,(3, 528246000, 8)"
",(3, 543970800, 9) ,(3, 559695600, 8)"
",(3, 575420400, 9) ,(3, 591145200, 8)"
",(3, 606870000, 9) ,(3, 622594800, 8)"
",(3, 638319600, 9) ,(3, 654649200, 8)"
",(3, 670374000, 10) ,(3, 686102400, 11)"
",(3, 695779200, 8) ,(3, 701812800, 5)"
",(3, 717534000, 4) ,(3, 733273200, 9)"
",(3, 748998000, 8) ,(3, 764722800, 9)"
",(3, 780447600, 8) ,(3, 796172400, 9)"
",(3, 811897200, 8) ,(3, 828226800, 9)"
",(3, 846370800, 8) ,(3, 859676400, 9)"
",(3, 877820400, 8) ,(3, 891126000, 9)"
",(3, 909270000, 8) ,(3, 922575600, 9)"
",(3, 941324400, 8) ,(3, 954025200, 9)"
",(3, 972774000, 8) ,(3, 985474800, 9)"
",(3, 1004223600, 8) ,(3, 1017529200, 9)"
",(3, 1035673200, 8) ,(3, 1048978800, 9)"
",(3, 1067122800, 8) ,(3, 1080428400, 9)"
",(3, 1099177200, 8) ,(3, 1111878000, 9)"
",(3, 1130626800, 8) ,(3, 1143327600, 9)"
",(3, 1162076400, 8) ,(3, 1174777200, 9)"
",(3, 1193526000, 8) ,(3, 1206831600, 9)"
",(3, 1224975600, 8) ,(3, 1238281200, 9)"
",(3, 1256425200, 8) ,(3, 1269730800, 9)"
",(3, 1288479600, 8) ,(3, 1301180400, 9)"
",(3, 1319929200, 8) ,(3, 1332630000, 9)"
",(3, 1351378800, 8) ,(3, 1364684400, 9)"
",(3, 1382828400, 8) ,(3, 1396134000, 9)"
",(3, 1414278000, 8) ,(3, 1427583600, 9)"
",(3, 1445727600, 8) ,(3, 1459033200, 9)"
",(3, 1477782000, 8) ,(3, 1490482800, 9)"
",(3, 1509231600, 8) ,(3, 1521932400, 9)"
",(3, 1540681200, 8) ,(3, 1553986800, 9)"
",(3, 1572130800, 8) ,(3, 1585436400, 9)"
",(3, 1603580400, 8) ,(3, 1616886000, 9)"
",(3, 1635634800, 8) ,(3, 1648335600, 9)"
",(3, 1667084400, 8) ,(3, 1679785200, 9)"
",(3, 1698534000, 8) ,(3, 1711839600, 9)"
",(3, 1729983600, 8) ,(3, 1743289200, 9)"
",(3, 1761433200, 8) ,(3, 1774738800, 9)"
",(3, 1792882800, 8) ,(3, 1806188400, 9)"
",(3, 1824937200, 8) ,(3, 1837638000, 9)"
",(3, 1856386800, 8) ,(3, 1869087600, 9)"
",(3, 1887836400, 8) ,(3, 1901142000, 9)"
",(3, 1919286000, 8) ,(3, 1932591600, 9)"
",(3, 1950735600, 8) ,(3, 1964041200, 9)"
",(3, 1982790000, 8) ,(3, 1995490800, 9)"
",(3, 2014239600, 8) ,(3, 2026940400, 9)"
",(3, 2045689200, 8) ,(3, 2058390000, 9)"
",(3, 2077138800, 8) ,(3, 2090444400, 9)"
",(3, 2108588400, 8) ,(3, 2121894000, 9)"
",(3, 2140038000, 8)"
",(4, -1688265000, 2) ,(4, -1656819048, 1)"
",(4, -1641353448, 2) ,(4, -1627965048, 3)"
",(4, -1618716648, 1) ,(4, -1596429048, 3)"
",(4, -1593829848, 5) ,(4, -1589860800, 4)"
",(4, -1542427200, 5) ,(4, -1539493200, 6)"
",(4, -1525323600, 5) ,(4, -1522728000, 4)"
",(4, -1491188400, 7) ,(4, -1247536800, 4)"
",(4, 354920409, 5) ,(4, 370728010, 4)"
",(4, 386456410, 5) ,(4, 402264011, 4)"
",(4, 417992411, 5) ,(4, 433800012, 4)"
",(4, 449614812, 5) ,(4, 465346812, 8)"
",(4, 481071612, 9) ,(4, 496796413, 8)"
",(4, 512521213, 9) ,(4, 528246013, 8)"
",(4, 543970813, 9) ,(4, 559695613, 8)"
",(4, 575420414, 9) ,(4, 591145214, 8)"
",(4, 606870014, 9) ,(4, 622594814, 8)"
",(4, 638319615, 9) ,(4, 654649215, 8)"
",(4, 670374016, 10) ,(4, 686102416, 11)"
",(4, 695779216, 8) ,(4, 701812816, 5)"
",(4, 717534017, 4) ,(4, 733273217, 9)"
",(4, 748998018, 8) ,(4, 764722818, 9)"
",(4, 780447619, 8) ,(4, 796172419, 9)"
",(4, 811897219, 8) ,(4, 828226820, 9)"
",(4, 846370820, 8) ,(4, 859676420, 9)"
",(4, 877820421, 8) ,(4, 891126021, 9)"
",(4, 909270021, 8) ,(4, 922575622, 9)"
",(4, 941324422, 8) ,(4, 954025222, 9)"
",(4, 972774022, 8) ,(4, 985474822, 9)"
",(4, 1004223622, 8) ,(4, 1017529222, 9)"
",(4, 1035673222, 8) ,(4, 1048978822, 9)"
",(4, 1067122822, 8) ,(4, 1080428422, 9)"
",(4, 1099177222, 8) ,(4, 1111878022, 9)"
",(4, 1130626822, 8) ,(4, 1143327622, 9)"
",(4, 1162076422, 8) ,(4, 1174777222, 9)"
",(4, 1193526022, 8) ,(4, 1206831622, 9)"
",(4, 1224975622, 8) ,(4, 1238281222, 9)"
",(4, 1256425222, 8) ,(4, 1269730822, 9)"
",(4, 1288479622, 8) ,(4, 1301180422, 9)"
",(4, 1319929222, 8) ,(4, 1332630022, 9)"
",(4, 1351378822, 8) ,(4, 1364684422, 9)"
",(4, 1382828422, 8) ,(4, 1396134022, 9)"
",(4, 1414278022, 8) ,(4, 1427583622, 9)"
",(4, 1445727622, 8) ,(4, 1459033222, 9)"
",(4, 1477782022, 8) ,(4, 1490482822, 9)"
",(4, 1509231622, 8) ,(4, 1521932422, 9)"
",(4, 1540681222, 8) ,(4, 1553986822, 9)"
",(4, 1572130822, 8) ,(4, 1585436422, 9)"
",(4, 1603580422, 8) ,(4, 1616886022, 9)"
",(4, 1635634822, 8) ,(4, 1648335622, 9)"
",(4, 1667084422, 8) ,(4, 1679785222, 9)"
",(4, 1698534022, 8) ,(4, 1711839622, 9)"
",(4, 1729983622, 8) ,(4, 1743289222, 9)"
",(4, 1761433222, 8) ,(4, 1774738822, 9)"
",(4, 1792882822, 8) ,(4, 1806188422, 9)"
",(4, 1824937222, 8) ,(4, 1837638022, 9)"
",(4, 1856386822, 8) ,(4, 1869087622, 9)"
",(4, 1887836422, 8) ,(4, 1901142022, 9)"
",(4, 1919286022, 8) ,(4, 1932591622, 9)"
",(4, 1950735622, 8) ,(4, 1964041222, 9)"
",(4, 1982790022, 8) ,(4, 1995490822, 9)"
",(4, 2014239622, 8) ,(4, 2026940422, 9)"
",(4, 2045689222, 8) ,(4, 2058390022, 9)"
",(4, 2077138822, 8) ,(4, 2090444422, 9)"
",(4, 2108588422, 8) ,(4, 2121894022, 9)"
",(4, 2140038022, 8), (5, -1009875600, 1);\n");
}
}
if (test_sys_file(mdata,"mysql/time_zone_transition_type.frm"))
{
fprintf(out,
"CREATE TABLE time_zone_transition_type ("
"Time_zone_id int unsigned NOT NULL,"
"Transition_type_id int unsigned NOT NULL,"
"Offset int signed DEFAULT 0 NOT NULL,"
"Is_DST tinyint unsigned DEFAULT 0 NOT NULL,"
"Abbreviation char(8) DEFAULT '' NOT NULL,"
"PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)"
") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zone transition types';\n");
if (test)
{
fprintf(out,
"INSERT INTO time_zone_transition_type (Time_zone_id,"
"Transition_type_id, Offset, Is_DST, Abbreviation) VALUES"
"(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')"
",(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')"
",(2, 0, 0, 0, 'UTC')"
",(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')"
",(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')"
",(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')"
",(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')"
",(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')"
",(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')"
",(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')"
",(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')"
",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')"
",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')"
",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')"
",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')"
",(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');\n");
}
}
if (test_sys_file(mdata,"mysql/time_zone_leap_second.frm"))
{
fprintf(out,
"CREATE TABLE time_zone_leap_second ("
"Transition_time bigint signed NOT NULL,"
"Correction int signed NOT NULL,"
"PRIMARY KEY TranTime (Transition_time)"
") engine=MyISAM CHARACTER SET utf8 "
"comment='Leap seconds information for time zones';\n");
if (test)
{
fprintf(out,
"INSERT INTO time_zone_leap_second "
"(Transition_time, Correction) VALUES "
"(78796800, 1) ,(94694401, 2) ,(126230402, 3)"
",(157766403, 4) ,(189302404, 5) ,(220924805, 6)"
",(252460806, 7) ,(283996807, 8) ,(315532808, 9)"
",(362793609, 10) ,(394329610, 11) ,(425865611, 12)"
",(489024012, 13) ,(567993613, 14) ,(631152014, 15)"
",(662688015, 16) ,(709948816, 17) ,(741484817, 18)"
",(773020818, 19) ,(820454419, 20) ,(867715220, 21)"
",(915148821, 22);\n");
}
}
return fclose(out);
}

View file

@ -1,887 +0,0 @@
/*
Copyright (c) 2003 Novell, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <errno.h>
#ifndef __WIN__
#include <dirent.h>
#endif
#include <string.h>
#ifdef __NETWARE__
#include <screen.h>
#include <proc.h>
#else
#include <sys/types.h>
#ifndef __WIN__
#include <sys/wait.h>
#include <unistd.h>
#include <signal.h>
#include <fnmatch.h> /* FIXME HAVE_FNMATCH_H or something */
#else
#include <direct.h>
#include <stdlib.h>
#include <stdio.h>
#endif
#endif
#include <ctype.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <assert.h>
#include "my_manage.h"
#ifndef __NETWARE__
#define ASSERT assert
extern char **environ;
#endif
/******************************************************************************
macros
******************************************************************************/
/******************************************************************************
global variables
******************************************************************************/
/******************************************************************************
functions
******************************************************************************/
/******************************************************************************
init_args()
Init an argument list.
******************************************************************************/
void init_args(arg_list_t *al)
{
ASSERT(al != NULL);
al->argc= 0;
al->size= ARG_BUF;
al->argv= malloc(al->size * sizeof(char *));
ASSERT(al->argv != NULL);
return;
}
/******************************************************************************
add_arg()
Add an argument to a list.
******************************************************************************/
void add_arg(arg_list_t *al, const char *format, ...)
{
va_list ap;
char temp[FN_REFLEN];
ASSERT(al != NULL);
/* increase size */
if (al->argc >= (int)al->size)
{
al->size+= ARG_BUF;
al->argv= realloc(al->argv, al->size * sizeof(char *));
ASSERT(al->argv != NULL);
}
if (format)
{
va_start(ap, format);
vsprintf(temp, format, ap);
va_end(ap);
al->argv[al->argc]= malloc(strlen(temp)+1);
ASSERT(al->argv[al->argc] != NULL);
strcpy(al->argv[al->argc], temp);
++(al->argc);
}
else
{
al->argv[al->argc]= NULL;
}
return;
}
/******************************************************************************
free_args()
Free an argument list.
******************************************************************************/
void free_args(arg_list_t *al)
{
int i;
ASSERT(al != NULL);
for (i= 0; i < al->argc; i++)
{
ASSERT(al->argv[i] != NULL);
free(al->argv[i]);
al->argv[i]= NULL;
}
free(al->argv);
al->argc= 0;
al->argv= NULL;
return;
}
/******************************************************************************
sleep_until_file_deleted()
Sleep until the given file is no longer found.
******************************************************************************/
#ifndef __WIN__
int sleep_until_file_deleted(char *pid_file)
#else
int sleep_until_file_deleted(HANDLE pid_file)
#endif
{
int err= 0; /* Initiate to supress warning */
#ifndef __WIN__
struct stat buf;
int i;
for (i= 0; (i < TRY_MAX) && (err= !stat(pid_file, &buf)); i++) sleep(1);
if (err != 0) err= errno;
#else
err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT);
#endif
return err;
}
/******************************************************************************
sleep_until_file_exists()
Sleep until the given file exists.
******************************************************************************/
#ifndef __WIN__
int sleep_until_file_exists(char *pid_file)
#else
int sleep_until_file_exists(HANDLE pid_file)
#endif
{
int err= 0; /* Initiate to supress warning */
#ifndef __WIN__
struct stat buf;
int i;
for (i= 0; (i < TRY_MAX) && (err= stat(pid_file, &buf)); i++) sleep(1);
if (err != 0) err= errno;
#else
err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT);
#endif
return err;
}
/******************************************************************************
wait_for_server_start()
Wait for the server on the given port to start.
******************************************************************************/
int wait_for_server_start(char *bin_dir __attribute__((unused)),
char *mysqladmin_file,
char *user, char *password, int port,char *tmp_dir)
{
arg_list_t al;
int err= 0;
char trash[FN_REFLEN];
/* mysqladmin file */
snprintf(trash, FN_REFLEN, "%s/trash.out",tmp_dir);
/* args */
init_args(&al);
add_arg(&al, "%s", mysqladmin_file);
add_arg(&al, "--no-defaults");
add_arg(&al, "--port=%u", port);
add_arg(&al, "--user=%s", user);
add_arg(&al, "--password=%s", password);
add_arg(&al, "--silent");
add_arg(&al, "--host=localhost");
#ifndef __NETWARE__
add_arg(&al, "--connect_timeout=10");
add_arg(&al, "-w");
add_arg(&al, "--protocol=tcp");
#endif
add_arg(&al, "ping");
/*
NetWare does not support the connect timeout in the TCP/IP stack
-- we will try the ping multiple times
*/
#ifndef __WIN__
{
int i;
for (i= 0;
(i < TRY_MAX) && (err= spawn(mysqladmin_file, &al, TRUE, NULL,
trash, NULL, NULL));
i++)
sleep(1);
}
#else
err= spawn(mysqladmin_file, &al, TRUE, NULL,trash, NULL, NULL);
#endif
/* free args */
free_args(&al);
return err;
}
/******************************************************************************
spawn()
Spawn the given path with the given arguments.
******************************************************************************/
#ifdef __NETWARE__
int spawn(char *path, arg_list_t *al, int join, char *input,
char *output, char *error, char *pid_file)
{
pid_t pid;
int result= 0;
wiring_t wiring= { FD_UNUSED, FD_UNUSED, FD_UNUSED };
unsigned long flags= PROC_CURRENT_SPACE | PROC_INHERIT_CWD;
/* open wiring */
if (input)
wiring.infd= open(input, O_RDONLY);
if (output)
wiring.outfd= open(output, O_WRONLY | O_CREAT | O_TRUNC);
if (error)
wiring.errfd= open(error, O_WRONLY | O_CREAT | O_TRUNC);
/* procve requires a NULL */
add_arg(al, NULL);
/* go */
pid= procve(path, flags, NULL, &wiring, NULL, NULL, 0,
NULL, (const char **)al->argv);
/* close wiring */
if (wiring.infd != -1)
close(wiring.infd);
if (wiring.outfd != -1)
close(wiring.outfd);
if (wiring.errfd != -1)
close(wiring.errfd);
return result;
}
#elif __WIN__
int spawn(char *path, arg_list_t *al, int join, char *input,
char *output, char *error, HANDLE *pid)
{
bool result;
int i;
STARTUPINFO startup_info;
PROCESS_INFORMATION process_information;
DWORD exit_code;
char win_args[1024]= "";
/* Skip the first parameter */
for (i= 1; i < al->argc; i++)
{
ASSERT(al->argv[i] != NULL);
strcat(win_args,al->argv[i]);
strcat(win_args," ");
}
memset(&startup_info,0,sizeof(STARTUPINFO));
startup_info.cb= sizeof(STARTUPINFO);
if (input)
freopen(input, "rb", stdin);
if (output)
freopen(output, "wb", stdout);
if (error)
freopen(error, "wb", stderr);
result= CreateProcess(
path,
(LPSTR)&win_args,
NULL,
NULL,
TRUE,
0,
NULL,
NULL,
&startup_info,
&process_information
);
if (result && process_information.hProcess)
{
if (join)
{
if (WaitForSingleObject(process_information.hProcess, mysqld_timeout)
== WAIT_TIMEOUT)
{
exit_code= -1;
}
else
{
GetExitCodeProcess(process_information.hProcess, &exit_code);
}
CloseHandle(process_information.hProcess);
}
else
{
exit_code= 0;
}
if (pid != NULL)
*pid= process_information.hProcess;
}
else
{
exit_code= -1;
}
if (input)
freopen("CONIN$","rb",stdin);
if (output)
freopen("CONOUT$","wb",stdout);
if (error)
freopen("CONOUT$","wb",stderr);
return exit_code;
}
#else
int spawn(char *path, arg_list_t *al, int join, char *input,
char *output, char *error, char *pid_file __attribute__((unused)))
{
pid_t pid;
int res_exec= 0;
int result= 0;
pid= fork();
if (pid == -1)
{
fprintf(stderr, "fork was't created\n");
/* We can't create the fork...exit with error */
return EXIT_FAILURE;
}
if (pid > 0)
{
/* The parent process is waiting for child process if join is not zero */
if (join)
{
waitpid(pid, &result, 0);
if (WIFEXITED(result) != 0)
{
result= WEXITSTATUS(result);
}
else
{
result= EXIT_FAILURE;
}
}
}
else
{
/* Child process */
add_arg(al, NULL);
/* Reassign streams */
if (input)
freopen(input, "r", stdin);
if (output)
freopen(output, "w", stdout);
if (error)
freopen(error, "w", stderr);
/* Spawn the process */
if ((res_exec= execve(path, al->argv, environ)) < 0)
exit(EXIT_FAILURE);
/* Restore streams */
if (input)
freopen("/dev/tty", "r", stdin);
if (output)
freopen("/dev/tty", "w", stdout);
if (error)
freopen("/dev/tty", "w", stderr);
exit(0);
}
return result;
}
#endif
/******************************************************************************
stop_server()
Stop the server with the given port and pid file.
******************************************************************************/
int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file,
char *user, char *password, int port,
#ifndef __WIN__
char *pid_file,
#else
HANDLE pid_file,
#endif
char *tmp_dir)
{
arg_list_t al;
int err= 0;
char trash[FN_REFLEN];
snprintf(trash, FN_REFLEN, "%s/trash.out",tmp_dir);
/* args */
init_args(&al);
add_arg(&al, "%s", mysqladmin_file);
add_arg(&al, "--no-defaults");
add_arg(&al, "--port=%u", port);
add_arg(&al, "--user=%s", user);
add_arg(&al, "--password=%s", password);
add_arg(&al, "-O");
add_arg(&al, "shutdown_timeout=20");
#ifndef __NETWARE__
add_arg(&al, "--protocol=tcp");
#endif
add_arg(&al, "shutdown");
/* spawn */
if ((err= spawn(mysqladmin_file, &al, TRUE, NULL,
trash, NULL, NULL)) == 0)
{
sleep_until_file_deleted(pid_file);
}
else
{
#ifndef __WIN__
pid_t pid= get_server_pid(pid_file);
/* shutdown failed - kill server */
kill_server(pid);
sleep(TRY_MAX);
/* remove pid file if possible */
err= remove(pid_file);
#else
TerminateProcess(pid_file,err);
#endif
}
/* free args */
free_args(&al);
return err;
}
/******************************************************************************
get_server_pid()
Get the VM id with the given pid file.
******************************************************************************/
#ifndef __WIN__
pid_t get_server_pid(char *pid_file)
{
char buf[FN_REFLEN];
int fd, err;
char *p;
pid_t id= 0;
/* discover id */
fd= open(pid_file, O_RDONLY);
err= read(fd, buf, FN_REFLEN);
close(fd);
if (err > 0)
{
/* terminate string */
if ((p= strchr(buf, '\n')) != NULL)
{
*p= '\0';
/* check for a '\r' */
if ((p= strchr(buf, '\r')) != NULL)
{
*p= '\0';
}
}
else
{
buf[err]= '\0';
}
id= strtol(buf, NULL, 0);
}
return id;
}
/******************************************************************************
kill_server()
Force a kill of the server with the given pid.
******************************************************************************/
void kill_server(pid_t pid)
{
if (pid > 0)
{
#if !defined(__NETWARE__)
/* Send SIGTERM to pid */
kill(pid, SIGTERM);
#else /* __NETWARE__ */
/* destroy vm */
NXVmDestroy(pid);
#endif
}
}
#endif
/******************************************************************************
del_tree()
Delete the directory and subdirectories.
******************************************************************************/
void del_tree(char *dir)
{
#ifndef __WIN__
DIR *parent= opendir(dir);
struct dirent *entry;
char temp[FN_REFLEN];
if (parent == NULL)
{
return;
}
while ((entry= readdir(parent)) != NULL)
{
/* create long name */
snprintf(temp, FN_REFLEN, "%s/%s", dir, entry->d_name);
if (entry->d_name[0] == '.')
{
/* Skip */
}
else
{
/* FIXME missing test in acinclude.m4 */
#ifndef STRUCT_DIRENT_HAS_D_TYPE
struct stat st;
if (lstat(entry->d_name, &st) == -1)
{
/* FIXME error */
return;
}
if (S_ISDIR(st.st_mode))
#else
if (S_ISDIR(entry->d_type))
#endif
{
/* delete subdirectory */
del_tree(temp);
}
else
{
/* remove file */
remove(temp);
}
}
}
/* remove directory */
rmdir(dir);
#else
struct _finddata_t parent;
#if defined(_MSC_VER) && _MSC_VER > 1200
intptr_t handle;
#else
long handle;
#endif /* _MSC_VER && _MSC_VER > 1200 */
char temp[FN_REFLEN];
char mask[FN_REFLEN];
snprintf(mask,FN_REFLEN,"%s/*.*",dir);
if ((handle=_findfirst(mask,&parent)) == -1L)
{
return;
}
do
{
/* create long name */
snprintf(temp, FN_REFLEN, "%s/%s", dir, parent.name);
if (parent.name[0] == '.')
{
/* Skip */
}
else
if (parent.attrib & _A_SUBDIR)
{
/* delete subdirectory */
del_tree(temp);
}
else
{
/* remove file */
remove(temp);
}
} while (_findnext(handle,&parent) == 0);
_findclose(handle);
/* remove directory */
_rmdir(dir);
#endif
}
/******************************************************************************
removef()
******************************************************************************/
int removef(const char *format, ...)
{
#ifdef __NETWARE__
va_list ap;
char path[FN_REFLEN];
va_start(ap, format);
vsnprintf(path, FN_REFLEN, format, ap);
va_end(ap);
return remove(path);
#elif __WIN__
{
va_list ap;
char path[FN_REFLEN];
struct _finddata_t parent;
#if defined(_MSC_VER) && _MSC_VER > 1200
intptr_t handle;
#else
long handle;
#endif /* _MSC_VER && _MSC_VER > 1200 */
char temp[FN_REFLEN];
char *p;
va_start(ap, format);
vsnprintf(path, FN_REFLEN, format, ap);
va_end(ap);
p= path + strlen(path);
while (*p != '\\' && *p != '/' && p > path) p--;
if ((handle=_findfirst(path,&parent)) == -1L)
{
/* if there is not files....it's ok */
return 0;
}
*p= '\0';
do
{
if (! (parent.attrib & _A_SUBDIR))
{
snprintf(temp, FN_REFLEN, "%s/%s", path, parent.name);
remove(temp);
}
}while (_findnext(handle,&parent) == 0);
_findclose(handle);
}
#else
DIR *parent;
struct dirent *entry;
char temp[FN_REFLEN];
va_list ap;
char path[FN_REFLEN];
char *p;
/* Get path with mask */
va_start(ap, format);
vsnprintf(path, FN_REFLEN, format, ap);
va_end(ap);
p= path + strlen(path);
while (*p != '\\' && *p != '/' && p > path) p--;
*p= '\0';
p++;
parent= opendir(path);
if (parent == NULL)
{
return 1; /* Error, directory missing */
}
while ((entry= readdir(parent)) != NULL)
{
/* entry is not directory and entry matches with mask */
#ifndef STRUCT_DIRENT_HAS_D_TYPE
struct stat st;
/* create long name */
snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name);
if (lstat(temp, &st) == -1)
{
return 1; /* Error couldn't lstat file */
}
if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0))
#else
if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0))
#endif
{
/* create long name */
snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name);
/* Delete only files */
remove(temp);
}
}
#endif
return 0;
}
/******************************************************************************
get_basedir()
******************************************************************************/
void get_basedir(char *argv0, char *basedir)
{
char temp[FN_REFLEN];
char *p;
int position;
ASSERT(argv0 != NULL);
ASSERT(basedir != NULL);
strcpy(temp, strlwr(argv0));
while ((p= strchr(temp, '\\')) != NULL) *p= '/';
if ((position= strinstr(temp, "/bin/")) != 0)
{
p= temp + position;
*p= '\0';
strcpy(basedir, temp);
}
}
uint strinstr(reg1 const char *str,reg4 const char *search)
{
reg2 my_string i,j;
my_string start= (my_string) str;
skipp:
while (*str != '\0')
{
if (*str++ == *search)
{
i=(my_string) str;
j= (my_string) search+1;
while (*j)
if (*i++ != *j++) goto skipp;
return ((uint) (str - start));
}
}
return (0);
}
/******************************************************************************
remove_empty_file()
******************************************************************************/
void remove_empty_file(const char *file_name)
{
struct stat file;
if (!stat(file_name,&file))
{
if (!file.st_size)
remove(file_name);
}
}

View file

@ -1,137 +0,0 @@
/*
Copyright (c) 2002 Novell, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _MY_MANAGE
#define _MY_MANAGE
/******************************************************************************
includes
******************************************************************************/
#include <stdlib.h>
#ifndef __WIN__
#include <unistd.h>
#endif
#ifndef __NETWARE__
#include <string.h>
#include <my_global.h>
#include <m_string.h>
#ifndef __WIN__
#define strnicmp strncasecmp
#define strlwr(STRARG) (STRARG)
#else
int my_vsnprintf_(char *to, size_t n, const char* value, ...);
#endif
#endif
/******************************************************************************
macros
******************************************************************************/
#define ARG_BUF 10
#define TRY_MAX 5
#ifdef __WIN__
#define PATH_MAX _MAX_PATH
#define NAME_MAX _MAX_FNAME
#define kill(A,B) TerminateProcess((HANDLE)A,0)
#define NOT_NEED_PID 0
#define MASTER_PID 1
#define SLAVE_PID 2
#define mysqld_timeout 60000
int pid_mode;
bool run_server;
bool skip_first_param;
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif
/******************************************************************************
structures
******************************************************************************/
typedef struct
{
int argc;
char **argv;
size_t size;
} arg_list_t;
#ifdef __WIN__
typedef int pid_t;
#endif
/******************************************************************************
global variables
******************************************************************************/
/******************************************************************************
prototypes
******************************************************************************/
void init_args(arg_list_t *);
void add_arg(arg_list_t *, const char *, ...);
void free_args(arg_list_t *);
#ifndef __WIN__
int sleep_until_file_exists(char *);
int sleep_until_file_deleted(char *);
#else
int sleep_until_file_exists(HANDLE);
int sleep_until_file_deleted(HANDLE);
#endif
int wait_for_server_start(char *, char *, char *, char *, int,char *);
#ifndef __WIN__
int spawn(char *, arg_list_t *, int, char *, char *, char *, char *);
#else
int spawn(char *, arg_list_t *, int , char *, char *, char *, HANDLE *);
#endif
#ifndef __WIN__
int stop_server(char *, char *, char *, char *, int, char *,char *);
pid_t get_server_pid(char *);
void kill_server(pid_t pid);
#else
int stop_server(char *, char *, char *, char *, int, HANDLE,char *);
#endif
void del_tree(char *);
int removef(const char *, ...);
void get_basedir(char *, char *);
void remove_empty_file(const char *file_name);
bool create_system_files(const char *mdata,const char *output_file, bool test);
#endif /* _MY_MANAGE */

View file

@ -250,12 +250,8 @@ MASTER_MYPORT=9306
SLAVE_RUNNING=0
SLAVE_MYHOST=127.0.0.1
SLAVE_MYPORT=9308 # leave room for 2 masters for cluster tests
MYSQL_MANAGER_PORT=9305 # needs to be out of the way of slaves
NDBCLUSTER_PORT=9350
NDBCLUSTER_PORT_SLAVE=9358
MYSQL_MANAGER_PW_FILE=$MYSQL_TEST_DIR/var/tmp/manager.pwd
MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log
MYSQL_MANAGER_USER=root
#
# To make it easier for different devs to work on the same host,
@ -269,14 +265,12 @@ MYSQL_MANAGER_USER=root
#
if [ -n "$MTR_BUILD_THREAD" ] ; then
MASTER_MYPORT=`expr $MTR_BUILD_THREAD '*' 10 + 10000`
MYSQL_MANAGER_PORT=`expr $MASTER_MYPORT + 2`
SLAVE_MYPORT=`expr $MASTER_MYPORT + 3`
NDBCLUSTER_PORT=`expr $MASTER_MYPORT + 6`
NDBCLUSTER_PORT_SLAVE=`expr $MASTER_MYPORT + 7`
echo "Using MTR_BUILD_THREAD = $MTR_BUILD_THREAD"
echo "Using MASTER_MYPORT = $MASTER_MYPORT"
echo "Using MYSQL_MANAGER_PORT = $MYSQL_MANAGER_PORT"
echo "Using SLAVE_MYPORT = $SLAVE_MYPORT"
echo "Using NDBCLUSTER_PORT = $NDBCLUSTER_PORT"
echo "Using NDBCLUSTER_PORT_SLAVE = $NDBCLUSTER_PORT_SLAVE"
@ -361,7 +355,6 @@ while test $# -gt 0; do
--user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;;
--force) FORCE=1 ;;
--timer) USE_TIMER=1 ;;
--verbose-manager) MANAGER_QUIET_OPT="" ;;
--old-master) MASTER_40_ARGS="";;
--master-binary=*)
MASTER_MYSQLD=`$ECHO "$1" | $SED -e "s;--master-binary=;;"` ;;
@ -407,7 +400,6 @@ while test $# -gt 0; do
LOCAL_MASTER=1 ;;
--master_port=*) MASTER_MYPORT=`$ECHO "$1" | $SED -e "s;--master_port=;;"` ;;
--slave_port=*) SLAVE_MYPORT=`$ECHO "$1" | $SED -e "s;--slave_port=;;"` ;;
--manager-port=*) MYSQL_MANAGER_PORT=`$ECHO "$1" | $SED -e "s;--manager_port=;;"` ;;
--ndbcluster_port=*) NDBCLUSTER_PORT=`$ECHO "$1" | $SED -e "s;--ndbcluster_port=;;"` ;;
--ndbcluster-port=*) NDBCLUSTER_PORT=`$ECHO "$1" | $SED -e "s;--ndbcluster-port=;;"` ;;
--ndbcluster-port-slave=*) NDBCLUSTER_PORT_SLAVE=`$ECHO "$1" | $SED -e "s;--ndbcluster-port-slave=;;"` ;;
@ -423,11 +415,6 @@ while test $# -gt 0; do
MYSQL_TEST_SSL_OPTS="--ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
--ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem \
--ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem" ;;
--no-manager | --skip-manager) USE_MANAGER=0 ;;
--manager)
USE_MANAGER=1
USE_RUNNING_SERVER=0
;;
--start-and-exit)
START_AND_EXIT=1
;;
@ -645,7 +632,6 @@ fi
#--
MYRUN_DIR=$MYSQL_TEST_DIR/var/run
MANAGER_PID_FILE="$MYRUN_DIR/manager.pid"
MASTER_MYDDIR="$MYSQL_TEST_DIR/var/master-data"
MASTER_MYSOCK="$MYSQL_TMP_DIR/master.sock"
@ -759,9 +745,6 @@ if [ x$SOURCE_DIST = x1 ] ; then
MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
WAIT_PID="$BASEDIR/extra/mysql_waitpid"
MYSQL_MY_PRINT_DEFAULTS="$BASEDIR/extra/my_print_defaults"
MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqltestmanagerc"
MYSQL_MANAGER="$BASEDIR/tools/mysqltestmanager"
MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqltestmanager-pwgen"
MYSQL="$CLIENT_BINDIR/mysql"
LANGUAGE="$BASEDIR/sql/share/english/"
CHARSETSDIR="$BASEDIR/sql/share/charsets"
@ -822,9 +805,6 @@ else
MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
WAIT_PID="$CLIENT_BINDIR/mysql_waitpid"
MYSQL_MY_PRINT_DEFAULTS="$CLIENT_BINDIR/my_print_defaults"
MYSQL_MANAGER="$CLIENT_BINDIR/mysqltestmanager"
MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqltestmanagerc"
MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqltestmanager-pwgen"
MYSQL="$CLIENT_BINDIR/mysql"
INSTALL_DB="./install_test_db --bin"
MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables"
@ -1214,96 +1194,27 @@ abort_if_failed()
fi
}
start_manager()
launch_in_background()
{
if [ $USE_MANAGER = 0 ] ; then
echo "Manager disabled, skipping manager start."
$RM -f $MYSQL_MANAGER_LOG
echo $@ | /bin/sh >> $CUR_MYERR 2>&1 &
sleep 2 #hack
return
fi
$ECHO "Starting MySQL Manager"
if [ -f "$MANAGER_PID_FILE" ] ; then
kill `cat $MANAGER_PID_FILE`
sleep 1
if [ -f "$MANAGER_PID_FILE" ] ; then
kill -9 `cat $MANAGER_PID_FILE`
sleep 1
fi
fi
$RM -f $MANAGER_PID_FILE
MYSQL_MANAGER_PW=`$MYSQL_MANAGER_PWGEN -u $MYSQL_MANAGER_USER \
-o $MYSQL_MANAGER_PW_FILE`
$MYSQL_MANAGER --log=$MYSQL_MANAGER_LOG --port=$MYSQL_MANAGER_PORT \
--password-file=$MYSQL_MANAGER_PW_FILE --pid-file=$MANAGER_PID_FILE
abort_if_failed "Could not start MySQL manager"
mysqltest_manager_args="--manager-host=localhost \
--manager-user=$MYSQL_MANAGER_USER \
--manager-password=$MYSQL_MANAGER_PW \
--manager-port=$MYSQL_MANAGER_PORT \
--manager-wait-timeout=$START_WAIT_TIMEOUT"
MYSQL_TEST="$MYSQL_TEST $mysqltest_manager_args"
MYSQL_TEST_ARGS="$MYSQL_TEST_ARGS $mysqltest_manager_args"
while [ ! -f $MANAGER_PID_FILE ] ; do
sleep 1
done
echo "Manager started"
}
stop_manager()
{
if [ $USE_MANAGER = 0 ] ; then
return
fi
$MYSQL_MANAGER_CLIENT $MANAGER_QUIET_OPT -u$MYSQL_MANAGER_USER \
-p$MYSQL_MANAGER_PW -P $MYSQL_MANAGER_PORT <<EOF
shutdown
EOF
echo "Manager terminated"
}
manager_launch()
{
ident=$1
shift
if [ $USE_MANAGER = 0 ] ; then
echo $@ | /bin/sh >> $CUR_MYERR 2>&1 &
sleep 2 #hack
return
fi
$MYSQL_MANAGER_CLIENT $MANAGER_QUIET_OPT --user=$MYSQL_MANAGER_USER \
--password=$MYSQL_MANAGER_PW --port=$MYSQL_MANAGER_PORT <<EOF
def_exec $ident "$@"
set_exec_stdout $ident $CUR_MYERR
set_exec_stderr $ident $CUR_MYERR
set_exec_con $ident root localhost $CUR_MYSOCK
start_exec $ident $START_WAIT_TIMEOUT
EOF
abort_if_failed "Could not execute manager command"
}
manager_term()
shutdown_mysqld()
{
pid=$1
ident=$2
if [ $USE_MANAGER = 0 ] ; then
# Shutdown time must be high as slave may be in reconnect
$MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=5 --shutdown_timeout=70 shutdown >> $MYSQL_MANAGER_LOG 2>&1
res=$?
# Some systems require an extra connect
$MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=1 ping >> $MYSQL_MANAGER_LOG 2>&1
if test $res = 0
then
wait_for_pid $pid
fi
return $res
# Shutdown time must be high as slave may be in reconnect
$MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=5 --shutdown_timeout=70 shutdown >> $MYSQL_MANAGER_LOG 2>&1
res=$?
# Some systems require an extra connect
$MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=1 ping >> $MYSQL_MANAGER_LOG 2>&1
if test $res = 0
then
wait_for_pid $pid
fi
$MYSQL_MANAGER_CLIENT $MANAGER_QUIET_OPT --user=$MYSQL_MANAGER_USER \
--password=$MYSQL_MANAGER_PW --port=$MYSQL_MANAGER_PORT <<EOF
stop_exec $ident $STOP_WAIT_TIMEOUT
EOF
abort_if_failed "Could not execute manager command"
return $res
}
start_ndbcluster()
@ -1486,7 +1397,7 @@ start_master()
if [ x$DO_DDD = x1 ]
then
$ECHO "set args $master_args" > $GDB_MASTER_INIT$1
manager_launch master ddd -display $DISPLAY --debugger \
launch_in_background master ddd -display $DISPLAY --debugger \
"gdb -x $GDB_MASTER_INIT$1" $MASTER_MYSQLD
elif [ x$DO_GDB = x1 ]
then
@ -1507,11 +1418,11 @@ end
r
EOF
fi ) > $GDB_MASTER_INIT$1
manager_launch master $XTERM -display $DISPLAY \
launch_in_background master $XTERM -display $DISPLAY \
-title "Master" -e gdb -x $GDB_MASTER_INIT$1 $MASTER_MYSQLD
fi
else
manager_launch master $MASTER_MYSQLD $master_args
launch_in_background master $MASTER_MYSQLD $master_args
fi
sleep_until_file_created $MASTER_MYPID$1 $wait_for_master
wait_for_master=$SLEEP_TIME_FOR_SECOND_MASTER
@ -1644,7 +1555,7 @@ start_slave()
if [ x$DO_DDD = x1 ]
then
$ECHO "set args $slave_args" > $GDB_SLAVE_INIT
manager_launch $slave_ident ddd -display $DISPLAY --debugger \
launch_in_background $slave_ident ddd -display $DISPLAY --debugger \
"gdb -x $GDB_SLAVE_INIT" $SLAVE_MYSQLD
elif [ x$DO_GDB = x1 ]
then
@ -1665,11 +1576,11 @@ end
r
EOF
fi ) > $GDB_SLAVE_INIT
manager_launch $slave_ident $XTERM -display $DISPLAY -title "Slave" -e \
launch_in_background $slave_ident $XTERM -display $DISPLAY -title "Slave" -e \
gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD
fi
else
manager_launch $slave_ident $SLAVE_MYSQLD $slave_args
launch_in_background $slave_ident $SLAVE_MYSQLD $slave_args
fi
eval "SLAVE$1_RUNNING=1"
sleep_until_file_created $slave_pid $wait_for_slave
@ -1701,7 +1612,7 @@ stop_slave ()
if [ x$this_slave_running = x1 ]
then
pid=`$CAT $slave_pid`
manager_term $pid $slave_ident
shutdown_mysqld $pid $slave_ident
if [ $? != 0 ] && [ -f $slave_pid ]
then # try harder!
$ECHO "slave not cooperating with mysqladmin, will try manual kill"
@ -1748,7 +1659,7 @@ stop_master ()
# MASTER_RUNNING=0 to get cleanup when calling start_master().
if [ x$USE_EMBEDDED_SERVER != x1 ] ; then
pid=`$CAT $MASTER_MYPID$1`
manager_term $pid master $1
shutdown_mysqld $pid master $1
if [ $? != 0 ] && [ -f $MASTER_MYPID$1 ]
then # try harder!
$ECHO "master not cooperating with mysqladmin, will try manual kill"
@ -2074,7 +1985,6 @@ run_testcase ()
[ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ]
then
mysql_stop
stop_manager
fi
exit 1
fi
@ -2244,18 +2154,6 @@ then
rm $MASTER_MYPID $MASTER_MYPID"1" $SLAVE_MYPID
fi
# Kill any running managers
if [ -f "$MANAGER_PID_FILE" ]
then
kill `cat $MANAGER_PID_FILE`
sleep 1
if [ -f "$MANAGER_PID_FILE" ]
then
kill -9 `cat $MANAGER_PID_FILE`
sleep 1
fi
fi
# just to force stopping anything from previous runs
USE_NDBCLUSTER_OPT=$USE_NDBCLUSTER
stop_ndbcluster
@ -2279,10 +2177,8 @@ then
USE_NDBCLUSTER_OPT=
fi
start_manager
# Do not automagically start daemons if we are in gdb or running only one test
# case
# Do not automagically start daemons if we are in gdb or running only one
# test case
if [ -z "$DO_GDB" ] && [ -z "$DO_DDD" ]
then
mysql_start
@ -2329,7 +2225,6 @@ then
fi
cd $savedir
mysql_stop
stop_manager
exit
fi
@ -2351,7 +2246,6 @@ then
if [ $USE_RUNNING_SERVER -eq 0 ] ; then
mysql_stop
stop_manager
fi
exit
@ -2398,7 +2292,6 @@ if [ -z "$DO_GDB" ] && [ $USE_RUNNING_SERVER -eq 0 ] && [ -z "$DO_DDD" ]
then
mysql_stop
fi
stop_manager
report_stats
$ECHO

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more