SQLite

Check-in [8278be06fa]
Login

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

Overview
Comment:Fix some problems with handling "no such collation sequence" errors.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | rowvalue
Files: files | file ages | folders
SHA1: 8278be06fa69e3266866220bdaf5be45a5fcfa23
User & Date: dan 2016-08-11 12:01:52.255
Context
2016-08-11
12:31
Merge recent changes from trunk. (check-in: 959677b97b user: drh tags: rowvalue)
12:01
Fix some problems with handling "no such collation sequence" errors. (check-in: 8278be06fa user: dan tags: rowvalue)
2016-08-09
05:48
Add rowvalue5.test, which should have been part of the previous commit on this branch. (check-in: ea03e219ce user: dan tags: rowvalue)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/expr.c.
2051
2052
2053
2054
2055
2056
2057



2058
2059
2060
2061
2062
2063
2064
        }

        for(i=0; i<nExpr; i++){
          Expr *pLhs = sqlite3ExprVectorField(pX->pLeft, i);
          Expr *pRhs = pEList->a[i].pExpr;
          CollSeq *pReq = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs);
          int j;




          for(j=0; j<nExpr; j++){
            if( pIdx->aiColumn[j]!=pRhs->iColumn ) continue;
            assert( pIdx->azColl[j] );
            if( sqlite3StrICmp(pReq->zName, pIdx->azColl[j])!=0 ) continue;
            break;
          }







>
>
>







2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
        }

        for(i=0; i<nExpr; i++){
          Expr *pLhs = sqlite3ExprVectorField(pX->pLeft, i);
          Expr *pRhs = pEList->a[i].pExpr;
          CollSeq *pReq = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs);
          int j;

          assert( pReq || pParse->nErr );
          if( pReq==0 ) break;

          for(j=0; j<nExpr; j++){
            if( pIdx->aiColumn[j]!=pRhs->iColumn ) continue;
            assert( pIdx->azColl[j] );
            if( sqlite3StrICmp(pReq->zName, pIdx->azColl[j])!=0 ) continue;
            break;
          }
Changes to src/where.c.
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
    }

    aff = sqlite3CompareAffinity(pRhs, sqlite3ExprAffinity(pLhs));
    idxaff = pIdx->pTable->aCol[pLhs->iColumn].affinity;
    if( aff!=idxaff ) break;

    pColl = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs);
    if( sqlite3StrICmp(pColl->zName, pIdx->azColl[i+nEq]) ) break;
  }
  return i;
}

/*
** Adjust the cost C by the costMult facter T.  This only occurs if
** compiled with -DSQLITE_ENABLE_COSTMULT







|







2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
    }

    aff = sqlite3CompareAffinity(pRhs, sqlite3ExprAffinity(pLhs));
    idxaff = pIdx->pTable->aCol[pLhs->iColumn].affinity;
    if( aff!=idxaff ) break;

    pColl = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs);
    if( pColl==0 || sqlite3StrICmp(pColl->zName, pIdx->azColl[i+nEq]) ) break;
  }
  return i;
}

/*
** Adjust the cost C by the costMult facter T.  This only occurs if
** compiled with -DSQLITE_ENABLE_COSTMULT
Changes to test/rowvalue4.test.
269
270
271
272
273
274
275


















276
277
278
do_eqp_test 6.5 {
  SELECT * FROM e1 WHERE (d, e) BETWEEN (?, ?) AND (?, ?) AND c = ?
} {
  0 0 0 
  {SEARCH TABLE e1 USING INDEX e1cde (c=? AND (d,e)>(?,?) AND (d,e)<(?,?))}
}




















finish_test








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



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
do_eqp_test 6.5 {
  SELECT * FROM e1 WHERE (d, e) BETWEEN (?, ?) AND (?, ?) AND c = ?
} {
  0 0 0 
  {SEARCH TABLE e1 USING INDEX e1cde (c=? AND (d,e)>(?,?) AND (d,e)<(?,?))}
}

#-------------------------------------------------------------------------

do_execsql_test 7.1 {
  CREATE TABLE f1(a, b, c);
  CREATE INDEX f1ab ON f1(a, b);
}

do_catchsql_test 7.2 {
  SELECT (a COLLATE nocase, b) IN (SELECT a, b FROM f1) FROM f1;
} {0 {}}

do_catchsql_test 7.3 {
  SELECT (a COLLATE nose, b) IN (SELECT a, b FROM f1) FROM f1;
} {1 {no such collation sequence: nose}}

do_catchsql_test 7.4 {
  SELECT * FROM f1 WHERE (?, ? COLLATE nose) > (a, b);
} {1 {no such collation sequence: nose}}

finish_test