Lines Matching defs:affinity
4941 ** numeric affinity to the value. This means that an attempt is
12890 #define OP_Cast 94 /* synopsis: affinity(r[P1]) */
12896 #define OP_Affinity 100 /* synopsis: affinity(r[P1@P2]) */
14438 #define SQLITE_FUNC_AFFINITY 0x4000 /* Built-in affinity() function */
14543 char affinity; /* One of the SQLITE_AFF_... values */
14579 ** Column affinity types.
14586 ** when multiple affinity types are concatenated into a string and
14602 ** affinity value.
14607 ** Additional bit values that can be ORed with an affinity without
14608 ** changing the affinity.
14683 char *zColAff; /* String defining the affinity of each column */
14954 char *zColAff; /* String defining the affinity of each column */
15153 char affinity; /* The affinity of the column or 0 if not a column */
15209 #define EP_Generic 0x000200 /* Ignore COLLATE or affinity on this tree */
15611 ** Apply the affinity pDest->affSdst before storing
15670 char *zAffSdst; /* Affinity used when eDest==SRT_Set */
18231 #define MEM_AffMask 0x001f /* Mask of affinity bits */
26683 switch( pExpr->affinity ){
29667 /* 94 */ "Cast" OpHelp("affinity(r[P1])"),
29673 /* 100 */ "Affinity" OpHelp("affinity(r[P1@P2])"),
70462 ** Cast the datatype of the value in pMem according to the affinity
70463 ** "aff". Casting is different from applying affinity in that a cast
70465 ** affinity even if that results in loss of data. This routine is
71028 ** Affinity aff is applied to the result of the function before returning.
71041 u8 aff, /* Affinity to use */
71135 u8 affinity, /* Affinity to use */
71162 sqlite3ValueApplyAffinity(*ppVal, affinity, SQLITE_UTF8);
71188 if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_BLOB ){
71191 sqlite3ValueApplyAffinity(pVal, affinity, SQLITE_UTF8);
71199 if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal)
71211 sqlite3ValueApplyAffinity(pVal, affinity, enc);
71235 rc = valueFromFunction(db, pExpr, enc, affinity, &pVal, pCtx);
71268 u8 affinity, /* Affinity to use */
71271 return pExpr ? valueFromExpr(db, pExpr, enc, affinity, ppVal, 0) : 0;
71345 u8 affinity, /* Affinity to use */
71372 sqlite3ValueApplyAffinity(pVal, affinity, ENC(db));
71378 rc = valueFromExpr(db, pExpr, ENC(db), affinity, &pVal, pAlloc);
71406 ** Before any value is appended to the record, the affinity of the
71468 u8 affinity, /* Affinity to use */
71471 return stat4ValueFromExpr(pParse, pExpr, affinity, 0, ppVal);
76124 ** 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_*
77987 }else if( p->pTab->aCol[iIdx].affinity==SQLITE_AFF_REAL ){
78641 ** Processing is determine by the affinity parameter:
78649 ** always preferred, even if the affinity is REAL, because
78659 Mem *pRec, /* The value to apply affinity to */
78660 char affinity, /* The affinity to be applied */
78663 if( affinity>=SQLITE_AFF_NUMERIC ){
78664 assert( affinity==SQLITE_AFF_INTEGER || affinity==SQLITE_AFF_REAL
78665 || affinity==SQLITE_AFF_NUMERIC );
78673 }else if( affinity==SQLITE_AFF_TEXT ){
78710 u8 affinity,
78713 applyAffinity((Mem *)pVal, affinity, enc);
80291 ** has REAL affinity. Such column values may still be stored as
80306 ** Synopsis: affinity(r[P1])
80344 ** The SQLITE_AFF_MASK portion of P5 must be an affinity character -
80346 ** to coerce both inputs according to this affinity before the
80348 ** affinity is used. Note that the affinity conversions are stored
80394 ** The SQLITE_AFF_MASK portion of P5 must be an affinity character -
80396 ** to coerce both inputs according to this affinity before the
80398 ** affinity is used. Note that the affinity conversions are stored
80440 char affinity; /* Affinity to use for comparison */
80486 affinity = pOp->p5 & SQLITE_AFF_MASK;
80487 if( affinity>=SQLITE_AFF_NUMERIC ){
80506 }else if( affinity==SQLITE_AFF_TEXT ){
81182 /* Opcode: Affinity P1 P2 * P4 *
81183 ** Synopsis: affinity(r[P1@P2])
81188 ** string indicates the column affinity that should be used for the N-th
81192 const char *zAffinity; /* The affinity to be applied */
81216 ** string indicates the column affinity that should be used for the N-th
81219 ** The mapping from character to affinity is given by the SQLITE_AFF_
81222 ** If P4 is NULL then all index fields have the affinity BLOB.
81236 char *zAffinity; /* The affinity string for the record */
81273 /* Apply the requested affinity to all inputs
89871 pExpr->affinity = SQLITE_AFF_INTEGER;
89901 pExpr->affinity = SQLITE_AFF_INTEGER;
90142 pExpr->affinity = SQLITE_AFF_INTEGER;
90296 /* FIX ME: Compute pExpr->affinity based on the expected return
91106 ** Return the affinity character for a single column of a table.
91110 return iCol>=0 ? pTab->aCol[iCol].affinity : SQLITE_AFF_INTEGER;
91114 ** Return the 'affinity' of the expression pExpr if any.
91118 ** affinity of that column is returned. Otherwise, 0x00 is returned,
91119 ** indicating no affinity for the expression.
91122 ** have an affinity:
91154 return pExpr->affinity;
91277 ** type affinity of the other operand. This routine returns the
91278 ** type affinity that should be used for the comparison operator.
91284 ** affinity, use that. Otherwise use no affinity.
91297 /* One side is a column, the other is not. Use the columns affinity. */
91304 ** pExpr is a comparison operator. Return the type affinity that should
91326 ** idx_affinity is the affinity of an indexed column. Return true
91327 ** if the index with affinity idx_affinity may be used to implement
93063 ** unchanged by OP_Affinity with the affinity given in the second
93343 /* Check that the affinity that will be used to perform each
93344 ** comparison is the same as the affinity of each column in table
93359 ** other has no affinity and the other side is TEXT. Hence,
93361 ** and for the term on the LHS of the IN to have no affinity. */
93641 ** statement returns a column value, then the affinity of that
93643 affinity is used
93644 ** if either column has NUMERIC or INTEGER affinity. If neither
93645 ** 'x' nor the SELECT... statement are columns, then numeric affinity
93695 ** that columns affinity when building index keys. If <expr> is not
93696 ** a column, use numeric affinity.
93698 char affinity; /* Affinity of the LHS of the IN */
93704 affinity = sqlite3ExprAffinity(pLeft);
93705 if( !affinity ){
93706 affinity = SQLITE_AFF_BLOB;
93742 sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
93884 char *zAff = 0; /* Affinity string for comparisons */
94429 ** Record the fact that an affinity change has occurred on iCount
94825 /* The AFFINITY() function evaluates to a string that describes
94826 ** the type affinity of the argument. This is used for testing of
95018 /* If the column has REAL affinity, it may currently be stored as an
95024 && pTab->aCol[pExpr->iColumn].affinity==SQLITE_AFF_REAL
95133 assert( pExpr->affinity==OE_Rollback
95134 || pExpr->affinity==OE_Abort
95135 || pExpr->affinity==OE_Fail
95136 || pExpr->affinity==OE_Ignore
95143 if( pExpr->affinity==OE_Abort ){
95147 if( pExpr->affinity==OE_Ignore ){
95153 pExpr->affinity, pExpr->u.zToken, 0, 0);
100973 /* If there is no type specified, columns have the default affinity
100975 pCol->affinity = SQLITE_AFF_BLOB;
100982 pCol->affinity = sqlite3AffinityType(zType, &pCol->szEst);
101005 ** associated affinity type.
101009 ** found, the corresponding affinity is returned. If zType contains
101014 ** Substring | Affinity
101462 assert( pCol->affinity-SQLITE_AFF_BLOB >= 0 );
101463 assert( pCol->affinity-SQLITE_AFF_BLOB < ArraySize(azType) );
101464 testcase( pCol->affinity==SQLITE_AFF_BLOB );
101465 testcase( pCol->affinity==SQLITE_AFF_TEXT );
101466 testcase( pCol->affinity==SQLITE_AFF_NUMERIC );
101467 testcase( pCol->affinity==SQLITE_AFF_INTEGER );
101468 testcase( pCol->affinity==SQLITE_AFF_REAL );
101470 zType = azType[pCol->affinity - SQLITE_AFF_BLOB];
101472 assert( pCol->affinity==SQLITE_AFF_BLOB
101473 || pCol->affinity==sqlite3AffinityType(zType, 0) );
105694 /* If the column affinity is REAL but the number is an integer, then it
107503 FUNCTION2(affinity, 1, 0, 0, noopFunc, SQLITE_FUNC_AFFINITY),
107957 ** apply the affinity of the parent key). If this fails, then there
107960 ** will have INTEGER affinity applied to it, which may not be correct. */
108074 pExpr->affinity = pCol->affinity;
108080 pExpr->affinity = SQLITE_AFF_INTEGER;
108170 ** the parent key columns. The affinity of the parent key column should
108817 ** that the affinity and collation sequence associated with the
108877 pRaise->affinity = OE_Abort;
109074 ** Return a pointer to the column affinity string associated with index
109075 ** pIdx. A column affinity string has one character for each column in
109076 ** the table, according to the affinity of the column:
109078 ** Character Column affinity
109089 ** Memory for the buffer containing the column index affinity string
109095 /* The first time a column affinity string for a particular index is
109099 ** The column affinity string will eventually be deleted by
109113 pIdx->zColAff[n] = pTab->aCol[x].affinity;
109132 ** Compute the affinity string for table pTab, if it has not already been
109135 ** If the affinity exists (if it is no entirely SQLITE_AFF_BLOB values) and
109139 ** an OP_MakeRecord) to the affinity string.
109141 ** A column affinity string has one character per column:
109143 ** Character Column affinity
109163 zColAff[i] = pTab->aCol[i].affinity;
111088 if( pDestCol->affinity!=pSrcCol->affinity ){
111089 return 0; /* Affinity must be the same on all columns */
118475 pCol->affinity = sqlite3ExprAffinity(p);
118484 if( pCol->affinity==0 ) pCol->affinity = SQLITE_AFF_BLOB;
123961 pCol->affinity, &pValue);
123967 if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){
126693 char idxaff; /* Must match this affinity, if zCollName!=NULL */
127252 ** Code an OP_Affinity opcode to apply the column affinity string zAff
127271 ** and end of the affinity string.
127292 ** Before the comparison operation, affinity zAff is to be applied
127294 ** affinity string to SQLITE_AFF_BLOB if either:
127296 ** * the comparison will be performed with no affinity, or
127297 ** * the affinity change in zAff is guaranteed not to change the value.
127302 char *zAff /* Affinity string to modify */
127510 ** compute the affinity string.
127526 ** copy of the column affinity string of the index allocated using
127528 ** with equality constraints that use BLOB or NONE affinity are set to
127534 ** In the example above, the index on t1(a) has TEXT affinity. But since
127535 ** the right hand side of the equality constraint (t2.b) has BLOB/NONE affinity,
127537 ** a key to search the index. Hence the first byte in the returned affinity
127545 char **pzAff /* OUT: Set to point to affinity string */
127556 char *zAff; /* Affinity string to return */
127616 /* No affinity ever needs to be (or should be) applied to a value
127619 ** affinity of the comparison has been applied to the value. */
128398 char *zStartAff; /* Affinity for start of range constraint */
128399 char *zEndAff = 0; /* Affinity for end of range constraint */
129306 ** be an ordinary column (not a virtual table column) with TEXT affinity.
130768 /* Verify the affinity and collating sequence match */
130850 pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity;
131147 aff = pSrc->pTab->aCol[pTerm->u.leftColumn].affinity;
131764 ** Return the affinity for a single column of an index.
132784 char aff; /* Comparison affinity */
132785 char idxaff = 0; /* Indexed columns affinity */
138659 ** affinity or the collating sequence to use for comparison. Otherwise,
138898 yymsp[-3].minor.yy190.pExpr->affinity = OE_Ignore;
138907 yymsp[-5].minor.yy190.pExpr->affinity = (char)yymsp[-3].minor.yy194;