Remove ConnInfo.drivers.onlyread and ConnInfo.drivers.conn_settings.
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Wed, 24 May 2017 02:13:40 +0000 (11:13 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Wed, 24 May 2017 02:13:40 +0000 (11:13 +0900)
They are rather confusing and we can use ConnInfo.onlyread and ConnInfo.conn_settings.

connection.c
dlg_specific.c
dlg_wingui.c
psqlodbc.h

index 1444c04d8d206bcdc005004e148dbdc827036aac..085e9d9611a710688ebdd99796a8d5e246924b46 100644 (file)
@@ -983,12 +983,10 @@ static char CC_initial_log(ConnectionClass *self, const char *func)
    if (NULL == self->locale_encoding)
    {
        encoding = check_client_encoding(ci->conn_settings);
-       if (!encoding)
-           encoding = check_client_encoding(ci->drivers.conn_settings);
        CC_set_locale_encoding(self, encoding);
        qlog("                extra_systable_prefixes='%s', conn_settings='%s' conn_encoding='%s'\n",
            ci->drivers.extra_systable_prefixes,
-           PRINT_NAME(ci->drivers.conn_settings),
+           PRINT_NAME(ci->conn_settings),
            encoding ? encoding : "");
    }
    if (self->status == CONN_DOWN)
@@ -1067,11 +1065,8 @@ CC_connect(ConnectionClass *self, char *salt_para)
     * function instead.
     */
 
-   /* Global settings */
-   retsend = CC_send_settings(self, GET_NAME(self->connInfo.drivers.conn_settings));
    /* Per Datasource settings */
-   if (retsend)
-       retsend = CC_send_settings(self, GET_NAME(self->connInfo.conn_settings));
+   retsend = CC_send_settings(self, GET_NAME(self->connInfo.conn_settings));
 
    if (CC_get_errornumber(self) > 0)
        saverr = strdup(CC_get_errormsg(self));
index 72ef7485fd70d646d27cfc7540fb3b27f8032883..83a30aa699da3ed372ee53e590101e4252902dd3 100644 (file)
@@ -1450,7 +1450,6 @@ get_Ci_Drivers(const char *section, const char *filename, GLOBAL_VALUES *comval)
        comval->unknowns_as_longvarchar = DEFAULT_UNKNOWNSASLONGVARCHAR;
        comval->bools_as_char = DEFAULT_BOOLSASCHAR;
        strcpy(comval->extra_systable_prefixes, DEFAULT_EXTRASYSTABLEPREFIXES);
-       comval->onlyread = DEFAULT_READONLY;
        strcpy(comval->protocol, DEFAULT_PROTOCOL);
    }
    if (NULL == section || strcmp(section, INVALID_DRIVER) == 0)
@@ -1545,23 +1544,6 @@ get_Ci_Drivers(const char *section, const char *filename, GLOBAL_VALUES *comval)
    /* Dont allow override of an override! */
    if (inst_position)
    {
-       char conn_settings[LARGE_REGISTRY_LEN];
-
-       /*
-        * ConnSettings is stored in the driver section and per datasource
-        * for override
-        */
-       SQLGetPrivateProfileString(section, INI_CONNSETTINGS, "",
-           conn_settings, sizeof(conn_settings), filename);
-       if ('\0' != conn_settings[0])
-           STRX_TO_NAME(comval->conn_settings, conn_settings);
-
-       /* Default state for future DSN's Readonly attribute */
-       SQLGetPrivateProfileString(section, INI_READONLY, "",
-                                  temp, sizeof(temp), filename);
-       if (temp[0])
-           comval->onlyread = atoi(temp);
-
        /*
         * Default state for future DSN's protocol attribute This isn't a
         * real driver option YET.  This is more intended for
@@ -1875,7 +1857,6 @@ void  copy_globals(GLOBAL_VALUES *to, const GLOBAL_VALUES *from)
    /***
    memcpy(to, from, sizeof(GLOBAL_VALUES));
    SET_NAME_DIRECTLY(to->drivername, NULL);
-   SET_NAME_DIRECTLY(to->conn_settings, NULL);
    ***/
    NAME_TO_NAME(to->drivername, from->drivername);
    CORR_VALCPY(fetch_max);
@@ -1885,8 +1866,6 @@ void  copy_globals(GLOBAL_VALUES *to, const GLOBAL_VALUES *from)
    CORR_VALCPY(debug);
    CORR_VALCPY(commlog);
    CORR_VALCPY(unique_index);
-   CORR_VALCPY(onlyread);      /* readonly is reserved on Digital C++
-                                * compiler */
    CORR_VALCPY(use_declarefetch);
    CORR_VALCPY(text_as_longvarchar);
    CORR_VALCPY(unknowns_as_longvarchar);
@@ -1895,7 +1874,6 @@ void  copy_globals(GLOBAL_VALUES *to, const GLOBAL_VALUES *from)
    CORR_VALCPY(parse);
    CORR_STRCPY(extra_systable_prefixes);
    CORR_STRCPY(protocol);
-   NAME_TO_NAME(to->conn_settings, from->conn_settings);
 
    mylog("copy_globals driver=%s\n", SAFE_NAME(to->drivername));
 }
@@ -1903,7 +1881,6 @@ void  copy_globals(GLOBAL_VALUES *to, const GLOBAL_VALUES *from)
 void   finalize_globals(GLOBAL_VALUES *glbv)
 {
    NULL_THE_NAME(glbv->drivername);
-   NULL_THE_NAME(glbv->conn_settings);
 }
 
 #undef CORR_STRCPY
index 370483c9179ef600e6773b943155faca1061ba18..4b3de67bffd0c2d29a21c483ff4bc02ac1675876 100644 (file)
@@ -169,8 +169,7 @@ mylog("!!!! %s;%d in\n", __FUNCTION__, src);
    CheckDlgButton(hdlg, DRV_COMMLOG, comval->commlog > 0);
    CheckDlgButton(hdlg, DRV_UNIQUEINDEX, comval->unique_index);
    /* EnableWindow(GetDlgItem(hdlg, DRV_UNIQUEINDEX), enable); */
-   CheckDlgButton(hdlg, DRV_READONLY, comval->onlyread);
-   EnableWindow(GetDlgItem(hdlg, DRV_READONLY), enable);
+   EnableWindow(GetDlgItem(hdlg, DRV_READONLY), FALSE);
    CheckDlgButton(hdlg, DRV_USEDECLAREFETCH, comval->use_declarefetch);
 
    /* Unknown Sizes clear */
@@ -203,8 +202,7 @@ mylog("!!!! %s;%d in\n", __FUNCTION__, src);
    SetDlgItemText(hdlg, DRV_EXTRASYSTABLEPREFIXES, comval->extra_systable_prefixes);
 
    /* Driver Connection Settings */
-   SetDlgItemText(hdlg, DRV_CONNSETTINGS, SAFE_NAME(comval->conn_settings));
-   EnableWindow(GetDlgItem(hdlg, DRV_CONNSETTINGS), enable);
+   EnableWindow(GetDlgItem(hdlg, DRV_CONNSETTINGS), FALSE);
    ShowWindow(GetDlgItem(hdlg, ID2NDPAGE), enable ? SW_HIDE : SW_SHOW);
    ShowWindow(GetDlgItem(hdlg, ID3RDPAGE), enable ? SW_HIDE : SW_SHOW);
 
@@ -222,10 +220,6 @@ driver_options_update(HWND hdlg, ConnInfo *ci)
 
    comval->commlog = IsDlgButtonChecked(hdlg, DRV_COMMLOG);
    comval->unique_index = IsDlgButtonChecked(hdlg, DRV_UNIQUEINDEX);
-   if (!ci)
-   {
-       comval->onlyread = IsDlgButtonChecked(hdlg, DRV_READONLY);
-   }
    comval->use_declarefetch = IsDlgButtonChecked(hdlg, DRV_USEDECLAREFETCH);
 
    /* Unknown (Default) Data Type sizes */
@@ -253,16 +247,6 @@ driver_options_update(HWND hdlg, ConnInfo *ci)
 
    GetDlgItemText(hdlg, DRV_EXTRASYSTABLEPREFIXES, comval->extra_systable_prefixes, sizeof(comval->extra_systable_prefixes));
 
-   /* Driver Connection Settings */
-   if (!ci)
-   {
-       char    conn_settings[LARGE_REGISTRY_LEN];
-
-       GetDlgItemText(hdlg, DRV_CONNSETTINGS, conn_settings, sizeof(conn_settings));
-       if ('\0' != conn_settings[0])
-           STR_TO_NAME(comval->conn_settings, conn_settings);
-   }
-
    /* fall through */
    return 0;
 }
index e54e3a880671680d3203f7506f11c0abb9012c94..281855e8866194e168c1687ac43630e744f8610d 100644 (file)
@@ -474,8 +474,6 @@ typedef struct GlobalValues_
    char        debug;
    char        commlog;
    char        unique_index;
-   char        onlyread;       /* readonly is reserved on Digital C++
-                                * compiler */
    char        use_declarefetch;
    char        text_as_longvarchar;
    char        unknowns_as_longvarchar;
@@ -484,7 +482,6 @@ typedef struct GlobalValues_
    char        parse;
    char        extra_systable_prefixes[MEDIUM_REGISTRY_LEN];
    char        protocol[SMALL_REGISTRY_LEN];
-   pgNAME      conn_settings;
 } GLOBAL_VALUES;
 
 void copy_globals(GLOBAL_VALUES *to, const GLOBAL_VALUES *from);