Commit 27ecbeec authored by unknown's avatar unknown
Browse files

Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/home/kent/bk/main/mysql-5.0


myisam/mi_check.c:
  Auto merged
myisam/mi_dynrec.c:
  Auto merged
myisam/mi_packrec.c:
  Auto merged
myisam/mi_range.c:
  Auto merged
myisam/mi_test1.c:
  Auto merged
myisam/mi_write.c:
  Auto merged
myisam/rt_split.c:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
parents cc5abe68 e2765a84
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
# Copyright (C) 2002, 2004-2005 MySQL AB
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
+15 −0
Original line number Diff line number Diff line
# Copyright (C) 2006 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; version 2 of the License.
# 
# 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

PROJECT(MySql)

# This reads user configuration, generated by configure.js.
+1 −1
Original line number Diff line number Diff line
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
# Copyright (C) 2000-2006 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

Docs/Support/colspec-fix.pl

deleted100755 → 0
+0 −78
Original line number Diff line number Diff line
#!/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";
}

Docs/Support/docbook-fixup.pl

deleted100755 → 0
+0 −200
Original line number Diff line number Diff line
#!/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 :)
Loading