~percona-toolkit-dev/percona-toolkit/manual-for-pt-query-digest--type-binlog-is-ambiguous-1377888

« back to all changes in this revision

Viewing changes to bin/pt-online-schema-change

  • Committer: Frank Cizmich
  • Date: 2014-07-29 15:51:01 UTC
  • mfrom: (606.1.12 release-2.2.9)
  • Revision ID: frank.cizmich@percona.com-20140729155101-f5kv4rmeu3s5rzk5
merged release 2.2.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
{
55
55
package Percona::Toolkit;
56
56
 
57
 
our $VERSION = '2.2.8';
 
57
our $VERSION = '2.2.9';
58
58
 
59
59
use strict;
60
60
use warnings FATAL => 'all';
7860
7860
         $o->save_error("Invalid --alter-foreign-keys-method value: $alter_fk_method");
7861
7861
      }
7862
7862
 
 
7863
      # Issue a strong warning if alter-foreign-keys-method = none
 
7864
      if ( $alter_fk_method eq 'none' && !$o->get('force') ) {
 
7865
         print STDERR "WARNING! Using alter-foreign-keys-method = \"none\". This will typically cause foreign key violations!\nThis method of handling foreign key constraints is only provided so that the database administrator can disable the tool’s built-in functionality if desired.\n\nContinue anyway? (y/N)";
 
7866
         my $response;
 
7867
         chomp($response = <STDIN>);
 
7868
         if ($response !~ /y|(yes)/i) { 
 
7869
            exit 1;
 
7870
         }
 
7871
      }
 
7872
 
7863
7873
      if ( $alter_fk_method eq 'drop_swap' && !$o->get('drop-new-table') ) {
7864
7874
         $o->save_error("--alter-foreign-keys-method=drop_swap does not work with --no-drop-new-table.");
7865
7875
      }
9815
9825
   
9816
9826
   my $sql = "SELECT table_schema, table_name "
9817
9827
           . "FROM information_schema.key_column_usage "
9818
 
           . "WHERE constraint_schema='$tbl->{db}' "
 
9828
           . "WHERE referenced_table_schema='$tbl->{db}' "
9819
9829
           . "AND referenced_table_name='$tbl->{tbl}'";
9820
9830
   PTDEBUG && _d($sql);
9821
9831
   my $rows = $cxn->dbh()->selectall_arrayref($sql);
11025
11035
documentation and understand how to use this tool.  If you have not read the
11026
11036
documentation, then do not specify this option.
11027
11037
 
 
11038
=item --force
 
11039
 
 
11040
This options bypasses confirmation in case of using alter-foreign-keys-method = none , which might break foreign key constraints.
 
11041
 
11028
11042
=item --help
11029
11043
 
11030
11044
Show help and exit.
11541
11555
 
11542
11556
=head1 VERSION
11543
11557
 
11544
 
pt-online-schema-change 2.2.8
 
11558
pt-online-schema-change 2.2.9
11545
11559
 
11546
11560
=cut