De-duplicate some error-output code in shell.c.in as part of tracking down the cause of [forum:5647ca2af1|forum post 5647ca2af1].
FossilOrigin-Name: fd5904495e0c775174f9380bc6877fb9def3d30dec1c9315979ad4503a18d70b
This commit is contained in:
parent
8c58fd78c3
commit
fb7d0c3c01
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
||||
C Remove\sincorrect\sassert()\sstatements\sin\sthe\sSrcItem\sinvariant\svalidator.\ndbsqlfuzz\s7f908865436ce531b0ace55c97a1c71d05c4e76c.
|
||||
D 2024-08-21T07:38:14.508
|
||||
C De-duplicate\ssome\serror-output\scode\sin\sshell.c.in\sas\spart\sof\stracking\sdown\sthe\scause\sof\s[forum:5647ca2af1|forum\spost\s5647ca2af1].
|
||||
D 2024-08-21T09:56:45.002
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -765,7 +765,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c 9afed5fd7b9111633bdb74a73cdc47324e28e4dc6c27113e3e9aee38fb9422ab
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c 44d135bbea93872a7318f048d9d6e566b1c3eaa92d6dabe06e4741aa78d1c1ec
|
||||
F src/shell.c.in 94571558b0fb28c37a5cf6dbd6ea27285341023a28a8cb5795cd2768fab67704
|
||||
F src/shell.c.in fb7fe0a39473e7a3ad5ad7076ff49d87aa8ed7fdd98a1595345747ac5d78ac2b
|
||||
F src/sqlite.h.in 1ad9110150773c38ebababbad11b5cb361bcd3997676dec1c91ac5e0416a7b86
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
|
||||
@ -2210,8 +2210,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 484bcd75bc95491d8540c791c1c4d40d996cb465839564662e14f98739699bf1
|
||||
R 136086d644c5a2efc92647bc4c586910
|
||||
U drh
|
||||
Z 029346cb8d0ee71c8f522bf954942df0
|
||||
P 81a1ede38823b8d50e221ecb6ce52a05d82a856099002a71d9f1ac561a587f05
|
||||
R 7dfeb7387454a33b7099aec64d81efae
|
||||
U stephan
|
||||
Z b55d6e3262271daffaa830513ab83e17
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@ -1 +1 @@
|
||||
81a1ede38823b8d50e221ecb6ce52a05d82a856099002a71d9f1ac561a587f05
|
||||
fd5904495e0c775174f9380bc6877fb9def3d30dec1c9315979ad4503a18d70b
|
||||
|
@ -6343,12 +6343,17 @@ static int shell_dbinfo_command(ShellState *p, int nArg, char **azArg){
|
||||
}
|
||||
#endif /* SQLITE_SHELL_HAVE_RECOVER */
|
||||
|
||||
/*
|
||||
** Print the given string as an error message.
|
||||
*/
|
||||
static void shellEmitError(const char *zErr){
|
||||
eputf("Error: %s\n", zErr);
|
||||
}
|
||||
/*
|
||||
** Print the current sqlite3_errmsg() value to stderr and return 1.
|
||||
*/
|
||||
static int shellDatabaseError(sqlite3 *db){
|
||||
const char *zErr = sqlite3_errmsg(db);
|
||||
eputf("Error: %s\n", zErr);
|
||||
shellEmitError(sqlite3_errmsg(db));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -6893,7 +6898,7 @@ static int arErrorMsg(ArCommand *pAr, const char *zFmt, ...){
|
||||
va_start(ap, zFmt);
|
||||
z = sqlite3_vmprintf(zFmt, ap);
|
||||
va_end(ap);
|
||||
eputf("Error: %s\n", z);
|
||||
shellEmitError(z);
|
||||
if( pAr->fromCmdLine ){
|
||||
eputz("Use \"-A\" for more help\n");
|
||||
}else{
|
||||
@ -8124,7 +8129,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
open_db(p, 0);
|
||||
pBackup = sqlite3_backup_init(pDest, "main", p->db, zDb);
|
||||
if( pBackup==0 ){
|
||||
eputf("Error: %s\n", sqlite3_errmsg(pDest));
|
||||
shellDatabaseError(pDest);
|
||||
close_db(pDest);
|
||||
return 1;
|
||||
}
|
||||
@ -8133,7 +8138,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
if( rc==SQLITE_DONE ){
|
||||
rc = 0;
|
||||
}else{
|
||||
eputf("Error: %s\n", sqlite3_errmsg(pDest));
|
||||
shellDatabaseError(pDest);
|
||||
rc = 1;
|
||||
}
|
||||
close_db(pDest);
|
||||
@ -8309,7 +8314,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
open_db(p, 0);
|
||||
rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0);
|
||||
if( rc ){
|
||||
eputf("Error: %s\n", sqlite3_errmsg(p->db));
|
||||
shellDatabaseError(p->db);
|
||||
rc = 1;
|
||||
}else{
|
||||
while( sqlite3_step(pStmt)==SQLITE_ROW ){
|
||||
@ -9005,7 +9010,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
zSql = 0;
|
||||
if( rc ){
|
||||
if (pStmt) sqlite3_finalize(pStmt);
|
||||
eputf("Error: %s\n", sqlite3_errmsg(p->db));
|
||||
shellDatabaseError(p->db);
|
||||
import_cleanup(&sCtx);
|
||||
rc = 1;
|
||||
goto meta_command_exit;
|
||||
@ -9049,7 +9054,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
sqlite3_free(zSql);
|
||||
zSql = 0;
|
||||
if( rc ){
|
||||
eputf("Error: %s\n", sqlite3_errmsg(p->db));
|
||||
shellDatabaseError(p->db);
|
||||
if (pStmt) sqlite3_finalize(pStmt);
|
||||
import_cleanup(&sCtx);
|
||||
rc = 1;
|
||||
@ -9343,7 +9348,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
open_db(p, 0);
|
||||
rc = sqlite3_load_extension(p->db, zFile, zProc, &zErrMsg);
|
||||
if( rc!=SQLITE_OK ){
|
||||
eputf("Error: %s\n", zErrMsg);
|
||||
shellEmitError(zErrMsg);
|
||||
sqlite3_free(zErrMsg);
|
||||
rc = 1;
|
||||
}
|
||||
@ -9965,7 +9970,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
open_db(p, 0);
|
||||
pBackup = sqlite3_backup_init(p->db, zDb, pSrc, "main");
|
||||
if( pBackup==0 ){
|
||||
eputf("Error: %s\n", sqlite3_errmsg(p->db));
|
||||
shellDatabaseError(p->db);
|
||||
close_db(pSrc);
|
||||
return 1;
|
||||
}
|
||||
@ -9983,7 +9988,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
eputz("Error: source database is busy\n");
|
||||
rc = 1;
|
||||
}else{
|
||||
eputf("Error: %s\n", sqlite3_errmsg(p->db));
|
||||
shellDatabaseError(p->db);
|
||||
rc = 1;
|
||||
}
|
||||
close_db(pSrc);
|
||||
@ -10080,7 +10085,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
rc = sqlite3_prepare_v2(p->db, "SELECT name FROM pragma_database_list",
|
||||
-1, &pStmt, 0);
|
||||
if( rc ){
|
||||
eputf("Error: %s\n", sqlite3_errmsg(p->db));
|
||||
shellDatabaseError(p->db);
|
||||
sqlite3_finalize(pStmt);
|
||||
rc = 1;
|
||||
goto meta_command_exit;
|
||||
@ -10149,7 +10154,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
freeText(&sSelect);
|
||||
}
|
||||
if( zErrMsg ){
|
||||
eputf("Error: %s\n", zErrMsg);
|
||||
shellEmitError(zErrMsg);
|
||||
sqlite3_free(zErrMsg);
|
||||
rc = 1;
|
||||
}else if( rc != SQLITE_OK ){
|
||||
@ -12728,7 +12733,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
|
||||
open_db(&data, 0);
|
||||
rc = shell_exec(&data, z, &zErrMsg);
|
||||
if( zErrMsg!=0 ){
|
||||
eputf("Error: %s\n", zErrMsg);
|
||||
shellEmitError(zErrMsg);
|
||||
if( bail_on_error ) return rc!=0 ? rc : 1;
|
||||
}else if( rc!=0 ){
|
||||
eputf("Error: unable to process SQL \"%s\"\n", z);
|
||||
@ -12782,7 +12787,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
|
||||
rc = shell_exec(&data, azCmd[i], &zErrMsg);
|
||||
if( zErrMsg || rc ){
|
||||
if( zErrMsg!=0 ){
|
||||
eputf("Error: %s\n", zErrMsg);
|
||||
shellEmitError(zErrMsg);
|
||||
}else{
|
||||
eputf("Error: unable to process SQL: %s\n", azCmd[i]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user