/ Check-in [b12f23a5]
Login

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

Overview
Comment:Add assert()s to the new code in the previous check-in.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tkt-b41031ea
Files: files | file ages | folders
SHA3-256:b12f23a5c484cab3654721299ea0f05230eef6b14012b557f3bf2592fac0f00e
User & Date: drh 2018-09-17 00:15:21
Context
2018-09-17
08:27
Add extra test for the fix on this branch. Also fix a pointer-compare-after-free problem that occurs in similar cases. check-in: 1856ea63 user: dan tags: tkt-b41031ea
00:15
Add assert()s to the new code in the previous check-in. check-in: b12f23a5 user: drh tags: tkt-b41031ea
2018-09-16
23:27
First proposed fix for the ALTER TABLE problem described by ticket [b41031ea2b5372378cb3d2d] check-in: 05a9d129 user: drh tags: tkt-b41031ea
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/resolve.c.

237
238
239
240
241
242
243



244
245
246
247
248
249
250
251
    SrcList *pSrcList = pNC->pSrcList;

    if( pSrcList ){
      for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){
        pTab = pItem->pTab;
        assert( pTab!=0 && pTab->zName!=0 );
        if( pTab->nCol==0 ){



          if( sqlite3ViewGetColumnNames(pNC->pParse, pTab) ) return WRC_Abort;
        }
        if( pItem->pSelect && (pItem->pSelect->selFlags & SF_NestedFrom)!=0 ){
          int hit = 0;
          pEList = pItem->pSelect->pEList;
          for(j=0; j<pEList->nExpr; j++){
            if( sqlite3MatchSpanName(pEList->a[j].zSpan, zCol, zTab, zDb) ){
              cnt++;







>
>
>
|







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
    SrcList *pSrcList = pNC->pSrcList;

    if( pSrcList ){
      for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){
        pTab = pItem->pTab;
        assert( pTab!=0 && pTab->zName!=0 );
        if( pTab->nCol==0 ){
          assert( pParse->eParseMode==PARSE_MODE_RENAME_COLUMN
               || pParse->eParseMode==PARSE_MODE_RENAME_TABLE );
          assert( pNC->pParse==pParse );
          if( sqlite3ViewGetColumnNames(pParse, pTab) ) return WRC_Abort;
        }
        if( pItem->pSelect && (pItem->pSelect->selFlags & SF_NestedFrom)!=0 ){
          int hit = 0;
          pEList = pItem->pSelect->pEList;
          for(j=0; j<pEList->nExpr; j++){
            if( sqlite3MatchSpanName(pEList->a[j].zSpan, zCol, zTab, zDb) ){
              cnt++;