Comment 1 for bug 1490548

Revision history for this message
Miguel Angel Nieto (miguelangelnieto) wrote :

I can reproduce the same problem on Oracle MySQL, but only using pt-osc. If I run the same commands that pt-osc runs on the background it works well!

SELECT @@SQL_MODE;
SHOW VARIABLES LIKE 'innodb\_lock_wait_timeout';
SHOW VARIABLES LIKE 'lock\_wait_timeout';
SHOW VARIABLES LIKE 'wait\_timeout';
SET SESSION wait_timeout=10000;
SET @@SQL_QUOTE_SHOW_CREATE = 1/*!40101, @@SQL_MODE='NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'*/;
SELECT @@server_id /*!50038 , @@hostname*/;
SELECT @@SQL_MODE;
SHOW VARIABLES LIKE 'innodb\_lock_wait_timeout';
SET SESSION innodb_lock_wait_timeout=1;
SHOW VARIABLES LIKE 'lock\_wait_timeout';
SET SESSION lock_wait_timeout=60;
SHOW VARIABLES LIKE 'wait\_timeout';
SET SESSION wait_timeout=10000;
SET @@SQL_QUOTE_SHOW_CREATE = 1/*!40101, @@SQL_MODE='NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'*/;
SHOW VARIABLES LIKE 'wsrep_on';
SHOW VARIABLES LIKE 'version%';
SHOW ENGINES;
SHOW VARIABLES LIKE 'innodb_version';
SELECT @@SERVER_ID;
SHOW GRANTS FOR CURRENT_USER();
SHOW PROCESSLIST;
SHOW SLAVE HOSTS;
SHOW GLOBAL STATUS LIKE 'Threads_running';
SHOW GLOBAL STATUS LIKE 'Threads_running';
SELECT CONCAT(@@hostname, @@port);
SHOW TABLES FROM `test` LIKE 'companies';
SELECT @@server_id /*!50038 , @@hostname*/;
SHOW TRIGGERS FROM `test` LIKE 'companies';
/*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := '', @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */;
USE `test`;
SHOW CREATE TABLE `test`.`companies`;
/*!40101 SET @@SQL_MODE := @OLD_SQL_MODE, @@SQL_QUOTE_SHOW_CREATE := @OLD_QUOTE */;
EXPLAIN SELECT * FROM `test`.`companies` WHERE 1=1;
SELECT table_schema, table_name FROM information_schema.key_column_usage WHERE referenced_table_schema='test' AND referenced_table_name='companies';
SHOW VARIABLES LIKE 'wsrep_on';
/*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := '', @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */;
USE `test`;
SHOW CREATE TABLE `test`.`companies`;
/*!40101 SET @@SQL_MODE := @OLD_SQL_MODE, @@SQL_QUOTE_SHOW_CREATE := @OLD_QUOTE */;
CREATE TABLE `test`.`_companies_new` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `site_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `custom1` varchar(255) DEFAULT NULL,
  `custom2` varchar(255) DEFAULT NULL,
  `custom3` varchar(255) DEFAULT NULL,
  `custom4` varchar(255) DEFAULT NULL,
  `custom5` varchar(255) DEFAULT NULL,
  `custom6` varchar(255) DEFAULT NULL,
  `custom7` varchar(255) DEFAULT NULL,
  `custom8` varchar(255) DEFAULT NULL,
  `custom9` varchar(255) DEFAULT NULL,
  `custom10` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `custom11` varchar(255) DEFAULT NULL,
  `custom12` varchar(255) DEFAULT NULL,
  `custom13` varchar(255) DEFAULT NULL,
  `custom14` varchar(255) DEFAULT NULL,
  `custom15` varchar(255) DEFAULT NULL,
  `custom16` varchar(255) DEFAULT NULL,
  `custom17` varchar(255) DEFAULT NULL,
  `custom18` varchar(255) DEFAULT NULL,
  `custom19` varchar(255) DEFAULT NULL,
  `custom20` varchar(255) DEFAULT NULL,
  `custom21` varchar(255) DEFAULT NULL,
  `custom22` varchar(255) DEFAULT NULL,
  `custom23` varchar(255) DEFAULT NULL,
  `custom24` varchar(255) DEFAULT NULL,
  `custom25` varchar(255) DEFAULT NULL,
  `ticket_count` mediumint(8) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;
/*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := '', @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */;
USE `test`;
SHOW CREATE TABLE `test`.`_companies_new`;
/*!40101 SET @@SQL_MODE := @OLD_SQL_MODE, @@SQL_QUOTE_SHOW_CREATE := @OLD_QUOTE */;
CREATE TRIGGER `pt_osc_test_companies_del` AFTER DELETE ON `test`.`companies` FOR EACH ROW DELETE IGNORE FROM `test`.`_companies_new` WHERE `test`.`_companies_new`.`id` <=> OLD.`id`;
CREATE TRIGGER `pt_osc_test_companies_upd` AFTER UPDATE ON `test`.`companies` FOR EACH ROW REPLACE INTO `test`.`_companies_new` (`id`, `site_id`, `name`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`, `created_at`, `updated_at`, `custom11`, `custom12`, `custom13`, `custom14`, `custom15`, `custom16`, `custom17`, `custom18`, `custom19`, `custom20`, `custom21`, `custom22`, `custom23`, `custom24`, `custom25`, `ticket_count`) VALUES (NEW.`id`, NEW.`site_id`, NEW.`name`, NEW.`custom1`, NEW.`custom2`, NEW.`custom3`, NEW.`custom4`, NEW.`custom5`, NEW.`custom6`, NEW.`custom7`, NEW.`custom8`, NEW.`custom9`, NEW.`custom10`, NEW.`created_at`, NEW.`updated_at`, NEW.`custom11`, NEW.`custom12`, NEW.`custom13`, NEW.`custom14`, NEW.`custom15`, NEW.`custom16`, NEW.`custom17`, NEW.`custom18`, NEW.`custom19`, NEW.`custom20`, NEW.`custom21`, NEW.`custom22`, NEW.`custom23`, NEW.`custom24`, NEW.`custom25`, NEW.`ticket_count`);
CREATE TRIGGER `pt_osc_test_companies_ins` AFTER INSERT ON `test`.`companies` FOR EACH ROW REPLACE INTO `test`.`_companies_new` (`id`, `site_id`, `name`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`, `created_at`, `updated_at`, `custom11`, `custom12`, `custom13`, `custom14`, `custom15`, `custom16`, `custom17`, `custom18`, `custom19`, `custom20`, `custom21`, `custom22`, `custom23`, `custom24`, `custom25`, `ticket_count`) VALUES (NEW.`id`, NEW.`site_id`, NEW.`name`, NEW.`custom1`, NEW.`custom2`, NEW.`custom3`, NEW.`custom4`, NEW.`custom5`, NEW.`custom6`, NEW.`custom7`, NEW.`custom8`, NEW.`custom9`, NEW.`custom10`, NEW.`created_at`, NEW.`updated_at`, NEW.`custom11`, NEW.`custom12`, NEW.`custom13`, NEW.`custom14`, NEW.`custom15`, NEW.`custom16`, NEW.`custom17`, NEW.`custom18`, NEW.`custom19`, NEW.`custom20`, NEW.`custom21`, NEW.`custom22`, NEW.`custom23`, NEW.`custom24`, NEW.`custom25`, NEW.`ticket_count`);
EXPLAIN SELECT * FROM `test`.`companies` WHERE 1=1;
EXPLAIN SELECT `id`, `site_id`, `name`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`, `created_at`, `updated_at`, `custom11`, `custom12`, `custom13`, `custom14`, `custom15`, `custom16`, `custom17`, `custom18`, `custom19`, `custom20`, `custom21`, `custom22`, `custom23`, `custom24`, `custom25`, `ticket_count` FROM `test`.`companies` LOCK IN SHARE MODE /*explain pt-online-schema-change 9132 copy table*/;
INSERT LOW_PRIORITY IGNORE INTO `test`.`_companies_new` (`id`, `site_id`, `name`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`, `created_at`, `updated_at`, `custom11`, `custom12`, `custom13`, `custom14`, `custom15`, `custom16`, `custom17`, `custom18`, `custom19`, `custom20`, `custom21`, `custom22`, `custom23`, `custom24`, `custom25`, `ticket_count`) SELECT `id`, `site_id`, `name`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`, `created_at`, `updated_at`, `custom11`, `custom12`, `custom13`, `custom14`, `custom15`, `custom16`, `custom17`, `custom18`, `custom19`, `custom20`, `custom21`, `custom22`, `custom23`, `custom24`, `custom25`, `ticket_count` FROM `test`.`companies` LOCK IN SHARE MODE /*pt-online-schema-change 9132 copy table*/;
SHOW WARNINGS;
SHOW GLOBAL STATUS LIKE 'Threads_running';
RENAME TABLE `test`.`companies` TO `test`.`_companies_old`, `test`.`_companies_new` TO `test`.`companies`;
DROP TABLE IF EXISTS `test`.`_companies_old`;
DROP TRIGGER IF EXISTS `test`.`pt_osc_test_companies_del`;
DROP TRIGGER IF EXISTS `test`.`pt_osc_test_companies_upd`;
DROP TRIGGER IF EXISTS `test`.`pt_osc_test_companies_ins`;
SHOW TABLES FROM `test` LIKE '\_companies\_new';