aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeInt.h
diff options
context:
space:
mode:
authordrh <>2022-04-01 17:01:57 +0000
committerdrh <>2022-04-01 17:01:57 +0000
commit17c4865b838d222314fa6256e7584a5fe164281b (patch)
tree2079fcf9d6f70d8827ed83d751cbde81956bd8e1 /src/vdbeInt.h
parent00946d79535aa1c11d859ea2e944068c953faf48 (diff)
parent99a218282c42057ada2c187dc28f47442ce78751 (diff)
downloadsqlite-17c4865b838d222314fa6256e7584a5fe164281b.tar.gz
sqlite-17c4865b838d222314fa6256e7584a5fe164281b.zip
Refactor the Vdbe.iVdbeMagic field into Vdbe.eVdbeState. Split the RUNNING
state into separate RUNNING and READY. This gives a size reduction and performance increase. FossilOrigin-Name: 5a50a42fde9477868fad31099f5fe976437825fac44f8b3a4cf6c739c7667bbb
Diffstat (limited to 'src/vdbeInt.h')
-rw-r--r--src/vdbeInt.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/vdbeInt.h b/src/vdbeInt.h
index 32c341eb8..9247b41c3 100644
--- a/src/vdbeInt.h
+++ b/src/vdbeInt.h
@@ -418,7 +418,6 @@ struct Vdbe {
Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
Parse *pParse; /* Parsing context used to create this Vdbe */
ynVar nVar; /* Number of entries in aVar[] */
- u32 iVdbeMagic; /* Magic number defining state of the SQL statement */
int nMem; /* Number of memory locations currently allocated */
int nCursor; /* Number of slots in apCsr[] */
u32 cacheCtr; /* VdbeCursor row cache generation counter */
@@ -457,6 +456,7 @@ struct Vdbe {
u8 minWriteFileFormat; /* Minimum file format for writable database files */
u8 prepFlags; /* SQLITE_PREPARE_* flags */
u8 doingRerun; /* True if rerunning after an auto-reprepare */
+ u8 eVdbeState; /* On of the VDBE_*_STATE values */
bft expired:2; /* 1: recompile VM immediately 2: when convenient */
bft explain:2; /* True if EXPLAIN present on SQL command */
bft changeCntOn:1; /* True to update the change-counter */
@@ -487,13 +487,12 @@ struct Vdbe {
};
/*
-** The following are allowed values for Vdbe.magic
+** The following are allowed values for Vdbe.eVdbeState
*/
-#define VDBE_MAGIC_INIT 0x16bceaa5 /* Building a VDBE program */
-#define VDBE_MAGIC_RUN 0x2df20da3 /* VDBE is ready to execute */
-#define VDBE_MAGIC_HALT 0x319c2973 /* VDBE has completed execution */
-#define VDBE_MAGIC_RESET 0x48fa9f76 /* Reset and ready to run again */
-#define VDBE_MAGIC_DEAD 0x5606c3c8 /* The VDBE has been deallocated */
+#define VDBE_INIT_STATE 0 /* Prepared statement under construction */
+#define VDBE_READY_STATE 1 /* Ready to run but not yet started */
+#define VDBE_RUN_STATE 2 /* Run in progress */
+#define VDBE_HALT_STATE 3 /* Finished. Need reset() or finalize() */
/*
** Structure used to store the context required by the