Changeset: 554885e0cc33 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/554885e0cc33
Modified Files:
clients/mapilib/connect.c
clients/mapilib/connect_unix.c
Branch: Mar2025
Log Message:
If database was not unknown, skip further attempts to connect.
diffs (34 lines):
diff --git a/clients/mapilib/connect.c b/clients/mapilib/connect.c
--- a/clients/mapilib/connect.c
+++ b/clients/mapilib/connect.c
@@ -106,6 +106,10 @@ scan_sockets(Mapi mid)
if (scan_unix_sockets(mid) == MOK)
return MOK;
+ /* if database was not unknown (no message "no such database"),
+ * skip further attempts to connect */
+ if (mid->errorstr && strstr(mid->errorstr, "no such database") == NULL)
+ return MERROR;
errmsg = msetting_set_string(mid->settings, MP_HOST, "localhost");
if (!errmsg)
diff --git a/clients/mapilib/connect_unix.c b/clients/mapilib/connect_unix.c
--- a/clients/mapilib/connect_unix.c
+++ b/clients/mapilib/connect_unix.c
@@ -106,6 +106,16 @@ scan_unix_sockets(Mapi mid)
msettings_destroy(original);
free(namebuf);
return MOK;
+ } else if (msg == MSERVER && mid->errorstr &&
+ strstr(mid->errorstr, "no such database") ==
NULL) {
+ /* connecting failed, but database not
+ * unknown (no message "no such
+ * database"), so skip further
+ * attempts */
+ msettings_destroy(mid->settings);
+ mid->settings = NULL;
+ round = 2; /* to break out of outer loop */
+ break;
} else {
msettings_destroy(mid->settings);
mid->settings = NULL;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]