mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-05 04:30:38 +03:00
Fix a problem with the CLI where not all SQL commands were being echoed.
Added tests of same to tools/shell2.test. Ticket [eb620916be]. FossilOrigin-Name: 7080ae3bc3828168483ac23d5b8976d67ea5089e
This commit is contained in:
10
src/shell.c
10
src/shell.c
@@ -1501,10 +1501,6 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int
|
||||
int i;
|
||||
struct callback_data *p = (struct callback_data*)pArg;
|
||||
|
||||
if( p->echoOn && p->cnt==0 && p->pStmt){
|
||||
printf("%s\n", sqlite3_sql(p->pStmt));
|
||||
}
|
||||
|
||||
switch( p->mode ){
|
||||
case MODE_Line: {
|
||||
int w = 5;
|
||||
@@ -1855,6 +1851,12 @@ static int shell_exec(
|
||||
continue;
|
||||
}
|
||||
|
||||
/* echo the sql statement if echo on */
|
||||
if( pArg->echoOn ){
|
||||
char *zStmtSql = sqlite3_sql(pStmt);
|
||||
fprintf(pArg->out,"%s\n", zStmtSql ? zStmtSql : zSql);
|
||||
}
|
||||
|
||||
/* perform the first step. this will tell us if we
|
||||
** have a result set or not and how wide it is.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user