1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Change the function name to sqlite_unsupported_offset(X). Only enable the

function if compiled with -DSQLITE_ENABLE_OFFSET_SQL_FUNC.  The makefiles add
that definition to shell builds.

FossilOrigin-Name: 7a7f826e324b1a2c332e2f1d0740fd0babffcaca6275a798572f02ad367b99ab
This commit is contained in:
drh
2017-12-29 15:04:49 +00:00
parent fe6d20e9f4
commit 092457b18c
14 changed files with 73 additions and 37 deletions

View File

@@ -3870,14 +3870,17 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
if( !pColl ) pColl = db->pDfltColl;
sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ);
}
if( pDef->funcFlags & SQLITE_FUNC_LOCATION ){
#ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC
if( pDef->funcFlags & SQLITE_FUNC_OFFSET ){
Expr *pArg = pFarg->a[0].pExpr;
if( pArg->op==TK_COLUMN ){
sqlite3VdbeAddOp3(v, OP_Location, pArg->iTable, pArg->iColumn,target);
sqlite3VdbeAddOp3(v, OP_Offset, pArg->iTable, pArg->iColumn, target);
}else{
sqlite3VdbeAddOp2(v, OP_Null, 0, target);
}
}else{
}else
#endif
{
sqlite3VdbeAddOp4(v, pParse->iSelfTab ? OP_PureFunc0 : OP_Function0,
constMask, r1, target, (char*)pDef, P4_FUNCDEF);
sqlite3VdbeChangeP5(v, (u8)nFarg);