changeset 86171:b76b6db1d4bf

Rename internal argument name from catalog to dbname.
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Wed, 27 Jul 2022 18:11:46 +0200
parents 4eab9935b32f
children 8fff25e863e6
files clients/odbc/driver/SQLConnect.c
diffstat 1 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/clients/odbc/driver/SQLConnect.c
+++ b/clients/odbc/driver/SQLConnect.c
@@ -113,7 +113,7 @@ MNDBConnect(ODBCDbc *dbc,
 	    SQLSMALLINT NameLength3,
 	    const char *host,
 	    int port,
-	    const char *catalog)
+	    const char *dbname)
 {
 	SQLRETURN rc = SQL_SUCCESS;
 	char *dsn = NULL;
@@ -199,19 +199,19 @@ MNDBConnect(ODBCDbc *dbc,
 		pwd[NameLength3] = 0;
 	}
 
-	if (catalog == NULL || *catalog == 0) {
-		catalog = dbc->dbname;
+	if (dbname == NULL || *dbname == 0) {
+		dbname = dbc->dbname;
 	}
-	if (catalog == NULL || *catalog == 0) {
+	if (dbname == NULL || *dbname == 0) {
 		if (dsn && *dsn) {
 			n = SQLGetPrivateProfileString(dsn, "database", "", db,
 						       sizeof(db), "odbc.ini");
 			if (n > 0)
-				catalog = db;
+				dbname = db;
 		}
 	}
-	if (catalog && !*catalog)
-		catalog = NULL;
+	if (dbname && !*dbname)
+		dbname = NULL;
 
 	if (port == 0 && (s = getenv("MAPIPORT")) != NULL)
 		port = atoi(s);
@@ -238,12 +238,12 @@ MNDBConnect(ODBCDbc *dbc,
 #ifdef ODBCDEBUG
 	ODBCLOG("SQLConnect: DSN=%s UID=%s PWD=%s host=%s port=%d database=%s\n",
 		dsn ? dsn : "(null)", uid, pwd, host, port,
-		catalog ? catalog : "(null)");
+		dbname ? dbname : "(null)");
 #endif
 
 	/* connect to a server on host via port */
-	/* FIXME: use dbname/catalog from ODBC connect string/options here */
-	mid = mapi_connect(host, port, uid, pwd, "sql", catalog);
+	/* FIXME: use dbname from ODBC connect string/options here */
+	mid = mapi_connect(host, port, uid, pwd, "sql", dbname);
 	if (mid == NULL || mapi_error(mid)) {
 		/* Client unable to establish connection */
 		addDbcError(dbc, "08001", NULL, 0);
@@ -269,11 +269,11 @@ MNDBConnect(ODBCDbc *dbc,
 		if (dbc->host)
 			free(dbc->host);
 		dbc->host = strdup(host);
-		if (catalog)	/* dup before dbname is freed */
-			catalog = strdup(catalog);
+		if (dbname)	/* dup before dbname is freed */
+			dbname = strdup(dbname);
 		if (dbc->dbname != NULL)
 			free(dbc->dbname);
-		dbc->dbname = (char *) catalog; /* discard const */
+		dbc->dbname = (char *) dbname; /* discard const */
 		mapi_setAutocommit(mid, dbc->sql_attr_autocommit == SQL_AUTOCOMMIT_ON);
 		set_timezone(mid);
 		get_serverinfo(dbc);