Lines Matching defs:sub

3540 **        any changes performed by sub-triggers, as the sqlite3_changes()
3541 ** value will be saved and restored after each sub-trigger has run.)^
6344 ** [sqlite3_value_subtype()] to inspect the sub-types of its arguments.
6347 ** function, then any sub-types belonging to arguments passed to the window
7165 ** the current directory on the sub-platforms of Win32 where that concept is
14983 ** that make up the Pager sub-system API. See source code comments for
15616 ** A sub-routine used to implement a trigger program.
15619 VdbeOp *aOp; /* Array of opcodes for sub-program */
15625 SubProgram *pNext; /* Next sub-program already visited */
17318 #define SQLITE_FUNC_SUBTYPE 0x00100000 /* Result likely to have sub-type */
18125 ** Expr.x.pSelect is used if the expression is a sub-select or an expression of
18223 } sub;
18259 #define EP_Subrtn 0x2000000 /* Uses Expr.y.sub. TK_IN, _SELECT, or _EXISTS */
18423 unsigned isCorrelated :1; /* True if sub-query is correlated */
18493 #define WHERE_OR_SUBCLAUSE 0x0020 /* Processing a sub-WHERE as part of
18822 ** A Vdbe sub-program that implements the body and WHEN clause of trigger
18922 int nMaxArg; /* Max args passed to user function by sub-program */
18969 int nHeight; /* Expression tree height of current sub-select */
20461 ** provided (enforcement of FK constraints requires the triggers sub-system).
21128 ** When a sub-program is executed (OP_Program), a structure of this type
21131 ** values stored in the Vdbe struct. When the sub-program is finished,
21133 ** restoring the state of the VM to as it was before the sub-program
21430 SubProgram *pProgram; /* Linked list of all sub-programs used by VM */
27213 ** For some Windows sub-platforms, the _beginthreadex() / _endthreadex()
42152 ** based on the sub-platform)?
42160 ** based on the sub-platform)?
43225 ** NOTE: On some sub-platforms, the InterlockedCompareExchange "function"
43542 ** NOTE: The WinRT sub-platform is always assumed to be based on the NT
43567 ** NOTE: All sub-platforms where the GetVersionEx[AW] functions are
48965 ** sub-dividing and re-hashing. */
48990 ** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap
49064 ** This routine might cause sub-bitmaps to be allocated. Failing
49065 ** to get the memory needed to hold the sub-bitmap is the only
49094 /* worring about sub-dividing and re-hashing. */
52584 Pgno iSubRec; /* Index of first record in sub-journal */
52686 ** This is a boolean variable. If true, then any required sub-journal
52688 ** sub-journals are only used for in-memory pager files.
52752 ** sub-codes.
52795 u8 subjInMemory; /* True to use in-memory sub-journals */
52805 u32 nSubRec; /* Number of records written to sub-journal */
52809 sqlite3_file *sjfd; /* File descriptor for sub-journal */
53205 ** Return true if it is necessary to write page *pPg into the sub-journal.
53206 ** A page needs to be written into the sub-journal if there exists one
53911 ** Pager.aSavepoint and Pager.nSavepoint to zero. Close the sub-journal
54051 ** IOERR sub-codes, the pager enters the ERROR state and the error code
54349 ** from the sub-journal (if isMainJrnl==0) and playback that page.
54356 ** If the page number of the page record read from the (sub-)journal file
54366 ** If the page record is successfully read from the (sub-)journal file
54368 ** while reading the record from the (sub-)journal file or while writing
54370 ** is successfully read from the (sub-)journal file but appears to be
54388 int isMainJrnl, /* 1 -> main journal. 0 -> sub-journal. */
54401 assert( isMainJrnl || pDone ); /* pDone always used on sub-journals */
54412 ** only reads from the main journal, not the sub-journal.
54419 /* Read the page number and page data from the journal or sub-journal
54506 (isMainJrnl?"main-journal":"sub-journal")
54524 ** is if the data was just read from an in-memory sub-journal. In that
54548 ** the data just read from the sub-journal. Mark the page as dirty
55369 /* Query the WAL sub-system for the database size. The WalDbsize()
55372 ** available from the WAL sub-system if the log file is empty or
55382 ** WAL sub-system, determine the page count based on the size of
55476 ** * Pages are then played back from the sub-journal file, starting
55575 /* Finally, rollback pages from the sub-journal. Page that were
55819 ** one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL).
56048 ** be necessary to write the current content out to the sub-journal
56058 ** sub-journal rolled back the content could not be restored and the
56578 ** Ensure that the sub-journal file is open. If it is already open, this
56601 ** Append a record of the current state of page pPg to the sub-journal.
56607 ** error code if the attempt to write to the sub-journal fails, or
56616 /* Open the sub-journal, if it has not already been opened */
56626 /* If the sub-journal was opened successfully (or was already open),
56831 ** (there are two of them, the main journal and the sub-journal). */
57874 ** to the start of it. If there are active savepoints, open the sub-journal
57939 ** the sub-journal if necessary.
57971 ** If the subjInMemory argument is non-zero, then any sub-journal opened
57973 ** has no effect if the sub-journal is already opened (as it may be when
57975 ** sub-journal. If the subjInMemory argument is zero, then any required
57976 ** sub-journal is implemented in-memory if pPager is an in-memory database,
58025 ** transactions may copy data from the sub-journal into the database
58100 ** main journal or sub-journal as required. If the page is written into
58966 ** occurs while opening the sub-journal file, then an IO error code is
59082 ** the sub-journal to zero bytes in size. */
59086 /* Only truncate if it is an in-memory sub-journal. */
59227 ** sub-journal now. This is required to handle the following scenario:
59235 ** If page X were not written to the sub-journal here, it would not
61463 ht_slot *aList; /* Pointer to sub-list content */
61471 struct Sublist aSub[13]; /* Array of sub-lists */
68525 ** the sub-journal is not already open, then it will be opened here.
69253 ** A statement sub-transaction is implemented as an anonymous savepoint. The
73220 ** sub-algorithm in some documentation.
74103 ** sub-tree headed by the child page of the cell being deleted. This makes
74134 ** is currently pointing to the largest entry in the sub-tree headed
78980 ** in a Vdbe main program and each of the sub-programs (triggers) it may
79000 int iSub; /* 0 = main program, 1 = first sub-program etc. */
79050 ** sub-programs contains any of the following:
79562 ** list at Vdbe.pSubProgram. This list is used to delete all sub-program
80346 int nSub = 0; /* Number of sub-vdbes seen so far */
80347 SubProgram **apSub = 0; /* Array of sub-vdbes */
80894 ** is used, for example, when a trigger sub-program is halted to restore
81448 ** occurred while writing to the journal, sub-journal or database
87040 /* Halt the sub-program. Return control to the parent frame. */
87047 /* Instruction pcx is the OP_Program that invoked the sub-program
87049 ** instruction is set to OE_Ignore, then the sub-program is throwing
92572 ** cell in an array of values used as arguments to the sub-program. P2
92573 ** contains the address to jump to if the sub-program throws an IGNORE
92576 ** memory required by the sub-vdbe at runtime.
92583 int nMem; /* Number of memory registers for sub-program */
92584 int nByte; /* Bytes of runtime space required for sub-program */
92597 ** disabled for backwards compatibility (p5 is set if this sub-program
92716 ** This opcode is only ever present in sub-programs called via the
92788 ** within a sub-program). Set the value of register P1 to the maximum of
94911 typedef struct SortSubtask SortSubtask; /* A sub-task in the sort process */
95045 VdbeSorter *pSorter; /* Sorter that owns this sub-task */
96281 ** PMA in the temp file belonging to sub-task pTask. Return SQLITE_OK if
96456 /* Select a sub-task to sort and flush the current list of in-memory
96459 ** the background thread from a sub-tasks previous turn is still running,
96460 ** skip it. If the first (pSorter->nTask-1) sub-tasks are all still busy,
96461 ** fall back to using the final sub-task. The first (pSorter->nTask-1)
96462 ** sub-tasks are prefered as they use background threads - the final
96463 ** sub-task uses the main thread. */
96908 ** in the sub-tree headed by pReadr are also initialized. Data is then
96914 ** background thread. In this case all PmaReaders in the sub-tree are
97176 ** one PmaReader per sub-task. */
97557 Mem sub; /* Subprograms */
97629 sqlite3VdbeMemInit(&pCur->sub, pVTab->db, 1);
97640 sqlite3VdbeMemRelease(&pCur->sub);
97641 sqlite3VdbeMemSetNull(&pCur->sub);
97681 pCur->showSubprograms ? &pCur->sub : 0,
97687 sqlite3VdbeMemSetNull(&pCur->sub);
100258 ** as if it were part of the sub-query, not the parent. This block
100259 ** moves the pOrderBy down to the sub-query. It will be moved back
100283 ** expressions in the sub-select were resolved, the sub-select
100356 ** the sub-query back to the parent query. At this point each term
100685 ** or a sub-select with a column as the return value, then the
101080 ** is a sub-select, return the number of columns in the sub-select. For
101146 Expr *pVector, /* The vector. List of expressions or a sub-SELECT */
101185 ** sub-select returns more than one column, the first in an array
101209 ** containing the results of the sub-select.
102831 /* Check if pExpr is a sub-select. If so, consider it variable. */
103459 ** "sub-select returns N columns - expected M"
103463 const char *zFmt = "sub-select returns %d columns - expected %d";
103471 ** it is not permitted. If pExpr is a sub-select vector, this routine
103474 ** "sub-select returns N columns - expected 1"
103550 sqlite3VdbeAddOp2(v, OP_Gosub, pExpr->y.sub.regReturn,
103551 pExpr->y.sub.iAddr);
103560 pExpr->y.sub.regReturn = ++pParse->nMem;
103561 pExpr->y.sub.iAddr =
103562 sqlite3VdbeAddOp2(v, OP_Integer, 0, pExpr->y.sub.regReturn) + 1;
103680 sqlite3VdbeAddOp1(v, OP_Return, pExpr->y.sub.regReturn);
103681 sqlite3VdbeChangeP1(v, pExpr->y.sub.iAddr-1, sqlite3VdbeCurrentAddr(v)-1);
103733 sqlite3VdbeAddOp2(v, OP_Gosub, pExpr->y.sub.regReturn,
103734 pExpr->y.sub.iAddr);
103740 pExpr->y.sub.regReturn = ++pParse->nMem;
103741 pExpr->y.sub.iAddr =
103742 sqlite3VdbeAddOp2(v, OP_Integer, 0, pExpr->y.sub.regReturn) + 1;
103801 sqlite3VdbeAddOp1(v, OP_Return, pExpr->y.sub.regReturn);
103802 sqlite3VdbeChangeP1(v, pExpr->y.sub.iAddr-1, sqlite3VdbeCurrentAddr(v)-1);
103813 ** sub-select on the RHS of the IN() operator has the same number of
103815 ** a sub-query, that the LHS is a vector of size 1.
106376 ** FunctionUsesThisSrc() when creating a new sub-select. */
106738 ** the sub/co-routine does not use registers in common with the code that
106739 ** invokes the sub/co-routine.
107682 ** descend into sub-select statements.
107742 ** sub-routine is currently stored in pParse->zErrMsg. This function
121399 ** and all of its sub-components.
121401 ** The Trigger structure or any of its sub-components may be allocated from
121886 ** sub-system, code for them is created by fkScanChildren()).
122107 ** trigger sub-program. */
130677 ** created by a sub-select). In this case the return value of this
132876 ** sub-select. In this case, set the column type to NULL, even
132888 /* The "table" is actually a sub-select or a view in the FROM clause
132890 ** data for the result-set column of the sub-select.
132894 ** rowid of the sub-select or view. This expression is legal (see
132935 /* The expression is a sub-select. Return the declaration type and
134710 ** just as it did when it was a column of a view or sub-query. */
134824 ** If pSrc contains any sub-selects, call this routine recursively
134825 ** on the FROM clause of each such sub-select, with iExcept set to -1.
134865 ** cursor in the FROM clause of any FROM clause sub-selects, recursively.
134946 ** sub-queries that were excluded from this optimization. Restriction
134994 ** The parent and sub-query may contain WHERE clauses. Subject to
135001 ** Also, each component of the sub-query must return the same number
135004 ** such (illegal) sub-query is flattened. The caller will detect the
135007 ** (18) If the sub-query is a compound select, then all terms of the
135014 ** (20) If the sub-query is a compound select, then it must not use
135025 ** (23) If the outer query is a recursive CTE, then the sub-query may not be
135060 Select *pSub1; /* Pointer to the rightmost select in sub-query */
135158 /* Restriction (17): If the sub-query is a compound SELECT, then it must
135226 /* If the sub-query is a compound SELECT statement, then (by restrictions
135230 ** SELECT <expr-list> FROM (<sub-query>) <where-clause>
135236 ** select statements in the compound sub-query.
135396 ** function attempts to flatten a compound sub-query into pParent
135397 ** (the only way this can happen is if the compound sub-query is
135658 ** push WHERE clause expression pExpr down to FROM clause sub-query
135665 ** BY clause of all window function used by the sub-query. It is safe
135671 ** * the sub-query uses only one distinct window frame, and
135741 ** all window-functions used by the sub-query. It is safe to
135896 ** where table is a database table, not a sub-select or view. If the query
136297 ** sub-query in the FROM clause of a SELECT statement. This function
136392 /* A sub-query in the FROM clause of a SELECT */
136708 /* A sub-query in the FROM clause of a SELECT */
136961 ** sub-expression matches the criteria for being moved to the WHERE
136962 ** clause. If so, add it to the WHERE clause and replace the sub-expression
137411 ** (2) Generate code for all sub-queries
137443 /* Generate code for all sub-queries in the FROM clause
139577 ** Parse context structure pFrom has just been used to create a sub-vdbe
139594 ** Create and populate a new TriggerPrg object with a sub-program
139608 NameContext sNC; /* Name context for sub-vdbe */
139610 Parse *pSubParse; /* Parse context for sub-vdbe */
139632 ** trigger sub-program. */
139664 ** (or NULL) the sub-vdbe is immediately halted by jumping to the
139677 /* Code the trigger program into the sub-vdbe. */
139680 /* Insert an OP_Halt at the end of the sub-program. */
139707 ** Return a pointer to a TriggerPrg object containing the sub-program for
139760 ** is a pointer to the sub-vdbe containing the trigger program. */
139771 ** invocation is disallowed if (a) the sub-program is really a trigger,
143596 #define TERM_VARSELECT 0x1000 /* Term.pExpr contains a correlated sub-query */
144817 ** be a correlated sub-query, and expression pExpr is an aggregate from
146076 ** sub-WHERE clause is to to invoke the main loop body as a subroutine.
146105 /* This is the sub-WHERE clause body. First skip over
146106 ** duplicate rows from prior sub-WHERE clauses, and record the
146108 ** row will be skipped in subsequent sub-WHERE clauses.
146161 ** current sub-WHERE row is a duplicate from prior sub-WHEREs. */
146255 ** sub-queries.
146961 ** A single subterm might be a set of AND-connected sub-subterms.
147444 ** a sub-select.
147446 ** If there is no sub-select in pExpr, then return true if pExpr
147455 ** bUses==1 true pExpr contains either a sub-select or a
147458 ** bUses==1 false pExpr contains no sub-selects and all TK_COLUMN
147461 ** bUses==0 true pExpr contains either a sub-select or a TK_COLUMN
147464 ** bUses==0 false pExpr contains no sub-selects and all TK_COLUMN
147585 ** 1. The sub-select must not be an aggregate or use window functions,
147587 ** 2. The sub-select must not be a compound SELECT,
148014 ** is not a sub-select. */
148854 /* If there is more than one table or sub-select in the FROM clause of
148863 ** current SELECT is a correlated sub-query.
151933 ** of all sub-scans required by the OR-scan. However, due to rounding
151935 ** most expensive sub-scan. Add the smallest possible penalty
152934 ** part of sub-select statements.
153215 ** that are not within a sub-select. This is not strictly required, but
153981 ** the sub-query.
153987 ** selected by the sub-query. For the purposes of the transformation,
154019 ** sub-query, which is always implemented as a co-routine. It then calls
154024 ** by the sub-query a sub-routine (OP_Gosub) coded by select.c is invoked.
154025 ** When the sub-routine is invoked:
154677 Select *pSubSelect; /* Current sub-select, if any */
154691 /* If this function is being called from within a scalar sub-select
154695 ** to the scalar sub-select. */
154894 ExprList *pSublist = 0; /* Expression list for sub-query */
154916 /* Create the ORDER BY clause for the sub-select. This is the concatenation
154942 ** sub-select expression list. They are required to figure out where
154948 ** sub-select expression list. Also allocate two registers for each
155291 ** to begin iterating through the sub-query results. It is used to allocate
155546 ** already populated with all columns from the current row of the sub-query.
155798 ** Invoke the sub-routine at regGosub (generated by code in select.c) to
156330 ** and invoke the sub-routine at instruction addrGosub once for each row.
156672 int csrInput = p->pSrc->a[0].iCursor; /* Cursor of sub-select */
156673 int nInput = p->pSrc->a[0].pTab->nCol; /* Number of cols returned by sub */
156674 int iInput; /* To iterate through sub cols */
156685 WindowCodeArg s; /* Context object for sub-routines */
156747 /* Allocate registers for the array of values from the sub-query, the
156778 /* Load the column values for the row returned by the sub-select
169015 ** requiring any dynamic allocation. This is sub-optimal because
171882 ** of the child node that heads the sub-tree that may contain the term.
171885 ** that heads a sub-tree that may contain a term for which zTerm/nTerm is
171965 ** to the term from the interior node, then all terms on the sub-tree
171998 ** contains a term. This function searches the sub-tree headed by the zNode
177441 ** nMaxDepth is the maximum allowable depth of the balanced sub-tree.
180241 ** of the sub-routines used to merge segments are also used by the query
181542 int rc; /* Return code of various sub-routines */
186295 ** are part of a sub-tree that is the right-hand-side of a NOT operator.
188719 u32 n; /* Bytes of content, or number of sub-nodes */
189293 u32 n, /* Content size or sub-node count */
189320 u32 n, /* Content size or sub-node count */
191349 ** RtreeNode.pNext. RtreeNode.iNode stores the depth of the sub-tree
191353 int iReinsertHeight; /* Height of sub-trees Reinsert() has run on */
193377 int iHeight, /* Height of sub-tree rooted at pCell */
194115 ** the height of the sub-tree headed by the cell.
194184 ** the height of the sub-tree headed by the cell.
198512 ** large transaction to be broken down into sub-transactions performed
198517 ** has committed one or more sub-transactions, other database clients continue
222577 int iChanged, /* Index of sub-iterator just advanced */
222604 int iChanged, /* Index of sub-iterator just advanced */
222643 ** Set the pIter->bEof variable based on the state of the sub-iterators.
226568 ** And as sub-transactions are opened/closed:
226898 /* Open the index sub-system */
226903 /* Open the storage sub-system */