/ Check-in [b032b646]
Login

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

Overview
Comment:Fix a bug that prevented sorting by index. Down to 162 failed tests. (CVS 1421)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b032b646b72a03e828d732ac22192f992904d79f
User & Date: drh 2004-05-20 23:37:55
Context
2004-05-21
01:29
Sorting bug fixes. Now only 17 tests fail. (CVS 1422) check-in: 0736b7e8 user: drh tags: trunk
2004-05-20
23:37
Fix a bug that prevented sorting by index. Down to 162 failed tests. (CVS 1421) check-in: b032b646 user: drh tags: trunk
22:16
Add internal support for collating sequences. This breaks 244 tests. (CVS 1420) check-in: a6cb09d7 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/parse.y.

    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains SQLite's grammar for SQL.  Process this file
    13     13   ** using the lemon parser generator to generate C code that runs
    14     14   ** the parser.  Lemon will also generate a header file containing
    15     15   ** numeric codes for all of the tokens.
    16     16   **
    17         -** @(#) $Id: parse.y,v 1.116 2004/05/20 22:16:29 drh Exp $
           17  +** @(#) $Id: parse.y,v 1.117 2004/05/20 23:37:55 drh Exp $
    18     18   */
    19     19   %token_prefix TK_
    20     20   %token_type {Token}
    21     21   %default_type {Token}
    22     22   %extra_argument {Parse *pParse}
    23     23   %syntax_error {
    24     24     if( pParse->zErrMsg==0 ){
................................................................................
   431    431   %destructor sortlist {sqlite3ExprListDelete($$);}
   432    432   %type sortitem {Expr*}
   433    433   %destructor sortitem {sqlite3ExprDelete($$);}
   434    434   
   435    435   orderby_opt(A) ::= .                          {A = 0;}
   436    436   orderby_opt(A) ::= ORDER BY sortlist(X).      {A = X;}
   437    437   sortlist(A) ::= sortlist(X) COMMA sortitem(Y) collate(C) sortorder(Z). {
   438         -  A = sqlite3ExprListAppend(X,Y,&C);
          438  +  A = sqlite3ExprListAppend(X,Y,C.n>0?&C:0);
   439    439     if( A ) A->a[A->nExpr-1].sortOrder = Z;
   440    440   }
   441    441   sortlist(A) ::= sortitem(Y) collate(C) sortorder(Z). {
   442         -  A = sqlite3ExprListAppend(0,Y,&C);
          442  +  A = sqlite3ExprListAppend(0,Y,C.n>0?&C:0);
   443    443     if( A ) A->a[0].sortOrder = Z;
   444    444   }
   445    445   sortitem(A) ::= expr(X).   {A = X;}
   446    446   
   447    447   %type sortorder {int}
   448    448   %type collate {Token}
   449    449