pt-t-c changed text of warnings and docs. Minor tweak of test for Ubuntu 14

This commit is contained in:
Frank Cizmich
2015-04-06 16:41:35 -03:00
parent 8d7c749e16
commit 54c3419e68
2 changed files with 26 additions and 30 deletions

View File

@@ -10976,18 +10976,15 @@ sub check_repl_table {
}
}
if ( $o->get('binary-key') ) {
PTDEBUG && _d('--binary-key : checking if replicate table has binary type columns');
if ( $o->get('binary-index') ) {
PTDEBUG && _d('--binary-index : checking if replicate table has binary type columns');
my $create_table = $tp->get_create_table( $dbh, $db, $tbl );
if ( $create_table !~ /lower_boundary`?\s+blob/si
|| $create_table !~ /upper_boundary`?\s+blob/si )
if ( $create_table !~ /lower_boundary`?\s+BLOB/si
|| $create_table !~ /upper_boundary`?\s+BLOB/si )
{
die "--binary-key was specified but current replicate table "
. "has text datatype boundary columns.\n"
. "You need to drop the current table and recreate it using "
. "both --create-replicate-table and --binary-key\n"
. "Alternatively you can manually create the replicate table "
. "as specified in the docs. See --binary-key usage\n";
die "--binary-index was specified but the current checksum table ($db.$tbl) uses"
." TEXT columns. To use BLOB columns, drop the current checksum table, then recreate"
." it by specifying --create-replicate-table --binary-index.";
}
}
@@ -11149,9 +11146,9 @@ sub create_repl_table {
my $sql = $o->read_para_after(__FILE__, qr/MAGIC_create_replicate/);
$sql =~ s/CREATE TABLE checksums/CREATE TABLE IF NOT EXISTS $repl_table/;
$sql =~ s/;$//;
if ( $o->get('binary-key') ) {
$sql =~ s/`?lower_boundary`?\s+text/`lower_boundary` blob/s;
$sql =~ s/`?upper_boundary`?\s+text/`upper_boundary` blob/s;
if ( $o->get('binary-index') ) {
$sql =~ s/`?lower_boundary`?\s+TEXT/`lower_boundary` BLOB/is;
$sql =~ s/`?upper_boundary`?\s+TEXT/`upper_boundary` BLOB/is;
}
PTDEBUG && _d($dbh, $sql);
eval {
@@ -11829,10 +11826,10 @@ Check that the C<binlog_format> is the same on all servers.
See "Replicas using row-based replication" under L<"LIMITATIONS">.
=item --binary-key
=item --binary-index
This option modifies the behavior of L<"--create-replicate-table"> such that the
replicate table's upper and lower boundary columns are created with binary (blob)
replicate table's upper and lower boundary columns are created with the BLOB
datatype.
This is useful in cases where you have trouble checksuming tables with keys that
include a binary datatype or that have non-standard character sets.
@@ -12372,24 +12369,23 @@ Write checksum results to this table. The replicate table must have this
structure (MAGIC_create_replicate):
CREATE TABLE checksums (
db char(64) NOT NULL,
tbl char(64) NOT NULL,
chunk int NOT NULL,
chunk_time float NULL,
chunk_index varchar(200) NULL,
lower_boundary text NULL,
upper_boundary text NULL,
this_crc char(40) NOT NULL,
this_cnt int NOT NULL,
master_crc char(40) NULL,
master_cnt int NULL,
ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
db CHAR(64) NOT NULL,
tbl CHAR(64) NOT NULL,
chunk INT NOT NULL,
chunk_time FLOAT NULL,
chunk_index VARCHAR(200) NULL,
lower_boundary TEXT NULL,
upper_boundary TEXT NULL,
this_crc CHAR(40) NOT NULL,
this_cnt INT NOT NULL,
master_crc CHAR(40) NULL,
master_cnt INT NULL,
ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (db, tbl, chunk),
INDEX ts_db_tbl (ts, db, tbl)
) ENGINE=InnoDB;
Note: lower_boundary and upper_boundary datatype can also be set to blob.
See L<"--binary-key">
Note: lower_boundary and upper_boundary data type can be BLOB. See L<"--binary-index">.
By default, L<"--[no]create-replicate-table"> is true, so the database and
the table specified by this option are created automatically if they do not

View File

@@ -68,7 +68,7 @@ $sb->wait_for_slaves();
# then starts it again.
# TEST_WISHLIST PLUGIN_WISHLIST: do this with a plugin to the tool itself,
# not in this unreliable fashion.
system("$trunk/util/wait-to-exec '$scripts/wait-for-chunk.sh 12345 sakila city 1' '$scripts/exec-wait-exec.sh 12347 \"stop slave sql_thread\" 2 \"start slave sql_thread\"' 3 >/dev/null &");
system("$trunk/util/wait-to-exec '$scripts/wait-for-chunk.sh 12345 sakila city 1' '$scripts/exec-wait-exec.sh 12347 \"stop slave sql_thread\" 2 \"start slave sql_thread\"' 4 >/dev/null &");
$output = output(
sub { pt_table_checksum::main(@args, qw(-d sakila)); },