Commit 073b0e77 authored by unknown's avatar unknown

- MySQL connection was not closed in case of error

modified:
  storage/connect/myconn.cpp
parent 63798ef4
...@@ -148,9 +148,10 @@ PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db, ...@@ -148,9 +148,10 @@ PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db,
/* Now get the results into blocks. */ /* Now get the results into blocks. */
/**********************************************************************/ /**********************************************************************/
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
if ((rc = myc.Fetch(g, -1) == RC_FX)) if ((rc = myc.Fetch(g, -1) == RC_FX)) {
myc.Close();
return NULL; return NULL;
else if (rc == RC_NF) } else if (rc == RC_NF)
break; break;
// Get column name // Get column name
...@@ -165,12 +166,14 @@ PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db, ...@@ -165,12 +166,14 @@ PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db,
if ((nf = sscanf(fld, "%[^(](%d,%d", cmd, &len, &prec)) < 1) { if ((nf = sscanf(fld, "%[^(](%d,%d", cmd, &len, &prec)) < 1) {
sprintf(g->Message, MSG(BAD_FIELD_TYPE), fld); sprintf(g->Message, MSG(BAD_FIELD_TYPE), fld);
myc.Close();
return NULL; return NULL;
} else } else
qrp->Nblin++; qrp->Nblin++;
if ((type = MYSQLtoPLG(cmd)) == TYPE_ERROR) { if ((type = MYSQLtoPLG(cmd)) == TYPE_ERROR) {
sprintf(g->Message, "Unsupported column type %s", cmd); sprintf(g->Message, "Unsupported column type %s", cmd);
myc.Close();
return NULL; return NULL;
} // endif type } // endif type
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment