summaryrefslogtreecommitdiff
path: root/storage/connect/plgdbutl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storage/connect/plgdbutl.cpp')
-rw-r--r--storage/connect/plgdbutl.cpp40
1 files changed, 37 insertions, 3 deletions
diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp
index 03a326ce89a..25da3162516 100644
--- a/storage/connect/plgdbutl.cpp
+++ b/storage/connect/plgdbutl.cpp
@@ -70,7 +70,13 @@
#include "rcmsg.h"
#ifdef ZIP_SUPPORT
#include "filamzip.h"
-#endif // ZIP_SUPPORT
+#endif // ZIP_SUPPORT
+#ifdef JDBC_SUPPORT
+#include "javaconn.h"
+#endif // JDBC_SUPPORT
+#ifdef CMGO_SUPPORT
+#include "cmgoconn.h"
+#endif // MONGO_SUPPORT
/***********************************************************************/
/* DB static variables. */
@@ -82,7 +88,11 @@ extern "C" {
extern char version[];
} // extern "C"
+//#if defined(__WIN__)
+//extern CRITICAL_SECTION parsec; // Used calling the Flex parser
+//#else // !__WIN__
extern pthread_mutex_t parmut;
+//#endif // !__WIN__
// The debug trace used by the main thread
FILE *pfile = NULL;
@@ -104,6 +114,9 @@ void CloseXMLFile(PGLOBAL, PFBLOCK, bool);
#include "libdoc.h"
#endif // LIBXML2_SUPPORT
+#ifdef ODBC_SUPPORT
+void OdbcClose(PGLOBAL g, PFBLOCK fp);
+#endif // ODBC_SUPPORT
/***********************************************************************/
/* Routines for file IO with error reporting to g->Message */
@@ -691,7 +704,7 @@ PDTP MakeDateFormat(PGLOBAL g, PCSZ dfmt, bool in, bool out, int flag)
/*********************************************************************/
/* Call the FLEX generated parser. In multi-threading mode the next */
- /* instruction is included in an Enter/LeaveCriticalSection bracket. */
+ /* instruction is protected by mutex fmdflex using static variables. */
/*********************************************************************/
pthread_mutex_lock(&parmut);
rc = fmdflex(pdp);
@@ -870,7 +883,7 @@ FILE *PlugReopenFile(PGLOBAL g, PFBLOCK fp, LPCSTR md)
/* Close file routine: the purpose of this routine is to avoid */
/* double closing that freeze the system on some Unix platforms. */
/***********************************************************************/
-int PlugCloseFile(PGLOBAL g __attribute__((unused)), PFBLOCK fp, bool all)
+int PlugCloseFile(PGLOBAL g, PFBLOCK fp, bool all)
{
int rc = 0;
@@ -919,6 +932,13 @@ int PlugCloseFile(PGLOBAL g __attribute__((unused)), PFBLOCK fp, bool all)
CloseXML2File(g, fp, all);
break;
#endif // LIBXML2_SUPPORT
+#ifdef ODBC_SUPPORT
+ case TYPE_FB_ODBC:
+ OdbcClose(g, fp);
+ fp->Count = 0;
+ fp->File = NULL;
+ break;
+#endif // ODBC_SUPPORT
#ifdef ZIP_SUPPORT
case TYPE_FB_ZIP:
if (fp->Mode == MODE_INSERT)
@@ -932,6 +952,20 @@ int PlugCloseFile(PGLOBAL g __attribute__((unused)), PFBLOCK fp, bool all)
fp->File = NULL;
break;
#endif // ZIP_SUPPORT
+#ifdef JDBC_SUPPORT
+ case TYPE_FB_JAVA:
+ ((JAVAConn*)fp->File)->Close();
+ fp->Count = 0;
+ fp->File = NULL;
+ break;
+#endif // JDBC_SUPPORT
+#ifdef CMGO_SUPPORT
+ case TYPE_FB_MONGO:
+ ((CMgoConn*)fp->File)->Close();
+ fp->Count = 0;
+ fp->File = NULL;
+ break;
+#endif // MONGO_SUPPORT
default:
rc = RC_FX;
} // endswitch Type