/ Check-in [4d8be404]
Login

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

Overview
Comment:Minor modification to the fix on this branch to avoid adding extra conditional compilation macros.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tkt-b41031ea
Files: files | file ages | folders
SHA3-256: 4d8be404dab265b51e5a6a95e83be85c22512e19a437191690c7d845c87ff259
User & Date: dan 2018-09-17 13:38:45
Context
2018-09-17
13:55
Restore an assert() that was present on trunk. Closed-Leaf check-in: a7b572ca user: drh tags: tkt-b41031ea
13:38
Minor modification to the fix on this branch to avoid adding extra conditional compilation macros. check-in: 4d8be404 user: dan tags: tkt-b41031ea
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
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/alter.c.

  1072   1072         sqlite3SelectPrep(pParse, pStep->pSelect, &sNC);
  1073   1073         if( pParse->nErr ) rc = pParse->rc;
  1074   1074       }
  1075   1075       if( rc==SQLITE_OK && pStep->zTarget ){
  1076   1076         Table *pTarget = sqlite3LocateTable(pParse, 0, pStep->zTarget, zDb);
  1077   1077         if( pTarget==0 ){
  1078   1078           rc = SQLITE_ERROR;
  1079         -      }else{
         1079  +      }else if( SQLITE_OK==(rc = sqlite3ViewGetColumnNames(pParse, pTarget)) ){
  1080   1080           SrcList sSrc;
  1081   1081           memset(&sSrc, 0, sizeof(sSrc));
  1082   1082           sSrc.nSrc = 1;
  1083   1083           sSrc.a[0].zName = pStep->zTarget;
  1084   1084           sSrc.a[0].pTab = pTarget;
  1085   1085           sNC.pSrcList = &sSrc;
  1086   1086           if( pStep->pWhere ){

Changes to src/resolve.c.

   236    236       ExprList *pEList;
   237    237       SrcList *pSrcList = pNC->pSrcList;
   238    238   
   239    239       if( pSrcList ){
   240    240         for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){
   241    241           pTab = pItem->pTab;
   242    242           assert( pTab!=0 && pTab->zName!=0 );
   243         -        if( pTab->nCol==0 ){
   244         -          assert( pParse->eParseMode==PARSE_MODE_RENAME_COLUMN
   245         -               || pParse->eParseMode==PARSE_MODE_RENAME_TABLE );
   246         -          assert( pNC->pParse==pParse );
   247         -          if( sqlite3ViewGetColumnNames(pParse, pTab) ) return WRC_Abort;
   248         -        }
   249    243           if( pItem->pSelect && (pItem->pSelect->selFlags & SF_NestedFrom)!=0 ){
   250    244             int hit = 0;
   251    245             pEList = pItem->pSelect->pEList;
   252    246             for(j=0; j<pEList->nExpr; j++){
   253    247               if( sqlite3MatchSpanName(pEList->a[j].zSpan, zCol, zTab, zDb) ){
   254    248                 cnt++;
   255    249                 cntTab = 2;