TYPE=TRIGGERS
triggers='CREATE TRIGGER `Before_customer_insert` BEFORE INSERT ON `customer` FOR EACH ROW begin
\n set NEW.PATH = (Select PATH from customer_path where dir = NEW.dir);
\nend' 'CREATE TRIGGER `after_customer_insert` AFTER INSERT ON `customer` FOR EACH ROW begin
\ndeclare locktag integer default 0;
\n
\n   select count(*)  into locktag from zdts_variant
\n       where keyname = \'locked.customer\'  and keyvalue = \'yes\';
\n
\n   if (locktag = 0) then
\n      CALL  zproc_record(\'customer\',cast(new.id as char(100)),1,current_timestamp,cast(new.owner as char(100)));
\n   end if;
\n
\nend' 'CREATE TRIGGER `Before_customer_update` BEFORE UPDATE ON `customer` FOR EACH ROW begin
\n set NEW.PATH = (Select PATH from customer_path where dir = NEW.dir);
\nend' 'CREATE TRIGGER `after_customer_update` AFTER UPDATE ON `customer` FOR EACH ROW begin
\ndeclare locktag integer default 0;
\n
\n   select count(*)  into locktag from zdts_variant
\n       where keyname = \'locked.customer\'  and keyvalue = \'yes\';
\n
\n   if (locktag = 0) then
\n      CALL  zproc_record(\'customer\',cast(old.id as char(100)),0,current_timestamp,cast(old.owner as char(100)));
\n   end if;
\n
\nend' 'CREATE TRIGGER `after_customer_delete` AFTER DELETE ON `customer` FOR EACH ROW begin
\ndeclare locktag integer default 0;
\n
\n   select count(*)  into locktag from zdts_variant
\n       where keyname = \'locked.customer\'  and keyvalue = \'yes\';
\n
\n   if (locktag = 0) then
\n      CALL  zproc_record(\'customer\',cast(old.id as char(100)),-1,current_timestamp,cast(old.owner as char(100)));
\n   end if;
\n
\nend'
sql_modes=0 0 0 0 0
definers='root@' 'root@' 'root@' 'root@' 'root@'
