/ Check-in [acf3b9cc]
Login

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

Overview
Comment:Make sure the columns of a VALUES() clause are named "column%d" even if the VALUES() clause is a subquery in the FROM clause of an outer query.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: acf3b9cc9c3932431979995a1dceacc06c659ab400fad95ce3728ff8895a022b
User & Date: drh 2017-07-09 00:30:58
Context
2017-07-09
18:55
Always make "column%d" column-names 1-based, never 0-based. check-in: 70096c50 user: drh tags: trunk
00:30
Make sure the columns of a VALUES() clause are named "column%d" even if the VALUES() clause is a subquery in the FROM clause of an outer query. check-in: acf3b9cc user: drh tags: trunk
2017-07-08
22:30
Add the --icc, --gcc7, and --orm options to the speed-check.sh test script. check-in: 70dae08a user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/select.c.

1700
1701
1702
1703
1704
1705
1706



1707

1708
1709
1710
1711
1712
1713
1714
        assert( !ExprHasProperty(pColExpr, EP_IntValue) );
        zName = pColExpr->u.zToken;
      }else{
        /* Use the original text of the column expression as its name */
        zName = pEList->a[i].zSpan;
      }
    }



    zName = sqlite3MPrintf(db, "%s", zName);


    /* Make sure the column name is unique.  If the name is not unique,
    ** append an integer to the name so that it becomes unique.
    */
    cnt = 0;
    while( zName && sqlite3HashFind(&ht, zName)!=0 ){
      nName = sqlite3Strlen30(zName);







>
>
>
|
>







1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
        assert( !ExprHasProperty(pColExpr, EP_IntValue) );
        zName = pColExpr->u.zToken;
      }else{
        /* Use the original text of the column expression as its name */
        zName = pEList->a[i].zSpan;
      }
    }
    if( zName ){
      zName = sqlite3DbStrDup(db, zName);
    }else{
      zName = sqlite3MPrintf(db,"column%d",i);
    }

    /* Make sure the column name is unique.  If the name is not unique,
    ** append an integer to the name so that it becomes unique.
    */
    cnt = 0;
    while( zName && sqlite3HashFind(&ht, zName)!=0 ){
      nName = sqlite3Strlen30(zName);