On Sun, 2005-05-22 at 10:19 +0200, Ludvig Strigeus wrote:
> Why not pass a single number to sqlite3VdbeRecordCompare instead, that
> just says how many fields to compare? That seems simpler. Why was the
> current design chosen.
> 
The reason for not passing in a nField value is that the BTree layer
which calls VdbeRecordCompare does not know about fields.  The BTree 
layer thinks of each row as a single BLOB - a sequence of bytes - with
no internal structure.  So the BTree layer has no idea how many fields
their are.

The first parameter to VdbeRecordCompare is a structure that defines
the format of the BLOBs being compared and *does* contain an nField
parameter.  But the rowid that appears at the end of index entries
is omitted from the count.  So nField is off by one. But perhaps you
can use it instead of a call to sqlite3VdbeSerialTypeLen().  If you
can get such a change to pass a full regression test, I will likely
check it in.

-- 
D. Richard Hipp <[EMAIL PROTECTED]>

Reply via email to