IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29280


Ignore:
Timestamp:
Sep 30, 2010, 9:21:35 AM (16 years ago)
Author:
rhenders
Message:

Added a methid to optimize a table and report on success/failure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czartool/MySQLDb.pm

    r29023 r29280  
    131131#######################################################################################
    132132#
     133# Optimizes a table
     134#
     135#######################################################################################
     136sub optimizeTable {
     137    my ($self, $table) = @_;
     138
     139    my $query = $self->{_db}->prepare(<<SQL);
     140    OPTIMIZE TABLE $table;
     141SQL
     142
     143    my $success = $query->execute;
     144
     145    print "* ";
     146    if (!$success) {print "UN";}
     147    print "successfully optimized '$table' table\n";
     148
     149    return $success;
     150}
     151
     152#######################################################################################
     153#
    133154# Checks whether a certain table exists
    134155#
Note: See TracChangeset for help on using the changeset viewer.