You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB

  1. #!/usr/bin/perl
  2. # Copyright (c) 2001 MySQL AB, 2009 Sun Microsystems, Inc.
  3. # Use is subject to license terms.
  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-1301, USA
  19. # This is a utility for MySQL. It is not needed by any standard part
  20. # of MySQL.
  21. # Usage: mysql_fix_extentions datadir
  22. # does not work with RAID, with InnoDB or BDB tables
  23. # makes .frm lowercase and .MYI/MYD/ISM/ISD uppercase
  24. # useful when datafiles are copied from windows
  25. die "Usage: $0 datadir\n" unless -d $ARGV[0];
  26. for $a (<$ARGV[0]/*/*.*>) { $_=$a;
  27. s/\.frm$/.frm/i;
  28. s/\.(is[md]|my[id])$/\U$&/i;
  29. rename ($a, $_) || warn "Cannot rename $a => $_ : $!";
  30. }