创建了一个触发器,插入任何数据出现下面错误:
Error Code: 1644. Strange error!
DELIMITER $$
CREATE DEFINER = CURRENT_USER TRIGGER `test`.`gender_BEFORE_INSERT` BEFORE INSERT ON `gender` FOR EACH ROW
BEGIN
IF NEW.gendercol<>1 or NEW.gendercol<>2 THEN
SIGNAL SQLSTATE '45000'
SET message_text = 'Strange error!';
END IF;
END$$
DELIMITER ;
建表语句:
CREATE TABLE `gender` (
`idgender` int(11) NOT NULL AUTO_INCREMENT,
`gendercol` int(11) DEFAULT NULL,
PRIMARY KEY (`idgender`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
ringa_lee