recursion - 如何设置SQLITE_MAX_TRIGGER_DEPTH?

标签 recursion sqlite triggers

我需要增加 SQLite 中递归触发器的最大深度。 我知道我需要将 SQLITE_MAX_TRIGGER_DEPTH 设置为我想要的值,但我找不到方法来执行此操作。

我尝试了PRAGMA SQLITE_MAX_TRIGGER_DEPTH = X,但效果不佳。

知道如何设置这个变量吗? 谢谢!

引用 SQLite 文档:

SQLite limits the depth of recursion of triggers in order to prevent a statement involving recursive triggers from using an unbounded amount of memory.

Prior to SQLite version 3.6.18, triggers were not recursive and so this limit was meaningless. Beginning with version 3.6.18, recursive triggers were supported but had to be explicitly enabled using the PRAGMA recursive_triggers statement. Beginning with version 3.7.0, recursive triggers are enabled by default but can be manually disabled using PRAGMA recursive_triggers. The SQLITE_MAX_TRIGGER_DEPTH is only meaningful if recursive triggers are enabled.

The default maximum trigger recursion depth is 1000.

最佳答案

PRAGMA recursive_triggers 仅用于启用递归触发器。

SQLITE_MAX_TRIGGER_DEPTH 参数是一个 C 预处理器符号,在编译 SQLite 本身时必须设置;在运行时增加它是不可能的。

关于recursion - 如何设置SQLITE_MAX_TRIGGER_DEPTH?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12713188/

相关文章:

android - 从 sqlite 中删除不起作用

mysql - 这个简单的 MySQL 触发器的语法有什么问题?

sql - 触发 2 个表

C 递归函数

haskell - 将内存添加到递归定义的 haskell 函数

iphone - 如何在尝试实现我的 DBAccess 类时修复 sqlite3 错误

mysql - 如何在mySQL搜索中搜索独立的单词?

sql - 如何在该触发器中找到已调用触发器的 sql 语句的 audsid、sql_id

java - 如何递归搜索文件并跳过权限不足的文件?

c# - 有条件地执行功能的最佳方式?