Lines Matching defs:rowid

3441 ** integer key called the [ROWID | "rowid"]. ^The rowid is always available
3445 ** is another alias for the rowid.
3447 ** ^The sqlite3_last_insert_rowid(D) interface usually returns the [rowid] of
3448 ** the most recent successful [INSERT] into a rowid table or [virtual table]
3450 ** recorded. ^If no successful [INSERT]s into rowid tables have ever occurred
3458 ** Some virtual table implementations may INSERT rows into rowid tables as
3460 ** to disk). In this case subsequent calls to this function return the rowid
3462 ** unintuitive results. Virtual table implementations that do write to rowid
3464 ** rowid value using [sqlite3_set_last_insert_rowid()] before returning
3468 ** return the [rowid] of the inserted row as long as the trigger is
3490 ** function is running and thus changes the last insert [rowid],
3493 ** last insert [rowid].
7390 ** a [rowid table].
7395 ** row is updated, inserted or deleted in a rowid table.
7403 ** ^The final callback parameter is the [rowid] of the row.
7404 ** ^In the case of an update, this is the [rowid] after the update takes place.
7638 ** ^If the specified column is "rowid", "oid" or "_rowid_" and the table
7643 ** for the [rowid] are set as follows:
8216 ** SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
8305 ** by the rowid value passed as the second argument. Only the row can be
10551 ** For an UPDATE or DELETE operation on a [rowid table], the sixth
10552 ** parameter passed to the preupdate callback is the initial [rowid] of the
10553 ** row being modified or deleted. For an INSERT operation on a rowid table,
10555 ** parameter is undefined. For an INSERT or UPDATE on a rowid table the
10556 ** seventh parameter is the final rowid value of the row being inserted
10559 ** DELETE operations on rowid tables.
10609 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
11224 ** PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) or not. The PRIMARY
12880 ** Returns the rowid of the current row.
12889 ** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid
15395 ** Table btrees (used for rowid tables) contain an integer rowid used as
15827 #define OP_NewRowid 122 /* synopsis: r[P2]=rowid */
15835 #define OP_Rowid 130 /* synopsis: r[P2]=rowid */
15841 #define OP_DeferredSeek 136 /* synopsis: Move P3 to P1.rowid if needed */
15842 #define OP_IdxRowid 137 /* synopsis: r[P2]=rowid */
17665 i16 iPKey; /* If not negative, use aCol[iPKey] as the rowid */
17709 #define TF_WithoutRowid 0x0080 /* No rowid. PRIMARY KEY is the key */
17712 #define TF_NoVisibleRowid 0x0200 /* No user-visible "rowid" column */
17751 /* Does the table have a rowid */
17852 ** for the rowid at the end.
18006 #define XN_ROWID (-1) /* Indexed column is the rowid */
18210 ynVar iColumn; /* TK_COLUMN: column index. -1 for rowid.
18772 #define SRT_Fifo 8 /* Store result as data with an automatic rowid */
18782 #define SRT_Table 14 /* Store result as data with an automatic rowid */
18783 #define SRT_Upfrom 15 /* Store result as data with rowid */
18812 int regCtr; /* Memory register holding the rowid counter */
18920 int regRowid; /* Register holding rowid of CREATE TABLE entry */
20509 #define IN_INDEX_ROWID 1 /* Search the rowid of the table */
21067 u8 isTable; /* True for rowid tables. False for indexes */
21158 i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */
30416 ** read the rowid field.
33600 /* 122 */ "NewRowid" OpHelp("r[P2]=rowid"),
33608 /* 130 */ "Rowid" OpHelp("r[P2]=rowid"),
33614 /* 136 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
33615 /* 137 */ "IdxRowid" OpHelp("r[P2]=rowid"),
51500 ** can be intermixed with tests to see if a given rowid has been
51693 SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet *p, i64 rowid){
51702 pEntry->v = rowid;
51706 if( rowid<=pLast->v ){ /*OPTIMIZATION-IF-FALSE*/
65496 ** rowid iRow is being replaced or deleted. In this case invalidate
65502 i64 iRow, /* The rowid that might be changing */
65617 ** (the rowid) is stored in pCur->nKey and pCur->pKey is left set to
65629 /* Only the rowid is required for a table btree */
69568 ** Return the value of the integer key or "rowid" for a table btree.
73612 ** For a table btree (used for rowid tables), only the pX.nKey value of
73614 ** rowid or INTEGER PRIMARY KEY of the row. The pX.nData,pData,nZero fields
73922 ** parameter iKey is used as the rowid value when the record is copied
74225 ** BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys
77801 int nCol = pIdx->nColumn; /* Number of index columns including rowid */
79956 sqlite3_str_appendf(p, "rowid");
80341 int *piPc, /* IN/OUT: Current rowid. Overwritten with next rowid */
80381 /* The rowid is small enough that we are still in the
83273 ** Read the rowid (the last field in the record) and store it in *rowid.
83279 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){
83283 u32 typeRowid; /* Serial type of the rowid */
83284 u32 lenRowid; /* Size of the rowid */
83335 *rowid = v.u.i;
83353 ** pUnpacked is either created without a rowid or is truncated so that it
83354 ** omits the rowid at the end. The rowid at the end of the index entry
83356 ** of the keys prior to the final rowid, not the entire key.
90179 i64 iKey; /* The rowid we are to seek to */
90733 ** contain a record with rowid P3 then jump immediately to P2.
90735 ** a record with rowid P3 then
90756 ** keys). P3 is an integer rowid. If P1 does not contain a record with
90757 ** rowid P3 then jump immediately to P2. Or, if P2 is 0, raise an
90758 ** SQLITE_CORRUPT error. If P1 does contain a record with rowid P3 then
90855 ** Synopsis: r[P2]=rowid
90857 ** Get a new integer record number (a.k.a "rowid") used as the key to a table.
90870 i64 v; /* The new rowid */
90871 VdbeCursor *pC; /* Cursor of table to get the new rowid */
90875 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
90889 /* The next rowid or record number (different terms for the same
90892 ** First we attempt to find the largest existing rowid and add one
90893 ** to that. But if the largest existing rowid is already the maximum
90897 ** The second algorithm is to select a rowid at random and see if
90899 ** succeeded. If the random rowid does exist, we select a new one
90967 assert( pOp->p3==0 ); /* We cannot be in random rowid mode if this is
91002 ** then rowid is stored for subsequent return by the
91116 ** tables, register P3 contains the rowid to use with the new record in
91170 ** of the memory cell that contains the value that the rowid of the row will
91195 ** OP_Delete will have also set the pC->movetoTarget field to the rowid of
91206 ** VdbeCursor.movetoTarget to the current rowid. */
91413 ** Synopsis: r[P2]=rowid
91887 ** Synopsis: Move P3 to P1.rowid if needed
91906 ** Synopsis: r[P2]=rowid
91910 ** the rowid of the table entry to which this index entry points.
91918 i64 rowid; /* Rowid that P1 current points to */
91939 rowid = 0; /* Not needed. Only used to silence a warning. */
91940 rc = sqlite3VdbeIdxRowid(db, pC->uc.pCursor, &rowid);
91952 pTabCur->movetoTarget = rowid;
91961 pOut->u.i = rowid;
92236 ** P1>1. The P3 argument must be 1 (BTREE_INTKEY) for a rowid table
92318 "SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid",
93707 ** is the rowid of a row to delete. If argv[0] is NULL then no
93708 ** deletion occurs. The argv[1] element is the rowid of the new
93710 ** rowid for itself. The subsequent elements in the array are
93713 ** If P2==1 then no insert is performed. argv[0] is the rowid of
93718 ** is set to the value of the rowid for the row just inserted.
93728 sqlite_int64 rowid;
93757 rc = pModule->xUpdate(pVtab, nArg, apArg, &rowid);
93762 db->lastRowid = rowid;
94338 zErr = sqlite3MPrintf(p->db, "no such rowid: %lld", iRow);
94403 sqlite3ErrorMsg(&sParse, "cannot open table without rowid: %s", zTable);
94502 /* blobSeekToRow() will initialize r[1] to the desired rowid */
94503 {OP_NotExists, 0, 5, 1}, /* 2: Seek the cursor to rowid=r[1] */
97463 ** the comparison, ignore the rowid field at the end of each record.
97548 int iRowid; /* The rowid of the output table */
97811 ** Return the rowid for the current row. In this implementation, the
97812 ** rowid is the same as the output value.
98976 /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */
99410 /* The special operator TK_ROW means use the rowid for the first
100461 ** Expr.iColumn The column index in X.Y. -1 for the rowid.
103262 /* The "x IN (SELECT rowid FROM table)" case */
103372 } /* End if not an rowid index */
104274 ** is called. If iColumn<0 then code is generated that extracts the rowid.
104515 VdbeComment((v,"%s.rowid",pTab->zName));
104558 ** 0-(pParse->iSelfTab). The rowid (if any) is in a register
105023 ** read the rowid field.
105026 ** parameter is set to 0 for an old.rowid reference, or to (i+1)
105028 ** i is the index of the column. For a new.rowid reference, p1 is
105039 ** p1==0 -> old.rowid p1==3 -> new.rowid
105056 (pExpr->iColumn<0 ? "rowid" : pExpr->y.pTab->aCol[iCol].zName)
109053 int nCol; /* Number of columns in index + pk/rowid */
109054 int nKeyCol; /* Number of index columns w/o the pk/rowid */
109148 ** N: The number of columns in the index including the rowid/pk (note 1)
109149 ** K: The number of columns in the index excluding the rowid/pk.
109157 ** For indexes on ordinary rowid tables, N==K+1. But for indexes on
109381 /* The "rows less-than" for the rowid column must be greater than that
109557 #define STAT_GET_ROWID 1 /* "rowid" column of stat[34] entry */
109734 VdbeComment((v,"%s.rowid",pIdx->zName));
109874 ** regRowid = idx(rowid)
109883 ** the regPrev array and a trailing rowid (the rowid slot is required
109896 ** (1) the number of columns in the index including the rowid
109898 ** (2) the number of columns in the key without the rowid/pk
109990 ** regRowid = idx(rowid) // STAT4 only
112807 ** The rowid for the new entry is left in register pParse->regRowid.
112809 ** The rowid and root page number values are needed by the code that
113222 ** then we will try to use that column as the rowid. Set the Table.iPKey
113649 ** not a rowid or expression.
113714 ** are appropriate for a WITHOUT ROWID table instead of a rowid table.
113729 ** (6) Replace the rowid tail on all automatically generated UNIQUE
113823 ** the final rowid column into one or more columns of the PRIMARY KEY.
114194 " WHERE rowid=#%d",
115509 ** normal tables (when pPk==0) this will be the rowid.
116603 ** Code an OP_Halt due to non-unique rowid.
116608 Table *pTab /* The table with the non-unique rowid */
116617 zMsg = sqlite3MPrintf(pParse->db, "%s.rowid", pTab->zName);
117605 Expr *pInClause = NULL; /* WHERE rowid IN ( select ) */
117607 SrcList *pSelectSrc = NULL; /* SELECT rowid FROM x ... (dup of pSrc) */
117631 ** DELETE FROM table_a WHERE rowid IN (
117632 ** SELECT rowid FROM table_a WHERE col1=1 ORDER BY col2 LIMIT 1 OFFSET 1
117679 /* now generate the new WHERE rowid IN clause for the DELETE/UDPATE */
117893 /* For a rowid table, initialize the RowSet to an empty set */
117911 /* Construct a query to find the rowid or primary key for every row
117934 /* Extract the rowid or primary key for the current row */
117948 /* For ONEPASS, no need to store the rowid/primary-key. There is only
117972 /* Add the rowid of the row to be deleted to the RowSet */
117973 nKey = 1; /* OP_DeferredSeek always uses a single rowid */
118060 ** maximum rowid counter values recorded while inserting into
118107 ** in the case of a rowid table, or the PRIMARY KEY index in the case
118181 ** avoid copying the contents of the rowid register. */
118281 ** for rowid tables or to the primary key index for WITHOUT ROWID
118305 Index *pPk; /* PRIMARY KEY index, or NULL for rowid tables */
121181 ** for pTab. regBase itself holds the rowid. regBase+1 holds the first
121320 ** $current_rowid!=rowid
121323 ** The first form is used for rowid tables. The second form is used
121489 ** is set to -1). If the rowid column is modified by the UPDATE statement
121499 int bChngRowid /* True if rowid is modified by this update */
121516 ** is set to -1). If the rowid column is modified by the UPDATE statement
121571 ** rowid of the row being deleted, followed by each of the column values
121590 int bChngRowid /* True if rowid is UPDATEd */
121820 ** UPDATE statement modifies the rowid fields of the table.
121840 int chngRowid /* True for UPDATE that affects rowid */
122102 int bChngRowid /* True if rowid is UPDATEd */
122235 ** rowid that appears as the last column in every index.
122490 ** that holds the maximum rowid. Return zero if pTab is not an AUTOINCREMENT
122504 ** (3) The rowid in sqlite_sequence of pTab
122515 int memId = 0; /* Register holding maximum rowid */
122525 ** rowid table with exactly two columns.
122549 pInfo->regCtr = ++pToplevel->nMem; /* Max rowid register */
122565 int memId; /* Register holding max rowid */
122615 ** Update the maximum rowid for an autoincrement calculation.
122618 ** new rowid that is about to be inserted. If that new rowid is
122619 ** larger than the maximum rowid in the memId memory cell, then the
122630 ** maximum rowid values back into the sqlite_sequence register.
122826 int regIns; /* Block of regs holding rowid+data being inserted */
122827 int regRowid; /* registers holding insert rowid */
122928 /* Allocate a block registers to hold the rowid and the values
123212 ** SELECT, go ahead and copy the value into the rowid slot now, so that
123220 ** Only ordinary columns are computed in this loop. The rowid
123222 ** computed after the rowid since they might depend on the value
123223 ** of the rowid.
123233 ** using the rowid. So put a NULL in the IPK slot of the record to avoid
123302 ** not happened yet) so we substitute a rowid of -1
123359 /* Compute the new rowid */
123479 ** maximum rowid counter values recorded while inserting into
123551 ** changing columns (or the rowid if it is changing). In other words,
123563 int chngRowid /* True if UPDATE changes the rowid */
123653 ** that regNewData points to) will contain the new rowid, or NULL in the
123664 ** rowid for a normal table or the PRIMARY KEY for a WITHOUT ROWID table)
123668 ** For an INSERT, the pkChng boolean indicates whether or not the rowid
123670 ** is zero, it means that the either rowid is computed automatically or
123671 ** that the table is a WITHOUT ROWID table and has no rowid. On an INSERT,
123673 ** value for either the rowid column or its INTEGER PRIMARY KEY alias.
123682 ** main table, if pTab is a rowid table, and stores that record in the
123692 ** inserting or updating a rowid table, or the cursor for the PRIMARY KEY
123745 u8 pkChng, /* Non-zero if the rowid or PRIMARY KEY changed */
123786 ** normal rowid tables. nPkField is the number of key fields in the
123787 ** pPk index or 1 for a rowid table. In other words, nPkField is the
123965 ** (A) The rowid constraint
124078 /* If rowid is changing, make sure the new rowid does not previously
124084 /* Figure out what action to take in case of a rowid collision */
124110 /* If the response to a rowid conflict is REPLACE but the response
124112 ** to defer the running of the rowid conflict checking until after
124124 /* pkChng!=0 does not mean that the rowid has changed, only that
124125 ** it might have changed. Skip the conflict logic below if the rowid
124132 /* Check to see if the new rowid already exists in the table. Skip
124171 ** REPLACE INTO t(rowid) VALUES($newrowid)
124278 VdbeComment((v, "rowid"));
124360 /* Conflict only if the rowid of the existing index entry
124361 ** is different from old-rowid */
124613 ** rowid and the content to be inserted.
124695 ** Use iBase as the first cursor (either the *piDataCur for rowid tables
124699 ** For a rowid table, *piDataCur will be exactly one less than *piIdxCur.
124867 int regData, regRowid; /* Registers holding data and rowid */
125092 ** (If the destination is not initially empty, the rowid fields
127034 /* 38 */ "rowid",
129845 sqlite_int64 iRowid; /* Current rowid */
130501 "SELECT*FROM\"%w\".%s ORDER BY rowid",
132894 ** rowid of the sub-select or view. This expression is legal (see
132912 zOrigCol = "rowid";
133084 zCol = "rowid";
133171 zName = iCol>=0 ? pTab->aCol[iCol].zName : "rowid";
139795 ** reg+0 OLD.rowid
139799 ** reg+N+1 NEW.rowid
139876 ** It is not possible to determine if the old.rowid or new.rowid column is
139949 Expr *pRowidExpr, /* Expression used to recompute the rowid */
140015 ** being updated. chngRowid will be true if the rowid of the table is
140022 int chngRowid /* true if the rowid is being updated */
140025 assert( iIdxCol!=XN_ROWID ); /* Cannot index rowid */
140045 ** being updated. chngRowid will be true if the rowid of the table is
140051 int chngRowid /* true if the rowid is being updated */
140103 ** is its rowid. For a virtual table, the results are written to iEph as
140105 ** rowid value in <other-columns> is used as the integer key, and the
140234 int iRowidExpr = -1; /* Index of "rowid=" (or IPK) assignment in pChanges */
140262 int regOldRowid = 0; /* The old rowid */
140263 int regNewRowid = 0; /* The new rowid */
140668 /* Read the rowid of the current row of the WHERE scan. In ONEPASS_OFF
140669 ** mode, write the rowid into the FIFO. In either of the one-pass modes,
140773 /* If the rowid value will change, set register regNewRowid to
140774 ** contain the new value. If the rowid is not being modified,
140952 /* If changing the rowid value, or if there are foreign key constraints
141023 ** maximum rowid counter values recorded while inserting into
141073 ** (A) The original rowid of that row.
141074 ** (B) The revised rowid for the row.
141089 Expr *pRowid, /* Expression used to recompute the rowid */
141103 int regRowid; /* Register for ephem table rowid */
141373 /* Check to see if the conflict target matches the rowid. */
141382 /* The conflict-target is the rowid of the primary table */
142446 ** The VM register number pParse->regRowid holds the rowid of an
142454 "WHERE rowid=#%d",
143938 if( i==XN_ROWID ) return "rowid";
144098 zRangeOp = ">? AND rowid<";
144106 " USING INTEGER PRIMARY KEY (rowid%s?)",zRangeOp);
144937 ** a rowid value just read from cursor iIdxCur, open on index pIdx. This
144939 ** rowid stored in register iRowid.
145380 ** we reference multiple rows using a "rowid IN (...)"
145940 ** RowSetTest are such that the rowid of the current row is inserted
145945 ** RowSetTest # Insert rowid into rowset
145973 int regRowid = 0; /* Register holding rowid */
146107 ** rowid (or PRIMARY KEY) for the current row so that the same
151272 ** variable sPk to represent the rowid primary key index. Make this
152075 ** Any WhereLoop with an WHERE_COLUMN_EQ constraint on the rowid is one-row.
152087 ** The rowid for a table is always UNIQUE and NOT NULL so whenever the
152088 ** rowid appears in the ORDER BY clause, the corresponding WhereLoop is
152871 /* TUNING: Cost of a rowid lookup is 10 */
155710 int regCRowid = 0; /* Current rowid value */
155712 int regRowid = 0; /* AggStep rowid value */
156748 ** samve values in record form, and the rowid used to insert said record
160613 if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
167797 ** 1. The specified column name was rowid", "oid" or "_rowid_"
170013 #define FTS3_DOCID_SEARCH 1 /* Lookup by rowid on %_content table */
170911 fts3Appendf(pRc, &zRet, "rowid");
171610 ** 1. Direct lookup by rowid or docid.
171654 /* A direct lookup on the rowid or docid column. Assign a cost of 1.0. */
171665 ** rowid/docid lookup, prefer the MATCH strategy. This is done even
171666 ** though the rowid/docid lookup is faster than a MATCH query, selecting
171700 /* If using a docid=? or rowid=? strategy, set the UNIQUE flag. */
171721 /* Regardless of the strategy selected, FTS can deliver rows in rowid (or
171810 ** "SELECT <columns> FROM %_content WHERE rowid = ?"
171824 zSql = sqlite3_mprintf("SELECT %s WHERE rowid = ?", p->zReadExprlist);
173314 sqlite3_value *pCons = 0; /* The MATCH or rowid constraint, if any */
173388 "SELECT %s WHERE rowid BETWEEN %lld AND %lld ORDER BY rowid %s",
173393 zSql = sqlite3_mprintf("SELECT %s ORDER BY rowid %s",
173433 ** retrieve the rowid for the current row of the result set. fts3
173434 ** exposes %_content.docid as the rowid for the virtual table. The
173435 ** rowid should be written to *pRowid.
173512 sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */
176141 sqlite3_int64 iRowid; /* Current rowid */
176377 /* Increment our pretend rowid value. */
176608 ** xRowid - Return the current rowid for the cursor.
179832 int iRowid; /* Current 'rowid' value */
180174 ** xRowid - Return the current rowid for the cursor.
180519 /* 0 */ "DELETE FROM %Q.'%q_content' WHERE rowid = ?",
180520 /* 1 */ "SELECT NOT EXISTS(SELECT docid FROM %Q.'%q_content' WHERE rowid!=?)",
180526 /* 7 */ "SELECT %s WHERE rowid=?",
181172 ** apVal[1] rowid
181177 ** apVal[p->nColumn+3] Hidden "docid" column (alias for rowid)
181218 ** a value for the "rowid" field, for the "docid" field, or for both.
181219 ** Which is a problem, since "rowid" and "docid" are aliases for the
181222 ** INSERT INTO fts3tbl(rowid, docid) VALUES(1, 2);
181225 ** for both docid and some other rowid alias.
181231 /* A rowid/docid conflict. */
185028 ** exists, is stored in the rowid==1 row of the %_stat table.
185808 ** SQLite value pRowid contains the rowid of a row that may or may not be
185865 sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */
185913 /* If this is an INSERT operation, or an UPDATE that modifies the rowid
185923 /* Find the value object that holds the new rowid value. */
185933 /* The new rowid is not NULL (in this case the rowid will be
185936 ** rowid column. So if the conflict mode is REPLACE, then delete any
185937 ** existing row with rowid=pNewRowid.
185940 ** the %_content table. If we hit the duplicate rowid constraint (or any
190613 u32 iRowid; /* The rowid */
190890 /* Return the current rowid value */
191223 ** CREATE TABLE %_rowid(rowid INTEGER PRIMARY KEY, nodeno INTEGER, ...)
191229 ** table that maps from the entries rowid to the id of the node that it
191247 ** of 4-byte coordinates. For leaf nodes the integer is the rowid
191438 ** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates).
192109 ** node pNode. If pNode is a leaf node, this is a rowid. If it is
192951 ** rowid iRowid. If successful, set *ppLeaf to point to the node and
192958 i64 iRowid, /* The rowid searching for */
193031 /* Special case - lookup by rowid. */
193135 ** 1 Unused Direct lookup by rowid.
193174 ** is, do not consider the lookup-by-rowid plan as using such a plan would
193190 /* We have an equality constraint on the rowid. Use strategy 1. */
193200 /* This strategy involves a two rowid lookups on an B-Tree structures
193202 ** considered almost as quick as a direct rowid lookup (for which
193887 ** rowid of the row to delete, which can be used to find the leaf on which
194200 ** Select a currently unused rowid for a new r-tree record.
194213 ** Remove the entry with rowid=iDelete from the r-tree structure.
194390 int bHaveRowid = 0; /* Set to 1 after new rowid is determined */
194406 ** 1. A duplicate rowid value, or
194451 /* If a rowid value was supplied, check if it is already present in
194475 /* If aData[0] is not an SQL NULL value, it is the rowid of a
194491 /* Figure out the rowid of the new row. */
194644 "node", "parent", "rowid"
194696 "SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1",
194698 "DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1",
194716 "CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno",
194759 zFormat = "INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)"
194760 "ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno";
194772 "SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1",
194789 sqlite3_str_appendf(p, " WHERE rowid=?1");
195031 ** list, containing the 8-byte rowid/pageno followed by the
195237 ** CREATE TABLE %_rowid(rowid INTEGER PRIMARY KEY, nodeno INTEGER, ...)
195253 "SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1"
195517 ** table corresponding to the cell's rowid value that
196898 ** 1 rowid lookup
196924 /* Special case - lookup by rowid. */
197030 ** 1 "rowid" Direct lookup by rowid.
197060 pIdxInfo->idxStr = "rowid";
197127 ** argv[0] = the rowid to be deleted
197132 ** argv[1] = rowid to insert, or an SQL NULL to select automatically
197138 ** argv[0] = rowid to modify. Never NULL
197139 ** argv[1] = rowid after the change. Never NULL
197152 i64 oldRowid; /* The old rowid */
197154 i64 newRowid; /* The new rowid */
197188 /* If a rowid value was supplied, check if it is already present in
197205 /* If aData[0] is not an SQL NULL value, it is the rowid of a
198538 ** has no PRIMARY KEY, affected rows must be identified by rowid.
198586 ** key column - "rowid". Virtual tables for which the "rowid" column does
198680 ** UPDATE ft1 SET b = 'usa' WHERE rowid = 12;
198684 ** table in "rowid" order is roughly the same as reading them sorted by
199285 ** 1: Table has an implicit rowid.
200133 ** RBU_PK_NONE: Table has an implicit rowid.
200463 ** updating a table (not an index). The table may be a rowid table or
200467 ** rows from the source table. For a rowid table, the WHERE clause
200482 int bRowid, /* True for a rowid table */
202365 rbuIsVacuum(p) ? "rowid" : "rbu_rowid"
206938 sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
207383 ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
211327 ** Returns the rowid of the current row.
211336 ** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid
211845 /* Name of rank and rowid columns */
211847 #define FTS5_ROWID_NAME "rowid"
211922 ** the string "rowid" otherwise. This text is not quoted - if it is
212138 #define FTS5INDEX_QUERY_DESC 0x0002 /* Docs in descending rowid order */
212400 #define FTS5_STMT_SCAN_ASC 0 /* SELECT rowid, * FROM ... ORDER BY 1 ASC */
212401 #define FTS5_STMT_SCAN_DESC 1 /* SELECT rowid, * FROM ... ORDER BY 1 DESC */
212402 #define FTS5_STMT_LOOKUP 2 /* SELECT rowid, * FROM ... WHERE rowid=? */
212481 ** // The document with rowid iRowid matches the expression!
215851 pRet->zContentRowid = sqlite3Fts5Strndup(&rc, "rowid", -1);
216238 int bDesc; /* Iterate in descending rowid order */
216261 i64 iRowid; /* Current rowid */
216620 ** Argument pTerm must be a synonym iterator. Return the current rowid
216721 ** pointing to the same rowid when this function is called. This function
216722 ** checks if the current rowid really is a match, and if so populates
216727 ** otherwise. It is not considered an error code if the current rowid is
216969 int bDesc, /* True if iterator is "rowid DESC" */
216970 i64 *piLast, /* IN/OUT: Lastest rowid seen so far */
216995 int bDesc, /* True if iterator is "rowid DESC" */
216996 i64 *piLast, /* IN/OUT: Lastest rowid seen so far */
217211 ** point to the same rowid, and if not, advances them until they do.
217226 i64 iLast; /* Lastest rowid any iterator points to */
217228 int bMatch; /* True if all terms are at the same rowid */
217238 /* Initialize iLast, the "lastest" rowid any iterator points to. If the
217240 ** the maximum rowid. Or, if the iterator is "ORDER BY rowid DESC", then it
217241 ** means the minimum rowid. */
217303 /* Find the firstest rowid any synonym points to. */
217307 ** is valid - each iterator that points to a rowid before iFrom. */
217484 ** rowid iLast. So if it is not at exactly iLast, pChild->iRowid is the
217485 ** new lastest rowid seen so far. */
217665 ** parameter is passed a non-zero value, iteration is in descending rowid
217668 ** If iterating in ascending rowid order (bDesc==0), the first document
217669 ** visited is that with the smallest rowid that is larger than or equal
217671 ** then the first document visited must have a rowid smaller than or
217685 /* If not at EOF but the current rowid occurs earlier than iFirst in
219296 ** * Size of previous position list and rowid, as a 4 byte
219300 ** Offset of last rowid written to data area. Relative to first byte of
219546 /* Add the first rowid field to the hash-entry */
219562 ** + 9 bytes for a new rowid,
219585 /* If this is a new rowid, append the 4-byte size field for the previous
219586 ** entry, and the new rowid for this entry. */
219844 ** records that contain a copy of the first rowid on each page spanned by
219928 ** varint: first rowid
219931 ** varint: rowid delta (always > 0)
219958 ** * The byte offset of the first rowid on the page, if it exists
219976 ** + if the first rowid on a page occurs before the first term, it
219979 ** varint: first rowid
219998 ** * First rowid on page indicated by previous field. As a varint.
220001 ** positive delta if the termless page contains at least one rowid,
220011 ** * Copy of first rowid on page indicated by previous field. As a varint.
220013 ** * A list of delta-encoded varints - the first rowid on each subsequent
220031 ** The rowid for each segment leaf is found by passing the segment id and
220162 i64 iPrev; /* Previous rowid value written to page */
220168 i64 iPrevRowid; /* Previous rowid written to current leaf */
220169 u8 bFirstRowidInDoclist; /* True if next rowid is first in doclist */
220170 u8 bFirstRowidInPage; /* True if next rowid is first in page */
220191 ** Object for iterating through a single segment, visiting each term/rowid
220203 ** rowid field of the current entry. Usually this is the size field of the
220204 ** position list data. The exception is if the rowid for the current entry
220223 ** it is set, iterate through rowid in descending order instead of the
220229 ** For each rowid on the page corresponding to the current term, the
220248 ** is the offset of the first rowid in the current doclist. */
220258 int *aRowidOffset; /* Array of offset to rowid fields */
220264 i64 iRowid; /* Current rowid */
220293 ** visiting each term/rowid pair in the merged data.
220304 ** points to the smaller term/rowid combination. Iterators at EOF are
220328 i64 iSwitchRowid; /* Firstest rowid of other than aFirst[1] */
220355 i64 iRowid; /* First rowid on leaf iLeafPgno */
221142 ** points to the first rowid in the doclist-index.
221447 ** Fts5SegIter.rowid
221543 ** the position-list size field for the first relevant rowid on the page.
221544 ** Fts5SegIter.rowid is set, but nPos and bDel are not.
221547 ** relevant rowid on the page and, if necessary, initializes the
221550 ** byte of the position list content associated with said rowid.
221619 ** thing on the page - i.e. the first rowid is on the following page.
221901 ** Iterator pIter currently points to the first rowid in a doclist. This
221918 ** position-list content for the current rowid. Back it up so that it
221929 /* If this condition is true then the largest rowid for the current
221931 ** see where said rowid really is. */
221936 /* The last rowid in the doclist may not be on the current page. Search
221937 ** forward to find the page containing the last rowid. */
221956 /* If pLast is NULL at this point, then the last rowid for this doclist
221959 ** field associated with the first relevant rowid on the page.
221962 ** rowid. In this case configure the iterator so that it points to the
221963 ** first rowid on this page.
221986 ** Iterator pIter currently points to the first rowid of a doclist.
222468 ** Move the seg-iter so that it points to the first rowid on page iLeafPgno.
222506 ** past rowid iFrom. Regardless of the value of iFrom, the iterator is
222594 ** points to the same term though - just a different rowid. This function
223182 ** The iterator initially points to the first term/rowid entry in the
223287 int bDesc, /* True for descending rowid order */
223332 ** Return the rowid of the entry that the iterator currently points
223623 ** a copy of iRowid (which will become the first rowid on the next
223626 ** also push its first rowid upwards. */
223637 /* This was the root node. Push its first rowid up to the new root. */
223794 ** Append a rowid and position-list size field to the writers output.
223808 /* If this is to be the first rowid written to the page, set the
223809 ** rowid-pointer in the page-header. Also append a value to the dlidx
223816 /* Write the rowid. */
224106 /* Append the rowid to the output */
224363 fts5PutU16(&pBuf->p[0], (u16)pBuf->n); /* first rowid on page */
224660 i64 *piLastRowid, /* IN/OUT: Previous rowid written (if any) */
224802 ** a linked-list starting at pHead in ascending order of rowid. Avoid
224818 ** first rowid in one input is a large negative number, and the first in
224929 int bDesc, /* True for "ORDER BY rowid DESC" */
225062 ** to the document with rowid iRowid.
225277 ** Open a new iterator to iterate though all rowid that match the
225362 ** Move to the next matching rowid.
225372 ** Move to the next matching term/rowid. Used by the fts5vocab module.
225394 ** Move to the next matching rowid that occurs at or after iMatch. The
225396 ** in ascending or descending rowid order.
225537 ** Instead, it tests that the same set of pgno/rowid combinations are
225591 i64 rowid = pIter->iRowid;
225594 cksum ^= sqlite3Fts5IndexEntryCksum(rowid, 0, 0, iIdx, z, n);
225603 cksum ^= sqlite3Fts5IndexEntryCksum(rowid, iCol, iOff, iIdx, z, n);
225841 ** is also a rowid pointer within the leaf page header, it points to a
225847 int iRowidOff; /* Offset of first rowid on leaf */
225887 /* Check any rowid-less pages that occur before the current leaf. */
225899 ** contain the rowid suggested by the same. */
226038 ** Decode a segment-data rowid from the %_data table. This function is
226648 ** SELECT rowid, <fts> FROM <fts> ORDER BY +rank;
226657 i64 iRowid; /* Current rowid */
226677 ** <tbl> MATCH <expr> AND rowid BETWEEN $iFirstRowid AND $iLastRowid
226679 ** If the cursor iterates in descending order of rowid, iFirstRowid
226680 ** is the upper limit (i.e. the "first" rowid visited) and iLastRowid
226691 int bDesc; /* True for "ORDER BY rowid DESC" queries */
226725 #define FTS5_BI_ROWID_EQ 0x0004 /* rowid == ? */
226726 #define FTS5_BI_ROWID_LE 0x0008 /* rowid <= ? */
226727 #define FTS5_BI_ROWID_GE 0x0010 /* rowid >= ? */
226967 #define FTS5_PLAN_ROWID 6 /* (rowid = ?) */
227009 ** 4. An == constraint against the rowid column.
227010 ** 5. A < or <= constraint against the rowid column.
227011 ** 6. A > or >= constraint against the rowid column.
227016 ** 6. ORDER BY rowid [ASC|DESC]
227034 ** Equality constraint against the rowid: "="
227035 ** A < or <= against the rowid: "<"
227036 ** A > or >= against the rowid: ">"
227050 ** * One rowid range constraint: cost=750.0
227051 ** * Both rowid range constraints: cost=500.0
227052 ** * An == rowid constraint: cost=100.0
227057 ** * One rowid range constraint: cost=750000.0
227058 ** * Both rowid range constraints: cost=250000.0
227059 ** * An == rowid constraint: cost=10.0
227373 ** is using. Then attempt to move the cursor to a rowid equal to or laster
227374 ** (in the cursors sort order - ASC or DESC) than the current rowid.
227376 ** If the new rowid is not equal to the old, set output parameter *pbSkip
227524 "SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s",
227718 ** 2. A by-rowid lookup.
227732 int bDesc; /* True if ORDER BY [rank|rowid] DESC */
227735 sqlite3_value *pRowidEq = 0; /* rowid = ? expression (or NULL) */
227736 sqlite3_value *pRowidLe = 0; /* rowid <= ? expression (or NULL) */
227737 sqlite3_value *pRowidGe = 0; /* rowid >= ? expression (or NULL) */
227833 /* Set the cursor upper and lower rowid limits. Only some strategies
227836 ** on the rowid field. */
227887 ** by rowid (ePlan==FTS5_PLAN_ROWID). */
227919 ** Return the rowid that the cursor currently points to.
227935 ** retrieve the rowid for the current row of the result set. fts5
227936 ** exposes %_content.rowid as the rowid for the virtual table. The
227937 ** rowid should be written to *pRowid.
228122 ** A delete specifies a single argument - the rowid of the row to remove.
228126 ** 1. The "old" rowid, or NULL.
228127 ** 2. The "new" rowid.
228135 sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */
228171 ** any conflict on the rowid value must be detected before any
228175 ** 2) UPDATE (rowid not modified)
228176 ** 3) UPDATE (rowid modified)
228179 ** Cases 3 and 4 may violate the rowid constraint.
228224 i64 iOld = sqlite3_value_int64(apVal[0]); /* Old rowid */
228225 i64 iNew = sqlite3_value_int64(apVal[1]); /* New rowid */
229687 int bWithout, /* True for without rowid */
229828 ** If a row with rowid iDel is present in the %_content table, add the
230105 ** Allocate a new rowid. This is used for "external content" tables when
230106 ** a NULL value is inserted into the rowid column. The new rowid is allocated
230111 ** this case the user is required to provide a rowid explicitly.
230489 ** specified rowid and populates aCol[] with the results.
233204 Fts5IndexIter *pIter; /* Term/rowid iterator object */
233215 i64 rowid; /* This table's current rowid value */
233536 pCsr->rowid = 0;
233618 pCsr->rowid++;
233883 ** retrieve the rowid for the current row of the result set. The
233884 ** rowid should be written to *pRowid.
233891 *pRowid = pCsr->rowid;
233983 sqlite3_int64 iRowid; /* The rowid */
234124 ** Return the rowid for the current row. In this implementation, the
234125 ** rowid is the same as the output value.