summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2013-06-29 01:10:31 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2013-06-29 01:10:31 +0200
commitb8d6f97380c7f3e3e9278afb9dd21c133c0d051e (patch)
tree710f3b381dfe9a8053fab30ff5336b6008df2a5c /storage
parent9508e913e726f23cfdaeccbce12619e5e4e72bfc (diff)
downloadmariadb-git-b8d6f97380c7f3e3e9278afb9dd21c133c0d051e.tar.gz
- Add the PROFILE_End function in inihandl. Called by connect_done_func
to release the cache memory allocated by the PROFILE perocessing. (also add some break at the end of switch's to avoid warnings) modified: storage/connect/filamvct.cpp storage/connect/ha_connect.cc storage/connect/inihandl.c storage/connect/inihandl.h
Diffstat (limited to 'storage')
-rwxr-xr-xstorage/connect/filamvct.cpp8
-rw-r--r--storage/connect/ha_connect.cc24
-rw-r--r--storage/connect/inihandl.c25
-rw-r--r--storage/connect/inihandl.h1
4 files changed, 51 insertions, 7 deletions
diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp
index 47ac07c6554..914d671637c 100755
--- a/storage/connect/filamvct.cpp
+++ b/storage/connect/filamvct.cpp
@@ -10,15 +10,15 @@
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
/* This program are the VCT file access method classes. */
-/* Added in version 2: F */
+/* Added in version 2: F */
/* - Split Vec format. */
/* - Partial delete. */
-/* - Use of tempfile for update. */
+/* - Use of tempfile for update. */
/* */
/***********************************************************************/
/***********************************************************************/
-/* Include relevant MariaDB header file. */
+/* Include relevant MariaDB header file. */
/***********************************************************************/
#include "my_global.h"
#if defined(WIN32)
@@ -1823,7 +1823,7 @@ bool VECFAM::OpenTableFile(PGLOBAL g)
{
char opmode[4];
int i;
- bool b;
+ bool b= false;
PCOLDEF cdp;
PVCTCOL cp;
MODE mode = Tdbp->GetMode();
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index a75bcf86b22..62641c2234f 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -360,6 +360,9 @@ static int connect_init_func(void *p)
trace= xtrace;
} // endif xtrace
+#if !defined(WIN32)
+ PROFILE_Close(connectini);
+#endif // !WIN32
init_connect_psi_keys();
@@ -395,7 +398,7 @@ static int connect_done_func(void *p)
#endif // LIBXML2_SUPPORT
#if !defined(WIN32)
- PROFILE_Close(connectini);
+ PROFILE_End();
#endif // !WIN32
for (pc= user_connect::to_users; pc; pc= pn) {
@@ -903,6 +906,7 @@ void *ha_connect::GetColumnOption(void *field, PCOLINFO pcf)
case MYSQL_TYPE_VARCHAR:
case MYSQL_TYPE_VAR_STRING:
pcf->Flags |= U_VAR;
+ /* no break */
case MYSQL_TYPE_STRING:
pcf->Type= TYPE_STRING;
@@ -966,6 +970,7 @@ void *ha_connect::GetColumnOption(void *field, PCOLINFO pcf)
break;
default:
pcf->Type=TYPE_ERROR;
+ break;
} // endswitch type
// This is used to skip null bit
@@ -1327,6 +1332,7 @@ int ha_connect::MakeRecord(char *buf)
break;
default:
fmt= "%Y-%m-%d %H:%M:%S";
+ break;
} // endswitch type
// Get date in the format required by MySQL fields
@@ -1340,6 +1346,7 @@ int ha_connect::MakeRecord(char *buf)
// Passthru
default:
p= value->GetCharString(val);
+ break;
} // endswitch Type
if (p) {
@@ -1459,6 +1466,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *buf)
attribute.charset(), charset, &cnv_errors);
value->SetValue_psz(data_charset_value.c_ptr_safe());
}
+ break;
} // endswitch Type
#ifdef NEWCHANGE
@@ -1566,6 +1574,7 @@ const char *ha_connect::GetValStr(OPVAL vop, bool neg)
break;
default:
val= " ? ";
+ break;
} /* endswitch */
return val;
@@ -2168,6 +2177,7 @@ int ha_connect::ReadIndexed(uchar *buf, OPVAL op, const uchar *key, uint key_len
DBUG_PRINT("ReadIndexed", ("%s", xp->g->Message));
printf("ReadIndexed: %s\n", xp->g->Message);
rc= HA_ERR_INTERNAL_ERROR;
+ break;
} // endswitch RC
if (xtrace > 1)
@@ -2210,7 +2220,7 @@ int ha_connect::index_read(uchar * buf, const uchar * key, uint key_len,
case HA_READ_KEY_EXACT: op= OP_EQ; break;
case HA_READ_AFTER_KEY: op= OP_GT; break;
case HA_READ_KEY_OR_NEXT: op= OP_GE; break;
- default: DBUG_RETURN(-1);
+ default: DBUG_RETURN(-1); break;
} // endswitch find_flag
if (xtrace > 1)
@@ -2833,6 +2843,7 @@ int ha_connect::external_lock(THD *thd, int lock_type)
case F_UNLCK:
default:
newmode= MODE_ANY;
+ break;
} // endswitch mode
if (newmode == MODE_ANY) {
@@ -2990,6 +3001,7 @@ int ha_connect::external_lock(THD *thd, int lock_type)
printf("Unsupported sql_command=%d", thd_sql_command(thd));
sprintf(g->Message, "Unsupported sql_command=%d", thd_sql_command(thd));
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
+ break;
} // endswitch newmode
} else if (newmode == MODE_READ) {
@@ -3027,6 +3039,7 @@ int ha_connect::external_lock(THD *thd, int lock_type)
printf("Unsupported sql_command=%d", thd_sql_command(thd));
sprintf(g->Message, "Unsupported sql_command=%d", thd_sql_command(thd));
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
+ break;
} // endswitch newmode
} // endif's newmode
@@ -3583,6 +3596,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
break;
default:
sprintf(g->Message, "Cannot get column info for table type %s", topt->type);
+ break;
} // endif ttp
// Check for supported catalog function
@@ -3643,6 +3657,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
break;
default:
sprintf(g->Message, "invalid catfunc %s", fncn);
+ break;
} // endswitch info
break;
@@ -3979,7 +3994,8 @@ int ha_connect::create(const char *name, TABLE *table_arg,
} // endif tabname
default: /* do nothing */;
- } // endswitch ttp
+ break;
+ } // endswitch ttp
if (type == TAB_XML) {
bool dom; // True: MS-DOM, False libxml2
@@ -4001,6 +4017,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
break;
default:
dom= false;
+ break;
} // endswitch xsup
#if !defined(DOMDOC_SUPPORT)
@@ -4086,6 +4103,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
"Unsupported type for column '%s'",
MYF(0), fp->field_name);
DBUG_RETURN(rc);
+ break;
} // endswitch type
if ((fp)->real_maybe_null() && !IsTypeNullable(type)) {
diff --git a/storage/connect/inihandl.c b/storage/connect/inihandl.c
index 60b72bd2604..0dc7a53faf3 100644
--- a/storage/connect/inihandl.c
+++ b/storage/connect/inihandl.c
@@ -609,6 +609,31 @@ void PROFILE_Close(LPCSTR filename)
/***********************************************************************
+ * PROFILE_End
+ *
+ * Terminate and release the cache.
+ ***********************************************************************/
+void PROFILE_End(void)
+{
+ int i;
+
+ if (trace)
+ htrc("PROFILE_End: CurProfile=%p N=%d\n", CurProfile, N_CACHED_PROFILES);
+
+ /* Close all opened files and free the cache structure */
+ for (i = 0; i < N_CACHED_PROFILES; i++) {
+ if (trace)
+ htrc("MRU=%s i=%d\n", SVP(MRUProfile[i]->filename), i);
+
+ CurProfile = MRUProfile[i];
+ PROFILE_ReleaseFile();
+ free(MRUProfile[i]);
+ } // endfor i
+
+} // end of PROFILE_End
+
+
+/***********************************************************************
* PROFILE_DeleteSection
*
* Delete a section from a profile tree.
diff --git a/storage/connect/inihandl.h b/storage/connect/inihandl.h
index 7f6fcb1f582..f0b7c9afe5c 100644
--- a/storage/connect/inihandl.h
+++ b/storage/connect/inihandl.h
@@ -8,6 +8,7 @@ extern "C" {
#endif
void PROFILE_Close(LPCSTR filename);
+void PROFILE_End(void);
int GetPrivateProfileString(
LPCTSTR lpAppName, // section name