Lines Matching defs:affinity

6032 ** numeric affinity to the value.  This means that an attempt is
16704 #define OP_Cast 88 /* synopsis: affinity(r[P1]) */
16712 #define OP_Affinity 96 /* synopsis: affinity(r[P1@P2]) */
18216 char affinity; /* One of the SQLITE_AFF_... values */
18285 ** Column affinity types.
18292 ** when multiple affinity types are concatenated into a string and
18310 ** affinity value.
18315 ** Additional bit values that can be ORed with an affinity without
18316 ** changing the affinity.
18395 char *zColAff; /* String defining the affinity of each column */
18738 char *zColAff; /* String defining the affinity of each column */
18972 char affExpr; /* affinity, or RAISE type */
19052 #define EP_Skip 0x002000 /* Operator does not contribute to affinity */
19594 ** Apply the affinity pDest->affSdst before storing
23061 ** sqlite3StdTypeAffinity[] The affinity associated with each entry
23409 #define MEM_AffMask 0x003f /* Mask of affinity bits */
37268 /* 88 */ "Cast" OpHelp("affinity(r[P1])"),
37276 /* 96 */ "Affinity" OpHelp("affinity(r[P1@P2])"),
83590 ** Cast the datatype of the value in pMem according to the affinity
83591 ** "aff". Casting is different from applying affinity in that a cast
83593 ** affinity even if that results in loss of data. This routine is
84381 u8 affinity, /* Affinity to use */
84417 sqlite3ValueApplyAffinity(*ppVal, affinity, enc);
84454 if( affinity==SQLITE_AFF_BLOB ){
84466 sqlite3ValueApplyAffinity(pVal, affinity, SQLITE_UTF8);
84479 if( SQLITE_OK==valueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal,pCtx)
84495 sqlite3ValueApplyAffinity(pVal, affinity, enc);
84519 rc = valueFromFunction(db, pExpr, enc, affinity, &pVal, pCtx);
84528 sqlite3ValueApplyAffinity(pVal, affinity, enc);
84564 u8 affinity, /* Affinity to use */
84567 return pExpr ? valueFromExpr(db, pExpr, enc, affinity, ppVal, 0) : 0;
84592 u8 affinity, /* Affinity to use */
84617 sqlite3ValueApplyAffinity(pVal, affinity, ENC(db));
84622 rc = valueFromExpr(db, pExpr, ENC(db), affinity, &pVal, pAlloc);
84650 ** Before any value is appended to the record, the affinity of the
84712 u8 affinity, /* Affinity to use */
84715 return stat4ValueFromExpr(pParse, pExpr, affinity, 0, ppVal);
90167 ** 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_*
92585 }else if( p->pTab->aCol[iIdx].affinity==SQLITE_AFF_REAL ){
93480 ** Processing is determine by the affinity parameter:
93488 ** always preferred, even if the affinity is REAL, because
93503 Mem *pRec, /* The value to apply affinity to */
93504 char affinity, /* The affinity to be applied */
93507 if( affinity>=SQLITE_AFF_NUMERIC ){
93508 assert( affinity==SQLITE_AFF_INTEGER || affinity==SQLITE_AFF_REAL
93509 || affinity==SQLITE_AFF_NUMERIC || affinity==SQLITE_AFF_FLEXNUM );
93513 }else if( affinity<=SQLITE_AFF_REAL ){
93517 }else if( affinity==SQLITE_AFF_TEXT ){
93557 u8 affinity,
93560 applyAffinity((Mem *)pVal, affinity, enc);
95184 ** has REAL affinity. Such column values may still be stored as
95202 ** Synopsis: affinity(r[P1])
95241 ** The SQLITE_AFF_MASK portion of P5 must be an affinity character -
95243 ** to coerce both inputs according to this affinity before the
95245 ** affinity is used. Note that the affinity conversions are stored
95285 ** The SQLITE_AFF_MASK portion of P5 must be an affinity character -
95287 ** to coerce both inputs according to this affinity before the
95289 ** affinity is used. Note that the affinity conversions are stored
95334 char affinity; /* Affinity to use for comparison */
95402 affinity = pOp->p5 & SQLITE_AFF_MASK;
95403 if( affinity>=SQLITE_AFF_NUMERIC ){
95414 }else if( affinity==SQLITE_AFF_TEXT && ((flags1 | flags3) & MEM_Str)!=0 ){
96326 ** to implement "strict affinity".
96360 applyAffinity(pIn1, aCol[i].affinity, encoding);
96380 /* When applying REAL affinity, if the result is still an MEM_Int
96422 ** Synopsis: affinity(r[P1@P2])
96427 ** string indicates the column affinity that should be used for the N-th
96431 const char *zAffinity; /* The affinity to be applied */
96443 /* When applying REAL affinity, if the result is still an MEM_Int
96476 ** string indicates the column affinity that should be used for the N-th
96479 ** The mapping from character to affinity is given by the SQLITE_AFF_
96482 ** If P4 is NULL then all index fields have the affinity BLOB.
96506 char *zAffinity; /* The affinity string for the record */
96541 /* Apply the requested affinity to all inputs
97890 newType = pIn3->flags; /* Record the type after applying numeric affinity */
108067 /* FIX ME: Compute pExpr->affinity based on the expected return
109033 ** Return the affinity character for a single column of a table.
109037 return pTab->aCol[iCol].affinity;
109041 ** Return the 'affinity' of the expression pExpr if any.
109045 ** affinity of that column is returned. Otherwise, 0x00 is returned,
109046 ** indicating no affinity for the expression.
109049 ** have an affinity:
109344 ** type affinity of the other operand. This routine returns the
109345 ** type affinity that should be used for the comparison operator.
109351 ** affinity, use that. Otherwise use no affinity.
109359 /* One side is a column, the other is not. Use the columns affinity. */
109366 ** pExpr is a comparison operator. Return the type affinity that should
109388 ** idx_affinity is the affinity of an indexed column. Return true
109389 ** if the index with affinity idx_affinity may be used to implement
111883 ** unchanged by OP_Affinity with the affinity given in the second
112192 /* Check that the affinity that will be used to perform each
112193 ** comparison is the same as the affinity of each column in table
112208 ** other has no affinity and the other side is TEXT. Hence,
112210 ** and for the term on the LHS of the IN to have no affinity. */
112424 ** the SELECT statement returns a column value, then the affinity of that
112426 ** SELECT... statement are columns, then numeric affinity is used
112427 ** if either column has NUMERIC or INTEGER affinity. If neither
112428 ** 'x' nor the SELECT... statement are columns, then numeric affinity
112553 ** that columns affinity when building index keys. If <expr> is not
112554 ** a column, use numeric affinity.
112556 char affinity; /* Affinity of the LHS of the IN */
112561 affinity = sqlite3ExprAffinity(pLeft);
112562 if( affinity<=SQLITE_AFF_NONE ){
112563 affinity = SQLITE_AFF_BLOB;
112564 }else if( affinity==SQLITE_AFF_REAL ){
112565 affinity = SQLITE_AFF_NUMERIC;
112592 sqlite3VdbeAddOp4(v, OP_MakeRecord, r1, 1, r2, &affinity, 1);
113156 if( pCol->affinity>=SQLITE_AFF_TEXT ){
113157 sqlite3VdbeAddOp4(v, OP_Affinity, regOut, 1, 0, &pCol->affinity, 1);
113414 ** the type affinity of the argument. This is used for testing of
113596 if( pTab->aCol[pCol->iColumn].affinity==SQLITE_AFF_REAL ){
113672 if( pCol->affinity==SQLITE_AFF_REAL ){
114162 /* If the column has REAL affinity, it may currently be stored as an
114167 if( iCol>=0 && pTab->aCol[iCol].affinity==SQLITE_AFF_REAL ){
118407 char aff = pTab->aCol[i].affinity;
118409 pTab->aCol[i].affinity = SQLITE_AFF_NUMERIC;
118412 pTab->aCol[i].affinity = aff;
122869 char affinity = SQLITE_AFF_BLOB;
122906 affinity = sqlite3StdTypeAffinity[i];
122907 if( affinity<=SQLITE_AFF_TEXT ) szEst = 5;
122940 /* If there is no type specified, columns have the default affinity
122942 pCol->affinity = affinity;
122946 if( affinity==SQLITE_AFF_BLOB ){
122957 pCol->affinity = sqlite3AffinityType(zType, pCol);
122995 ** associated affinity type.
122999 ** found, the corresponding affinity is returned. If zType contains
123379 if( pExpr && pExpr->op!=TK_RAISE ) pExpr->affExpr = pCol->affinity;
123526 assert( pCol->affinity-SQLITE_AFF_BLOB >= 0 );
123527 assert( pCol->affinity-SQLITE_AFF_BLOB < ArraySize(azType) );
123528 testcase( pCol->affinity==SQLITE_AFF_BLOB );
123529 testcase( pCol->affinity==SQLITE_AFF_TEXT );
123530 testcase( pCol->affinity==SQLITE_AFF_NUMERIC );
123531 testcase( pCol->affinity==SQLITE_AFF_INTEGER );
123532 testcase( pCol->affinity==SQLITE_AFF_REAL );
123533 testcase( pCol->affinity==SQLITE_AFF_FLEXNUM );
123535 zType = azType[pCol->affinity - SQLITE_AFF_BLOB];
123537 assert( pCol->affinity==SQLITE_AFF_BLOB
123538 || pCol->affinity==SQLITE_AFF_FLEXNUM
123539 || pCol->affinity==sqlite3AffinityType(zType, 0) );
124058 pCol->affinity = SQLITE_AFF_BLOB;
128620 /* If the column affinity is REAL but the number is an integer, then it
131232 TEST_FUNC(affinity, 1, INLINEFUNC_affinity, 0),
131774 ** apply the affinity of the parent key). If this fails, then there
131777 ** will have INTEGER affinity applied to it, which may not be correct. */
131895 pExpr->affExpr = pCol->affinity;
131988 ** the parent key columns. The affinity of the parent key column should
132674 ** that the affinity and collation sequence associated with the
132949 ** Return a pointer to the column affinity string associated with index
132950 ** pIdx. A column affinity string has one character for each column in
132951 ** the table, according to the affinity of the column:
132953 ** Character Column affinity
132964 ** Memory for the buffer containing the column index affinity string
132969 /* The first time a column affinity string for a particular index is
132973 ** The column affinity string will eventually be deleted by
132988 aff = pTab->aCol[x].affinity;
133011 ** Compute an affinity string for a table. Space is obtained
133022 zColAff[j++] = pTab->aCol[i].affinity;
133033 ** Make changes to the evolving bytecode to do affinity transformations
133039 ** Compute the affinity string for table pTab, if it has not already been
133042 ** If the affinity string is empty (because it was all SQLITE_AFF_BLOB entries
133048 ** an OP_MakeRecord) to the affinity string.
133050 ** A column affinity string has one character per column:
133052 ** Character Column affinity
133191 ** that appropriate affinity has been applied to the regular columns
133198 ** columns. '@' is the no-op affinity and those columns have not
133500 ** only argument are both constant and have no affinity.
133560 ** has an affinity (i.e. is a CAST expression). This causes problems
133563 ** affinity of such a column for all rows require access to all values in
134716 ** record be generated during constraint checks to avoid affinity changes
136034 if( pDestCol->affinity!=pSrcCol->affinity ){
140633 doTypeCheck = pCol->affinity>SQLITE_AFF_BLOB;
140647 pCol->affinity, &pDfltValue);
140713 }else if( !bStrict && pCol->affinity==SQLITE_AFF_TEXT ){
140722 }else if( !bStrict && pCol->affinity>=SQLITE_AFF_NUMERIC ){
145201 ** * The affinity of the column
145207 char aff /* Default affinity. */
145234 pCol->affinity = sqlite3ExprAffinity(p);
145235 while( pCol->affinity<=SQLITE_AFF_NONE && pS2->pNext!=0 ){
145238 pCol->affinity = sqlite3ExprAffinity(pS2->pEList->a[i].pExpr);
145240 if( pCol->affinity<=SQLITE_AFF_NONE ){
145241 pCol->affinity = aff;
145243 if( pCol->affinity>=SQLITE_AFF_TEXT && (pS2->pNext || pS2!=pSelect) ){
145247 if( pCol->affinity==SQLITE_AFF_TEXT && (m&0x01)!=0 ){
145248 pCol->affinity = SQLITE_AFF_BLOB;
145250 if( pCol->affinity>=SQLITE_AFF_NUMERIC && (m&0x02)!=0 ){
145251 pCol->affinity = SQLITE_AFF_BLOB;
145253 if( pCol->affinity>=SQLITE_AFF_NUMERIC && p->op==TK_CAST ){
145254 pCol->affinity = SQLITE_AFF_FLEXNUM;
145258 if( zType==0 || pCol->affinity!=sqlite3AffinityType(zType, 0) ){
145259 if( pCol->affinity==SQLITE_AFF_NUMERIC
145260 || pCol->affinity==SQLITE_AFF_FLEXNUM
145266 if( sqlite3StdTypeAffinity[j]==pCol->affinity ){
147147 ** compound must have the same affinity.
147654 int bHasAffBlob; /* At least one column in apExpr[] as affinity BLOB */
147748 ** if argument bIgnoreAffBlob is non-zero and the affinity of pExpr
147793 ** + pExpr is a column with an affinity other than BLOB that matches
147797 ** uses an affinity other than TEXT and one of its immediate
147839 ** Implementation note: Constant propagation is tricky due to affinity
147848 ** is always true because the comparison uses numeric affinity, but b=123
147849 ** is false because it uses text affinity and '0123' is not the same as '123'.
147867 ** columns with BLOB affinity is only allowed if the constant is used with
149288 ** Column.affinity information to the Table structure that represents
149292 ** by selectExpander() but the type and collation and affinity information
153329 ** If column as REAL affinity and the table is an ordinary b-tree table
153347 pCol->affinity, &pValue);
153353 if( pCol->affinity==SQLITE_AFF_REAL && !IsVirtual(pTab) ){
154964 if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){
157114 char idxaff; /* Must match this affinity, if zCollName!=NULL */
157811 ** Code an OP_Affinity opcode to apply the column affinity string zAff
157830 ** entries at the beginning and end of the affinity string.
157851 ** Before the comparison operation, affinity zAff is to be applied
157853 ** affinity string to SQLITE_AFF_BLOB if either:
157855 ** * the comparison will be performed with no affinity, or
157856 ** * the affinity change in zAff is guaranteed not to change the value.
158173 ** compute the affinity string.
158189 ** copy of the column affinity string of the index allocated using
158191 ** with equality constraints that use BLOB or NONE affinity are set to
158197 ** In the example above, the index on t1(a) has TEXT affinity. But since
158198 ** the right hand side of the equality constraint (t2.b) has BLOB/NONE affinity,
158200 ** a key to search the index. Hence the first byte in the returned affinity
158208 char **pzAff /* OUT: Set to point to affinity string */
158281 /* No affinity ever needs to be (or should be) applied to a value
158284 ** affinity of the comparison has been applied to the value. */
160494 /* If the LHS is not an ordinary column with TEXT affinity, then the
162426 ** column with affinity idxaff (one of the SQLITE_AFF_XYZ values). If so,
162429 ** with affinity idxaff, NULL is returned.
162506 /* Verify the affinity and collating sequence match */
162621 pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity;
162985 aff = pSrc->pTab->aCol[pTerm->u.x.leftColumn].affinity;
163916 ** Return the affinity for a single column of an index.
165042 char aff; /* Comparison affinity */
165043 char idxaff = 0; /* Indexed columns affinity */
165771 ** (c) Column "a" has an affinity other than NONE or BLOB.
165809 aff = pIdx->pTable->aCol[pLeft->iColumn].affinity;