1#!@PERL_PATH@
2
3# Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
4#
5# This program is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Library General Public
7# License as published by the Free Software Foundation; version 2
8# of the License.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13# Library General Public License for more details.
14#
15# You should have received a copy of the GNU Library General Public
16# License along with this library; if not, write to the Free
17# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
18# MA 02110-1335  USA
19
20# This is a utility for MariaDB. It is not needed by any standard part
21# of MariaDB.
22
23# Usage: mysql_fix_extensions datadir
24# does not work with RAID, with InnoDB or BDB tables
25# makes .frm lowercase and .MYI/MYD/ISM/ISD uppercase
26# useful when datafiles are copied from windows
27
28die "Usage: $0 datadir\n" unless -d $ARGV[0];
29
30for $a (<$ARGV[0]/*/*.*>) { $_=$a;
31  s/\.frm$/.frm/i;
32  s/\.(is[md]|my[id])$/\U$&/i;
33  rename ($a, $_) || warn "Cannot rename $a => $_ : $!";
34}
35