在级联删除中触发调用

Trigger calls in cascade deleting(在级联删除中触发调用)
本文介绍了在级联删除中触发调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 MySQL 中有表A".它有一些对其他一些表(B"、C"、D"...)的级联删除的引用.当某些内容从A"中删除时,我需要使用触发器.当我直接从A"删除记录时,此触发器起作用.但它不适用于级联删除.是否存在任何版本的 MySQL,我的触发器可以与级联删除一起使用?或者,也许还有另一种调用方式

I have table "A" in MySQL. It has some references with cascade deleting to some other tables ("B", "C", "D" ...). I need to use a trigger when something deletes from "A". This trigger works when I delete records from "A" directly. But it doesn't work with cascade deleting. Does any version of MySQL exist where my trigger will work with cascade deleting? Or, maybe, there is another way to call

推荐答案

来自http://dev.mysql.com/doc/refman/5.6/en/innodb-restrictions.html

级联外键操作不会激活触发器

Cascaded foreign key actions do not activate triggers

换句话说,您不能将触发器与级联删除一起使用.

In other words, you cannot use the trigger with cascaded deleting.

另见相关错误:

  • MySQL:https://bugs.mysql.com/bug.php?id=11472
  • MariaDB:https://jira.mariadb.org/browse/MDEV-19402

这篇关于在级联删除中触发调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SQL/MySQL: split a quantity value into multiple rows by date(SQL/MySQL:按日期将数量值拆分为多行)