Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a problem with querying non-primary key indexes for blob values.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 74aa63bb486f3ca2adb0152a6eb6598fb5885fdb
User & Date: dan 2013-03-01 19:29:21.628
Context
2013-03-02
09:09
Remove a couple of unused variables from sqltest.c. check-in: e423d6c4bc user: dan tags: trunk
2013-03-01
19:29
Fix a problem with querying non-primary key indexes for blob values. check-in: 74aa63bb48 user: dan tags: trunk
19:06
Add sqltest.c. Containing tests used to compare the performance of different sqlite versions. check-in: c9a4437853 user: dan tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/where.c.
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
    testcase( op==OP_Rewind );
    testcase( op==OP_Last );
    testcase( op==OP_SeekGt );
    testcase( op==OP_SeekGe );
    testcase( op==OP_SeekLe );
    testcase( op==OP_SeekLt );
    sqlite4VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase, nConstraint);
    if( pIdx->nColumn>nEq ){
      sqlite4VdbeChangeP5(v, OPFLAG_PARTIALKEY);
    }

    /* Set variable op to the instruction required to determine if the
    ** cursor is passed the end of the range. If the range is unbounded,
    ** then set op to OP_Noop. Nothing to do in this case.  */
    assert( (endEq==0 || endEq==1) );







|







4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
    testcase( op==OP_Rewind );
    testcase( op==OP_Last );
    testcase( op==OP_SeekGt );
    testcase( op==OP_SeekGe );
    testcase( op==OP_SeekLe );
    testcase( op==OP_SeekLt );
    sqlite4VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase, nConstraint);
    if( (pIdx->nColumn + (pIdx==pPk ? 0 : pPk->nColumn))>nEq ){
      sqlite4VdbeChangeP5(v, OPFLAG_PARTIALKEY);
    }

    /* Set variable op to the instruction required to determine if the
    ** cursor is passed the end of the range. If the range is unbounded,
    ** then set op to OP_Noop. Nothing to do in this case.  */
    assert( (endEq==0 || endEq==1) );
Changes to test/simple.test.
1457
1458
1459
1460
1461
1462
1463
1464
1465


















1466
1467
do_test 74.2 {
  for {set i 0} {$i<30} {incr i} {
    db close
    sqlite4 db test.db
    execsql "INSERT INTO t1 VALUES('k$i', randstr(500,500))"
  }
} {}
breakpoint
db close



















finish_test







<

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


1457
1458
1459
1460
1461
1462
1463

1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
do_test 74.2 {
  for {set i 0} {$i<30} {incr i} {
    db close
    sqlite4 db test.db
    execsql "INSERT INTO t1 VALUES('k$i', randstr(500,500))"
  }
} {}

db close

#-------------------------------------------------------------------------
# Index on a blob.
#
reset_db

do_execsql_test 75.1 { 
  CREATE TABLE t1(a PRIMARY KEY, b UNIQUE);
  INSERT INTO t1 VALUES(x'12345678', x'12345678');
}

do_execsql_test 75.2 { 
  SELECT count(*) FROM t1 WHERE a = x'12345678'
} 1

do_execsql_test 75.3 { 
  SELECT count(*) FROM t1 WHERE b = x'12345678'
} 1

finish_test