mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / scripts / mysql_fix_extensions.sh
blob2a50bfe22bb33aaf06dba1e87ff3dea8b3257147
1 #!/usr/bin/perl
3 # Copyright (c) 2001 MySQL AB, 2009 Sun Microsystems, Inc.
4 # Use is subject to license terms.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Library General Public
8 # License as published by the Free Software Foundation; version 2
9 # of the License.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Library General Public License for more details.
16 # You should have received a copy of the GNU Library General Public
17 # License along with this library; if not, write to the Free
18 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
19 # MA 02110-1301, USA
21 # This is a utility for MySQL. It is not needed by any standard part
22 # of MySQL.
24 # Usage: mysql_fix_extentions datadir
25 # does not work with RAID, with InnoDB or BDB tables
26 # makes .frm lowercase and .MYI/MYD/ISM/ISD uppercase
27 # useful when datafiles are copied from windows
29 die "Usage: $0 datadir\n" unless -d $ARGV[0];
31 for $a (<$ARGV[0]/*/*.*>) { $_=$a;
32 s/\.frm$/.frm/i;
33 s/\.(is[md]|my[id])$/\U$&/i;
34 rename ($a, $_) || warn "Cannot rename $a => $_ : $!";