mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
ad126d90e0
This includes both code and test cases.
28 lines
839 B
Text
28 lines
839 B
Text
stop slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
reset master;
|
|
reset slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
start slave;
|
|
create database if not exists mysqltest1;
|
|
DROP TABLE IF EXISTS mysqltest1.t1;
|
|
CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
|
|
a TIMESTAMP DEFAULT '2005-05-05 01:01:01',
|
|
b TIMESTAMP DEFAULT '2005-05-05 01:01:01',
|
|
PRIMARY KEY(n));
|
|
CREATE FUNCTION mysqltest1.f1() RETURNS TIMESTAMP
|
|
BEGIN
|
|
DECLARE v1 INT DEFAULT 300;
|
|
WHILE v1 > 0 DO
|
|
SET v1 = v1 - 1;
|
|
END WHILE;
|
|
RETURN NOW();
|
|
END|
|
|
INSERT INTO mysqltest1.t1 VALUES(NULL,NOW(),mysqltest1.f1());
|
|
CREATE TRIGGER mysqltest1.trig1 BEFORE INSERT ON mysqltest1.t1
|
|
FOR EACH ROW BEGIN
|
|
SET new.b = mysqltest1.f1();
|
|
END|
|
|
INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
|
|
DROP TABLE IF EXISTS mysqltest1.t1;
|
|
DROP FUNCTION mysqltest1.f1;
|