/ Check-in [ef01e304]
Login

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

Overview
Comment:When resolving result-set name collisions, make them x:1, x:2, x:3, etc. instead of x:1, x:1:1, x:1;1;1.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | name-resolution-fix
Files: files | file ages | folders
SHA1: ef01e30456670e6b1bc67fe41ec27e52c182efaf
User & Date: drh 2013-01-02 14:57:32
Context
2013-01-03
00:45
Now supports result sets of the form "TABLE.*" with nested FROM clauses. check-in: 4cf5ed7e user: drh tags: name-resolution-fix
2013-01-02
14:57
When resolving result-set name collisions, make them x:1, x:2, x:3, etc. instead of x:1, x:1:1, x:1;1;1. check-in: ef01e304 user: drh tags: name-resolution-fix
12:29
Merge all the latest trunk changes into the name-resolution enhancement branch. check-in: a5f4d2b6 user: drh tags: name-resolution-fix
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

  1371   1371       /* Make sure the column name is unique.  If the name is not unique,
  1372   1372       ** append a integer to the name so that it becomes unique.
  1373   1373       */
  1374   1374       nName = sqlite3Strlen30(zName);
  1375   1375       for(j=cnt=0; j<i; j++){
  1376   1376         if( sqlite3StrICmp(aCol[j].zName, zName)==0 ){
  1377   1377           char *zNewName;
         1378  +        int k;
         1379  +        for(k=nName-1; k>1 && sqlite3Isdigit(zName[k]); k--){}
         1380  +        if( zName[k]==':' ) nName = k;
  1378   1381           zName[nName] = 0;
  1379   1382           zNewName = sqlite3MPrintf(db, "%s:%d", zName, ++cnt);
  1380   1383           sqlite3DbFree(db, zName);
  1381   1384           zName = zNewName;
  1382   1385           j = -1;
  1383   1386           if( zName==0 ) break;
  1384   1387         }