aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeaux.c
diff options
context:
space:
mode:
authordrh <>2022-10-13 12:47:33 +0000
committerdrh <>2022-10-13 12:47:33 +0000
commite995d2c226e2b65c5e40cd238415bdfeb0936e8c (patch)
tree9b2219f327bd1fb7af389ed14bdcd52f32e2e45d /src/vdbeaux.c
parent1ffb6be1195c592e6c85d57603984b1f36bfde62 (diff)
downloadsqlite-e995d2c226e2b65c5e40cd238415bdfeb0936e8c.tar.gz
sqlite-e995d2c226e2b65c5e40cd238415bdfeb0936e8c.zip
Proposed optimization to the IS NULL and NOT NULL operators that avoids
loading the entire content of larges strings and BLOBs. Response to [forum:/info/3c08d4715dc05b00|forum post 3c08d4715dc05b00]. FossilOrigin-Name: 45f171565442f9fd6574fb93ae7abe83c168b20be68af42531bc55571450d3ab
Diffstat (limited to 'src/vdbeaux.c')
-rw-r--r--src/vdbeaux.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index 8785e3b56..275ba6f77 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -1156,6 +1156,22 @@ void sqlite3VdbeChangeP5(Vdbe *p, u16 p5){
}
/*
+** If the previous opcode is an OP_Column that delivers results
+** into register iDest, then add the OPFLAG_TYPEOF flag to that
+** opcode.
+*/
+void sqlite3VdbeTypeofColumn(Vdbe *p, int iDest){
+ if( p->nOp>0 ){
+ VdbeOp *pOp = &p->aOp[p->nOp-1];
+ if( pOp->opcode==OP_Column && pOp->p3==iDest ){
+ pOp->p5 |= OPFLAG_TYPEOFARG;
+ }
+ }else{
+ assert( p->db->mallocFailed );
+ }
+}
+
+/*
** Change the P2 operand of instruction addr so that it points to
** the address of the next instruction to be coded.
*/