Changeset: 117bbd1b7493 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=117bbd1b7493
Modified Files:
        sql/storage/store.c
        tools/merovingian/daemon/snapshot.c
Branch: octbugs
Log Message:

Simplify error message when snapshot cannot be created

Old:
    snapshot:
    internal error:
    execute failed:
    GDK reported error:
    store_hot_snapshot:
    Failed to open DIR/foo_20201013T120047UTC.tar..tmp..lz4 for writing:
    when opening DIR/foo_20201013T120047UTC.tar..tmp..lz4:
    LZ4 support has been left out of this MonetDB

New:
    snapshot:
    GDK reported error:
    store_hot_snapshot:
    when opening DIR/foo_20201013T123209UTC.tar..tmp..lz4:
    LZ4 support has been left out of this MonetDB


diffs (48 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -2822,7 +2822,7 @@ store_hot_snapshot(str tarfile)
        }
        tar_stream = open_wstream(tmppath);
        if (!tar_stream) {
-               GDKerror("Failed to open %s for writing: %s", tmppath, 
mnstr_peek_error(NULL));
+               GDKerror("%s", mnstr_peek_error(NULL));
                goto end;
        }
        do_remove = 1;
diff --git a/tools/merovingian/daemon/snapshot.c 
b/tools/merovingian/daemon/snapshot.c
--- a/tools/merovingian/daemon/snapshot.c
+++ b/tools/merovingian/daemon/snapshot.c
@@ -117,11 +117,11 @@ snapshot_database_stream(char *dbname, s
 
        handle = mapi_prepare(conn, "CALL sys.hot_snapshot('/root/dummy', 0)");
        if (handle == NULL || mapi_error(conn)) {
-               e = newErr("prepare failed: %s", mapi_error_str(conn));
+               e = newErr("mapi_prepare: %s", mapi_error_str(conn));
                goto bailout;
        }
        if (mapi_execute(handle) != MOK) {
-               e = newErr("internal error: execute failed: %s", 
mapi_result_error(handle));
+               e = newErr("%s", mapi_result_error(handle));
                goto bailout;
        }
 
@@ -192,15 +192,15 @@ snapshot_database_to(char *dbname, char 
        /* Trigger the snapshot */
        handle = mapi_prepare(conn, "CALL sys.hot_snapshot(?)");
        if (handle == NULL || mapi_error(conn)) {
-               e = newErr("prepare failed: %s", mapi_error_str(conn));
+               e = newErr("mapi_prepare: %s", mapi_error_str(conn));
                goto bailout;
        }
        if (mapi_param_string(handle, 0, 12, dest, NULL) != MOK) {
-               e = newErr("internal error: mapi_param_string: %s", 
mapi_error_str(conn));
+               e = newErr("mapi_param_string: %s", mapi_error_str(conn));
                goto bailout;
        }
        if (mapi_execute(handle) != MOK) {
-               e = newErr("internal error: execute failed: %s", 
mapi_result_error(handle));
+               e = newErr("%s", mapi_result_error(handle));
                goto bailout;
        }
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to