I stumbled into a pretty nasty bug into our PROD environment

I was running some alter scripts and it appears it ended up duplicating the table for each column altered.

I've tested with MySQL Workbench, HeidSQL and DBBeaver they all display same duplicated results.

Bear in mind below examples it's just one table, but I have this issue with 4 different tables in the same Database

DBBeaver screenshot

Any table that appears duplicated now it's also duplicated in the DB backup script. If I click and drop one, all entries are gone. When I run the create script, the table is multiplied for each column.

Per question below this the CREATE script, this script is multipled same in the dump script. If I drop the table, all entries are gone. When run this script, they're all back

DROP TABLE IF EXISTS `employee`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employeeNumber` varchar(45) DEFAULT NULL,
  `firstName` varchar(150) NOT NULL,
  `lastName` varchar(150) DEFAULT NULL,
  `email` varchar(150) NOT NULL,
  `phoneNumber` varchar(20) DEFAULT NULL,
  `address` varchar(250) DEFAULT NULL,
  `userId` int(11) NOT NULL,
  `merchantId` int(11) NOT NULL,
  `departmentId` int(11) NOT NULL,
  `startDate` date NOT NULL,
  `endDate` date DEFAULT NULL,
  `contract` tinyint(4) DEFAULT '0',
  `countryId` int(11) NOT NULL,
  `createdDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `modifiedDate` datetime DEFAULT NULL,
  `isActive` tinyint(4) NOT NULL DEFAULT '0',
  `contractIssueDate` datetime DEFAULT NULL,
  `visaType` varchar(45) DEFAULT NULL,
  `visaStartDate` datetime DEFAULT NULL,
  `visaEndDate` datetime DEFAULT NULL,
  `knownAs` varchar(45) DEFAULT NULL,
  `dateOfBirth` datetime DEFAULT NULL,
  `ppsNumber` varchar(15) DEFAULT NULL,
  `passOrIdNumber` varchar(45) DEFAULT NULL,
  `nokName` varchar(100) DEFAULT NULL,
  `nokAddress` varchar(200) DEFAULT NULL,
  `nokRelationship` varchar(100) DEFAULT NULL,
  `nokPhoneNumber` varchar(20) DEFAULT NULL,
  `lastModifiedUserId` int(11) DEFAULT NULL,
  `version` int(11) DEFAULT NULL,
  `honorificTitleId` int(11) NOT NULL DEFAULT '0',
  `genderId` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `fk_country_idx` (`countryId`),
  KEY `fk_department_idx` (`departmentId`),
  KEY `fk_gender_idx` (`genderId`),
  KEY `fk_honorificTitle_idx` (`honorificTitleId`),
  KEY `fk_merchant_idx` (`merchantId`),
  CONSTRAINT `fk_country` FOREIGN KEY (`countryId`) REFERENCES `country` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_dep` FOREIGN KEY (`departmentId`) REFERENCES `department` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_gender` FOREIGN KEY (`genderId`) REFERENCES `gender` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_honorificTitle` FOREIGN KEY (`honorificTitleId`) REFERENCES `honorificTitle` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_merchant2` FOREIGN KEY (`merchantId`) REFERENCES `merchant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;

Any help would be greatly appreciated on how to prevent or resolve it.

Thank you

有帮助吗?

解决方案

Resolved the problem through Azure Helpdesk

The problem was that the parameter dir_cache_fine_grained_enabled switched on during an Azure update. This needed to be switched off and the DB server restarted. After restart things went back to normal

The parameter is not available to the public.

许可以下: CC-BY-SA归因
不隶属于 dba.stackexchange
scroll top