Lines Matching refs:pVal

72251 static SQLITE_NOINLINE const void *valueToText(sqlite3_value* pVal, u8 enc){
72252 assert( pVal!=0 );
72253 assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) );
72255 assert( (pVal->flags & MEM_RowSet)==0 );
72256 assert( (pVal->flags & (MEM_Null))==0 );
72257 if( pVal->flags & (MEM_Blob|MEM_Str) ){
72258 if( ExpandBlob(pVal) ) return 0;
72259 pVal->flags |= MEM_Str;
72260 if( pVal->enc != (enc & ~SQLITE_UTF16_ALIGNED) ){
72261 sqlite3VdbeChangeEncoding(pVal, enc & ~SQLITE_UTF16_ALIGNED);
72263 if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&SQLITE_PTR_TO_INT(pVal->z)) ){
72264 assert( (pVal->flags & (MEM_Ephem|MEM_Static))!=0 );
72265 if( sqlite3VdbeMemMakeWriteable(pVal)!=SQLITE_OK ){
72269 sqlite3VdbeMemNulTerminate(pVal); /* IMP: R-31275-44060 */
72271 sqlite3VdbeMemStringify(pVal, enc, 0);
72272 assert( 0==(1&SQLITE_PTR_TO_INT(pVal->z)) );
72274 assert(pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || pVal->db==0
72275 || pVal->db->mallocFailed );
72276 if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){
72277 return pVal->z;
72293 SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
72294 if( !pVal ) return 0;
72295 assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) );
72297 assert( (pVal->flags & MEM_RowSet)==0 );
72298 if( (pVal->flags&(MEM_Str|MEM_Term))==(MEM_Str|MEM_Term) && pVal->enc==enc ){
72299 return pVal->z;
72301 if( pVal->flags&MEM_Null ){
72304 return valueToText(pVal, enc);
72415 sqlite3_value *pVal = 0; /* New value */
72444 pVal = valueNew(db, pCtx);
72445 if( pVal==0 ){
72452 ctx.pOut = pVal;
72457 sqlite3ErrorMsg(pCtx->pParse, "%s", sqlite3_value_text(pVal));
72459 sqlite3ValueApplyAffinity(pVal, aff, SQLITE_UTF8);
72461 rc = sqlite3VdbeChangeEncoding(pVal, enc);
72462 if( rc==SQLITE_OK && sqlite3VdbeMemTooBig(pVal) ){
72471 pVal = 0;
72480 *ppVal = pVal;
72507 sqlite3_value *pVal = 0;
72549 pVal = valueNew(db, pCtx);
72550 if( pVal==0 ) goto no_mem;
72552 sqlite3VdbeMemSetInt64(pVal, (i64)pExpr->u.iValue*negInt);
72556 sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, SQLITE_DYNAMIC);
72559 sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, SQLITE_UTF8);
72561 sqlite3ValueApplyAffinity(pVal, affinity, SQLITE_UTF8);
72563 if( pVal->flags & (MEM_Int|MEM_Real) ) pVal->flags &= ~MEM_Str;
72565 rc = sqlite3VdbeChangeEncoding(pVal, enc);
72569 if( SQLITE_OK==valueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal,pCtx)
72570 && pVal!=0
72572 sqlite3VdbeMemNumerify(pVal);
72573 if( pVal->flags & MEM_Real ){
72574 pVal->u.r = -pVal->u.r;
72575 }else if( pVal->u.i==SMALLEST_INT64 ){
72576 pVal->u.r = -(double)SMALLEST_INT64;
72577 MemSetTypeFlag(pVal, MEM_Real);
72579 pVal->u.i = -pVal->u.i;
72581 sqlite3ValueApplyAffinity(pVal, affinity, enc);
72584 pVal = valueNew(db, pCtx);
72585 if( pVal==0 ) goto no_mem;
72586 sqlite3VdbeMemNumerify(pVal);
72593 pVal = valueNew(db, pCtx);
72594 if( !pVal ) goto no_mem;
72598 sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(db, zVal, nVal), nVal/2,
72605 rc = valueFromFunction(db, pExpr, enc, affinity, &pVal, pCtx);
72609 *ppVal = pVal;
72620 if( pCtx==0 ) sqlite3ValueFree(pVal);
72622 assert( pCtx==0 ); sqlite3ValueFree(pVal);
72723 sqlite3_value *pVal = 0;
72731 pVal = valueNew(db, pAlloc);
72732 if( pVal ){
72733 sqlite3VdbeMemSetNull((Mem*)pVal);
72740 pVal = valueNew(db, pAlloc);
72741 if( pVal ){
72742 rc = sqlite3VdbeMemCopy((Mem*)pVal, &v->aVar[iBindVar-1]);
72743 sqlite3ValueApplyAffinity(pVal, affinity, ENC(db));
72744 pVal->db = pParse->db;
72748 rc = valueFromExpr(db, pExpr, ENC(db), affinity, &pVal, pAlloc);
72751 assert( pVal==0 || pVal->db==db );
72752 *ppVal = pVal;
72811 sqlite3_value *pVal = 0;
72815 rc = stat4ValueFromExpr(pParse, pElem, aff, &alloc, &pVal);
72816 if( !pVal ) break;
72939 static SQLITE_NOINLINE int valueBytes(sqlite3_value *pVal, u8 enc){
72940 return valueToText(pVal, enc)!=0 ? pVal->n : 0;
72942 SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){
72943 Mem *p = (Mem*)pVal;
72945 if( (p->flags & MEM_Str)!=0 && pVal->enc==enc ){
72956 return valueBytes(pVal, enc);
77875 SQLITE_API const void *sqlite3_value_blob(sqlite3_value *pVal){
77876 Mem *p = (Mem*)pVal;
77885 return sqlite3_value_text(pVal);
77888 SQLITE_API int sqlite3_value_bytes(sqlite3_value *pVal){
77889 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
77891 SQLITE_API int sqlite3_value_bytes16(sqlite3_value *pVal){
77892 return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE);
77894 SQLITE_API double sqlite3_value_double(sqlite3_value *pVal){
77895 return sqlite3VdbeRealValue((Mem*)pVal);
77897 SQLITE_API int sqlite3_value_int(sqlite3_value *pVal){
77898 return (int)sqlite3VdbeIntValue((Mem*)pVal);
77900 SQLITE_API sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
77901 return sqlite3VdbeIntValue((Mem*)pVal);
77903 SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
77904 Mem *pMem = (Mem*)pVal;
77907 SQLITE_API void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
77908 Mem *p = (Mem*)pVal;
77920 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
77921 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
77924 SQLITE_API const void *sqlite3_value_text16(sqlite3_value* pVal){
77925 return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE);
77927 SQLITE_API const void *sqlite3_value_text16be(sqlite3_value *pVal){
77928 return sqlite3ValueText(pVal, SQLITE_UTF16BE);
77930 SQLITE_API const void *sqlite3_value_text16le(sqlite3_value *pVal){
77931 return sqlite3ValueText(pVal, SQLITE_UTF16LE);
77938 SQLITE_API int sqlite3_value_type(sqlite3_value* pVal){
77973 return aType[pVal->flags&MEM_AffMask];
77977 SQLITE_API int sqlite3_value_nochange(sqlite3_value *pVal){
77978 return (pVal->flags&(MEM_Null|MEM_Zero))==(MEM_Null|MEM_Zero);
80214 SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){
80215 int eType = sqlite3_value_type(pVal);
80217 Mem *pMem = (Mem*)pVal;
80219 eType = sqlite3_value_type(pVal);
80229 sqlite3_value *pVal,
80233 applyAffinity((Mem *)pVal, affinity, enc);
89564 Mem *pVal /* Memory cell containing record */
89576 getVarint32((const u8*)&pVal->z[1], t);
89603 nReq = pVal->n + sizeof(SorterRecord);
89604 nPMA = pVal->n + sqlite3VarintLen(pVal->n);
89658 memcpy(SRVAL(pNew), pVal->z, pVal->n);
89659 pNew->nVal = pVal->n;
90519 Mem *pVal, /* Value to compare to current sorter key */
90549 *pRes = sqlite3VdbeRecordCompare(pVal->n, pVal->z, r2);
98683 sqlite3_value *pVal = 0;
98685 rc = sqlite3ValueFromExpr(db, pDflt, SQLITE_UTF8, SQLITE_AFF_BLOB, &pVal);
98691 if( !pVal ){
98695 sqlite3ValueFree(pVal);
131580 sqlite3_value *pVal = 0;
131598 pVal = sqlite3VdbeGetBoundValue(pReprepare, iCol, SQLITE_AFF_BLOB);
131599 if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
131600 z = sqlite3_value_text(pVal);
131621 sqlite3ValueFree(pVal);
131683 sqlite3ValueFree(pVal);
134238 sqlite3_value *pVal = 0; /* Value extracted from record */
134254 rc = sqlite3Stat4Column(db, p->aSample[i].p, p->aSample[i].n, nEq, &pVal);
134256 int res = sqlite3MemCompare(p1, pVal, pColl);
134260 int res = sqlite3MemCompare(p2, pVal, pColl);
134286 sqlite3ValueFree(pVal);
143247 sqlite3_value *pVal;
143255 pVal = sqlite3ValueNew(0);
143256 sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);
143257 zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8);
143263 sqlite3ValueFree(pVal);
146545 sqlite3_value *pVal;
146557 pVal = sqlite3ValueNew(0);
146558 sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC);
146559 zFilename8 = sqlite3ValueText(pVal, SQLITE_UTF8);
146570 sqlite3ValueFree(pVal);
149250 static void fts3GetDeltaVarint(char **pp, sqlite3_int64 *pVal){
149253 *pVal += iVal;
149268 sqlite3_int64 *pVal
149281 *pVal = iVal;
151210 sqlite3_int64 *pVal /* IN/OUT: Integer value */
151218 *pVal -= iVal;
151220 *pVal += iVal;
151967 static sqlite3_int64 fts3DocidRange(sqlite3_value *pVal, i64 iDefault){
151968 if( pVal ){
151969 int eType = sqlite3_value_numeric_type(pVal);
151971 return sqlite3_value_int64(pVal);
152368 sqlite3_value *pVal, /* argv[0] passed to function */
152372 *ppCsr = (Fts3Cursor*)sqlite3_value_pointer(pVal, "fts3cursor");
164185 static int fts3SpecialInsert(Fts3Table *p, sqlite3_value *pVal){
164187 const char *zVal = (const char *)sqlite3_value_text(pVal);
164188 int nVal = sqlite3_value_bytes(pVal);
175642 sqlite3_value *pVal;
175683 pVal = sqlite3_column_value(pIter->pSelect, i);
175684 p->rc = sqlite3_bind_value(pWriter, i+1, pVal);
175702 pVal = sqlite3_column_value(pIter->pSelect, pIter->nCol+1);
175703 p->rc = sqlite3_bind_value(pWriter, pIter->nCol+1, pVal);
175749 sqlite3_value *pVal;
175758 pVal = sqlite3_column_value(pIter->pSelect, i);
175760 p->rc = sqlite3_bind_value(pUpdate, i+1, pVal);
175768 pVal = sqlite3_column_value(pIter->pSelect, pIter->nCol+1);
175769 p->rc = sqlite3_bind_value(pUpdate, pIter->nCol+1, pVal);
179234 sqlite3_value *pVal;
179237 rc = pSession->hook.xNew(pSession->hook.pCtx, i, &pVal);
179239 rc = pSession->hook.xOld(pSession->hook.pCtx, i, &pVal);
179243 eType = sqlite3_value_type(pVal);
179248 iVal = sqlite3_value_int64(pVal);
179250 double rVal = sqlite3_value_double(pVal);
179259 z = (const u8 *)sqlite3_value_text(pVal);
179261 z = (const u8 *)sqlite3_value_blob(pVal);
179263 n = sqlite3_value_bytes(pVal);
179564 sqlite3_value *pVal; /* Value returned by preupdate_new/old */
179575 rc = pSession->hook.xNew(pSession->hook.pCtx, iCol, &pVal);
179578 rc = pSession->hook.xOld(pSession->hook.pCtx, iCol, &pVal);
179581 if( sqlite3_value_type(pVal)!=eType ) return 0;
179592 if( sqlite3_value_int64(pVal)!=iVal ) return 0;
179597 if( sqlite3_value_double(pVal)!=rVal ) return 0;
179603 if( sqlite3_value_bytes(pVal)!=n ) return 0;
179605 z = sqlite3_value_text(pVal);
179607 z = sqlite3_value_blob(pVal);
179841 sqlite3_value *pVal = 0;
179842 int rc = p->hook.xOld(p->hook.pCtx, iCol, &pVal);
179843 if( rc==SQLITE_OK && iCol==1 && sqlite3_value_type(pVal)==SQLITE_NULL ){
179844 pVal = p->pSession->pZeroBlob;
179846 *ppVal = pVal;
179851 sqlite3_value *pVal = 0;
179852 int rc = p->hook.xNew(p->hook.pCtx, iCol, &pVal);
179853 if( rc==SQLITE_OK && iCol==1 && sqlite3_value_type(pVal)==SQLITE_NULL ){
179854 pVal = p->pSession->pZeroBlob;
179856 *ppVal = pVal;
180587 static void sessionAppendValue(SessionBuffer *p, sqlite3_value *pVal, int *pRc){
180591 rc = sessionSerializeValue(0, pVal, &nByte);
180594 rc = sessionSerializeValue(&p->aBuf[p->nBuf], pVal, 0);
181436 sqlite3_value *pVal, /* Set the value of this object */
181448 sqlite3ValueSetStr(pVal, nData, (char*)aCopy, enc, sqlite3_free);
182044 sqlite3_value *pVal = apVal[iCol + (abPK[iCol] ? 0 : nCol)];
182045 sessionAppendValue(&sOut, pVal, &rc);
182052 sqlite3_value *pVal = (abPK[iCol] ? 0 : apVal[iCol]);
182053 sessionAppendValue(&sOut, pVal, &rc);
182428 sqlite3_value *pVal /* Value to bind */
182430 int eType = sqlite3_value_type(pVal);
182435 if( (eType==SQLITE_TEXT || eType==SQLITE_BLOB) && pVal->z==0 ){
182441 return sqlite3_bind_value(pStmt, i, pVal);
182476 sqlite3_value *pVal;
182477 (void)xValue(pIter, i, &pVal);
182478 rc = sessionBindValue(pStmt, i+1, pVal);
189172 static const char *fts5ValueToText(sqlite3_value *pVal){
189173 const char *zRet = (const char*)sqlite3_value_text(pVal);
190737 sqlite3_value *pVal,
190744 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
190745 pgsz = sqlite3_value_int(pVal);
190756 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
190757 nHashSize = sqlite3_value_int(pVal);
190768 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
190769 nAutomerge = sqlite3_value_int(pVal);
190781 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
190782 nUsermerge = sqlite3_value_int(pVal);
190793 if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
190794 nCrisisMerge = sqlite3_value_int(pVal);
190805 const char *zIn = (const char*)sqlite3_value_text(pVal);
190851 sqlite3_value *pVal = sqlite3_column_value(p, 1);
190853 iVersion = sqlite3_value_int(pVal);
190856 sqlite3Fts5ConfigSetValue(pConfig, zK, pVal, &bDummy);
201860 static i64 fts5GetRowidLimit(sqlite3_value *pVal, i64 iDefault){
201861 if( pVal ){
201862 int eType = sqlite3_value_numeric_type(pVal);
201864 return sqlite3_value_int64(pVal);
202137 sqlite3_value *pVal /* Value inserted into rank column */
202165 int nMerge = sqlite3_value_int(pVal);
202171 pConfig->bPrefixIndex = sqlite3_value_int(pVal);
202176 rc = sqlite3Fts5ConfigSetValue(pTab->pConfig, zCmd, pVal, &bError);
202182 rc = sqlite3Fts5StorageConfigValue(pTab->pStorage, zCmd, pVal, 0);
204615 sqlite3_value *pVal,
204622 if( pVal ){
204623 sqlite3_bind_value(pReplace, 2, pVal);
204630 if( rc==SQLITE_OK && pVal ){