From fc2d79480971645661b7debb7d0a21f515754b8d Mon Sep 17 00:00:00 2001
From: Olivier Bertrand <bertrandop@gmail.com>
Date: Wed, 3 Jan 2018 12:57:41 +0100
Subject: - Fix MDEV-9844, MDEV-10179, MDEV-14214  This is done by removing the
 tbl table type THREAD option  that causes a multiple of sporadic bugs.  This
 may be temporary depending on whether a real fix is found.   modified:  
 storage/connect/mysql-test/connect/disabled.def   modified:  
 storage/connect/tabtbl.cpp   modified:   storage/connect/tabtbl.h

---
 storage/connect/mysql-test/connect/disabled.def |  1 +
 storage/connect/tabtbl.cpp                      | 20 ++++++----
 storage/connect/tabtbl.h                        | 50 ++++++++++++++-----------
 3 files changed, 41 insertions(+), 30 deletions(-)

(limited to 'storage/connect')

diff --git a/storage/connect/mysql-test/connect/disabled.def b/storage/connect/mysql-test/connect/disabled.def
index 6d59369a4df..0dcf030613d 100644
--- a/storage/connect/mysql-test/connect/disabled.def
+++ b/storage/connect/mysql-test/connect/disabled.def
@@ -19,3 +19,4 @@ json_java_3     : Need MongoDB running and its Java Driver installed
 mongo_c         : Need MongoDB running and its C Driver installed
 mongo_java_2    : Need MongoDB running and its Java Driver installed
 mongo_java_3    : Need MongoDB running and its Java Driver installed
+tbl_thread      : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed
diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp
index d3fb31fb57a..05bf2e33878 100644
--- a/storage/connect/tabtbl.cpp
+++ b/storage/connect/tabtbl.cpp
@@ -1,12 +1,9 @@
 /************* TabTbl C++ Program Source Code File (.CPP) **************/
 /* PROGRAM NAME: TABTBL                                                */
 /* -------------                                                       */
-/*  Version 1.8                                                        */
+/*  Version 1.9                                                        */
 /*                                                                     */
-/* COPYRIGHT:                                                          */
-/* ----------                                                          */
-/*  (C) Copyright to PlugDB Software Development          2008-2017    */
-/*  Author: Olivier BERTRAND                                           */
+/*  Author: Olivier BERTRAND                              2008-2018    */
 /*                                                                     */
 /* WHAT THIS PROGRAM DOES:                                             */
 /* -----------------------                                             */
@@ -168,9 +165,14 @@ PTDB TBLDEF::GetTable(PGLOBAL g, MODE)
   {
   if (Catfunc == FNC_COL)
     return new(g) TDBTBC(this);
-  else if (Thread)
-    return new(g) TDBTBM(this);
-  else
+	else if (Thread) {
+#if defined(DEVELOPMENT)
+		return new(g) TDBTBM(this);
+#else
+		strcpy(g->Message, "Option THREAD is no more supported");
+		return NULL;
+#endif   // DEVELOPMENT
+	} else
     return new(g) TDBTBL(this);
 
   } // end of GetTable
@@ -560,6 +562,7 @@ void TBTBLK::ReadColumn(PGLOBAL)
 
   } // end of ReadColumn
 
+#if defined(DEVELOPMENT)
 /* ------------------------- Class TDBTBM ---------------------------- */
 
 /***********************************************************************/
@@ -865,5 +868,6 @@ int TDBTBM::ReadNextRemote(PGLOBAL g)
 
   return RC_OK;
   } // end of ReadNextRemote
+#endif   // DEVELOPMENT
 
 /* ------------------------------------------------------------------- */
diff --git a/storage/connect/tabtbl.h b/storage/connect/tabtbl.h
index f02bf620aae..e7a84395787 100644
--- a/storage/connect/tabtbl.h
+++ b/storage/connect/tabtbl.h
@@ -11,29 +11,8 @@
 
 typedef class TBLDEF *PTBLDEF;
 typedef class TDBTBL *PTDBTBL;
-typedef class TDBTBM *PTDBTBM;
 typedef class MYSQLC *PMYC;
 
-/***********************************************************************/
-/*  Defines the structures used for distributed TBM tables.            */
-/***********************************************************************/
-typedef struct _TBMtable *PTBMT;
-
-typedef struct _TBMtable {
-  PTBMT     Next;                 // Points to next data table struct
-  PTABLE    Tap;                  // Points to the sub table
-  PGLOBAL   G;                    // Needed in thread routine
-  bool      Complete;             // TRUE when all results are read
-  bool      Ready;                // TRUE when results are there
-  int       Rows;                 // Total number of rows read so far
-  int       ProgCur;              // Current pos
-  int       ProgMax;              // Max pos
-  int       Rc;                   // Return code
-  THD      *Thd;
-  pthread_attr_t attr;            // ???
-  pthread_t Tid;                  // CheckOpen thread ID
-  } TBMT;
-
 /***********************************************************************/
 /*  TBL table.                                                         */
 /***********************************************************************/
@@ -123,7 +102,33 @@ class TBTBLK : public TIDBLK {
 
  protected:
   // Must not have additional members
-  }; // end of class TBTBLK
+}; // end of class TBTBLK
+
+#if defined(DEVELOPMENT)
+/***********************************************************************/
+/*  This table type is buggy and removed until a fix is found.         */
+/***********************************************************************/
+typedef class TDBTBM *PTDBTBM;
+
+/***********************************************************************/
+/*  Defines the structures used for distributed TBM tables.            */
+/***********************************************************************/
+typedef struct _TBMtable *PTBMT;
+
+typedef struct _TBMtable {
+	PTBMT     Next;                 // Points to next data table struct
+	PTABLE    Tap;                  // Points to the sub table
+	PGLOBAL   G;                    // Needed in thread routine
+	bool      Complete;             // TRUE when all results are read
+	bool      Ready;                // TRUE when results are there
+	int       Rows;                 // Total number of rows read so far
+	int       ProgCur;              // Current pos
+	int       ProgMax;              // Max pos
+	int       Rc;                   // Return code
+	THD      *Thd;
+	pthread_attr_t attr;            // ???
+	pthread_t Tid;                  // CheckOpen thread ID
+} TBMT;
 
 /***********************************************************************/
 /*  This is the TBM Access Method class declaration.                   */
@@ -160,3 +165,4 @@ class DllExport TDBTBM : public TDBTBL {
   }; // end of class TDBTBM
 
 pthread_handler_t ThreadOpen(void *p);
+#endif // DEVELOPMENT
-- 
cgit v1.2.1