【 使用环境 】测试环境
【 OB or 其他组件 】OB mysql
【 使用版本 】V3.2.4
【问题描述】触发器 具体逻辑变量无法使用 执行报错 【1327 - Undeclared variable】
【复现路径】
CREATE TRIGGER set_is_first_friend_insert BEFORE INSERT ON qw_customer_follower FOR EACH ROW
BEGIN
DECLARE o_id INT;
DECLARE o_createtime TIMESTAMP;
DECLARE o_is_first INT;
set o_id = (SELECT ID FROM qw_customer_follower WHERE external_userid = NEW.external_userid AND corpid = NEW.corpid ORDER BY createtime ASC LIMIT 1);
set o_createtime = (SELECT createtime FROM qw_customer_follower WHERE external_userid = NEW.external_userid AND corpid = NEW.corpid ORDER BY createtime ASC LIMIT 1);
set o_is_first = (SELECT is_first FROM qw_customer_follower WHERE external_userid = NEW.external_userid AND corpid = NEW.corpid ORDER BY createtime ASC LIMIT 1);
...
END;
;```