mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-25 13:46:22 +00:00
Fixes for DSN parser to use UTF8
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -315,6 +315,7 @@ sub test_alter_table {
|
||||
# still functiona: i.e. that they'll prevent us from delete
|
||||
# a parent row that's being referenced by a child.
|
||||
my $sql = "DELETE FROM $table WHERE $pk_col=1 LIMIT 1";
|
||||
warn ">> SQL: $sql";
|
||||
eval {
|
||||
$master_dbh->do($sql);
|
||||
};
|
||||
@@ -471,6 +472,7 @@ test_alter_table(
|
||||
],
|
||||
);
|
||||
|
||||
diag(">>>>>>>");
|
||||
test_alter_table(
|
||||
name => "Basic FK drop_swap --execute",
|
||||
table => "pt_osc.country",
|
||||
@@ -487,6 +489,7 @@ test_alter_table(
|
||||
],
|
||||
);
|
||||
|
||||
diag("2 >>>>>>>");
|
||||
# Let the tool auto-determine the fk update method. This should choose
|
||||
# the rebuild_constraints method because the tables are quite small.
|
||||
# This is tested by indicating the rebuild_constraints method, which
|
||||
@@ -510,6 +513,7 @@ test_alter_table(
|
||||
],
|
||||
);
|
||||
|
||||
diag("3 >>>>>>>");
|
||||
# Specify --alter-foreign-keys-method for a table with no child tables.
|
||||
test_alter_table(
|
||||
name => "Child table",
|
||||
@@ -527,6 +531,7 @@ test_alter_table(
|
||||
],
|
||||
);
|
||||
|
||||
diag("4 >>>>>>>");
|
||||
# Use drop_swap to alter address, which no other table references,
|
||||
# so the tool should re-enable --swap-tables and --drop-old-table.
|
||||
test_alter_table(
|
||||
@@ -545,6 +550,7 @@ test_alter_table(
|
||||
],
|
||||
);
|
||||
|
||||
diag("5 >>>>>>>");
|
||||
# Alter city and verify that its fk to country still exists.
|
||||
# (https://bugs.launchpad.net/percona-toolkit/+bug/969726)
|
||||
test_alter_table(
|
||||
|
@@ -32,25 +32,25 @@ CREATE TABLE `address` (
|
||||
CONSTRAINT `fk_address_city` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO pt_osc.country VALUES
|
||||
(1, 'Canada', null),
|
||||
(2, 'USA', null),
|
||||
(3, 'Mexico', null),
|
||||
(4, 'France', null),
|
||||
(5, 'Spain', null);
|
||||
INSERT INTO pt_osc.country (`country_id`, `country`) VALUES
|
||||
(1, 'Canada'),
|
||||
(2, 'USA'),
|
||||
(3, 'Mexico'),
|
||||
(4, 'France'),
|
||||
(5, 'Spain');
|
||||
|
||||
INSERT INTO pt_osc.city VALUES
|
||||
(1, 'Montréal', 1, null),
|
||||
(2, 'New York', 2, null),
|
||||
(3, 'Durango', 3, null),
|
||||
(4, 'Paris', 4, null),
|
||||
(5, 'Madrid', 5, null);
|
||||
INSERT INTO pt_osc.city (`city_id`, `city`, `country_id`) VALUES
|
||||
(1, 'Montréal', 1),
|
||||
(2, 'New York', 2),
|
||||
(3, 'Durango', 3),
|
||||
(4, 'Paris', 4),
|
||||
(5, 'Madrid', 5);
|
||||
|
||||
INSERT INTO pt_osc.address VALUES
|
||||
(1, 'addy 1', 1, '10000', null),
|
||||
(2, 'addy 2', 2, '20000', null),
|
||||
(3, 'addy 3', 3, '30000', null),
|
||||
(4, 'addy 4', 4, '40000', null),
|
||||
(5, 'addy 5', 5, '50000', null);
|
||||
INSERT INTO pt_osc.address (`address_id`, `address`, `city_id`, `postal_code`) VALUES
|
||||
(1, 'addy 1', 1, '10000'),
|
||||
(2, 'addy 2', 2, '20000'),
|
||||
(3, 'addy 3', 3, '30000'),
|
||||
(4, 'addy 4', 4, '40000'),
|
||||
(5, 'addy 5', 5, '50000');
|
||||
|
||||
SET foreign_key_checks=1;
|
||||
|
Reference in New Issue
Block a user