• Home
  • Raw
  • Download

Lines Matching refs:pVal

76886 static SQLITE_NOINLINE const void *valueToText(sqlite3_value* pVal, u8 enc){
76887 assert( pVal!=0 );
76888 assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) );
76890 assert( !sqlite3VdbeMemIsRowSet(pVal) );
76891 assert( (pVal->flags & (MEM_Null))==0 );
76892 if( pVal->flags & (MEM_Blob|MEM_Str) ){
76893 if( ExpandBlob(pVal) ) return 0;
76894 pVal->flags |= MEM_Str;
76895 if( pVal->enc != (enc & ~SQLITE_UTF16_ALIGNED) ){
76896 sqlite3VdbeChangeEncoding(pVal, enc & ~SQLITE_UTF16_ALIGNED);
76898 if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&SQLITE_PTR_TO_INT(pVal->z)) ){
76899 assert( (pVal->flags & (MEM_Ephem|MEM_Static))!=0 );
76900 if( sqlite3VdbeMemMakeWriteable(pVal)!=SQLITE_OK ){
76904 sqlite3VdbeMemNulTerminate(pVal); /* IMP: R-31275-44060 */
76906 sqlite3VdbeMemStringify(pVal, enc, 0);
76907 assert( 0==(1&SQLITE_PTR_TO_INT(pVal->z)) );
76909 assert(pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || pVal->db==0
76910 || pVal->db->mallocFailed );
76911 if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){
76912 assert( sqlite3VdbeMemValidStrRep(pVal) );
76913 return pVal->z;
76929 SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
76930 if( !pVal ) return 0;
76931 assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) );
76933 assert( !sqlite3VdbeMemIsRowSet(pVal) );
76934 if( (pVal->flags&(MEM_Str|MEM_Term))==(MEM_Str|MEM_Term) && pVal->enc==enc ){
76935 assert( sqlite3VdbeMemValidStrRep(pVal) );
76936 return pVal->z;
76938 if( pVal->flags&MEM_Null ){
76941 return valueToText(pVal, enc);
77052 sqlite3_value *pVal = 0; /* New value */
77081 pVal = valueNew(db, pCtx);
77082 if( pVal==0 ){
77089 ctx.pOut = pVal;
77094 sqlite3ErrorMsg(pCtx->pParse, "%s", sqlite3_value_text(pVal));
77096 sqlite3ValueApplyAffinity(pVal, aff, SQLITE_UTF8);
77098 rc = sqlite3VdbeChangeEncoding(pVal, enc);
77099 if( rc==SQLITE_OK && sqlite3VdbeMemTooBig(pVal) ){
77108 pVal = 0;
77117 *ppVal = pVal;
77144 sqlite3_value *pVal = 0;
77186 pVal = valueNew(db, pCtx);
77187 if( pVal==0 ) goto no_mem;
77189 sqlite3VdbeMemSetInt64(pVal, (i64)pExpr->u.iValue*negInt);
77193 sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, SQLITE_DYNAMIC);
77196 sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, SQLITE_UTF8);
77198 sqlite3ValueApplyAffinity(pVal, affinity, SQLITE_UTF8);
77200 assert( (pVal->flags & MEM_IntReal)==0 );
77201 if( pVal->flags & (MEM_Int|MEM_IntReal|MEM_Real) ){
77202 testcase( pVal->flags & MEM_Int );
77203 testcase( pVal->flags & MEM_Real );
77204 pVal->flags &= ~MEM_Str;
77207 rc = sqlite3VdbeChangeEncoding(pVal, enc);
77211 if( SQLITE_OK==valueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal,pCtx)
77212 && pVal!=0
77214 sqlite3VdbeMemNumerify(pVal);
77215 if( pVal->flags & MEM_Real ){
77216 pVal->u.r = -pVal->u.r;
77217 }else if( pVal->u.i==SMALLEST_INT64 ){
77219 pVal->u.r = -(double)SMALLEST_INT64;
77221 pVal->u.r = LARGEST_INT64;
77223 MemSetTypeFlag(pVal, MEM_Real);
77225 pVal->u.i = -pVal->u.i;
77227 sqlite3ValueApplyAffinity(pVal, affinity, enc);
77230 pVal = valueNew(db, pCtx);
77231 if( pVal==0 ) goto no_mem;
77232 sqlite3VdbeMemSetNull(pVal);
77239 pVal = valueNew(db, pCtx);
77240 if( !pVal ) goto no_mem;
77244 sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(db, zVal, nVal), nVal/2,
77250 rc = valueFromFunction(db, pExpr, enc, affinity, &pVal, pCtx);
77254 pVal = valueNew(db, pCtx);
77255 if( pVal ){
77256 pVal->flags = MEM_Int;
77257 pVal->u.i = pExpr->u.zToken[4]==0;
77261 *ppVal = pVal;
77272 if( pCtx==0 ) sqlite3ValueFree(pVal);
77274 assert( pCtx==0 ); sqlite3ValueFree(pVal);
77326 sqlite3_value *pVal = 0;
77334 pVal = valueNew(db, pAlloc);
77335 if( pVal ){
77336 sqlite3VdbeMemSetNull((Mem*)pVal);
77343 pVal = valueNew(db, pAlloc);
77344 if( pVal ){
77345 rc = sqlite3VdbeMemCopy((Mem*)pVal, &v->aVar[iBindVar-1]);
77346 sqlite3ValueApplyAffinity(pVal, affinity, ENC(db));
77347 pVal->db = pParse->db;
77351 rc = valueFromExpr(db, pExpr, ENC(db), affinity, &pVal, pAlloc);
77354 assert( pVal==0 || pVal->db==db );
77355 *ppVal = pVal;
77414 sqlite3_value *pVal = 0;
77418 rc = stat4ValueFromExpr(pParse, pElem, aff, &alloc, &pVal);
77419 if( !pVal ) break;
77542 static SQLITE_NOINLINE int valueBytes(sqlite3_value *pVal, u8 enc){
77543 return valueToText(pVal, enc)!=0 ? pVal->n : 0;
77545 SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){
77546 Mem *p = (Mem*)pVal;
77548 if( (p->flags & MEM_Str)!=0 && pVal->enc==enc ){
77559 return valueBytes(pVal, enc);
82977 SQLITE_API const void *sqlite3_value_blob(sqlite3_value *pVal){
82978 Mem *p = (Mem*)pVal;
82987 return sqlite3_value_text(pVal);
82990 SQLITE_API int sqlite3_value_bytes(sqlite3_value *pVal){
82991 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
82993 SQLITE_API int sqlite3_value_bytes16(sqlite3_value *pVal){
82994 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
82996 SQLITE_API double sqlite3_value_double(sqlite3_value *pVal){
82997 return sqlite3VdbeRealValue((Mem*)pVal);
82999 SQLITE_API int sqlite3_value_int(sqlite3_value *pVal){
83000 return (int)sqlite3VdbeIntValue((Mem*)pVal);
83002 SQLITE_API sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
83003 return sqlite3VdbeIntValue((Mem*)pVal);
83005 SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
83006 Mem *pMem = (Mem*)pVal;
83009 SQLITE_API void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
83010 Mem *p = (Mem*)pVal;
83022 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
83023 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
83026 SQLITE_API const void *sqlite3_value_text16(sqlite3_value* pVal){
83027 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
83029 SQLITE_API const void *sqlite3_value_text16be(sqlite3_value *pVal){
83030 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
83032 SQLITE_API const void *sqlite3_value_text16le(sqlite3_value *pVal){
83033 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
83040 SQLITE_API int sqlite3_value_type(sqlite3_value* pVal){
83110 if( pVal->flags & MEM_Null ){
83112 }else if( pVal->flags & (MEM_Real|MEM_IntReal) ){
83114 }else if( pVal->flags & MEM_Int ){
83116 }else if( pVal->flags & MEM_Str ){
83119 assert( eType == aType[pVal->flags&MEM_AffMask] );
83122 return aType[pVal->flags&MEM_AffMask];
83126 SQLITE_API int sqlite3_value_nochange(sqlite3_value *pVal){
83127 return (pVal->flags&(MEM_Null|MEM_Zero))==(MEM_Null|MEM_Zero);
83131 SQLITE_API int sqlite3_value_frombind(sqlite3_value *pVal){
83132 return (pVal->flags&MEM_FromBind)!=0;
85465 SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){
85466 int eType = sqlite3_value_type(pVal);
85468 Mem *pMem = (Mem*)pVal;
85470 eType = sqlite3_value_type(pVal);
85480 sqlite3_value *pVal,
85484 applyAffinity((Mem *)pVal, affinity, enc);
95449 Mem *pVal /* Memory cell containing record */
95461 getVarint32NR((const u8*)&pVal->z[1], t);
95488 nReq = pVal->n + sizeof(SorterRecord);
95489 nPMA = pVal->n + sqlite3VarintLen(pVal->n);
95547 memcpy(SRVAL(pNew), pVal->z, pVal->n);
95548 pNew->nVal = pVal->n;
96413 Mem *pVal, /* Value to compare to current sorter key */
96443 *pRes = sqlite3VdbeRecordCompare(pVal->n, pVal->z, r2);
105934 sqlite3_value *pVal = 0;
105936 rc = sqlite3ValueFromExpr(db, pDflt, SQLITE_UTF8, SQLITE_AFF_BLOB, &pVal);
105942 if( !pVal ){
105946 sqlite3ValueFree(pVal);
143540 sqlite3_value *pVal = 0;
143558 pVal = sqlite3VdbeGetBoundValue(pReprepare, iCol, SQLITE_AFF_BLOB);
143559 if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
143560 z = sqlite3_value_text(pVal);
143634 sqlite3ValueFree(pVal);
143665 sqlite3ValueFree(pVal);
146333 sqlite3_value *pVal = 0; /* Value extracted from record */
146349 rc = sqlite3Stat4Column(db, p->aSample[i].p, p->aSample[i].n, nEq, &pVal);
146351 int res = sqlite3MemCompare(p1, pVal, pColl);
146355 int res = sqlite3MemCompare(p2, pVal, pColl);
146381 sqlite3ValueFree(pVal);
150988 sqlite3_value *pVal;
151004 sqlite3_value_free(p->pVal);
151005 p->pVal = sqlite3_value_dup(apArg[0]);
151006 if( p->pVal==0 ){
151025 sqlite3_value_free(p->pVal);
151026 p->pVal = 0;
151033 if( p && p->pVal ){
151034 sqlite3_result_value(pCtx, p->pVal);
151040 if( p && p->pVal ){
151041 sqlite3_result_value(pCtx, p->pVal);
151042 sqlite3_value_free(p->pVal);
151043 p->pVal = 0;
152875 sqlite3_value *pVal = 0;
152876 sqlite3ValueFromExpr(db, pExpr, db->enc, SQLITE_AFF_NUMERIC, &pVal);
152877 if( pVal && sqlite3_value_int(pVal)>0 ){
152880 sqlite3ValueFree(pVal);
160195 sqlite3_value *pVal;
160203 pVal = sqlite3ValueNew(0);
160204 sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);
160205 zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8);
160211 sqlite3ValueFree(pVal);
163725 sqlite3_value *pVal;
163737 pVal = sqlite3ValueNew(0);
163738 sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC);
163739 zFilename8 = sqlite3ValueText(pVal, SQLITE_UTF8);
163750 sqlite3ValueFree(pVal);
166674 static void fts3GetDeltaVarint(char **pp, sqlite3_int64 *pVal){
166677 *pVal += iVal;
166692 sqlite3_int64 *pVal
166705 *pVal = iVal;
168688 sqlite3_int64 *pVal /* IN/OUT: Integer value */
168696 *pVal = (i64)((u64)*pVal - iVal);
168698 *pVal = (i64)((u64)*pVal + iVal);
169450 static sqlite3_int64 fts3DocidRange(sqlite3_value *pVal, i64 iDefault){
169451 if( pVal ){
169452 int eType = sqlite3_value_numeric_type(pVal);
169454 return sqlite3_value_int64(pVal);
169859 sqlite3_value *pVal, /* argv[0] passed to function */
169863 *ppCsr = (Fts3Cursor*)sqlite3_value_pointer(pVal, "fts3cursor");
181780 static int fts3SpecialInsert(Fts3Table *p, sqlite3_value *pVal){
181782 const char *zVal = (const char *)sqlite3_value_text(pVal);
181783 int nVal = sqlite3_value_bytes(pVal);
191864 static int geopolyParseNumber(GeoParse *p, GeoCoord *pVal){
191899 if( pVal ){
191905 *pVal = r;
191907 *pVal = (GeoCoord)atof((const char*)p->z);
192001 sqlite3_value *pVal, /* The value to decode */
192006 if( sqlite3_value_type(pVal)==SQLITE_BLOB
192007 && (nByte = sqlite3_value_bytes(pVal))>=(4+6*sizeof(GeoCoord))
192009 const unsigned char *a = sqlite3_value_blob(pVal);
192035 }else if( sqlite3_value_type(pVal)==SQLITE_TEXT ){
192036 const unsigned char *zJson = sqlite3_value_text(pVal);
198437 sqlite3_value *pVal;
198478 pVal = sqlite3_column_value(pIter->pSelect, i);
198479 p->rc = sqlite3_bind_value(pWriter, i+1, pVal);
198497 pVal = sqlite3_column_value(pIter->pSelect, pIter->nCol+1);
198498 p->rc = sqlite3_bind_value(pWriter, pIter->nCol+1, pVal);
198544 sqlite3_value *pVal;
198553 pVal = sqlite3_column_value(pIter->pSelect, i);
198555 p->rc = sqlite3_bind_value(pUpdate, i+1, pVal);
198563 pVal = sqlite3_column_value(pIter->pSelect, pIter->nCol+1);
198564 p->rc = sqlite3_bind_value(pUpdate, pIter->nCol+1, pVal);
202207 sqlite3_value *pVal;
202210 rc = pSession->hook.xNew(pSession->hook.pCtx, i, &pVal);
202212 rc = pSession->hook.xOld(pSession->hook.pCtx, i, &pVal);
202216 eType = sqlite3_value_type(pVal);
202221 iVal = sqlite3_value_int64(pVal);
202223 double rVal = sqlite3_value_double(pVal);
202232 z = (const u8 *)sqlite3_value_text(pVal);
202234 z = (const u8 *)sqlite3_value_blob(pVal);
202236 n = sqlite3_value_bytes(pVal);
202537 sqlite3_value *pVal; /* Value returned by preupdate_new/old */
202548 rc = pSession->hook.xNew(pSession->hook.pCtx, iCol, &pVal);
202551 rc = pSession->hook.xOld(pSession->hook.pCtx, iCol, &pVal);
202554 if( sqlite3_value_type(pVal)!=eType ) return 0;
202565 if( sqlite3_value_int64(pVal)!=iVal ) return 0;
202570 if( sqlite3_value_double(pVal)!=rVal ) return 0;
202576 if( sqlite3_value_bytes(pVal)!=n ) return 0;
202578 z = sqlite3_value_text(pVal);
202580 z = sqlite3_value_blob(pVal);
202814 sqlite3_value *pVal = 0;
202815 int rc = p->hook.xOld(p->hook.pCtx, iCol, &pVal);
202816 if( rc==SQLITE_OK && iCol==1 && sqlite3_value_type(pVal)==SQLITE_NULL ){
202817 pVal = p->pSession->pZeroBlob;
202819 *ppVal = pVal;
202824 sqlite3_value *pVal = 0;
202825 int rc = p->hook.xNew(p->hook.pCtx, iCol, &pVal);
202826 if( rc==SQLITE_OK && iCol==1 && sqlite3_value_type(pVal)==SQLITE_NULL ){
202827 pVal = p->pSession->pZeroBlob;
202829 *ppVal = pVal;
203562 static void sessionAppendValue(SessionBuffer *p, sqlite3_value *pVal, int *pRc){
203566 rc = sessionSerializeValue(0, pVal, &nByte);
203569 rc = sessionSerializeValue(&p->aBuf[p->nBuf], pVal, 0);
204432 sqlite3_value *pVal, /* Set the value of this object */
204444 sqlite3ValueSetStr(pVal, nData, (char*)aCopy, enc, sqlite3_free);
205077 sqlite3_value *pVal = apVal[iCol + (abPK[iCol] ? 0 : nCol)];
205078 sessionAppendValue(&sOut, pVal, &rc);
205085 sqlite3_value *pVal = (abPK[iCol] ? 0 : apVal[iCol]);
205086 sessionAppendValue(&sOut, pVal, &rc);
205463 sqlite3_value *pVal /* Value to bind */
205465 int eType = sqlite3_value_type(pVal);
205470 if( (eType==SQLITE_TEXT || eType==SQLITE_BLOB) && pVal->z==0 ){
205476 return sqlite3_bind_value(pStmt, i, pVal);
205511 sqlite3_value *pVal;
205512 (void)xValue(pIter, i, &pVal);
205513 if( pVal==0 ){
205518 rc = sessionBindValue(pStmt, i+1, pVal);
205604 sqlite3_value *pVal = 0;
205606 sqlite3changeset_old(pIter, i, &pVal);
205608 sqlite3changeset_new(pIter, i, &pVal);
205610 sessionAppendValue(&p->rebase, pVal, &rc);
210441 static const char *fts5ValueToText(sqlite3_value *pVal){
210442 const char *zRet = (const char*)sqlite3_value_text(pVal);
212016 sqlite3_value *pVal,
212023 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
212024 pgsz = sqlite3_value_int(pVal);
212035 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
212036 nHashSize = sqlite3_value_int(pVal);
212047 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
212048 nAutomerge = sqlite3_value_int(pVal);
212060 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
212061 nUsermerge = sqlite3_value_int(pVal);
212072 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
212073 nCrisisMerge = sqlite3_value_int(pVal);
212085 const char *zIn = (const char*)sqlite3_value_text(pVal);
212131 sqlite3_value *pVal = sqlite3_column_value(p, 1);
212133 iVersion = sqlite3_value_int(pVal);
212136 sqlite3Fts5ConfigSetValue(pConfig, zK, pVal, &bDummy);
223400 static i64 fts5GetRowidLimit(sqlite3_value *pVal, i64 iDefault){
223401 if( pVal ){
223402 int eType = sqlite3_value_numeric_type(pVal);
223404 return sqlite3_value_int64(pVal);
223721 sqlite3_value *pVal /* Value inserted into rank column */
223749 int nMerge = sqlite3_value_int(pVal);
223755 pConfig->bPrefixIndex = sqlite3_value_int(pVal);
223760 rc = sqlite3Fts5ConfigSetValue(pTab->p.pConfig, zCmd, pVal, &bError);
223766 rc = sqlite3Fts5StorageConfigValue(pTab->pStorage, zCmd, pVal, 0);
226241 sqlite3_value *pVal,
226248 if( pVal ){
226249 sqlite3_bind_value(pReplace, 2, pVal);
226257 if( rc==SQLITE_OK && pVal ){