/ Check-in [d5d973fe]
Login

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

Overview
Comment:Make sure that the difference between two string pointers is passed into sqlite3_mprintf() as type "int".
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d5d973fedcf5a2eea219f10e11ba3dacdd0593f0
User & Date: drh 2014-02-20 19:23:15
Context
2014-02-20
19:32
Fix a harmless shadowed-variable warning. check-in: 82402909 user: drh tags: trunk
19:23
Make sure that the difference between two string pointers is passed into sqlite3_mprintf() as type "int". check-in: d5d973fe user: drh tags: trunk
2014-02-19
19:14
Add the VdbeCoverageNeverTaken() macro, and comments that better describe how the VDBE branch coverage measurement works. Add some tags to provide 100% VDBE branch coverage. check-in: c1e94169 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/alter.c.

    73     73         do {
    74     74           zCsr += len;
    75     75           len = sqlite3GetToken(zCsr, &token);
    76     76         } while( token==TK_SPACE );
    77     77         assert( len>0 );
    78     78       } while( token!=TK_LP && token!=TK_USING );
    79     79   
    80         -    zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", ((u8*)tname.z) - zSql, zSql, 
    81         -       zTableName, tname.z+tname.n);
           80  +    zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", (int)(((u8*)tname.z) - zSql),
           81  +       zSql, zTableName, tname.z+tname.n);
    82     82       sqlite3_result_text(context, zRet, -1, SQLITE_DYNAMIC);
    83     83     }
    84     84   }
    85     85   
    86     86   /*
    87     87   ** This C function implements an SQL user function that is used by SQL code
    88     88   ** generated by the ALTER TABLE ... RENAME command to modify the definition
................................................................................
   126    126         }while( token==TK_SPACE );
   127    127   
   128    128         zParent = sqlite3DbStrNDup(db, (const char *)z, n);
   129    129         if( zParent==0 ) break;
   130    130         sqlite3Dequote(zParent);
   131    131         if( 0==sqlite3StrICmp((const char *)zOld, zParent) ){
   132    132           char *zOut = sqlite3MPrintf(db, "%s%.*s\"%w\"", 
   133         -            (zOutput?zOutput:""), z-zInput, zInput, (const char *)zNew
          133  +            (zOutput?zOutput:""), (int)(z-zInput), zInput, (const char *)zNew
   134    134           );
   135    135           sqlite3DbFree(db, zOutput);
   136    136           zOutput = zOut;
   137    137           zInput = &z[n];
   138    138         }
   139    139         sqlite3DbFree(db, zParent);
   140    140       }
................................................................................
   212    212           dist = 0;
   213    213         }
   214    214       } while( dist!=2 || (token!=TK_WHEN && token!=TK_FOR && token!=TK_BEGIN) );
   215    215   
   216    216       /* Variable tname now contains the token that is the old table-name
   217    217       ** in the CREATE TRIGGER statement.
   218    218       */
   219         -    zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", ((u8*)tname.z) - zSql, zSql, 
   220         -       zTableName, tname.z+tname.n);
          219  +    zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", (int)(((u8*)tname.z) - zSql),
          220  +       zSql, zTableName, tname.z+tname.n);
   221    221       sqlite3_result_text(context, zRet, -1, SQLITE_DYNAMIC);
   222    222     }
   223    223   }
   224    224   #endif   /* !SQLITE_OMIT_TRIGGER */
   225    225   
   226    226   /*
   227    227   ** Register built-in functions used to help implement ALTER TABLE