1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Optimize the argument to the octet_length() function so that it does not

attempt to read content from disk.

FossilOrigin-Name: 8b8ea4e3f52d96cc217bd1fb27ca4a83489ef1f250756ed2f790d1b0ee529a3a
This commit is contained in:
drh
2023-06-22 21:19:37 +00:00
parent 7f9dcd664d
commit 077efc2730
6 changed files with 29 additions and 19 deletions

View File

@@ -3056,10 +3056,14 @@ op_column_restart:
pDest->flags = aFlag[t&1];
}
}else{
u8 p5;
pDest->enc = encoding;
/* This branch happens only when content is on overflow pages */
if( ((pOp->p5 & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG))!=0
&& ((t>=12 && (t&1)==0) || (pOp->p5 & OPFLAG_TYPEOFARG)!=0))
if( ((p5 = (pOp->p5 & OPFLAG_BYTELENARG))!=0
&& (p5==OPFLAG_TYPEOFARG
|| (t>=12 && ((t&1)==0 || p5==OPFLAG_BYTELENARG))
)
)
|| (len = sqlite3VdbeSerialTypeLen(t))==0
){
/* Content is irrelevant for