- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
根据the docs ,
Some pragmas take effect during the SQL compilation stage, not the execution stage. This means if using the C-language sqlite3_prepare(), sqlite3_step(), sqlite3_finalize() API (or similar in a wrapper interface), the pragma may run during the sqlite3_prepare() call, not during the sqlite3_step() call as normal SQL statements do. Or the pragma might run during sqlite3_step() just like normal SQL statements. Whether or not the pragma runs during sqlite3_prepare() or sqlite3_step() depends on the pragma and on the specific release of SQLite.
特定编译指示的文档中未给出最后一条语句中的信息。假设我仍然有兴趣找到它,大概我必须查看来源。但具体在哪里呢?
最佳答案
所有 implemented by the underlying VFS 的编译指示解析时执行。(但是 VFS 中没有实现任何预定义的编译指示。)
否则,最简单的查找方法是 look在生成的 virtual machine instructions的杂注。有些编译指示在 VDBE 代码中不执行任何操作,这意味着它们在解析时完全执行(并且 EXPLAIN 不会阻止这种情况):
> EXPLAIN PRAGMA page_size = 16384;addr opcode p1 p2 p3 p4 p5 comment ---- ------------- ---- ---- ---- ------------- -- -------------0 Init 0 1 0 00 Start at 1 1 Halt 0 0 0 00
但请注意,未知的编译指示会被简单地忽略:
> EXPLAIN PRAGMA give_me_lots_of_money;addr opcode p1 p2 p3 p4 p5 comment ---- ------------- ---- ---- ---- ------------- -- -------------0 Init 0 1 0 00 Start at 1 1 Halt 0 0 0 00
许多仅返回值的编译指示会在解析时生成具有当前值的代码:
> EXPLAIN PRAGMA page_size;addr opcode p1 p2 p3 p4 p5 comment ---- ------------- ---- ---- ---- ------------- -- -------------0 Init 0 1 0 00 Start at 1 1 Int64 0 1 0 16384 00 r[1]=16384 2 ResultRow 1 1 0 00 output=r[1] 3 Halt 0 0 0 00
但是有些编译指示在执行时会查找值:
> EXPLAIN PRAGMA user_version;addr opcode p1 p2 p3 p4 p5 comment ---- ------------- ---- ---- ---- ------------- -- -------------0 Init 0 1 0 00 Start at 1 1 Transaction 0 0 0 00 2 ReadCookie 0 1 6 00 3 ResultRow 1 1 0 00 output=r[1] 4 Halt 0 0 0 00
一些编译指示可以用 VDBE 代码实现:
> EXPLAIN PRAGMA foreign_key_check;addr opcode p1 p2 p3 p4 p5 comment ---- ------------- ---- ---- ---- ------------- -- -------------0 Init 0 15 0 00 Start at 15 1 OpenRead 0 2 0 2 00 root=2 iDb=0; MyTable2 String8 0 3 0 MyTable 00 r[3]='MyTable'3 OpenRead 1 3 0 k(2,,) 00 root=3 iDb=0 4 Rewind 0 14 0 00 5 Column 0 1 8 00 r[8]=MyTable.Parent6 IsNull 8 13 0 00 if r[8]==NULL goto 137 MakeRecord 8 1 7 A 00 r[7]=mkrec(r[8])8 Found 1 13 7 0 00 key=r[7] 9 Rowid 0 4 0 00 r[4]=rowid 10 String8 0 5 0 MyTable 00 r[5]='MyTable'11 Integer 0 6 0 00 r[6]=0 12 ResultRow 3 4 0 00 output=r[3..6]13 Next 0 5 0 00 14 Halt 0 0 0 00 15 Transaction 0 0 3 0 01 usesStmtJournal=016 Goto 0 1 0 00
有些编译指示(例如,default_cache_size
)在解析和执行时都会执行;这通常适用于记录在数据库文件中的值(此类写入只能在事务内完成)。
所以最安全的方法是查看src/pragma.c
文件中的函数sqlite3Pragma
。
关于sqlite - 如何在SQL编译过程中找到哪些SQLite pragmas生效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43939590/
我应该使用其中哪些忽略警告? #pragma clang diagnostic ignored "-W" #pragma GCC diagnostic ignored "-W" 两者似乎都对我有用,但
#pragma startup and #pragma exit: These directives helps us to specify the functions that are needed
Xcode 中 #pragma 标记的目的是什么?它们在 .m 文件中的位置是否重要?某些 #pragma 是否应该排在所有其他之前? 他们必须在场吗? 可以添加新标记吗?他们为什么会这样?是什么原因
我想使用 nim 访问完整模块(文件)的 AST。我发现,任何宏都可以用作自定义编译指示,所以我在文件 foo.nim 中做了这样的事情: import macros macro getAst(ast
考虑: void saxpy_worksharing(float* x, float* y, float a, int N) { #pragma omp parallel for
在带有 openMP 的 C++ 中,两者之间有什么区别吗 #pragma omp parallel for for(int i=0; i
在 Visual Studio 2010 中使用 C++ native 解决方案。 #pragma warning (push) 用于 cpp 文件的开头,在所有包含之后。之后,#pragma war
在 #pragma omp parallel 的开头创建了一堆线程,然后当我们到达 #pragma omp for 时,工作负载被分配。如果这个 for 循环内部有一个 for 循环,并且我在它之前也
使用#pragma pop_macro("int") #include using namespace std; #define int double void main() { int i
我正在处理一些事情,试图让孤立工作发挥作用,并通过减少 #pragma omp parallel 的调用来减少开销。我正在尝试的是这样的: #pragma omp parallel default(n
我是 OpenMP 的新手,我一直在尝试运行一个使用 OpenMP 添加两个数组的程序。在 OpenMP 教程中,我了解到,在 for 循环上使用 OpenMP 时,我们需要使用 #pragma om
我阅读了有关循环展开的文档。它解释说,如果将展开因子设置为 1,则程序将像使用 #pragma nounrolling 一样工作。 但是,该文件不包括#pragma unroll(0) 案例..由于
我正在尝试使用 #pragma pack (n) 对齐数据成员.以下面为例: #include using namespace std; #pragma pack(8) // or (16) str
我是 C 语言的菜鸟,正在尝试学习 #pragma 预处理器指令。我在谷歌上查找并找到了这个链接:GeeksforGeeks Pragma Directive in C 在这个链接中,他们说 #pra
之间有什么区别: #pragma omp for {for_loop} 和 #pragma omp parallel for {for_loop} 最佳答案 #pragma omp par
我正在查看一些 C++/CLI 代码,并且看到了很多这样的语句,主要是围绕 #includes。他们的意思是什么?我知道他们,根据 MSDN,Enable function-level control
在 OpenMP 中 #pragma omp master 中的任何代码指令由单个线程(主线程)执行,在区域末尾没有隐含的屏障。 (见 section on MASTER directive in t
一些项目使用 #pragma nv_exec_check_disable 和/或 #pragma hd_warning_disable 使 NVCC 的警告静音 warning: calling a
英特尔编译器允许我们通过以下方式对循环进行矢量化 #pragma simd for ( ... ) 但是,您也可以选择使用 OpenMP 4 的指令执行此操作: #pragma omp simd fo
我想构建一些代码,在加载共享库时调用一些代码。我以为我会这样做: #pragma init(my_init) static void my_init () { //do-something }
我是一名优秀的程序员,十分优秀!