我用MySQL创建了一个Federated表,我发现结果的本地表只包含远程数据的子集。
这是Federated:
CREATE TABLE `Activities` (
`idActivity` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Periods_idPeriod` int(10) unsigned NOT NULL DEFAULT 1,
`applicationActivityId` varchar(255) DEFAULT NULL,
`previousApplicationActivityId` varchar(255) DEFAULT NULL,
`title` text,
`ActivityTypes_idActivityType` int(10) unsigned DEFAULT 4,
`comment1` text,
`comment2` text,
`comment3` text,
`Areas_idArea` int(10) unsigned DEFAULT NULL,
`sentReports` int(11) DEFAULT '1',
PRIMARY KEY (`idActivity`)
) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://admin:*******@*******:3306/sup_supperdb/Activities';
这是远程(原始)的:
CREATE TABLE `Activities` (
`idActivity` int(10) unsigned NOT NULL auto_increment,
`Periods_idPeriod` int(10) unsigned NOT NULL default '0',
`applicationActivityId` varchar(255) default NULL,
`previousApplicationActivityId` varchar(255) default NULL,
`title` text,
`ActivityTypes_idActivityType` int(10) unsigned default NULL,
`comment1` text,
`comment2` text,
`comment3` text,
`Areas_idArea` int(10) unsigned default NULL,
`sentReports` int(11) default '1',
PRIMARY KEY (`idActivity`),
KEY `Activities_FKIndex1` (`Periods_idPeriod`),
KEY `Areas_idArea` (`Areas_idArea`),
KEY `ActivityTypes_idActivityType` (`ActivityTypes_idActivityType`),
CONSTRAINT `Activities_ibfk_1` FOREIGN KEY (`Areas_idArea`) REFERENCES `Areas` (`idArea`) ON DELETE SET NULL,
CONSTRAINT `Activities_ibfk_2` FOREIGN KEY (`ActivityTypes_idActivityType`) REFERENCES `ActivityTypes` (`idActivityType`) ON DELETE SET NULL,
CONSTRAINT `Activities_ibfk_3` FOREIGN KEY (`Periods_idPeriod`) REFERENCES `Periods` (`idPeriod`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
在原始版本中,我获得3045行,但在联邦版中只有2946行。
如果有人对可能发生的事情有所暗示,或者是某种联邦表限制,他的评论将会受到赞赏。