recordCompare
int recordCompare(int i,
ISqlJetMemoryPointer cellKey)
throws SqlJetException
This function compares the two table rows or index records specified by
{nKey1, pKey1} and pPKey2. It returns a negative, zero or positive
integer if key1 is less than, equal to or greater than key2. The {nKey1,
pKey1} key must be a blob created by th OP_MakeRecord opcode of the VDBE.
The pPKey2 key must be a parsed key such as obtained from
sqlite3VdbeParseRecord.
Key1 and Key2 do not have to contain the same number of fields. The key
with fewer fields is usually compares less than the longer key. However
if the UNPACKED_INCRKEY flags in pPKey2 is set and the common prefixes
are equal, then key1 is less than key2. Or if the UNPACKED_MATCH_PREFIX
flag is set and the prefixes are equal, then the keys are considered to
be equal and the parts beyond the common prefix are ignored.
If the UNPACKED_IGNORE_ROWID flag is set, then the last byte of the
header of pKey1 is ignored. It is assumed that pKey1 is an index key, and
thus ends with a rowid value. The last byte of the header will therefore
be the serial type of the rowid: one of 1, 2, 3, 4, 5, 6, 8, or 9 - the
integer serial types. The serial type of the final rowid will always be a
single byte. By ignoring this last byte of the header, we force the
comparison to ignore the rowid at the end of key1.
- Parameters:
i
-
cellKey
-
- Returns:
- Throws:
SqlJetException