diff options
author | drh <drh@noemail.net> | 2013-10-10 20:13:18 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-10-10 20:13:18 +0000 |
commit | a63b85299290b7eca076ea6e031e7f43d4feadcf (patch) | |
tree | e925eb05965ec76f37b6483581d5bd8f8ea9e53b /src/shell.c | |
parent | 59255f9a98381960cfede9253277f128895531f6 (diff) | |
parent | 7e65c94bdc689bebd222321dec5c034194267ac9 (diff) | |
download | sqlite-a63b85299290b7eca076ea6e031e7f43d4feadcf.tar.gz sqlite-a63b85299290b7eca076ea6e031e7f43d4feadcf.zip |
Synchronize with the trunk.
FossilOrigin-Name: 136445ba020c9475d3f5a7843d7d0add98477138
Diffstat (limited to 'src/shell.c')
-rw-r--r-- | src/shell.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/shell.c b/src/shell.c index 915952cfb..9f0e3530b 100644 --- a/src/shell.c +++ b/src/shell.c @@ -974,7 +974,7 @@ static int run_table_dump_query( rc = sqlite3_prepare(p->db, zSelect, -1, &pSelect, 0); if( rc!=SQLITE_OK || !pSelect ){ fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); - p->nErr++; + if( (rc&0xff)!=SQLITE_CORRUPT ) p->nErr++; return rc; } rc = sqlite3_step(pSelect); @@ -1001,7 +1001,7 @@ static int run_table_dump_query( rc = sqlite3_finalize(pSelect); if( rc!=SQLITE_OK ){ fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); - p->nErr++; + if( (rc&0xff)!=SQLITE_CORRUPT ) p->nErr++; } return rc; } @@ -1194,7 +1194,7 @@ static int shell_exec( char **azCols = (char **)pData; /* Names of result columns */ char **azVals = &azCols[nCol]; /* Results */ int *aiTypes = (int *)&azVals[nCol]; /* Result types */ - int i; + int i, x; assert(sizeof(int) <= sizeof(char *)); /* save off ptrs to column names */ for(i=0; i<nCol; i++){ @@ -1203,8 +1203,12 @@ static int shell_exec( do{ /* extract the data and data types */ for(i=0; i<nCol; i++){ - azVals[i] = (char *)sqlite3_column_text(pStmt, i); - aiTypes[i] = sqlite3_column_type(pStmt, i); + aiTypes[i] = x = sqlite3_column_type(pStmt, i); + if( x==SQLITE_BLOB && pArg->mode==MODE_Insert ){ + azVals[i] = ""; + }else{ + azVals[i] = (char*)sqlite3_column_text(pStmt, i); + } if( !azVals[i] && (aiTypes[i]!=SQLITE_NULL) ){ rc = SQLITE_NOMEM; break; /* from for */ |