|
大神们,帮帮忙,为啥这里执行错误
CREATE TABLE film(
id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
infohash CHAR(40) UNIQUE,
name VARCHAR(300) DEFAULT "",
length BIGINT UNSIGNED DEFAULT 0,
ctime INT UNSIGNED DEFAULT 0,
click INT UNSIGNED DEFAULT 0,
lastac INT UNSIGNED NOT NULL,
ymd DATE NOT NULL
)ENGINE=MyISAM CHARACTER SET "utf8";
CREATE TABLE IF NOT EXISTS file(
id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
fmid INT UNSIGNED NOT NULL,
file VARCHAR(300) NOT NULL DEFAULT "",
length BIGINT UNSIGNED DEFAULT 0
)ENGINE=MyISAM CHARACTER SET "utf8";
CREATE INDEX fmid_i ON file(fmid);
CREATE TABLE IF NOT EXISTS sph_counter(
counter_id INT PRIMARY KEY NOT NULL,
max_doc_id INT NOT NULL
)ENGINE=MyISAM CHARACTER SET "utf8";
CREATE TABLE IF NOT EXISTS counter(
ymd DATE PRIMARY KEY,
today INT UNSIGNED
)ENGINE=MyISAM CHARACTER SET "utf8";
DELIMITER |
CREATE TRIGGER after_film_insert AFTER INSERT ON film
FOR EACH ROW BEGIN
INSERT INTO counter(ymd, today) VALUES(new.ymd, 1)
ON DUPLICATE KEY UPDATE today=today+1;
END
|
DELIMITER ; |
|