SQLite

Check-in [70096c50]
Login

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

Overview
Comment:Always make "column%d" column-names 1-based, never 0-based.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 70096c505d702a9646da24613da387cee19afcf395d0294b3797c5ab50bb3ee2
User & Date: drh 2017-07-09 18:55:29
Context
2017-07-10
11:17
Remove the error message text from disused error codes such as SQLITE_EMPTY and SQLITE_FORMAT. (check-in: 871752f2 user: drh tags: trunk)
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)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/select.c.

1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
        /* 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 ){







|







1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
        /* 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+1);
    }

    /* 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 ){