/ Check-in [9d8e73bf71]
Login

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

Overview
Comment:Additional fixes for harmless compiler warnings that are specific to this branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | alter-table-rename-column
Files: files | file ages | folders
SHA3-256: 9d8e73bf71e996b810959ffc0e60de69b5e8ca3301df52f9c35d5e9075921798
User & Date: drh 2018-08-18 18:27:18
Context
2018-08-20
16:16
Ensure that it is not possible to rename columns of system tables, views or virtual tables. check-in: 786b5991dc user: dan tags: alter-table-rename-column
2018-08-18
18:27
Additional fixes for harmless compiler warnings that are specific to this branch. check-in: 9d8e73bf71 user: drh tags: alter-table-rename-column
18:14
Merge trunk fixes. check-in: ccad277927 user: drh tags: alter-table-rename-column
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/alter.c.

   966    966   
   967    967   /*
   968    968   ** This is a Walker select callback. It does nothing. It is only required
   969    969   ** because without a dummy callback, sqlite3WalkExpr() and similar do not
   970    970   ** descend into sub-select statements.
   971    971   */
   972    972   static int renameColumnSelectCb(Walker *pWalker, Select *p){
          973  +  UNUSED_PARAMETER(pWalker);
          974  +  UNUSED_PARAMETER(p);
   973    975     return WRC_Continue;
   974    976   }
   975    977   
   976    978   /*
   977    979   ** This is a Walker expression callback.
   978    980   **
   979    981   ** For every TK_COLUMN node in the expression tree, search to see
................................................................................
  1100   1102     char *zOut = 0;
  1101   1103   
  1102   1104     char *zQuot = 0;                /* Quoted version of zNew */
  1103   1105     int nQuot = 0;                  /* Length of zQuot in bytes */
  1104   1106     int i;
  1105   1107     Table *pTab;
  1106   1108   
         1109  +  UNUSED_PARAMETER(NotUsed);
  1107   1110     if( zSql==0 ) return;
  1108   1111     if( zNew==0 ) return;
  1109   1112     if( zTable==0 ) return;
  1110   1113     if( iCol<0 ) return;
  1111   1114     pTab = sqlite3FindTable(db, zTable, zDb);
  1112   1115     if( pTab==0 || iCol>=pTab->nCol ) return;
  1113   1116     zOld = pTab->aCol[iCol].zName;
................................................................................
  1341   1344     if( zOut ){
  1342   1345       int nOut = nSql;
  1343   1346       memcpy(zOut, zSql, nSql);
  1344   1347       while( sCtx.pList ){
  1345   1348         int iOff;                   /* Offset of token to replace in zOut */
  1346   1349         RenameToken *pBest = renameColumnTokenNext(&sCtx);
  1347   1350   
  1348         -      int nReplace;
         1351  +      u32 nReplace;
  1349   1352         const char *zReplace;
  1350   1353         if( sqlite3IsIdChar(*pBest->t.z) ){
  1351   1354           nReplace = nNew;
  1352   1355           zReplace = zNew;
  1353   1356         }else{
  1354   1357           nReplace = nQuot;
  1355   1358           zReplace = zQuot;

Changes to src/sqliteInt.h.

  3636   3636   # define sqlite3Isalnum(x)   isalnum((unsigned char)(x))
  3637   3637   # define sqlite3Isalpha(x)   isalpha((unsigned char)(x))
  3638   3638   # define sqlite3Isdigit(x)   isdigit((unsigned char)(x))
  3639   3639   # define sqlite3Isxdigit(x)  isxdigit((unsigned char)(x))
  3640   3640   # define sqlite3Tolower(x)   tolower((unsigned char)(x))
  3641   3641   # define sqlite3Isquote(x)   ((x)=='"'||(x)=='\''||(x)=='['||(x)=='`')
  3642   3642   #endif
  3643         -#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
  3644   3643   int sqlite3IsIdChar(u8);
  3645         -#endif
  3646   3644   
  3647   3645   /*
  3648   3646   ** Internal function prototypes
  3649   3647   */
  3650   3648   int sqlite3StrICmp(const char*,const char*);
  3651   3649   int sqlite3Strlen30(const char*);
  3652   3650   char *sqlite3ColumnType(Column*,char*);

Changes to src/tokenize.c.

   180    180       0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1,  /* Dx */
   181    181       0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1,  /* Ex */
   182    182       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0,  /* Fx */
   183    183   };
   184    184   #define IdChar(C)  (((c=C)>=0x42 && sqlite3IsEbcdicIdChar[c-0x40]))
   185    185   #endif
   186    186   
   187         -/* Make the IdChar function accessible from ctime.c */
   188         -#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
          187  +/* Make the IdChar function accessible from ctime.c and alter.c */
   189    188   int sqlite3IsIdChar(u8 c){ return IdChar(c); }
   190         -#endif
   191    189   
   192    190   #ifndef SQLITE_OMIT_WINDOWFUNC
   193    191   /*
   194    192   ** Return the id of the next token in string (*pz). Before returning, set
   195    193   ** (*pz) to point to the byte following the parsed token.
   196    194   */
   197    195   static int getToken(const unsigned char **pz){