Commit d0e09ed8 authored by paul@teton.kitebird.com's avatar paul@teton.kitebird.com

Merge paul@work.mysql.com:/home/bk/mysql-4.0

into teton.kitebird.com:/home/paul/mysql-4.0
parents 2645d508 12f1cba0
This diff is collapsed.
#!/usr/bin/perl -w
#
# Script to rewrite colspecs from relative values to absolute values
#
use strict;
my $table_width = 12.75; # cm
my $gutter_width = 0.09; # cm
my $str = join '', <>;
$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 @widths = ();
my $total = 0;
my $output = '';
$str =~ /^(\s+)/;
my $ws = $1;
while ($str =~ m/<colspec colwidth="(\d+)\*" \/>/g) {
$total += $1;
push @widths, $1;
}
my $unit = ($table_width - ($#widths * $gutter_width)) / ($total);
foreach (@widths) {
$output .= $ws . '<colspec colwidth="'. sprintf ("%0.2f", $_ * $unit) .'" />' . "\n";
}
return $output . "\n$ws";
}
#!/usr/bin/perl -w #!/usr/bin/perl -w
# 2002-02-15 zak@mysql.com
# Use -w to make perl print useful warnings about the script being run
sub fix_underscore { # Fix the output of `makeinfo --docbook` version 4.0c
$str = shift; # Convert the broken docbook output to well-formed XML that conforms to the O'Reilly idiom
$str =~ tr/_/-/; # See code for detailed comments
return $str; # Authors: Arjen Lentz and Zak Greant
};
sub strip_emph { use strict;
$str = shift;
$str =~ s{<emphasis>(.+?)</emphasis>}
{$1}gs;
return $str;
};
print STDERR "\n--Post-processing makeinfo output--\n"; my $data = '';
my @apx = ();
my $apx = '';
my @nodes = ();
my $nodes = '';
# 2002-02-15 zak@mysql.com msg ("\n-- Post-processing `makeinfo --docbook` output --");
print STDERR "Discard DTD - ORA can add the appropriate DTD for their flavour of DocBook\n"; msg ("** Written to work with makeinfo version 4.0c **\n");
<STDIN>;
print STDERR "Slurp! In comes the rest of the file. :)\n"; msg ("Discarding DTD - not required by subsequent scripts");
$data = join "", <STDIN>; # <> is a magic filehandle - either reading lines from stdin or from file(s) specified on the command line
<>;
# 2002-02-15 zak@mysql.com msg ("Create an XML PI with ISO-8859-1 character encoding");
print STDERR "Add an XML processing instruction with the right character encoding\n"; $data = "<?xml version='1.0' encoding='ISO-8859-1'?>";
$data = "<?xml version='1.0' encoding='ISO-8859-1'?>" . $data;
# 2002-02-15 zak@mysql.com msg ("Get the rest of the data");
# Less than optimal - should be fixed in makeinfo $data = $data . join "", <>;
print STDERR "Put in missing <bookinfo> and <abstract>\n";
$data =~ s/<book lang="en">/<book lang="en"><bookinfo><abstract>/gs;
# 2002-02-15 zak@mysql.com msg ("Add missing <bookinfo> and <abstract> opening tags");
print STDERR "Convert existing ampersands to escape sequences \n"; # Note the absence of the g (global) pattern modified. This situation can only happen once.
$data =~ s/&(?!\w+;)/&amp;/gs; # ...as soon as we find the first instance, we can stop looking.
$data =~ s/<book lang="en">/<book lang="en"><bookinfo><abstract>/;
# 2002-02-15 zak@mysql.com msg ("Removing mailto: from email addresses...");
# Need to talk to Arjen about what the <n> bits are for $data =~ s/mailto://g;
print STDERR "Rework references of the notation '<n>'\n";
$data =~ s/<(\d)>/[$1]/gs; msg ("Removing INFORMALFIGURE...");
$data =~ s{<informalfigure>.+?</informalfigure>}
{}gs;
msg ("Convert ampersands to XML escape sequences ");
$data =~ s/&(?!\w+;)/&amp;/g;
# 2002-02-15 zak@mysql.com msg ("Changing @@ to @...");
# We might need to encode the high-bit characters to ensure proper representation $data =~ s/@@/@/g;
# print STDERR "Converting high-bit characters to entities\n";
# $data =~ s/([\200-\400])/&get_entity($1)>/gs;
# There is no get_entity function yet - no point writing it til we need it :)
print STDERR "Changing @@ to @...\n"; msg ("Rework references of the notation '<n>'");
$data =~ s/@@/@/gs; # Need to talk to Arjen about what the <n> bits are for
$data =~ s/<(\d)>/[$1]/g;
print STDERR "Changing '_' to '-' in references...\n"; msg ("Changing '_' to '-' in references...");
$data =~ s{id=\"(.+?)\"} $data =~ s{((?:id|linkend)=\".+?\")}
{"id=\"".&fix_underscore($1)."\""}gsex; {&underscore2hyphen($1)}gex;
$data =~ s{linkend=\"(.+?)\"}
{"linkend=\"".&fix_underscore($1)."\""}gsex;
print STDERR "Changing ULINK to SYSTEMITEM...\n"; msg ("Changing ULINK to SYSTEMITEM...");
$data =~ s{<ulink url=\"(.+?)\"></ulink>} $data =~ s{<ulink url=\"(.+?)\">\s*</ulink>}
{<systemitem role=\"url\">$1</systemitem>}gs; {<systemitem role=\"url\">$1</systemitem>}gs;
print STDERR "Removing INFORMALFIGURE...\n"; msg ("Adding PARA inside ENTRY...");
$data =~ s{<informalfigure>(.+?)</informalfigure>}
{}gs;
print STDERR "Adding PARA inside ENTRY...\n";
$data =~ s{<entry>(.*?)</entry>} $data =~ s{<entry>(.*?)</entry>}
{<entry><para>$1</para></entry>}gs; {<entry><para>$1</para></entry>}gs;
print STDERR "Removing mailto: from email addresses...\n"; msg ("Fixing spacing problem with titles...");
$data =~ s{mailto:} $data =~ s{(</\w+>)(\w{2,})}
{}gs; {$1 $2}gs;
print STDERR "Fixing spacing problem with titles...\n"; msg ("Adding closing / to XREF and COLSPEC tags...");
$data =~ s{</(\w+)>(\w{2,})} $data =~ s{<(xref|colspec) (.+?)>}
{</$1> $2}gs; {<$1 $2 />}gs;
# 2002-02-15 arjen@mysql.com # Probably need to strip these
print STDERR "Adding closing / to XREF...\n"; msg ('Adding "See " to XREFs that used to be @xref...');
$data =~ s{<xref (.+?)>} $data =~ s{([.'!)])\s*<xref }
{<xref $1 />}gs; {$1 See <xref }gs;
# 2002-01-30 arjen@mysql.com msg ('Adding "see " to (XREFs) that used to be (@pxref)...');
print STDERR "Removing COLSPEC...\n"; $data =~ s{([([,;])(\s*)<xref }
$data =~ s{\n *<colspec colwidth=\"[0-9]+\*\">} {$1$2see <xref }gs;
{}gs;
# 2002-01-31 arjen@mysql.com msg ("Making first row in table THEAD...");
print STDERR "Making first row in table THEAD...\n"; $data =~ s{( *)<tbody>(\s*<row>.+?</row>)}
$data =~ s{([ ]*)<tbody>\n([ ]*<row>(.+?)</row>)} {$1<thead>$2\n$1</thead>\n$1<tbody>}gs;
{$1<thead>\n$2\n$1</thead>\n$1<tbody>}gs;
# 2002-01-31 arjen@mysql.com msg ("Removing EMPHASIS inside THEAD...");
print STDERR "Removing EMPHASIS inside THEAD...\n";
$data =~ s{<thead>(.+?)</thead>} $data =~ s{<thead>(.+?)</thead>}
{"<thead>".&strip_emph($1)."</thead>"}gsex; {"<thead>".&strip_tag($1, 'emphasis')."</thead>"}gsex;
# 2002-01-31 arjen@mysql.com msg ("Removing empty PARA...");
print STDERR "Removing lf before /PARA in ENTRY...\n"; $data =~ s{<para>\s*</para>}
$data =~ s{(<entry><para>(.+?))\n(</para></entry>)} {}gs;
{$1$3}gs;
# 2002-01-31 arjen@mysql.com (2002-02-15 added \n stuff)
print STDERR "Removing whitespace before /PARA if not on separate line...\n";
$data =~ s{([^\n ])[ ]+</para>}
{$1</para>}gs;
# 2002-01-31 arjen@mysql.com msg ("Removing lf before /PARA in ENTRY...");
print STDERR "Removing empty PARA in ENTRY...\n"; $data =~ s{\n(</para></entry>)}
$data =~ s{<entry><para></para></entry>} {$1}gs;
{<entry></entry>}gs;
# 2002-01-31 arjen@mysql.com msg ("Removing whitespace before /PARA if not on separate line...");
print STDERR "Removing PARA around INDEXENTRY if no text in PARA...\n"; $data =~ s{(\S+)[\t ]+</para>}
$data =~ s{<para>((<indexterm role=\"(cp|fn)\">(<(primary|secondary)>[^<]+?</(primary|secondary)>)+?</indexterm>)+?)[\n]*</para>[\n]*} {$1</para>}g;
{$1\n}gs;
# ----- msg ("Removing PARA around INDEXTERM if no text in PARA...");
$data =~ s{<para>((?:<indexterm role=\"(?:cp|fn)\">(?:<(primary|secondary)>[^>]+</\2>)+?</indexterm>)+?)\s*</para>}
{$1}gs;
@apx = ("Users", "MySQL Testimonials", "News", @apx = ("Users", "MySQL Testimonials", "News", "GPL-license", "LGPL-license");
"GPL-license", "LGPL-license");
foreach $apx (@apx) { foreach $apx (@apx) {
print STDERR "Removing appendix $apx...\n"; msg ("Removing appendix $apx...");
$data =~ s{<appendix id=\"$apx\">(.+?)</appendix>} $data =~ s{<appendix id=\"$apx\">(.+?)</appendix>}
{}gs; {}gs;
print STDERR " ... Building list of removed nodes ...\n"; # Skip to next appendix regex if the regex did not match anything
foreach(split "\n", $&) { next unless (defined $&);
push @nodes, $2 if(/<(\w+) id=\"(.+?)\">/)
}; msg ("...Building list of removed nodes...");
};
# Split the last bracketed regex match into an array
print STDERR "Fixing references to removed nodes...\n"; # Extract the node names from the tags and push them into an array
foreach $node (@nodes) { foreach (split "\n", $&) {
$web = $node; push @nodes, $1 if /<\w+ id=\"(.+?)\">/
$web =~ s/[ ]/_/; }
$web = "http://www.mysql.com/doc/" . }
(join "/", (split //, $web)[0..1])."/$web.html";
print STDERR "$node -> $web\n"; # 2002-02-22 arjen@mysql.com (added fix " /" to end of regex, to make it match)
$data =~ s{<(\w+) linkend=\"$node\">} msg ("Fixing references to removed nodes...");
{$web}gs; # 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; print STDOUT $data;
exit;
#
# Definitions for helper sub-routines
#
sub msg {
print STDERR 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 :)
#! /usr/local/bin/perl #! /usr/bin/perl -w
# O'Reilly's Perl script to chop mysql.xml into separate ch/apps/index files. # 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. # The indexes are actually not used, they're created straight from the xrefs.
use strict;
# Breaks the MySQL reference manual into chapters, appendices, and indexes. # Breaks the MySQL reference manual into chapters, appendices, and indexes.
my $input_file; use strict;
my $directory;
my $chap_num;
my $app_letter;
my $start_text;
my $line;
my $input_file;
my $output_name;
$input_file = "mysql.xml";
$directory="chaps_apps_index";
$chap_num=1; # Start chapter numbers at one (there is no preface)
$app_letter="a"; # Start appendix letters at "a"
$start_text="";
$line="";
open (INPUT_FILE, '<' . $input_file) or die "Cannot open $input_file";
if (-d $directory) {
my $unlinked = unlink <$directory/*>;
printf(Removed "%d files\n", $unlinked);
}
else {
mkdir $directory or die "Cannot make $directory subdirectory";
}
while (1) { 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 = "";
# Terminating statement for loop. mkdir $directory unless -d $directory;
exit if not defined $line;
if ($line =~ /(?:.*)(<chapter.*)/i ) { while (defined $line) {
if ($line =~ /(<chapter.+)/i ) {
$start_text = $1; $start_text = $1;
$output_name = &make_chapter_name($chap_num); $output_name = sprintf("ch%02d%s", $chap_num, $ext);
$chap_num++; ++$chap_num;
&process_file("chapter"); &process_file("chapter");
} }
elsif ($line =~ /(?:.*)(<appendix.*)/i ) { elsif ($line =~ /(<appendix.+)/i ) {
$start_text = $1 ; $start_text = $1 ;
$output_name = &make_appendix_name($app_letter); $output_name = "app$app_letter$ext";
$app_letter++; ++$app_letter;
&process_file("appendix"); &process_file("appendix");
} }
elsif ($line =~ /(?:.*)(<index\s+id=")(.*?)(">.*)/i ) { elsif ($line =~ /(<index\s+id=")(.*?)(">.*)/i ) {
$start_text = $1 . $2 . $3; $start_text = $1 . $2 . $3;
$output_name = lc($2) . ".xml"; $output_name = lc($2) . $ext;
&process_file("index"); &process_file("index");
} }
else { else {
# Automatically skips junk in between chapters, appendices, # Skip junk in between chapters, appendices and indexes.
# and indexes. $line = <>;
$line = <INPUT_FILE>;
} }
} }
sub make_chapter_name { sub process_file {
my $num = shift; my $marker = shift;
my $name = "ch" . sprintf("%02d", $num) . ".xml"; my $path = "$directory/$output_name";
return $name;
}
sub make_appendix_name { open (OUTPUT_FILE, ">$path") or die "Cannot open $path";
my $letter = shift;
my $name = "app" . sprintf("%s", $letter) . ".xml";
return $name;
}
sub process_file { print STDERR "Creating $path\n";
my $marker=shift;
open (OUTPUT_FILE, '>' . $directory . "/" . $output_name) or # Print out XML PI
die "Cannot open $output_name"; 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 whatever happened to appear at the end of the previous chapter.
print OUTPUT_FILE $start_text . "\n" if $start_text; print OUTPUT_FILE "$start_text\n" if $start_text;
while (1) {
$line = <INPUT_FILE>; while (defined $line) {
exit if not defined $line; $line = <>;
# Note: Anything after the terminating marker is lost, just like # Note: Anything after the terminating marker is lost, just like
# lines in between chapters. # lines in between chapters.
if ($line =~ /(.*<\/\s*$marker\s*>)/i ) { if ($line =~ /(.*<\/\s*$marker\s*>)/i ) {
print OUTPUT_FILE $1 . "\n" if $1; print OUTPUT_FILE "$1\n" if $1;
close OUTPUT_FILE; close OUTPUT_FILE;
return; return;
} }
......
...@@ -18,3 +18,7 @@ ...@@ -18,3 +18,7 @@
# See if the XML output is well-formed # See if the XML output is well-formed
xmlwf mysql.xml xmlwf mysql.xml
# If all is well, keep processing
cat mysql.xml | Support/colspec-fix.pl | Support/docbook-split;
@c This file is autogenerated by the Makefile
@set mysql_version 4.0.2
@set default_port 3306
This diff is collapsed.
...@@ -757,10 +757,9 @@ Large server clusters using replication are in production use, with ...@@ -757,10 +757,9 @@ Large server clusters using replication are in production use, with
good results. Work on enhanced replication features is continuing good results. Work on enhanced replication features is continuing
in @code{MySQL} 4.0. in @code{MySQL} 4.0.
@item @code{InnoDB} tables -- Stable (in 3.23 from 3.23.47) @item @code{InnoDB} tables -- Stable (in 3.23 from 3.23.49)
The @code{InnoDB} transactional table handler has now been declared The @code{InnoDB} transactional table handler has now been declared
stable in the @code{MySQL} 3.23 development tree, starting from stable in the @code{MySQL} 3.23 tree, starting from version 3.23.49.
version 3.23.47.
@code{InnoDB} is being used in large, heavy load production systems. @code{InnoDB} is being used in large, heavy load production systems.
@item @code{BDB} tables -- Gamma @item @code{BDB} tables -- Gamma
...@@ -1707,7 +1706,7 @@ development of the @code{MySQL} database. ...@@ -1707,7 +1706,7 @@ development of the @code{MySQL} database.
@code{MySQL} partnership logos may only be used by companies and persons @code{MySQL} partnership logos may only be used by companies and persons
having a written partnership agreement with @code{MySQL AB}. Partnerships having a written partnership agreement with @code{MySQL AB}. Partnerships
include certification as a @code{MySQL} trainer or consultant. include certification as a @code{MySQL} trainer or consultant.
Please see @xref{Business Services Partnering,,Partnering}. Please see @ref{Business Services Partnering,,Partnering}.
@node Using MySQL word in presentations, Using MySQL word in company and product names, MySQL AB Partnership Logos, MySQL AB Logos and Trademarks @node Using MySQL word in presentations, Using MySQL word in company and product names, MySQL AB Partnership Logos, MySQL AB Logos and Trademarks
...@@ -2496,7 +2495,7 @@ perhaps solved) the problem. ...@@ -2496,7 +2495,7 @@ perhaps solved) the problem.
For information on reporting bugs in @strong{MyODBC}, see @ref{ODBC Problems}. For information on reporting bugs in @strong{MyODBC}, see @ref{ODBC Problems}.
For solutions to some common problems, see @xref{Problems}. For solutions to some common problems, see @ref{Problems}.
When answers are sent to you individually and not to the mailing list, When answers are sent to you individually and not to the mailing list,
it is considered good etiquette to summarise the answers and send the it is considered good etiquette to summarise the answers and send the
...@@ -5276,7 +5275,7 @@ isn't good at many things (it is!) or that it isn't faster than MySQL Server ...@@ -5276,7 +5275,7 @@ isn't good at many things (it is!) or that it isn't faster than MySQL Server
under certain conditions. We would just like to see a fair test where under certain conditions. We would just like to see a fair test where
they are very good so that we could get some friendly competition going! they are very good so that we could get some friendly competition going!
For more information about our benchmarks suite @xref{MySQL Benchmarks}. For more information about our benchmarks suite, see @ref{MySQL Benchmarks}.
We are working on an even better benchmark suite, including multi user We are working on an even better benchmark suite, including multi user
tests, and a better documentation of what the individual tests really tests, and a better documentation of what the individual tests really
...@@ -15347,7 +15346,7 @@ starts up. Changes to the grant tables take effect as indicated in ...@@ -15347,7 +15346,7 @@ starts up. Changes to the grant tables take effect as indicated in
When you modify the contents of the grant tables, it is a good idea to make When you modify the contents of the grant tables, it is a good idea to make
sure that your changes set up privileges the way you want. For help in sure that your changes set up privileges the way you want. For help in
diagnosing problems, see @ref{Access denied}. For advice on security issues, diagnosing problems, see @ref{Access denied}. For advice on security issues,
@pxref{Security}. see @ref{Security}.
A useful A useful
diagnostic tool is the @code{mysqlaccess} script, which Yves Carlier has diagnostic tool is the @code{mysqlaccess} script, which Yves Carlier has
...@@ -16594,7 +16593,7 @@ dropped only with explicit @code{REVOKE} commands or by manipulating the ...@@ -16594,7 +16593,7 @@ dropped only with explicit @code{REVOKE} commands or by manipulating the
MySQL grant tables. MySQL grant tables.
@end itemize @end itemize
For a description of using @code{REQUIRE}, see @xref{Secure connections}. For a description of using @code{REQUIRE}, see @ref{Secure connections}.
@node User names, Privilege changes, GRANT, User Account Management @node User names, Privilege changes, GRANT, User Account Management
@subsection MySQL User Names and Passwords @subsection MySQL User Names and Passwords
...@@ -17476,7 +17475,7 @@ minimum needed to restore it. Currenlty only works for @code{MyISAM} ...@@ -17476,7 +17475,7 @@ minimum needed to restore it. Currenlty only works for @code{MyISAM}
tables. For @code{MyISAM} table, copies @code{.frm} (definition) and tables. For @code{MyISAM} table, copies @code{.frm} (definition) and
@code{.MYD} (data) files. The index file can be rebuilt from those two. @code{.MYD} (data) files. The index file can be rebuilt from those two.
Before using this command, please see @xref{Backup}. Before using this command, please see @ref{Backup}.
During the backup, read lock will be held for each table, one at time, During the backup, read lock will be held for each table, one at time,
as they are being backed up. If you want to backup several tables as as they are being backed up. If you want to backup several tables as
...@@ -23257,11 +23256,11 @@ it is not the only one. For example, if you already have a snapshot ...@@ -23257,11 +23256,11 @@ it is not the only one. For example, if you already have a snapshot
of the master, and of the master, and
the master already has server id set and binary logging enabled, one can the master already has server id set and binary logging enabled, one can
set up a slave without shutting the master down or even blocking the updates. set up a slave without shutting the master down or even blocking the updates.
Please refer to @xref{Replication FAQ}. for more details. For more details, please see @ref{Replication FAQ}.
If you want to become a real MySQL replication guru, we suggest that you If you want to become a real MySQL replication guru, we suggest that you
begin with studing, pondering, and trying all commands begin with studing, pondering, and trying all commands
mentioned in @xref{Replication SQL}. You should also familiarize yourself mentioned in @ref{Replication SQL}. You should also familiarize yourself
with replication startup options in @code{my.cnf} in with replication startup options in @code{my.cnf} in
@xref{Replication Options}. @xref{Replication Options}.
...@@ -31054,7 +31053,7 @@ relevance - similarity measure between the text in columns ...@@ -31054,7 +31053,7 @@ relevance - similarity measure between the text in columns
positive floating-point number. Zero relevance means no similarity. positive floating-point number. Zero relevance means no similarity.
@code{MATCH ... AGAINST()} is available in MySQL version @code{MATCH ... AGAINST()} is available in MySQL version
3.23.23 or later. @code{IN BOOLEAN MODE} extension was added in version 3.23.23 or later. @code{IN BOOLEAN MODE} extension was added in version
4.0.1. For details and usage examples @pxref{Fulltext Search}. 4.0.1. For details and usage examples, see @ref{Fulltext Search}.
@end table @end table
@node Case Sensitivity Operators, , String comparison functions, String functions @node Case Sensitivity Operators, , String comparison functions, String functions
...@@ -44272,7 +44271,7 @@ This chapter describes a lot of things that you need to know when ...@@ -44272,7 +44271,7 @@ This chapter describes a lot of things that you need to know when
working on the MySQL code. If you plan to contribute to MySQL working on the MySQL code. If you plan to contribute to MySQL
development, want to have access to the bleeding-edge in-between development, want to have access to the bleeding-edge in-between
versions code, or just want to keep track of development, follow the versions code, or just want to keep track of development, follow the
instructions in @xref{Installing source tree}. instructions in @ref{Installing source tree}.
If you are interested in MySQL internals, you should also subscribe If you are interested in MySQL internals, you should also subscribe
to our @code{internals} mailing list. This list is relatively low to our @code{internals} mailing list. This list is relatively low
traffic. For details on how to subscribe, please see traffic. For details on how to subscribe, please see
...@@ -47600,6 +47599,10 @@ Utility from Artronic to stop MySQL on win9x. ...@@ -47600,6 +47599,10 @@ Utility from Artronic to stop MySQL on win9x.
@item @uref{http://bardo.hyperlink.cz/mysqlmon/} @item @uref{http://bardo.hyperlink.cz/mysqlmon/}
A light weight GUI client for Windows. A light weight GUI client for Windows.
@item @uref{http://www.mysqlfront.de/}
MySQLfront is a very nice Windows client with lots of useful features.
By Angsar Becker.
@item @uref{http://www.dbtools.com.br/} @item @uref{http://www.dbtools.com.br/}
Dbtools, a tool to manage MySQL databases. Currently only for Windows. Dbtools, a tool to manage MySQL databases. Currently only for Windows.
Some features: Some features:
...@@ -291,6 +291,11 @@ WWW (@uref{http://mysql.tecnoera.com/}) ...@@ -291,6 +291,11 @@ WWW (@uref{http://mysql.tecnoera.com/})
@image{Flags/chile} Chile [Vision] @@ @image{Flags/chile} Chile [Vision] @@
WWW (@uref{http://mysql.vision.cl/}) WWW (@uref{http://mysql.vision.cl/})
@item
@image{Flags/costarica} Costa Rica [Ogmios Communications] @@
WWW (@uref{http://mysql.ogmios.co.cr/})
FTP (@uref{ftp://mysql.ogmios.co.cr/pub/mysql/})
@end itemize @end itemize
@strong{Asia:} @strong{Asia:}
......
...@@ -2687,6 +2687,13 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) ...@@ -2687,6 +2687,13 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
#endif /* HAVE_OPENSSL */ #endif /* HAVE_OPENSSL */
if (want_access & GRANT_ACL) if (want_access & GRANT_ACL)
global.append(" WITH GRANT OPTION",18); global.append(" WITH GRANT OPTION",18);
else if (acl_user->questions)
{
char buff[65], *p; // just as in int2str
global.append(" WITH MAX_QUERIES_PER_HOUR = ",29);
p=int2str(acl_user->questions,buff,10);
global.append(buff,p-buff);
}
thd->packet.length(0); thd->packet.length(0);
net_store_data(&thd->packet,global.ptr(),global.length()); net_store_data(&thd->packet,global.ptr(),global.length());
if (my_net_write(&thd->net,(char*) thd->packet.ptr(), if (my_net_write(&thd->net,(char*) thd->packet.ptr(),
......
...@@ -6963,13 +6963,16 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, ...@@ -6963,13 +6963,16 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
{ {
List<Item> field_list; List<Item> field_list;
Item *item; Item *item;
List<Item> item_list;
THD *thd=join->thd; THD *thd=join->thd;
MYSQL_LOCK *save_lock;
SELECT_LEX *select_lex = &(join->thd->lex.select_lex); SELECT_LEX *select_lex = &(join->thd->lex.select_lex);
select_result *result=join->result;
DBUG_ENTER("select_describe"); DBUG_ENTER("select_describe");
/* Don't log this into the slow query log */ /* Don't log this into the slow query log */
select_lex->options&= ~(QUERY_NO_INDEX_USED | QUERY_NO_GOOD_INDEX_USED); select_lex->options&= ~(QUERY_NO_INDEX_USED | QUERY_NO_GOOD_INDEX_USED);
if (join->thd->lex.select == select_lex) if (thd->lex.select == select_lex)
{ {
field_list.push_back(new Item_empty_string("table",NAME_LEN)); field_list.push_back(new Item_empty_string("table",NAME_LEN));
field_list.push_back(new Item_empty_string("type",10)); field_list.push_back(new Item_empty_string("type",10));
...@@ -6985,24 +6988,22 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, ...@@ -6985,24 +6988,22 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
item->maybe_null=1; item->maybe_null=1;
field_list.push_back(new Item_real("rows",0.0,0,10)); field_list.push_back(new Item_real("rows",0.0,0,10));
field_list.push_back(new Item_empty_string("Extra",255)); field_list.push_back(new Item_empty_string("Extra",255));
if (send_fields(thd,field_list,1)) if (result->send_fields(field_list,1))
return; return;
} }
char buff[512],*buff_ptr;
String tmp(buff,sizeof(buff)),*packet= &thd->packet;
if (message) if (message)
{ {
packet->length(0); item_list.push_back(new Item_empty_string("",0));
net_store_null(packet); item_list.push_back(new Item_empty_string("",0));
net_store_null(packet); item_list.push_back(new Item_empty_string("",0));
net_store_null(packet); item_list.push_back(new Item_empty_string("",0));
net_store_null(packet); item_list.push_back(new Item_empty_string("",0));
net_store_null(packet); item_list.push_back(new Item_empty_string("",0));
net_store_null(packet); item_list.push_back(new Item_empty_string("",0));
net_store_null(packet); item_list.push_back(new Item_string(message,strlen(message)));
net_store_data(packet,message,strlen(message)); if (result->send_data(item_list))
if (my_net_write(&thd->net,(char*) packet->ptr(),packet->length())) result->send_error(0,NullS);
DBUG_VOID_RETURN;
} }
else else
{ {
...@@ -7011,69 +7012,70 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, ...@@ -7011,69 +7012,70 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
{ {
JOIN_TAB *tab=join->join_tab+i; JOIN_TAB *tab=join->join_tab+i;
TABLE *table=tab->table; TABLE *table=tab->table;
char buff[512],*buff_ptr=buff;
char buff1[512], buff2[512], bufff[512];
String tmp1(buff1,sizeof(buff1));
String tmp2(buff2,sizeof(buff2));
item_list.empty();
if (tab->type == JT_ALL && tab->select && tab->select->quick) if (tab->type == JT_ALL && tab->select && tab->select->quick)
tab->type= JT_RANGE; tab->type= JT_RANGE;
packet->length(0); item_list.push_back(new Item_string(table->table_name,strlen(table->table_name)));
net_store_data(packet,table->table_name); item_list.push_back(new Item_string(join_type_str[tab->type],strlen(join_type_str[tab->type])));
net_store_data(packet,join_type_str[tab->type]); tmp1.length(0); tmp2.length(0);
tmp.length(0);
key_map bits; key_map bits;
uint j; uint j;
for (j=0,bits=tab->keys ; bits ; j++,bits>>=1) for (j=0,bits=tab->keys ; bits ; j++,bits>>=1)
{ {
if (bits & 1) if (bits & 1)
{ {
if (tmp.length()) if (tmp1.length())
tmp.append(','); tmp1.append(',');
tmp.append(table->key_info[j].name); tmp1.append(table->key_info[j].name);
} }
} }
if (tmp.length()) if (tmp1.length())
net_store_data(packet,tmp.ptr(),tmp.length()); item_list.push_back(new Item_string(tmp1.ptr(),tmp1.length()));
else else
net_store_null(packet); item_list.push_back(new Item_null());
if (tab->ref.key_parts) if (tab->ref.key_parts)
{ {
net_store_data(packet,table->key_info[tab->ref.key].name); item_list.push_back(new Item_string(table->key_info[tab->ref.key].name,strlen(table->key_info[tab->ref.key].name)));
net_store_data(packet,(uint32) tab->ref.key_length); item_list.push_back(new Item_int((int) tab->ref.key_length));
tmp.length(0);
for (store_key **ref=tab->ref.key_copy ; *ref ; ref++) for (store_key **ref=tab->ref.key_copy ; *ref ; ref++)
{ {
if (tmp.length()) if (tmp2.length())
tmp.append(','); tmp2.append(',');
tmp.append((*ref)->name()); tmp2.append((*ref)->name());
} }
net_store_data(packet,tmp.ptr(),tmp.length()); item_list.push_back(new Item_string(tmp2.ptr(),tmp2.length()));
} }
else if (tab->type == JT_NEXT) else if (tab->type == JT_NEXT)
{ {
net_store_data(packet,table->key_info[tab->index].name); item_list.push_back(new Item_string(table->key_info[tab->index].name,strlen(table->key_info[tab->index].name)));
net_store_data(packet,(uint32) table->key_info[tab->index].key_length); item_list.push_back(new Item_int((int) table->key_info[tab->index].key_length));
net_store_null(packet); item_list.push_back(new Item_null());
} }
else if (tab->select && tab->select->quick) else if (tab->select && tab->select->quick)
{ {
net_store_data(packet,table->key_info[tab->select->quick->index].name);; item_list.push_back(new Item_string(table->key_info[tab->select->quick->index].name,strlen(table->key_info[tab->select->quick->index].name)));
net_store_data(packet,(uint32) tab->select->quick->max_used_key_length); item_list.push_back(new Item_int((int) tab->select->quick->max_used_key_length));
net_store_null(packet); item_list.push_back(new Item_null());
} }
else else
{ {
net_store_null(packet); item_list.push_back(new Item_null());
net_store_null(packet); item_list.push_back(new Item_null());
net_store_null(packet); item_list.push_back(new Item_null());
} }
sprintf(buff,"%.0f",join->best_positions[i].records_read); sprintf(bufff,"%.0f",join->best_positions[i].records_read);
net_store_data(packet,buff); item_list.push_back(new Item_string(bufff,strlen(bufff)));
my_bool key_read=table->key_read; my_bool key_read=table->key_read;
if (tab->type == JT_NEXT && if (tab->type == JT_NEXT &&
((table->used_keys & ((key_map) 1 << tab->index)))) ((table->used_keys & ((key_map) 1 << tab->index))))
key_read=1; key_read=1;
buff_ptr=buff;
if (tab->info) if (tab->info)
net_store_data(packet,tab->info); item_list.push_back(new Item_string(tab->info,strlen(tab->info)));
else if (tab->select) else if (tab->select)
{ {
if (tab->use_quick == 2) if (tab->use_quick == 2)
...@@ -7127,16 +7129,20 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, ...@@ -7127,16 +7129,20 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
} }
buff_ptr=strmov(buff_ptr,"Distinct"); buff_ptr=strmov(buff_ptr,"Distinct");
} }
net_store_data(packet,buff,(uint) (buff_ptr - buff)); item_list.push_back(new Item_string(buff,(uint) (buff_ptr - buff)));
if (my_net_write(&thd->net,(char*) packet->ptr(),packet->length()))
DBUG_VOID_RETURN; /* Purecov: Inspected */
// For next iteration // For next iteration
used_tables|=table->map; used_tables|=table->map;
if (result->send_data(item_list))
result->send_error(0,NullS);
} }
} }
if (!join->thd->lex.select->next) if (!join->thd->lex.select->next)
send_eof(&thd->net); {
save_lock=thd->lock;
thd->lock=(MYSQL_LOCK *)0;
result->send_eof();
thd->lock=save_lock;
}
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
...@@ -31,10 +31,11 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) ...@@ -31,10 +31,11 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
ORDER *order; ORDER *order;
List<Item> item_list; List<Item> item_list;
TABLE *table; TABLE *table;
int describe=(lex->select_lex.options & SELECT_DESCRIBE) ? 1 : 0;
int res;
TABLE_LIST result_table_list; TABLE_LIST result_table_list;
TMP_TABLE_PARAM tmp_table_param; TMP_TABLE_PARAM tmp_table_param;
select_union *union_result; select_union *union_result;
int res;
DBUG_ENTER("mysql_union"); DBUG_ENTER("mysql_union");
/* Fix tables 'to-be-unioned-from' list to point at opened tables */ /* Fix tables 'to-be-unioned-from' list to point at opened tables */
...@@ -70,33 +71,26 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) ...@@ -70,33 +71,26 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
lex_sl=0; lex_sl=0;
order=0; order=0;
} }
if (lex->select_lex.options & SELECT_DESCRIBE) if (describe)
{ {
for (sl= &lex->select_lex; sl; sl=sl->next) Item *item;
{ item_list.push_back(new Item_empty_string("table",NAME_LEN));
lex->select=sl; item_list.push_back(new Item_empty_string("type",10));
thd->offset_limit=sl->offset_limit; item_list.push_back(item=new Item_empty_string("possible_keys",
thd->select_limit=sl->select_limit+sl->offset_limit; NAME_LEN*MAX_KEY));
if (thd->select_limit < sl->select_limit) item->maybe_null=1;
thd->select_limit= HA_POS_ERROR; // no limit item_list.push_back(item=new Item_empty_string("key",NAME_LEN));
if (thd->select_limit == HA_POS_ERROR) item->maybe_null=1;
sl->options&= ~OPTION_FOUND_ROWS; item_list.push_back(item=new Item_int("key_len",0,3));
res=mysql_select(thd, (TABLE_LIST*) sl->table_list.first, item->maybe_null=1;
sl->item_list, item_list.push_back(item=new Item_empty_string("ref",
sl->where, NAME_LEN*MAX_REF_PARTS));
((sl->braces) ? item->maybe_null=1;
(ORDER *) sl->order_list.first : (ORDER *) 0), item_list.push_back(new Item_real("rows",0.0,0,10));
(ORDER*) sl->group_list.first, item_list.push_back(new Item_empty_string("Extra",255));
sl->having,
(ORDER*) NULL,
(sl->options | thd->options | SELECT_NO_UNLOCK |
SELECT_DESCRIBE),
result);
}
DBUG_RETURN(0);
} }
else
{ {
Item *item; Item *item;
List_iterator<Item> it(lex->select_lex.item_list); List_iterator<Item> it(lex->select_lex.item_list);
...@@ -113,7 +107,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) ...@@ -113,7 +107,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
bzero((char*) &tmp_table_param,sizeof(tmp_table_param)); bzero((char*) &tmp_table_param,sizeof(tmp_table_param));
tmp_table_param.field_count=item_list.elements; tmp_table_param.field_count=item_list.elements;
if (!(table=create_tmp_table(thd, &tmp_table_param, item_list, if (!(table=create_tmp_table(thd, &tmp_table_param, item_list,
(ORDER*) 0, !lex->union_option, (ORDER*) 0, !describe & !lex->union_option,
1, 0, 1, 0,
(lex->select_lex.options | thd->options | (lex->select_lex.options | thd->options |
TMP_TABLE_ALL_COLUMNS)))) TMP_TABLE_ALL_COLUMNS))))
...@@ -130,7 +124,9 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) ...@@ -130,7 +124,9 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
res= -1; res= -1;
goto exit; goto exit;
} }
for (sl= &lex->select_lex; sl; sl=sl->next) union_result->save_time_stamp=!describe;
for (sl=&lex->select_lex;sl;sl=sl->next)
{ {
thd->offset_limit=sl->offset_limit; thd->offset_limit=sl->offset_limit;
thd->select_limit=sl->select_limit+sl->offset_limit; thd->select_limit=sl->select_limit+sl->offset_limit;
...@@ -146,7 +142,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) ...@@ -146,7 +142,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
(ORDER*) sl->group_list.first, (ORDER*) sl->group_list.first,
sl->having, sl->having,
(ORDER*) NULL, (ORDER*) NULL,
sl->options | thd->options | SELECT_NO_UNLOCK, sl->options | thd->options | SELECT_NO_UNLOCK | ((describe) ? SELECT_DESCRIBE : 0),
union_result); union_result);
if (res) if (res)
goto exit; goto exit;
...@@ -187,6 +183,8 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) ...@@ -187,6 +183,8 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
if (thd->select_limit == HA_POS_ERROR) if (thd->select_limit == HA_POS_ERROR)
thd->options&= ~OPTION_FOUND_ROWS; thd->options&= ~OPTION_FOUND_ROWS;
} }
if (describe)
thd->select_limit= HA_POS_ERROR; // no limit
res=mysql_select(thd,&result_table_list, res=mysql_select(thd,&result_table_list,
item_list, NULL, /*ftfunc_list,*/ order, item_list, NULL, /*ftfunc_list,*/ order,
(ORDER*) NULL, NULL, (ORDER*) NULL, (ORDER*) NULL, NULL, (ORDER*) NULL,
...@@ -222,7 +220,7 @@ select_union::~select_union() ...@@ -222,7 +220,7 @@ select_union::~select_union()
int select_union::prepare(List<Item> &list) int select_union::prepare(List<Item> &list)
{ {
if (list.elements != table->fields) if (save_time_stamp && list.elements != table->fields)
{ {
my_message(ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT, my_message(ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT,
ER(ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT),MYF(0)); ER(ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT),MYF(0));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment