SQLite

Check-in [8d9dcd7c]
Login

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

Overview
Comment:When setting the column types on a subquery, ensure that the COLFLAG_HASCOLL flag is cleared from column names from when the collating sequence name has been removed. Forum post 6916dacf83.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8d9dcd7cfdd53034e21cdb2cb997b6f5fe3207ca5d0d7a0b841b8a68e6ce8624
User & Date: drh 2023-04-14 10:40:50
Context
2023-04-14
13:34
Update test script recoverbuild.test so that it may be run using old test harnesses that run more than one test script in a process. (check-in: 5135aab0 user: dan tags: trunk)
10:46
When setting the column types on a subquery, ensure that the COLFLAG_HASCOLL flag is cleared from column names from when the collating sequence name has been removed. (check-in: de61bdc9 user: drh tags: branch-3.41)
10:40
When setting the column types on a subquery, ensure that the COLFLAG_HASCOLL flag is cleared from column names from when the collating sequence name has been removed. Forum post 6916dacf83. (check-in: 8d9dcd7c user: drh tags: trunk)
10:35
Fix a cosmetic indentation issue. (check-in: 90deb844 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/select.c.

2365
2366
2367
2368
2369
2370
2371

2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
        }
      }
    }
    if( zType ){
      i64 m = sqlite3Strlen30(zType);
      n = sqlite3Strlen30(pCol->zCnName);
      pCol->zCnName = sqlite3DbReallocOrFree(db, pCol->zCnName, n+m+2);

      if( pCol->zCnName ){
        memcpy(&pCol->zCnName[n+1], zType, m+1);
        pCol->colFlags |= COLFLAG_HASTYPE;
      }else{
        testcase( pCol->colFlags & COLFLAG_HASTYPE );
        pCol->colFlags &= ~(COLFLAG_HASTYPE|COLFLAG_HASCOLL);
      }
    }
    pColl = sqlite3ExprCollSeq(pParse, p);
    if( pColl ){
      assert( pTab->pIndex==0 );
      sqlite3ColumnSetColl(db, pCol, pColl->zName);
    }







>





<







2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377

2378
2379
2380
2381
2382
2383
2384
        }
      }
    }
    if( zType ){
      i64 m = sqlite3Strlen30(zType);
      n = sqlite3Strlen30(pCol->zCnName);
      pCol->zCnName = sqlite3DbReallocOrFree(db, pCol->zCnName, n+m+2);
      pCol->colFlags &= ~(COLFLAG_HASTYPE|COLFLAG_HASCOLL);
      if( pCol->zCnName ){
        memcpy(&pCol->zCnName[n+1], zType, m+1);
        pCol->colFlags |= COLFLAG_HASTYPE;
      }else{
        testcase( pCol->colFlags & COLFLAG_HASTYPE );

      }
    }
    pColl = sqlite3ExprCollSeq(pParse, p);
    if( pColl ){
      assert( pTab->pIndex==0 );
      sqlite3ColumnSetColl(db, pCol, pColl->zName);
    }