What if the last field of record1 is a NULL,
and the last field of record2 is an empty string.

Then there's no way to tell sqlite3VdbeRecordCompare that you don't
want to compare those items. If you set nKey1 and nKey2 to the last
offsets of each record, the last items will be compared too.

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.

/Ludvig

On 5/22/05, Dan Kennedy <[EMAIL PROTECTED]> wrote:
> 
> --- Ludvig Strigeus <[EMAIL PROTECTED]> wrote:
> > In sqlite3VdbeRecordCompare()
> >
> >     /* Read the serial types for the next element in each key. */
> >     idx1 += sqlite3GetVarint32(&aKey1[idx1], &serial_type1);f
> >     if( d1>=nKey1 && sqlite3VdbeSerialTypeLen(serial_type1)>0 ) break;
> >     idx2 += sqlite3GetVarint32(&aKey2[idx2], &serial_type2);
> >     if( d2>=nKey2 && sqlite3VdbeSerialTypeLen(serial_type2)>0 ) break;
> >
> > What is the purpose of the sqlite3VdbeSerialTypeLen(serial_type1)>0 here?
> 
> If the last field in the record is an SQL NULL, then d1==nKey1 and
> sqlite3VdbeSerialTypeLen() returns zero. In this case the record hasn't
> run out of fields, so we don't want to break out of that loop.
> 
> 
> 
> 
> Yahoo! Mail
> Stay connected, organized, and protected. Take the tour:
> http://tour.mail.yahoo.com/mailtour.html
> 
>

Reply via email to