Lines Matching defs:pVal

10173 **    for(rc=sqlite3_vtab_in_first(pList, &pVal);
10174 **   rc==SQLITE_OK && pVal
10175 **   rc=sqlite3_vtab_in_next(pList, &pVal)
10177 **   // do something with pVal
10197 SQLITE_API int sqlite3_vtab_in_first(sqlite3_value *pVal, sqlite3_value **ppOut);
10198 SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut);
81846 ** The pVal argument is known to be a value other than NULL.
81850 static SQLITE_NOINLINE const void *valueToText(sqlite3_value* pVal, u8 enc){
81851 assert( pVal!=0 );
81852 assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) );
81854 assert( !sqlite3VdbeMemIsRowSet(pVal) );
81855 assert( (pVal->flags & (MEM_Null))==0 );
81856 if( pVal->flags & (MEM_Blob|MEM_Str) ){
81857 if( ExpandBlob(pVal) ) return 0;
81858 pVal->flags |= MEM_Str;
81859 if( pVal->enc != (enc & ~SQLITE_UTF16_ALIGNED) ){
81860 sqlite3VdbeChangeEncoding(pVal, enc & ~SQLITE_UTF16_ALIGNED);
81862 if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&SQLITE_PTR_TO_INT(pVal->z)) ){
81863 assert( (pVal->flags & (MEM_Ephem|MEM_Static))!=0 );
81864 if( sqlite3VdbeMemMakeWriteable(pVal)!=SQLITE_OK ){
81868 sqlite3VdbeMemNulTerminate(pVal); /* IMP: R-31275-44060 */
81870 sqlite3VdbeMemStringify(pVal, enc, 0);
81871 assert( 0==(1&SQLITE_PTR_TO_INT(pVal->z)) );
81873 assert(pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || pVal->db==0
81874 || pVal->db->mallocFailed );
81875 if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){
81876 assert( sqlite3VdbeMemValidStrRep(pVal) );
81877 return pVal->z;
81893 SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
81894 if( !pVal ) return 0;
81895 assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) );
81897 assert( !sqlite3VdbeMemIsRowSet(pVal) );
81898 if( (pVal->flags&(MEM_Str|MEM_Term))==(MEM_Str|MEM_Term) && pVal->enc==enc ){
81899 assert( sqlite3VdbeMemValidStrRep(pVal) );
81900 return pVal->z;
81902 if( pVal->flags&MEM_Null ){
81905 return valueToText(pVal, enc);
82016 sqlite3_value *pVal = 0; /* New value */
82047 pVal = valueNew(db, pCtx);
82048 if( pVal==0 ){
82056 ctx.pOut = pVal;
82062 sqlite3ErrorMsg(pCtx->pParse, "%s", sqlite3_value_text(pVal));
82064 sqlite3ValueApplyAffinity(pVal, aff, SQLITE_UTF8);
82066 rc = sqlite3VdbeChangeEncoding(pVal, enc);
82067 if( rc==SQLITE_OK && sqlite3VdbeMemTooBig(pVal) ){
82076 pVal = 0;
82085 *ppVal = pVal;
82112 sqlite3_value *pVal = 0;
82152 pVal = valueNew(db, pCtx);
82153 if( pVal==0 ) goto no_mem;
82155 sqlite3VdbeMemSetInt64(pVal, (i64)pExpr->u.iValue*negInt);
82159 sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, SQLITE_DYNAMIC);
82162 sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, SQLITE_UTF8);
82164 sqlite3ValueApplyAffinity(pVal, affinity, SQLITE_UTF8);
82166 assert( (pVal->flags & MEM_IntReal)==0 );
82167 if( pVal->flags & (MEM_Int|MEM_IntReal|MEM_Real) ){
82168 testcase( pVal->flags & MEM_Int );
82169 testcase( pVal->flags & MEM_Real );
82170 pVal->flags &= ~MEM_Str;
82173 rc = sqlite3VdbeChangeEncoding(pVal, enc);
82177 if( SQLITE_OK==valueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal,pCtx)
82178 && pVal!=0
82180 sqlite3VdbeMemNumerify(pVal);
82181 if( pVal->flags & MEM_Real ){
82182 pVal->u.r = -pVal->u.r;
82183 }else if( pVal->u.i==SMALLEST_INT64 ){
82185 pVal->u.r = -(double)SMALLEST_INT64;
82187 pVal->u.r = LARGEST_INT64;
82189 MemSetTypeFlag(pVal, MEM_Real);
82191 pVal->u.i = -pVal->u.i;
82193 sqlite3ValueApplyAffinity(pVal, affinity, enc);
82196 pVal = valueNew(db, pCtx);
82197 if( pVal==0 ) goto no_mem;
82198 sqlite3VdbeMemSetNull(pVal);
82206 pVal = valueNew(db, pCtx);
82207 if( !pVal ) goto no_mem;
82211 sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(db, zVal, nVal), nVal/2,
82217 rc = valueFromFunction(db, pExpr, enc, affinity, &pVal, pCtx);
82222 pVal = valueNew(db, pCtx);
82223 if( pVal ){
82224 pVal->flags = MEM_Int;
82225 pVal->u.i = pExpr->u.zToken[4]==0;
82229 *ppVal = pVal;
82240 if( pCtx==0 ) sqlite3ValueFree(pVal);
82242 assert( pCtx==0 ); sqlite3ValueFree(pVal);
82294 sqlite3_value *pVal = 0;
82302 pVal = valueNew(db, pAlloc);
82303 if( pVal ){
82304 sqlite3VdbeMemSetNull((Mem*)pVal);
82311 pVal = valueNew(db, pAlloc);
82312 if( pVal ){
82313 rc = sqlite3VdbeMemCopy((Mem*)pVal, &v->aVar[iBindVar-1]);
82314 sqlite3ValueApplyAffinity(pVal, affinity, ENC(db));
82315 pVal->db = pParse->db;
82319 rc = valueFromExpr(db, pExpr, ENC(db), affinity, &pVal, pAlloc);
82322 assert( pVal==0 || pVal->db==db );
82323 *ppVal = pVal;
82382 sqlite3_value *pVal = 0;
82386 rc = stat4ValueFromExpr(pParse, pElem, aff, &alloc, &pVal);
82387 if( !pVal ) break;
82510 static SQLITE_NOINLINE int valueBytes(sqlite3_value *pVal, u8 enc){
82511 return valueToText(pVal, enc)!=0 ? pVal->n : 0;
82513 SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){
82514 Mem *p = (Mem*)pVal;
82516 if( (p->flags & MEM_Str)!=0 && pVal->enc==enc ){
82519 if( (p->flags & MEM_Str)!=0 && enc!=SQLITE_UTF8 && pVal->enc!=SQLITE_UTF8 ){
82530 return valueBytes(pVal, enc);
88036 SQLITE_API const void *sqlite3_value_blob(sqlite3_value *pVal){
88037 Mem *p = (Mem*)pVal;
88046 return sqlite3_value_text(pVal);
88049 SQLITE_API int sqlite3_value_bytes(sqlite3_value *pVal){
88050 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
88052 SQLITE_API int sqlite3_value_bytes16(sqlite3_value *pVal){
88053 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
88055 SQLITE_API double sqlite3_value_double(sqlite3_value *pVal){
88056 return sqlite3VdbeRealValue((Mem*)pVal);
88058 SQLITE_API int sqlite3_value_int(sqlite3_value *pVal){
88059 return (int)sqlite3VdbeIntValue((Mem*)pVal);
88061 SQLITE_API sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
88062 return sqlite3VdbeIntValue((Mem*)pVal);
88064 SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
88065 Mem *pMem = (Mem*)pVal;
88068 SQLITE_API void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
88069 Mem *p = (Mem*)pVal;
88081 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
88082 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
88085 SQLITE_API const void *sqlite3_value_text16(sqlite3_value* pVal){
88086 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
88088 SQLITE_API const void *sqlite3_value_text16be(sqlite3_value *pVal){
88089 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
88091 SQLITE_API const void *sqlite3_value_text16le(sqlite3_value *pVal){
88092 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
88099 SQLITE_API int sqlite3_value_type(sqlite3_value* pVal){
88169 if( pVal->flags & MEM_Null ){
88171 }else if( pVal->flags & (MEM_Real|MEM_IntReal) ){
88173 }else if( pVal->flags & MEM_Int ){
88175 }else if( pVal->flags & MEM_Str ){
88178 assert( eType == aType[pVal->flags&MEM_AffMask] );
88181 return aType[pVal->flags&MEM_AffMask];
88183 SQLITE_API int sqlite3_value_encoding(sqlite3_value *pVal){
88184 return pVal->enc;
88188 SQLITE_API int sqlite3_value_nochange(sqlite3_value *pVal){
88189 return (pVal->flags&(MEM_Null|MEM_Zero))==(MEM_Null|MEM_Zero);
88193 SQLITE_API int sqlite3_value_frombind(sqlite3_value *pVal){
88194 return (pVal->flags&MEM_FromBind)!=0;
88787 sqlite3_value *pVal, /* Pointer to the ValueList object */
88795 if( pVal==0 ) return SQLITE_MISUSE;
88796 pRhs = (ValueList*)sqlite3_value_pointer(pVal, "ValueList");
88831 ** Set the iterator value pVal to point to the first value in the set.
88834 SQLITE_API int sqlite3_vtab_in_first(sqlite3_value *pVal, sqlite3_value **ppOut){
88835 return valueFromValueList(pVal, ppOut, 0);
88839 ** Set the iterator value pVal to point to the next value in the set.
88842 SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut){
88843 return valueFromValueList(pVal, ppOut, 1);
90690 SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){
90691 int eType = sqlite3_value_type(pVal);
90693 Mem *pMem = (Mem*)pVal;
90695 eType = sqlite3_value_type(pVal);
90705 sqlite3_value *pVal,
90709 applyAffinity((Mem *)pVal, affinity, enc);
101545 Mem *pVal /* Memory cell containing record */
101557 getVarint32NR((const u8*)&pVal->z[1], t);
101584 nReq = pVal->n + sizeof(SorterRecord);
101585 nPMA = pVal->n + sqlite3VarintLen(pVal->n);
101643 memcpy(SRVAL(pNew), pVal->z, pVal->n);
101644 pNew->nVal = pVal->n;
102493 ** Compare the key in memory cell pVal with the key that the sorter cursor
102498 ** less than pVal. Even if pVal also contains NULL values.
102502 ** key in pVal is smaller than, equal to or larger than the current sorter
102510 Mem *pVal, /* Value to compare to current sorter key */
102518 void *pKey; int nKey; /* Sorter key to compare pVal with */
102540 *pRes = sqlite3VdbeRecordCompare(pVal->n, pVal->z, r2);
112713 sqlite3_value *pVal = 0;
112715 rc = sqlite3ValueFromExpr(db, pDflt, SQLITE_UTF8, SQLITE_AFF_BLOB, &pVal);
112721 if( !pVal ){
112725 sqlite3ValueFree(pVal);
154883 sqlite3_value *pVal = 0;
154902 pVal = sqlite3VdbeGetBoundValue(pReprepare, iCol, SQLITE_AFF_BLOB);
154903 if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
154904 z = sqlite3_value_text(pVal);
154983 sqlite3ValueFree(pVal);
155015 sqlite3ValueFree(pVal);
156261 Expr *pVal = sqlite3Expr(db, TK_INTEGER, 0);
156262 if( pVal==0 ) return;
156263 ExprSetProperty(pVal, EP_IntValue);
156264 pVal->u.iValue = iVal;
156265 pNew = sqlite3PExpr(pParse, TK_MATCH, 0, pVal);
156267 Expr *pVal = sqlite3Expr(db, TK_REGISTER, 0);
156268 if( pVal==0 ) return;
156269 pVal->iTable = iReg;
156270 pNew = sqlite3PExpr(pParse, TK_MATCH, 0, pVal);
158257 sqlite3_value *pVal = 0; /* Value extracted from record */
158273 rc = sqlite3Stat4Column(db, p->aSample[i].p, p->aSample[i].n, nEq, &pVal);
158275 int res = sqlite3MemCompare(p1, pVal, pColl);
158279 int res = sqlite3MemCompare(p2, pVal, pColl);
158305 sqlite3ValueFree(pVal);
160460 sqlite3_value *pVal = 0;
160473 pVal = pH->aRhs[iCons];
160475 *ppVal = pVal;
160477 if( rc==SQLITE_OK && pVal==0 ){ /* IMP: R-19933-32160 */
163607 sqlite3_value *pVal;
163623 sqlite3_value_free(p->pVal);
163624 p->pVal = sqlite3_value_dup(apArg[0]);
163625 if( p->pVal==0 ){
163644 sqlite3_value_free(p->pVal);
163645 p->pVal = 0;
163652 if( p && p->pVal ){
163653 sqlite3_result_value(pCtx, p->pVal);
163659 if( p && p->pVal ){
163660 sqlite3_result_value(pCtx, p->pVal);
163661 sqlite3_value_free(p->pVal);
163662 p->pVal = 0;
165559 sqlite3_value *pVal = 0;
165560 sqlite3ValueFromExpr(db, pExpr, db->enc, SQLITE_AFF_NUMERIC, &pVal);
165561 if( pVal && sqlite3_value_int(pVal)>0 ){
165564 sqlite3ValueFree(pVal);
173290 sqlite3_value *pVal;
173298 pVal = sqlite3ValueNew(0);
173299 sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);
173300 zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8);
173306 sqlite3ValueFree(pVal);
177015 sqlite3_value *pVal;
177027 pVal = sqlite3ValueNew(0);
177028 sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC);
177029 zFilename8 = sqlite3ValueText(pVal, SQLITE_UTF8);
177040 sqlite3ValueFree(pVal);
180132 ** to *pVal.
180134 static void fts3GetDeltaVarint(char **pp, sqlite3_int64 *pVal){
180137 *pVal += iVal;
180144 ** and sets *pVal by the varint value.
180152 sqlite3_int64 *pVal
180165 *pVal = iVal;
182143 ** If bDescIdx is false, the value read is added to *pVal before returning.
182144 ** If it is true, the value read is subtracted from *pVal before this
182151 sqlite3_int64 *pVal /* IN/OUT: Integer value */
182159 *pVal = (i64)((u64)*pVal - iVal);
182161 *pVal = (i64)((u64)*pVal + iVal);
182909 ** If the numeric type of argument pVal is "integer", then return it
182913 static sqlite3_int64 fts3DocidRange(sqlite3_value *pVal, i64 iDefault){
182914 if( pVal ){
182915 int eType = sqlite3_value_numeric_type(pVal);
182917 return sqlite3_value_int64(pVal);
183328 sqlite3_value *pVal, /* argv[0] passed to function */
183332 *ppCsr = (Fts3Cursor*)sqlite3_value_pointer(pVal, "fts3cursor");
195300 ** Argument pVal contains the result of <expr>. Currently the only
195303 static int fts3SpecialInsert(Fts3Table *p, sqlite3_value *pVal){
195305 const char *zVal = (const char *)sqlite3_value_text(pVal);
195306 int nVal = sqlite3_value_bytes(pVal);
205510 /* Parse out a number. Write the value into *pVal if pVal!=0.
205513 static int geopolyParseNumber(GeoParse *p, GeoCoord *pVal){
205548 if( pVal ){
205554 *pVal = r;
205556 *pVal = (GeoCoord)atof((const char*)p->z);
205650 sqlite3_value *pVal, /* The value to decode */
205656 if( sqlite3_value_type(pVal)==SQLITE_BLOB
205657 && (nByte = sqlite3_value_bytes(pVal))>=(4+6*sizeof(GeoCoord))
205659 const unsigned char *a = sqlite3_value_blob(pVal);
205689 }else if( sqlite3_value_type(pVal)==SQLITE_TEXT ){
205690 const unsigned char *zJson = sqlite3_value_text(pVal);
212151 sqlite3_value *pVal;
212192 pVal = sqlite3_column_value(pIter->pSelect, i);
212193 p->rc = sqlite3_bind_value(pWriter, i+1, pVal);
212211 pVal = sqlite3_column_value(pIter->pSelect, pIter->nCol+1);
212212 p->rc = sqlite3_bind_value(pWriter, pIter->nCol+1, pVal);
212258 sqlite3_value *pVal;
212267 pVal = sqlite3_column_value(pIter->pSelect, i);
212269 p->rc = sqlite3_bind_value(pUpdate, i+1, pVal);
212277 pVal = sqlite3_column_value(pIter->pSelect, pIter->nCol+1);
212278 p->rc = sqlite3_bind_value(pUpdate, pIter->nCol+1, pVal);
216046 sqlite3_value *pVal;
216049 rc = pSession->hook.xNew(pSession->hook.pCtx, i, &pVal);
216051 rc = pSession->hook.xOld(pSession->hook.pCtx, i, &pVal);
216055 eType = sqlite3_value_type(pVal);
216060 iVal = sqlite3_value_int64(pVal);
216062 double rVal = sqlite3_value_double(pVal);
216071 z = (const u8 *)sqlite3_value_text(pVal);
216073 z = (const u8 *)sqlite3_value_blob(pVal);
216075 n = sqlite3_value_bytes(pVal);
216376 sqlite3_value *pVal; /* Value returned by preupdate_new/old */
216387 rc = pSession->hook.xNew(pSession->hook.pCtx, iCol, &pVal);
216390 rc = pSession->hook.xOld(pSession->hook.pCtx, iCol, &pVal);
216393 if( sqlite3_value_type(pVal)!=eType ) return 0;
216404 if( sqlite3_value_int64(pVal)!=iVal ) return 0;
216409 if( sqlite3_value_double(pVal)!=rVal ) return 0;
216415 if( sqlite3_value_bytes(pVal)!=n ) return 0;
216417 z = sqlite3_value_text(pVal);
216419 z = sqlite3_value_blob(pVal);
216682 sqlite3_value *pVal = 0;
216683 int rc = p->hook.xOld(p->hook.pCtx, iCol, &pVal);
216684 if( rc==SQLITE_OK && iCol==1 && sqlite3_value_type(pVal)==SQLITE_NULL ){
216685 pVal = p->pSession->pZeroBlob;
216687 *ppVal = pVal;
216692 sqlite3_value *pVal = 0;
216693 int rc = p->hook.xNew(p->hook.pCtx, iCol, &pVal);
216694 if( rc==SQLITE_OK && iCol==1 && sqlite3_value_type(pVal)==SQLITE_NULL ){
216695 pVal = p->pSession->pZeroBlob;
216697 *ppVal = pVal;
217555 static void sessionAppendValue(SessionBuffer *p, sqlite3_value *pVal, int *pRc){
217559 rc = sessionSerializeValue(0, pVal, &nByte);
217562 rc = sessionSerializeValue(&p->aBuf[p->nBuf], pVal, 0);
218481 sqlite3_value *pVal, /* Set the value of this object */
218493 sqlite3ValueSetStr(pVal, nData, (char*)aCopy, enc, sqlite3_free);
219182 sqlite3_value *pVal = apVal[iCol + (abPK[iCol] ? 0 : nCol)];
219183 sessionAppendValue(&sOut, pVal, &rc);
219190 sqlite3_value *pVal = (abPK[iCol] ? 0 : apVal[iCol]);
219191 sessionAppendValue(&sOut, pVal, &rc);
219631 sqlite3_value *pVal /* Value to bind */
219633 int eType = sqlite3_value_type(pVal);
219634 /* COVERAGE: The (pVal->z==0) branch is never true using current versions
219636 ** the (pVal->z) variable remains as it was or the type of the value is
219638 if( (eType==SQLITE_TEXT || eType==SQLITE_BLOB) && pVal->z==0 ){
219641 ** a conflict-handler) has zeroed the pVal->z pointer. Return NOMEM. */
219644 return sqlite3_bind_value(pStmt, i, pVal);
219679 sqlite3_value *pVal = 0;
219680 (void)xValue(pIter, i, &pVal);
219681 if( pVal==0 ){
219686 rc = sessionBindValue(pStmt, i+1, pVal);
219772 sqlite3_value *pVal = 0;
219774 sqlite3changeset_old(pIter, i, &pVal);
219776 sqlite3changeset_new(pIter, i, &pVal);
219778 sessionAppendValue(&p->rebase, pVal, &rc);
224645 ** Return the value in pVal interpreted as utf-8 text. Except, if pVal
224649 static const char *fts5ValueToText(sqlite3_value *pVal){
224650 const char *zRet = (const char*)sqlite3_value_text(pVal);
226230 sqlite3_value *pVal,
226237 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
226238 pgsz = sqlite3_value_int(pVal);
226249 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
226250 nHashSize = sqlite3_value_int(pVal);
226261 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
226262 nAutomerge = sqlite3_value_int(pVal);
226274 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
226275 nUsermerge = sqlite3_value_int(pVal);
226286 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
226287 nCrisisMerge = sqlite3_value_int(pVal);
226299 const char *zIn = (const char*)sqlite3_value_text(pVal);
226345 sqlite3_value *pVal = sqlite3_column_value(p, 1);
226347 iVersion = sqlite3_value_int(pVal);
226350 sqlite3Fts5ConfigSetValue(pConfig, zK, pVal, &bDummy);
238012 static i64 fts5GetRowidLimit(sqlite3_value *pVal, i64 iDefault){
238013 if( pVal ){
238014 int eType = sqlite3_value_numeric_type(pVal);
238016 return sqlite3_value_int64(pVal);
238335 ** INSERT INTO fts(fts, rank) VALUES($pCmd, $pVal)
238337 ** Argument pVal is the value assigned to column "fts" by the INSERT
238348 sqlite3_value *pVal /* Value inserted into rank column */
238376 int nMerge = sqlite3_value_int(pVal);
238379 int iArg = sqlite3_value_int(pVal);
238383 pConfig->bPrefixIndex = sqlite3_value_int(pVal);
238388 rc = sqlite3Fts5ConfigSetValue(pTab->p.pConfig, zCmd, pVal, &bError);
238394 rc = sqlite3Fts5StorageConfigValue(pTab->pStorage, zCmd, pVal, 0);
240899 sqlite3_value *pVal,
240906 if( pVal ){
240907 sqlite3_bind_value(pReplace, 2, pVal);
240915 if( rc==SQLITE_OK && pVal ){