mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Bring the comments on sqlite3FindInIndex() into closer alignment with what
that routine actually does. FossilOrigin-Name: 40f3274745b53bb72933c1052d0e85bc74be56d3a1068e9d54dc28763a2cfef9
This commit is contained in:
@@ -2659,7 +2659,7 @@ static int sqlite3InRhsIsConstant(Expr *pIn){
|
||||
** all members of the RHS set, skipping duplicates.
|
||||
**
|
||||
** A cursor is opened on the b-tree object that is the RHS of the IN operator
|
||||
** and pX->iTable is set to the index of that cursor.
|
||||
** and the *piTab parameter is set to the index of that cursor.
|
||||
**
|
||||
** The returned value of this function indicates the b-tree type, as follows:
|
||||
**
|
||||
@@ -2679,7 +2679,10 @@ static int sqlite3InRhsIsConstant(Expr *pIn){
|
||||
** If the RHS of the IN operator is a list or a more complex subquery, then
|
||||
** an ephemeral table might need to be generated from the RHS and then
|
||||
** pX->iTable made to point to the ephemeral table instead of an
|
||||
** existing table.
|
||||
** existing table. In this case, the creation and initialization of the
|
||||
** ephmeral table might be put inside of a subroutine, the EP_Subrtn flag
|
||||
** will be set on pX and the pX->y.sub fields will be set to show where
|
||||
** the subroutine is coded.
|
||||
**
|
||||
** The inFlags parameter must contain, at a minimum, one of the bits
|
||||
** IN_INDEX_MEMBERSHIP or IN_INDEX_LOOP but not both. If inFlags contains
|
||||
@@ -2911,6 +2914,8 @@ int sqlite3FindInIndex(
|
||||
&& ExprUseXList(pX)
|
||||
&& (!sqlite3InRhsIsConstant(pX) || pX->x.pList->nExpr<=2)
|
||||
){
|
||||
pParse->nTab--; /* Back out the allocation of the unused cursor */
|
||||
iTab = -1; /* Cursor is not allocated */
|
||||
eType = IN_INDEX_NOOP;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user