globals.debug or globals.commlog means whether take mylog or commlog out of
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Wed, 9 Nov 2016 10:00:32 +0000 (19:00 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Thu, 10 Nov 2016 03:31:30 +0000 (12:31 +0900)
the connection time or not but doesn't mean the default of ci->drivers.debug(commlog).

dlg_specific.c

index 58c85d0da0e1b82c0dc8e92f5ef063ab23aba4e0..4f59f779ce4afe11ec80264b5924855a61a00fa4 100644 (file)
@@ -1310,38 +1310,58 @@ getCommonDefaults(const char *section, const char *filename, ConnInfo *ci)
        comval = &(ci->drivers);
    else
        comval = &globals;
-   /* Fetch Count is stored in driver section */
-   SQLGetPrivateProfileString(section, INI_FETCH, "",
-                              temp, sizeof(temp), filename);
-   if (temp[0])
-   {
-       comval->fetch_max = atoi(temp);
-       /* sanity check if using cursors */
-       if (comval->fetch_max <= 0)
-           comval->fetch_max = FETCH_MAX;
-   }
-   else if (inst_position)
-       comval->fetch_max = FETCH_MAX;
 
+   /*
+    * globals.debug or globals.commlog means whether take mylog or commlog
+    * out of the connection time or not but doesn't mean the default of
+    * ci->drivers.debug(commlog).
+    */
    /* Debug is stored in the driver section */
    SQLGetPrivateProfileString(section, INI_DEBUG, "",
-                              temp, sizeof(temp), filename);
+                  temp, sizeof(temp), filename);
    if (temp[0])
-       comval->debug = atoi(temp);
+   {
+       if (inst_position && ci)
+           ;
+       else
+           comval->debug = atoi(temp);
+   }
    else if (inst_position)
        comval->debug = DEFAULT_DEBUG;
 
    /* CommLog is stored in the driver section */
    SQLGetPrivateProfileString(section, INI_COMMLOG, "",
-                              temp, sizeof(temp), filename);
+                  temp, sizeof(temp), filename);
    if (temp[0])
-       comval->commlog = atoi(temp);
+   {
+       if (inst_position && ci)
+           ;
+       else
+           comval->commlog = atoi(temp);
+   }
    else if (inst_position)
        comval->commlog = DEFAULT_COMMLOG;
 
    if (!ci)
        logs_on_off(0, 0, 0);
 
+   /*
+    * If inst_position of xxxxxx is present(usually not present),
+    * it is the default of ci->drivers.xxxxxx .
+    */
+   /* Fetch Count is stored in driver section */
+   SQLGetPrivateProfileString(section, INI_FETCH, "",
+                              temp, sizeof(temp), filename);
+   if (temp[0])
+   {
+       comval->fetch_max = atoi(temp);
+       /* sanity check if using cursors */
+       if (comval->fetch_max <= 0)
+           comval->fetch_max = FETCH_MAX;
+   }
+   else if (inst_position)
+       comval->fetch_max = FETCH_MAX;
+
    /* Recognize Unique Index is stored in the driver section only */
    SQLGetPrivateProfileString(section, INI_UNIQUEINDEX, "",
                               temp, sizeof(temp), filename);