Lines Matching defs:sub
2947 ** any changes performed by sub-triggers, as the sqlite3_changes()
2948 ** value will be saved and restored after each sub-trigger has run.)^
5892 ** [sqlite3_value_subtype()] to inspect the sub-types of its arguments.
5903 ** [sqlite3_result_subtype()] to cause a sub-type to be associated with its
6844 ** the current directory on the sub-platforms of Win32 where that concept is
14922 ** if the sub-buffer S..E-1 overflows the buffer whose last byte is P-1.
15833 ** that make up the Pager sub-system API. See source code comments for
16481 ** A sub-routine used to implement a trigger program.
16484 VdbeOp *aOp; /* Array of opcodes for sub-program */
16490 SubProgram *pNext; /* Next sub-program already visited */
18866 ** Expr.x.pSelect is used if the expression is a sub-select or an expression of
18967 } sub;
19002 #define EP_Subrtn 0x2000000 /* Uses Expr.y.sub. TK_IN, _SELECT, or _EXISTS */
19213 unsigned isCorrelated :1; /* True if sub-query is correlated */
19289 #define WHERE_OR_SUBCLAUSE 0x0020 /* Processing a sub-WHERE as part of
19376 #define NC_NoSelect 0x080000 /* Do not descend into sub-selects */
19629 ** A Vdbe sub-program that implements the body and WHEN clause of trigger
19758 int nMaxArg; /* Max args passed to user function by sub-program */
19810 int nHeight; /* Expression tree height of current sub-select */
21493 ** provided (enforcement of FK constraints requires the triggers sub-system).
23180 ** When a sub-program is executed (OP_Program), a structure of this type
23183 ** values stored in the Vdbe struct. When the sub-program is finished,
23185 ** restoring the state of the VM to as it was before the sub-program
23524 SubProgram *pProgram; /* Linked list of all sub-programs used by VM */
29546 ** For some Windows sub-platforms, the _beginthreadex() / _endthreadex()
33030 pExpr->y.sub.regReturn, pExpr->y.sub.iAddr);
46344 ** based on the sub-platform)?
46352 ** based on the sub-platform)?
47417 ** NOTE: On some sub-platforms, the InterlockedCompareExchange "function"
47734 ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
47759 ** NOTE: All sub-platforms where the GetVersionEx[AW] functions are
53507 ** sub-dividing and re-hashing. */
53532 ** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap
53606 ** This routine might cause sub-bitmaps to be allocated. Failing
53607 ** to get the memory needed to hold the sub-bitmap is the only
53636 /* worrying about sub-dividing and re-hashing. */
57186 Pgno iSubRec; /* Index of first record in sub-journal */
57288 ** This is a boolean variable. If true, then any required sub-journal
57290 ** sub-journals are only used for in-memory pager files.
57354 ** sub-codes.
57398 u8 subjInMemory; /* True to use in-memory sub-journals */
57408 u32 nSubRec; /* Number of records written to sub-journal */
57412 sqlite3_file *sjfd; /* File descriptor for sub-journal */
57808 ** Return true if it is necessary to write page *pPg into the sub-journal.
57809 ** A page needs to be written into the sub-journal if there exists one
58537 ** Pager.aSavepoint and Pager.nSavepoint to zero. Close the sub-journal
58677 ** IOERR sub-codes, the pager enters the ERROR state and the error code
58993 ** from the sub-journal (if isMainJrnl==0) and playback that page.
59000 ** If the page number of the page record read from the (sub-)journal file
59010 ** If the page record is successfully read from the (sub-)journal file
59012 ** while reading the record from the (sub-)journal file or while writing
59014 ** is successfully read from the (sub-)journal file but appears to be
59032 int isMainJrnl, /* 1 -> main journal. 0 -> sub-journal. */
59045 assert( isMainJrnl || pDone ); /* pDone always used on sub-journals */
59056 ** only reads from the main journal, not the sub-journal.
59063 /* Read the page number and page data from the journal or sub-journal
59150 (isMainJrnl?"main-journal":"sub-journal")
59168 ** is if the data was just read from an in-memory sub-journal. In that
59192 ** the data just read from the sub-journal. Mark the page as dirty
60020 /* Query the WAL sub-system for the database size. The WalDbsize()
60023 ** available from the WAL sub-system if the log file is empty or
60033 ** WAL sub-system, determine the page count based on the size of
60127 ** * Pages are then played back from the sub-journal file, starting
60226 /* Finally, rollback pages from the sub-journal. Page that were
60468 ** one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL).
60698 ** be necessary to write the current content out to the sub-journal.
60707 ** sub-journal rolled back the content could not be restored and the
61235 ** Ensure that the sub-journal file is open. If it is already open, this
61258 ** Append a record of the current state of page pPg to the sub-journal.
61264 ** error code if the attempt to write to the sub-journal fails, or
61273 /* Open the sub-journal, if it has not already been opened */
61283 /* If the sub-journal was opened successfully (or was already open),
61483 ** (there are two of them, the main journal and the sub-journal). */
62536 ** to the start of it. If there are active savepoints, open the sub-journal
62602 ** the sub-journal if necessary.
62635 ** If the subjInMemory argument is non-zero, then any sub-journal opened
62637 ** has no effect if the sub-journal is already opened (as it may be when
62639 ** sub-journal. If the subjInMemory argument is zero, then any required
62640 ** sub-journal is implemented in-memory if pPager is an in-memory database,
62689 ** transactions may copy data from the sub-journal into the database
62764 ** main journal or sub-journal as required. If the page is written into
63637 ** occurs while opening the sub-journal file, then an IO error code is
63752 /* Truncate the sub-journal so that it only includes the parts
63757 /* Only truncate if it is an in-memory sub-journal. */
63902 ** sub-journal now. This is required to handle the following scenario:
63910 ** If page X were not written to the sub-journal here, it would not
66420 ht_slot *aList; /* Pointer to sub-list content */
66428 struct Sublist aSub[13]; /* Array of sub-lists */
73884 ** the sub-journal is not already open, then it will be opened here.
73909 ** the sub-journal is not already open, then it will be opened here.
74669 ** A statement sub-transaction is implemented as an anonymous savepoint. The
78963 ** sub-algorithm in some documentation.
79919 ** sub-tree headed by the child page of the cell being deleted. This makes
79950 ** is currently pointing to the largest entry in the sub-tree headed
85052 ** in a Vdbe main program and each of the sub-programs (triggers) it may
85072 int iSub; /* 0 = main program, 1 = first sub-program etc. */
85122 ** sub-programs contains any of the following:
85804 ** list at Vdbe.pSubProgram. This list is used to delete all sub-program
86609 int nSub = 0; /* Number of sub-vdbes seen so far */
86610 SubProgram **apSub = 0; /* Array of sub-vdbes */
87143 ** is used, for example, when a trigger sub-program is halted to restore
87697 ** occurred while writing to the journal, sub-journal or database
93867 /* Halt the sub-program. Return control to the parent frame. */
93874 /* Instruction pcx is the OP_Program that invoked the sub-program
93876 ** instruction is set to OE_Ignore, then the sub-program is throwing
99859 ** cell in an array of values used as arguments to the sub-program. P2
99860 ** contains the address to jump to if the sub-program throws an IGNORE
99863 ** memory required by the sub-vdbe at runtime.
99870 int nMem; /* Number of memory registers for sub-program */
99871 int nByte; /* Bytes of runtime space required for sub-program */
99884 ** disabled for backwards compatibility (p5 is set if this sub-program
99997 ** This opcode is only ever present in sub-programs called via the
100069 ** within a sub-program). Set the value of register P1 to the maximum of
102425 typedef struct SortSubtask SortSubtask; /* A sub-task in the sort process */
102560 VdbeSorter *pSorter; /* Sorter that owns this sub-task */
103797 ** PMA in the temp file belonging to sub-task pTask. Return SQLITE_OK if
103972 /* Select a sub-task to sort and flush the current list of in-memory
103975 ** the background thread from a sub-tasks previous turn is still running,
103976 ** skip it. If the first (pSorter->nTask-1) sub-tasks are all still busy,
103977 ** fall back to using the final sub-task. The first (pSorter->nTask-1)
103978 ** sub-tasks are preferred as they use background threads - the final
103979 ** sub-task uses the main thread. */
104425 ** in the sub-tree headed by pReadr are also initialized. Data is then
104431 ** background thread. In this case all PmaReaders in the sub-tree are
104693 ** one PmaReader per sub-task. */
105074 Mem sub; /* Subprograms */
105151 sqlite3VdbeMemInit(&pCur->sub, pVTab->db, 1);
105162 sqlite3VdbeMemRelease(&pCur->sub);
105163 sqlite3VdbeMemSetNull(&pCur->sub);
105203 pCur->showSubprograms ? &pCur->sub : 0,
105209 sqlite3VdbeMemSetNull(&pCur->sub);
107989 ** as if it were part of the sub-query, not the parent. This block
107990 ** moves the pOrderBy down to the sub-query. It will be moved back
108016 ** expressions in the sub-select were resolved, the sub-select
108105 ** the sub-query back to the parent query. At this point each term
108424 ** or a sub-select with a column as the return value, then the
108890 ** is a sub-select, return the number of columns in the sub-select. For
108960 Expr *pVector, /* The vector. List of expressions or a sub-SELECT */
109010 ** sub-select returns more than one column, the first in an array
109034 ** containing the results of the sub-select.
110981 /* Check if pExpr is a sub-select. If so, consider it variable. */
111332 ** will be set on pX and the pX->y.sub fields will be set to show where
111639 ** "sub-select returns N columns - expected M"
111643 const char *zFmt = "sub-select returns %d columns - expected %d";
111651 ** it is not permitted. If pExpr is a sub-select vector, this routine
111654 ** "sub-select returns N columns - expected 1"
111731 sqlite3VdbeAddOp2(v, OP_Gosub, pExpr->y.sub.regReturn,
111732 pExpr->y.sub.iAddr);
111743 pExpr->y.sub.regReturn = ++pParse->nMem;
111744 pExpr->y.sub.iAddr =
111745 sqlite3VdbeAddOp2(v, OP_BeginSubrtn, 0, pExpr->y.sub.regReturn) + 1;
111869 assert( sqlite3VdbeGetOp(v,pExpr->y.sub.iAddr-1)->opcode==OP_BeginSubrtn
111871 sqlite3VdbeAddOp3(v, OP_Return, pExpr->y.sub.regReturn,
111872 pExpr->y.sub.iAddr, 1);
111919 sqlite3VdbeAddOp2(v, OP_Gosub, pExpr->y.sub.regReturn,
111920 pExpr->y.sub.iAddr);
111928 pExpr->y.sub.regReturn = ++pParse->nMem;
111929 pExpr->y.sub.iAddr =
111930 sqlite3VdbeAddOp2(v, OP_BeginSubrtn, 0, pExpr->y.sub.regReturn) + 1;
112005 assert( sqlite3VdbeGetOp(v,pExpr->y.sub.iAddr-1)->opcode==OP_BeginSubrtn
112007 sqlite3VdbeAddOp3(v, OP_Return, pExpr->y.sub.regReturn,
112008 pExpr->y.sub.iAddr, 1);
112018 ** sub-select on the RHS of the IN() operator has the same number of
112020 ** a sub-query, that the LHS is a vector of size 1.
113362 ** from outer queries into sub-queries by the push-down optimization.
115339 ** the sub/co-routine does not use registers in common with the code that
115340 ** invokes the sub/co-routine.
116403 ** descend into sub-select statements.
116468 ** sub-routine is currently stored in pParse->zErrMsg. This function
131338 ** and all of its sub-components.
131340 ** The Trigger structure or any of its sub-components may be allocated from
131851 ** require no special handling by the triggers sub-system, code for them is
132079 ** trigger sub-program. */
141255 ** created by a sub-select). In this case the return value of this
143723 ** sub-select. In this case, set the column type to NULL, even
143735 /* The "table" is actually a sub-select or a view in the FROM clause
143737 ** data for the result-set column of the sub-select.
143747 ** rowid of the sub-select or view. This expression is legal (see
143788 /* The expression is a sub-select. Return the declaration type and
145688 ** just as it did when it was a column of a view or sub-query. */
145805 ** If pSrc contains any sub-selects, call this routine recursively
145806 ** on the FROM clause of each such sub-select, with iExcept set to -1.
145860 ** cursor in the FROM clause of any FROM clause sub-selects, recursively.
145983 ** sub-queries that were excluded from this optimization. Restriction
146036 ** The parent and sub-query may contain WHERE clauses. Subject to
146043 ** Also, each component of the sub-query must return the same number
146046 ** such (illegal) sub-query is flattened. The caller will detect the
146049 ** (18) If the sub-query is a compound select, then all terms of the
146056 ** (20) If the sub-query is a compound select, then it must not use
146067 ** (23) If the outer query is a recursive CTE, then the sub-query may not be
146114 Select *pSub1; /* Pointer to the rightmost select in sub-query */
146206 /* Restriction (17): If the sub-query is a compound SELECT, then it must
146285 /* If the sub-query is a compound SELECT statement, then (by restrictions
146289 ** SELECT <expr-list> FROM (<sub-query>) <where-clause>
146295 ** select statements in the compound sub-query.
146457 ** function attempts to flatten a compound sub-query into pParent
146458 ** (the only way this can happen is if the compound sub-query is
146805 ** push WHERE clause expression pExpr down to FROM clause sub-query
146812 ** BY clause of all window function used by the sub-query. It is safe
146818 ** * the sub-query uses only one distinct window frame, and
146888 ** all window-functions used by the sub-query. It is safe to
147196 ** where table is a database table, not a sub-select or view. If the query
147635 ** sub-query in the FROM clause of a SELECT statement. This function
147769 /* A sub-query in the FROM clause of a SELECT */
147972 /* If pTab is actually an SF_NestedFrom sub-select, do not
148167 /* A sub-query in the FROM clause of a SELECT */
148739 ** sub-expression matches the criteria for being moved to the WHERE
148740 ** clause. If so, add it to the WHERE clause and replace the sub-expression
148947 ** If any term of pSrc, or any SF_NestedFrom sub-query, is not the same
149143 ** and leaving this flag set can cause errors if a compound sub-query
149386 ** (2) Generate code for all sub-queries
149418 /* Generate code for all sub-queries in the FROM clause
151702 ** Parse context structure pFrom has just been used to create a sub-vdbe
151719 ** Create and populate a new TriggerPrg object with a sub-program
151733 NameContext sNC; /* Name context for sub-vdbe */
151736 Parse sSubParse; /* Parse context for sub-vdbe */
151757 ** trigger sub-program. */
151787 ** (or NULL) the sub-vdbe is immediately halted by jumping to the
151800 /* Code the trigger program into the sub-vdbe. */
151803 /* Insert an OP_Halt at the end of the sub-program. */
151831 ** Return a pointer to a TriggerPrg object containing the sub-program for
151885 ** is a pointer to the sub-vdbe containing the trigger program. */
151896 ** invocation is disallowed if (a) the sub-program is really a trigger,
155838 #define TERM_VARSELECT 0x1000 /* Term.pExpr contains a correlated sub-query */
158431 ** sub-WHERE clause is to to invoke the main loop body as a subroutine.
158466 /* This is the sub-WHERE clause body. First skip over
158467 ** duplicate rows from prior sub-WHERE clauses, and record the
158469 ** row will be skipped in subsequent sub-WHERE clauses.
158522 ** current sub-WHERE row is a duplicate from prior sub-WHEREs. */
158628 ** sub-queries.
159514 ** A single subterm might be a set of AND-connected sub-subterms.
160351 ** is not a sub-select.
161418 /* If there is more than one table or sub-select in the FROM clause of
161427 ** current SELECT is a correlated sub-query.
165385 ** of all sub-scans required by the OR-scan. However, due to rounding
165387 ** most expensive sub-scan. Add the smallest possible penalty
166456 ** part of sub-select statements.
167017 ** that are not within a sub-select. This is not required
167897 ** the sub-query.
167903 ** selected by the sub-query. For the purposes of the transformation,
167935 ** sub-query, which is always implemented as a co-routine. It then calls
167940 ** by the sub-query a sub-routine (OP_Gosub) coded by select.c is invoked.
167941 ** When the sub-routine is invoked:
168593 Select *pSubSelect; /* Current sub-select, if any */
168607 /* If this function is being called from within a scalar sub-select
168611 ** to the scalar sub-select. */
168827 ExprList *pSublist = 0; /* Expression list for sub-query */
168854 /* Create the ORDER BY clause for the sub-select. This is the concatenation
168880 ** sub-select expression list. They are required to figure out where
168886 ** sub-select expression list. Also allocate two registers for each
169241 ** to begin iterating through the sub-query results. It is used to allocate
169502 ** already populated with all columns from the current row of the sub-query.
169757 ** Invoke the sub-routine at regGosub (generated by code in select.c) to
170302 ** and invoke the sub-routine at instruction addrGosub once for each row.
170644 int csrInput = p->pSrc->a[0].iCursor; /* Cursor of sub-select */
170645 int nInput = p->pSrc->a[0].pTab->nCol; /* Number of cols returned by sub */
170646 int iInput; /* To iterate through sub cols */
170656 WindowCodeArg s; /* Context object for sub-routines */
170718 /* Allocate registers for the array of values from the sub-query, the
170749 /* Load the column values for the row returned by the sub-select
183538 ** requiring any dynamic allocation. This is sub-optimal because
186414 ** of the child node that heads the sub-tree that may contain the term.
186417 ** that heads a sub-tree that may contain a term for which zTerm/nTerm is
186497 ** to the term from the interior node, then all terms on the sub-tree
186530 ** contains a term. This function searches the sub-tree headed by the zNode
192066 ** nMaxDepth is the maximum allowable depth of the balanced sub-tree.
194869 ** of the sub-routines used to merge segments are also used by the query
196170 int rc; /* Return code of various sub-routines */
200958 ** are part of a sub-tree that is the right-hand-side of a NOT operator.
204666 u32 sub;
204674 sub = jsonbValidityCheck(pParse, j, j+n+sz, iDepth+1);
204675 if( sub ) return sub;
204683 u32 sub;
204695 sub = jsonbValidityCheck(pParse, j, j+n+sz, iDepth+1);
204696 if( sub ) return sub;
208695 ** RtreeNode.pNext. RtreeNode.iNode stores the depth of the sub-tree
210735 int iHeight, /* Height of sub-tree rooted at pCell */
211393 ** the height of the sub-tree headed by the cell.
215772 ** large transaction to be broken down into sub-transactions performed
215777 ** has committed one or more sub-transactions, other database clients continue
241747 int iChanged, /* Index of sub-iterator just advanced */
241774 int iChanged, /* Index of sub-iterator just advanced */
241813 ** Set the pIter->bEof variable based on the state of the sub-iterators.
247710 ** And as sub-transactions are opened/closed:
248042 /* Open the index sub-system */
248047 /* Open the storage sub-system */