Re: 0.91RC1

Ken Collins <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
> FreeTDS proudly, and with great relief, announces the first release
> candidate for its next version, 0.91.

Congrats and thanks!

>   Please give it a whirl.  
> As a member of this mailing list, your feedback is invaluable both to
> the developers and to the larger FreeTDS community.

Got a problem. Seems the patch for DBSETDBNAME was only partially applied and as such FreeTDS bombs when using that feature. I have attached another patch that focuses on what was missed in dblib.c, config.c, and login.c

_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
patch-defaultdb-again.diff (application/octet-stream, 1.6 KB)
--- a/src/dblib/dblib.c
+++ b/src/dblib/dblib.c
@@ -780,6 +780,10 @@ dbsetlname(LOGINREC * login, const char *value, int which)
 		tds_set_language(login->tds_login, value);
 		return SUCCEED;
 		break;
+	case DBSETDBNAME:
+		tds_set_database_name(login->tds_login, value ? value : "");
+		return SUCCEED;
+		break;
 	default:
 		dbperror(NULL, SYBEASUL, 0); /* Attempt to set unknown LOGINREC field */
 		return FAIL;
diff --git a/src/tds/config.c b/src/tds/config.c
index 742e3d0..71c2361 100644
--- a/src/tds/config.c
+++ b/src/tds/config.c
@@ -640,6 +640,11 @@ tds_config_login(TDSCONNECTION * connection, TDSLOGIN * login)
 		tdsdump_log(TDS_DBG_INFO1, "tds_config_login: %s is %s.\n", "client_charset",
 			    tds_dstr_cstr(&connection->client_charset));
 	}
+	if (!tds_dstr_isempty(&login->database)) {
+		tds_dstr_dup(&connection->database, &login->database);
+		tdsdump_log(TDS_DBG_INFO1, "tds_config_login: %s is %s.\n", "database_name",
+			    tds_dstr_cstr(&connection->database));
+	}
 	if (!tds_dstr_isempty(&login->client_host_name)) {
 		tds_dstr_dup(&connection->client_host_name, &login->client_host_name);
 	}
diff --git a/src/tds/login.c b/src/tds/login.c
index bc25aac..531b803 100644
--- a/src/tds/login.c
+++ b/src/tds/login.c
@@ -163,6 +163,12 @@ tds_set_language(TDSLOGIN * tds_login, const char *language)
 }
 
 void
+tds_set_database_name(TDSLOGIN * tds_login, const char *dbname)
+{
+	tds_dstr_copy(&tds_login->database, dbname);
+}
+
+void
 tds_set_capabilities(TDSLOGIN * tds_login, unsigned char *capabilities, int size)
 {
 	memcpy(tds_login->capabilities, capabilities, size > TDS_MAX_CAPABILITY ? TDS_MAX_CAPABILITY : size);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.