1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

In the sqldiff program, make sure the first argument to the db_prepare()

utility function is always a valid format string.

FossilOrigin-Name: 8bb8d886ffa948cd7bc66c8c62da76bce233be2e
This commit is contained in:
drh
2016-07-08 02:14:24 +00:00
parent c8dcdff37e
commit 5225449e5b
3 changed files with 11 additions and 12 deletions

View File

@ -684,7 +684,7 @@ static void diff_one_table(const char *zTab, FILE *out){
/* Run the query and output differences */
if( !g.bSchemaOnly ){
pStmt = db_prepare(sql.z);
pStmt = db_prepare("%s", sql.z);
while( SQLITE_ROW==sqlite3_step(pStmt) ){
int iType = sqlite3_column_int(pStmt, nPk);
if( iType==1 || iType==2 ){
@ -1461,7 +1461,7 @@ static void summarize_one_table(const char *zTab, FILE *out){
}
/* Run the query and output difference summary */
pStmt = db_prepare(sql.z);
pStmt = db_prepare("%s", sql.z);
nUpdate = 0;
nInsert = 0;
nDelete = 0;
@ -2018,7 +2018,7 @@ int main(int argc, char **argv){
xDiff(zTab, out);
}else{
/* Handle tables one by one */
pStmt = db_prepare( all_tables_sql() );
pStmt = db_prepare("%s", all_tables_sql() );
while( SQLITE_ROW==sqlite3_step(pStmt) ){
xDiff((const char*)sqlite3_column_text(pStmt,0), out);
}