/ Check-in [e313edca]
Login

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

Overview
Comment:Do not report missing collating functions while parsing the schema. Also remove a stray comment.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ticket-71e333e7
Files: files | file ages | folders
SHA1: e313edca0472f07e9b872b92120d80b4bc177328
User & Date: drh 2012-12-07 22:54:41
Context
2012-12-07
23:10
For an ORDER BY on a compound SELECT, take the collating sequence from the left-most term of the compound. check-in: 8e724b38 user: drh tags: ticket-71e333e7
22:54
Do not report missing collating functions while parsing the schema. Also remove a stray comment. check-in: e313edca user: drh tags: ticket-71e333e7
22:18
Fix a long-standing issue with the distinct-as-aggregate optimization that only expressed when the new collating-sequence logic is turned on. check-in: 0aaf52a3 user: drh tags: ticket-71e333e7
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

   108    108     while( p && pColl==0 ){
   109    109       int op = p->op;
   110    110       if( op==TK_CAST || op==TK_UPLUS ){
   111    111         p = p->pLeft;
   112    112         continue;
   113    113       }
   114    114       if( op==TK_COLLATE ){
   115         -      pColl = sqlite3GetCollSeq(pParse, ENC(db), 0, p->u.zToken);
          115  +      if( db->init.busy ){
          116  +        /* Do not report errors when parsing while the schema */
          117  +        pColl = sqlite3FindCollSeq(db, ENC(db), p->u.zToken, 0);
          118  +      }else{
          119  +        pColl = sqlite3GetCollSeq(pParse, ENC(db), 0, p->u.zToken);
          120  +      }
   116    121         break;
   117    122       }
   118    123       if( p->pTab!=0
   119    124        && (op==TK_AGG_COLUMN || op==TK_COLUMN
   120    125             || op==TK_REGISTER || op==TK_TRIGGER)
   121    126       ){
   122    127         /* op==TK_REGISTER && p->pTab!=0 happens when pExpr was originally

Changes to src/select.c.

  2333   2333         for(i=0; i<nOrderBy; i++){
  2334   2334           CollSeq *pColl;
  2335   2335           Expr *pTerm = pOrderBy->a[i].pExpr;
  2336   2336           if( pTerm->flags & EP_Collate ){
  2337   2337             pColl = sqlite3ExprCollSeq(pParse, pTerm);
  2338   2338           }else{
  2339   2339             pColl = multiSelectCollSeq(pParse, p, aPermute[i]);
  2340         -//          pTerm->flags |= EP_Collate;
  2341   2340           }
  2342   2341           pKeyMerge->aColl[i] = pColl;
  2343   2342           pKeyMerge->aSortOrder[i] = pOrderBy->a[i].sortOrder;
  2344   2343         }
  2345   2344       }
  2346   2345     }else{
  2347   2346       pKeyMerge = 0;