Home | History | Annotate | Download | only in dist

Lines Matching refs:rowid

2015 ** CAPI3REF: Last Insert Rowid
2018 ** integer key called the [ROWID | "rowid"]. ^The rowid is always available
2019 ** as an undeclared column named ROWID, OID, or _ROWID_ as long as those
2022 ** is another alias for the rowid.
2024 ** ^This routine returns the [rowid] of the most recent
2029 ** ^(If an [INSERT] occurs within a trigger, then the [rowid] of the inserted
2052 ** function is running and thus changes the last insert [rowid],
2055 ** last insert [rowid].
2582 ** select random [ROWID | ROWIDs] when inserting new records into a table that
2583 ** already uses the largest possible [ROWID]. The PRNG is also used for
4709 ** ^The final callback parameter is the [rowid] of the row.
4710 ** ^In the case of an update, this is the [rowid] after the update takes place.
4889 ** ^If the specified column is "rowid", "oid" or "_rowid_" and an
5318 ** SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
5381 ** by the rowid value passed as the second argument. Only the row can be
8908 ** The sqlite.lastRowid records the last insert rowid generated by an
8948 i64 lastRowid; /* ROWID of most recent insert (see above) */
9381 ** be set. An INTEGER PRIMARY KEY is used as the rowid for each row of
9382 ** the table. If a table has no INTEGER PRIMARY KEY, then a random rowid
9559 i64 rowid; /* Used by UNPACKED_PREFIX_SEARCH */
9568 #define UNPACKED_IGNORE_ROWID 0x0004 /* Ignore trailing rowid on key1 */
9795 ynVar iColumn; /* TK_COLUMN: column index. -1 for rowid.
10205 #define SRT_Table 8 /* Store result as data with an automatic rowid */
10235 int regCtr; /* Memory register holding the rowid counter */
10329 int regRowid; /* Register holding rowid of CREATE TABLE entry */
12016 ** the rowid is in VdbeCursor.iKey.
12021 i64 lastRowid; /* Last rowid from a Next or NextIdx operation */
12095 i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */
21368 /* 61 */ "Rowid",
34289 ** can be intermixed with tests to see if a given rowid has been
34352 i64 v; /* ROWID value for this entry */
34438 SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet *p, i64 rowid){
34455 pEntry->v = rowid;
34459 if( p->isSorted && rowid<=pLast->v ){
44866 sqlite3_int64 cachedRowid; /* Next rowid cache. 0 means not valid */
45829 ** rowid iRow is being replaced or deleted. In this case invalidate
45834 i64 iRow, /* The rowid that might be changing */
48880 ** Set the cached rowid value of every cursor in the same database file
48884 ** Only positive rowid values are considered valid for this cache.
48900 ** Return the cached rowid for the given cursor. A negative or zero
48901 ** return value indicates that the rowid cache is invalid and should be
48902 ** ignored. If the rowid cache has never before been set, then a
52265 ** BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys
53002 "Rowid %lld out of order (previous was %lld)", info.nKey, nMaxKey);
53059 "Rowid %lld out of order (max larger than parent min of %lld)",
53065 "Rowid %lld out of order (min less than parent min of %lld)",
53070 "Rowid %lld out of order (max larger than parent max of %lld)",
53079 "Rowid %lld out of order (min less than parent max of %lld)",
58169 ** an index key, and thus ends with a rowid value. The last byte
58170 ** of the header will therefore be the serial type of the rowid:
58172 ** The serial type of the final rowid will always be a single byte.
58174 ** to ignore the rowid at the end of key1.
58235 ** rowid field were equal, then clear the PREFIX_SEARCH flag and set
58236 ** pPKey2->rowid to the value of the rowid field in (pKey1, nKey1).
58243 pPKey2->rowid = mem1.u.i;
58279 ** Read the rowid (the last field in the record) and store it in *rowid.
58285 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){
58289 u32 typeRowid; /* Serial type of the rowid */
58290 u32 lenRowid; /* Size of the rowid */
58320 /* The last field of the index should be an integer - the ROWID.
58342 *rowid = v.u.i;
58360 ** pUnpacked is either created without a rowid or is truncated so that it
58361 ** omits the rowid at the end. The rowid at the end of the index entry
58363 ** of the keys prior to the final rowid, not the entire key.
60752 i64 iKey; /* The rowid we are to seek to */
60772 i64 R; /* Rowid stored in register P3 */
60781 i64 v; /* The new rowid */
60782 VdbeCursor *pC; /* Cursor of table to get the new rowid */
60785 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
60791 i64 iKey; /* The integer ROWID or key for the record to be inserted */
60848 i64 rowid;
60972 sqlite_int64 rowid;
63696 i64 iKey; /* The rowid we are to seek to */
63842 ** P1 is an open table cursor and P2 is a rowid integer. Arrange
63843 ** for P1 to move so that it points to the rowid given by P2.
63959 ** the list field being the integer ROWID of the entry that the index
63965 ** The value of N can be inferred from the cursor. N includes the rowid
63966 ** value appended to the end of the index record. This rowid value may
63973 ** where the first (N-1) fields match but the rowid value at the end
63975 ** to instruction P2. Otherwise, the rowid of the conflicting index
63989 i64 R; /* Rowid stored in register P3 */
64032 ** to P2. Otherwise, copy the rowid of the conflicting record to
64035 if( (u.bc.r.flags & UNPACKED_PREFIX_SEARCH) || u.bc.r.rowid==u.bc.R ){
64038 pIn3->u.i = u.bc.r.rowid;
64116 ** Get a new integer record number (a.k.a "rowid") used as the key to a table.
64130 i64 v; /* The new rowid */
64131 VdbeCursor *pC; /* Cursor of table to get the new rowid */
64134 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
64146 /* The next rowid or record number (different terms for the same
64149 ** First we attempt to find the largest existing rowid and add one
64150 ** to that. But if the largest existing rowid is already the maximum
64154 ** The second algorithm is to select a rowid at random and see if
64156 ** succeeded. If the random rowid does exist, we select a new one
64227 /* IMPLEMENTATION-OF: R-07677-41881 If the largest ROWID is equal to the
64231 assert( pOp->p3==0 ); /* We cannot be in random rowid mode if this is
64242 /* collision - try another random rowid */
64276 ** then rowid is stored for subsequent return by the
64315 i64 iKey; /* The integer ROWID or key for the record to be inserted */
64412 /* If the update-hook will be invoked, set u.bg.iKey to the rowid of the
64542 /* Opcode: Rowid P1 P2 * * *
64615 ** The next use of the Rowid or Column or Next instruction for P1
64670 ** The next use of the Rowid or Column or Next instruction for P1
64849 ** the rowid of the table entry to which this index entry points.
64851 ** See also: Rowid, MakeRecord.
64857 i64 rowid;
64871 rc = sqlite3VdbeIdxRowid(db, u.bp.pCrsr, &u.bp.rowid);
64875 pOut->u.i = u.bp.rowid;
64885 ** key that omits the ROWID. Compare this key value against the index
64886 ** that P1 is currently pointing to, ignoring the ROWID on the P1 index.
64899 ** key that omits the ROWID. Compare this key value against the index
64900 ** that P1 is currently pointing to, ignoring the ROWID on the P1 index.
65144 "SELECT name, rootpage, sql FROM '%q'.%s WHERE %s ORDER BY rowid",
66267 ** is the rowid of a row to delete. If argv[0] is NULL then no
66268 ** deletion occurs. The argv[1] element is the rowid of the new
66270 ** rowid for itself. The subsequent elements in the array are
66273 ** If P2==1 then no insert is performed. argv[0] is the rowid of
66278 ** is set to the value of the rowid for the row just inserted.
66286 sqlite_int64 rowid;
66305 rc = u.cl.pModule->xUpdate(u.cl.pVtab, u.cl.nArg, u.cl.apArg, &u.cl.rowid);
66309 db->lastRowid = u.cl.rowid;
66590 zErr = sqlite3MPrintf(p->db, "no such rowid: %lld", iRow);
66643 {OP_Variable, 1, 1, 1}, /* 5: Push the rowid to the stack */
67799 /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */
67881 ** Perhaps the name is a reference to the ROWID
68063 /* The special operator TK_ROW means use the rowid for the first
68714 ** Expr.iColumn The column index in X.Y. -1 for the rowid.
70135 if( sqlite3StrICmp(z, "ROWID")==0 ) return 1;
70360 ** to be of the form "<rowid> IN (?, ?, ?)", where <rowid> is a reference
70385 int isRowid /* If true, LHS of IN operator is a rowid */
70650 /* In this case, the RHS is the ROWID of table b-tree
70961 ** is called. If iColumn<0 then code is generated that extracts the rowid.
71499 ** read the rowid field.
71502 ** parameter is set to 0 for an old.rowid reference, or to (i+1)
71504 ** i is the index of the column. For a new.rowid reference, p1 is
71515 ** p1==0 -> old.rowid p1==3 -> new.rowid
71530 (pExpr->iColumn<0 ? "rowid" : pExpr->pTab->aCol[pExpr->iColumn].zName),
73499 int regRowid = iMem++; /* Rowid for the inserted record */
74783 zCol = "ROWID";
75719 ** The rowid for the new entry is left in register pParse->regRowid.
75721 ** The rowid and root page number values are needed by the code that
75953 ** then we will try to use that column as the rowid. Set the Table.iPKey
76418 "WHERE rowid=#%d",
79136 Expr *pWhereRowid = NULL; /* WHERE rowid .. */
79137 Expr *pInClause = NULL; /* WHERE rowid IN ( select ) */
79138 Expr *pSelectRowid = NULL; /* SELECT rowid ... */
79140 SrcList *pSelectSrc = NULL; /* SELECT rowid FROM x ... (dup of pSrc) */
79164 ** DELETE FROM table_a WHERE rowid IN (
79165 ** SELECT rowid FROM table_a WHERE col1=1 ORDER BY col2 LIMIT 1 OFFSET 1
79187 /* now generate the new WHERE rowid IN clause for the DELETE/UDPATE */
79364 int iRowid = ++pParse->nMem; /* Used for storing rowid values. */
79422 ** maximum rowid counter values recorded while inserting into
79478 int iRowid, /* Memory cell that contains the rowid to delete */
79503 ** avoid copying the contents of the rowid register. */
81759 ** row being deleted from the scan by adding ($rowid != rowid) to the WHERE
81760 ** clause, where $rowid is the rowid of the row being deleted. */
81906 ** rowid of the row being deleted, followed by each of the column values
82097 ** UPDATE statement modifies the rowid fields of the table.
82107 int chngRowid /* True for UPDATE that affects rowid */
82479 ** rowid that appears as the last column in every index.
82602 ** that holds the maximum rowid.
82613 ** (2) Register to hold the maximum ROWID of pTab.
82614 ** (3) Register to hold the rowid in sqlite_sequence of pTab
82624 int memId = 0; /* Register holding maximum rowid */
82639 pInfo->regCtr = ++pToplevel->nMem; /* Max rowid register */
82640 pToplevel->nMem++; /* Rowid in sqlite_sequence */
82655 int memId; /* Register holding max rowid */
82685 ** Update the maximum rowid for an autoincrement calculation.
82688 ** new rowid that is about to be inserted. If that new rowid is
82689 ** larger than the maximum rowid in the memId memory cell, then the
82700 ** maximum rowid values back into the sqlite_sequence register.
82893 int regIns; /* Block of regs holding rowid+data being inserted */
82894 int regRowid; /* registers holding insert rowid */
83073 int regTempRowid; /* Register to hold temp table ROWID */
83222 /* Allocate registers for holding the rowid of the new row,
83244 ** not happened yet) so we substitute a rowid of -1
83450 ** maximum rowid counter values recorded while inserting into
83495 ** 1. The rowid of the row after the update.
83506 ** the address of a register containing the rowid before the update takes
83509 ** indicates that the rowid was explicitly specified as part of the
83510 ** INSERT statement. If rowidChng is false, it means that the rowid is
83511 ** computed automatically in an insert or that the rowid value is not
83571 int rowidChng, /* True if the rowid might collide with existing entry */
83704 ** REPLACE INTO t(rowid) VALUES($newrowid)
83846 ** rowid and the content to be inserted.
84055 int regData, regRowid; /* Registers holding data and rowid */
86654 sqlite3VdbeChangeP4(v, addr+1, "rowid ", P4_STATIC);
87304 "SELECT name, rootpage, sql FROM '%q'.%s ORDER BY rowid",
88807 ** declaration type for a ROWID field is INTEGER. Exactly when an expression
88885 ** rowid of the sub-select or view. This expression is legal (see
88902 zOriginCol = "rowid";
89028 zCol = "rowid";
89100 iCol>=0 ? pTab->aCol[iCol].zName : "rowid");
90324 ** entry in pEList. (But leave references to the ROWID column
93455 ** reg+0 OLD.rowid
93459 ** reg+N+1 NEW.rowid
93528 ** It is not possible to determine if the old.rowid or new.rowid column is
93595 Expr *pRowidExpr, /* Expression used to recompute the rowid */
93697 int regOldRowid; /* The old rowid */
93698 int regNewRowid; /* The new rowid */
93890 /* Remember the rowid of every item to be updated.
94109 ** maximum rowid counter values recorded while inserting into
94153 ** (A) The original rowid of that row.
94154 ** (B) The revised rowid for the row. (note1)
94171 Expr *pRowid, /* Expression used to recompute the rowid */
94937 ** The VM register number pParse->regRowid holds the rowid of an
94945 "WHERE rowid=#%d",
95755 #define WHERE_ROWID_EQ 0x00001000 /* rowid=EXPR or rowid IN (...) */
95756 #define WHERE_ROWID_RANGE 0x00002000 /* rowid<EXPR and/or rowid>EXPR */
96918 ** represent the rowid index that is part of every table. */
96925 ** one additional column containing the rowid. The rowid column
96933 int iColumn; /* The i-th column of the index. -1 for rowid */
96967 /* Index column i is the rowid. All other terms match. */
97995 ** selected plan may still take advantage of the tables built-in rowid
98119 ** for the rowid index. For other indexes, it is true unless all the
98782 zMsg = sqlite3MAppendf(db, zMsg, "%s (rowid=?)", zMsg);
98784 zMsg = sqlite3MAppendf(db, zMsg, "%s (rowid>? AND rowid<?)", zMsg);
98786 zMsg = sqlite3MAppendf(db, zMsg, "%s (rowid>?)", zMsg);
98788 zMsg = sqlite3MAppendf(db, zMsg, "%s (rowid<?)", zMsg);
98836 int iRowidReg = 0; /* Rowid is stored in this register, if not zero */
98918 ** equality comparison against the ROWID field. Or
98919 ** we reference multiple rows using a "rowid IN (...)"
98937 /* Case 2: We have an inequality comparison against the ROWID field.
99262 ** RowSetTest are such that the rowid of the current row is inserted
99267 ** RowSetTest # Insert rowid into rowset
99290 int regRowid = 0; /* Register holding rowid */
99788 ** SELECT * FROM t2, t1 WHERE t2.rowid = t1.a;
105401 ** Return the ROWID of the most recent insert
107097 ** 1. The specified column name was rowid", "oid" or "_rowid_"
108536 #define FTS3_DOCID_SEARCH 1 /* Lookup by rowid on %_content table */
109276 ** 1. Direct lookup by rowid or docid.
109295 /* A direct lookup on the rowid or docid column. Assign a cost of 1.0. */
109308 ** rowid/docid lookup, prefer the MATCH strategy. This is done even
109309 ** though the rowid/docid lookup is faster than a MATCH query, selecting
111345 ** retrieve the rowid for the current row of the result set. fts3
111346 ** exposes %_content.docid as the rowid for the virtual table. The
111347 ** rowid should be written to *pRowid.
111355 ** (not using the full-text index). In this case grab the rowid from the
111382 ** alias for "rowid", use the xRowid() method to obtain the value.
111411 sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */
114675 sqlite3_int64 iStartBlock; /* Rowid of first leaf block to traverse */
114676 sqlite3_int64 iLeafEndBlock; /* Rowid of final leaf block to traverse */
114677 sqlite3_int64 iEndBlock; /* Rowid of final block in segment (or 0) */
114794 /* 0 */ "DELETE FROM %Q.'%q_content' WHERE rowid = ?",
114795 /* 1 */ "SELECT NOT EXISTS(SELECT docid FROM %Q.'%q_content' WHERE rowid!=?)",
114801 /* 7 */ "SELECT * FROM %Q.'%q_content' WHERE rowid=?",
115240 ** apVal[1] rowid
115245 ** apVal[p->nColumn+3] Hidden "docid" column (alias for rowid)
115269 ** a value for the "rowid" field, for the "docid" field, or for both.
115270 ** Which is a problem, since "rowid" and "docid" are aliases for the
115273 ** INSERT INTO fts3tbl(rowid, docid) VALUES(1, 2);
115276 ** for both docid and some other rowid alias.
115282 /* A rowid/docid conflict. */
117383 sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */
117388 sqlite3_int64 iRemove = 0; /* Rowid removed by UPDATE or DELETE */
119147 ** CREATE TABLE %_rowid(rowid INTEGER PRIMARY KEY, nodeno INTEGER)
119153 ** table that maps from the entries rowid to the id of the node that it
119170 ** of 4-byte coordinates. For leaf nodes the integer is the rowid
119316 ** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates).
119777 ** node pNode. If pNode is a leaf node, this is a rowid. If it is
120212 /* This "scan" is a direct lookup by rowid. There is no next entry. */
120281 ** rowid iRowid. If successful, set *ppLeaf to point to the node and
120367 /* Special case - lookup by rowid. */
120443 ** 1 Unused Direct lookup by rowid.
120484 /* We have an equality constraint on the rowid. Use strategy 1. */
120494 /* This strategy involves a two rowid lookups on an B-Tree structures
120496 rowid lookup (for which
121449 ** rowid of the row to delete, which can be used to find the leaf on which
121761 ** Select a currently unused rowid for a new r-tree record.
121789 /* If azData[0] is not an SQL NULL value, it is the rowid of a
121794 i64 iDelete; /* The rowid to delete */
121904 /* Figure out the rowid of the new row. */
121999 "SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = :1",
122001 "DELETE FROM '%q'.'%q_rowid' WHERE rowid = :1",
122016 "CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY, nodeno INTEGER);"
122229 ** list, containing the 8-byte rowid/pageno followed by the