gpt4 book ai didi

mysql - 当我发出类似 '01%' 的信号时,我没有收到警告

转载 作者:可可西里 更新时间:2023-11-01 07:59:25 27 4
gpt4 key购买 nike

在这个触发器之后,如果我在 foo.x 中插入 5,我不会收到警告

\d $
CREATE TRIGGER `tri` BEFORE INSERT ON `foo` FOR EACH ROW
BEGIN
IF NEW.bar = 5 THEN
SIGNAL SQLSTATE '01002' SET MESSAGE_TEXT = 'MSG';
END IF;
END$\d ;

INSERT INTO `foo` values (5);

1 row affected

最佳答案

根据 Changes in MySQL 5.5.8 (2010-12-03, General Availability) 记录:

Bugs Fixed

[ deletia ]

  • Warnings raised by a trigger were not cleared upon successful completion. Now warnings are cleared if the trigger completes successfully, per the SQL standard. (Bug #55850)

关于mysql - 当我发出类似 '01%' 的信号时,我没有收到警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13910491/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com