【发布时间】:2011-02-16 20:51:50
【问题描述】:
我认为有人试图模拟具有第二个 auto_increment 值。刚刚升级到 MySQL 5.5.9
CREATE TABLE `job_title` (
`job_id` int(11) NOT NULL AUTO_INCREMENT,
`position_id` int(11) DEFAULT NULL,
`title` varchar(255) COLLATE latin1_general_cs NOT NULL,
`selectable` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`job_id`),
UNIQUE KEY `title` (`title`)
) ENGINE=InnoDB;
create trigger job_position_trigger
before insert on job_title for each row
begin
if new.position_id is null then
set @position = (select max(position_id)+1 from job_title);
set new.position_id = @position;
end if;
end
错误:Thread stack overrun: 9024 bytes used of a 131072 byte stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a
bigger stack.' on query. Default database: 'mydb'. Query: 'insert ignore into job_title (title) values ('Morning Show Personality')
【问题讨论】:
-
我运行了同样的东西,没有抱怨
-
你用的是mysql 5.5吗?