Changeset: b76b6db1d4bf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b76b6db1d4bf
Modified Files:
        clients/odbc/driver/SQLConnect.c
Branch: default
Log Message:

Rename internal argument name from catalog to dbname.


diffs (69 lines):

diff --git a/clients/odbc/driver/SQLConnect.c b/clients/odbc/driver/SQLConnect.c
--- 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);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to