summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/connect/connect.cc5
-rw-r--r--storage/connect/ha_connect.cc6
-rwxr-xr-x[-rw-r--r--]storage/connect/mysql-test/connect/r/pivot.result0
-rwxr-xr-x[-rw-r--r--]storage/connect/mysql-test/connect/t/pivot.test0
-rwxr-xr-x[-rw-r--r--]storage/connect/tabpivot.cpp4
-rwxr-xr-x[-rw-r--r--]storage/connect/tabpivot.h0
-rw-r--r--storage/connect/tabtbl.cpp27
-rw-r--r--storage/connect/tabutil.h16
8 files changed, 13 insertions, 45 deletions
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index 54816f80e5c..6ae730f20b2 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -657,11 +657,6 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id)
cdp= tdbp->Key(k)->GetCdp();
valp= AllocateValue(g, cdp->GetType(), cdp->GetLength());
tdbp->To_Link[k]= new(g) CONSTANT(valp);
-
-//if (kdp->Klen && tdbp->To_Link[k]->GetResultType() == TYPE_STRING)
-// ((XCOLBLK*)tdbp->To_Link[k])->SetLength(kdp->Klen);
-
-//((PCOL)tdbp->To_Link[k])->InitValue(g);
} // endfor k
// Make the index on xdp
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 298fb71b334..ca0f9f7e08a 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -3014,8 +3014,10 @@ int ha_connect::external_lock(THD *thd, int lock_type)
// This can NOT be called without open called first, but
// the table can have been closed since then
} else if (!tdbp || xp->CheckQuery(valid_query_id) || xmod != newmode) {
- if (tdbp)
- CloseTable(g);
+ // If this is called by a later query, the table may have
+ // been already closed and the tdbp is not valid anymore.
+ if (tdbp && xp->last_query_id == valid_query_id)
+ rc= CloseTable(g);
xmod= newmode;
diff --git a/storage/connect/mysql-test/connect/r/pivot.result b/storage/connect/mysql-test/connect/r/pivot.result
index 4480788332b..4480788332b 100644..100755
--- a/storage/connect/mysql-test/connect/r/pivot.result
+++ b/storage/connect/mysql-test/connect/r/pivot.result
diff --git a/storage/connect/mysql-test/connect/t/pivot.test b/storage/connect/mysql-test/connect/t/pivot.test
index f06c92828f9..f06c92828f9 100644..100755
--- a/storage/connect/mysql-test/connect/t/pivot.test
+++ b/storage/connect/mysql-test/connect/t/pivot.test
diff --git a/storage/connect/tabpivot.cpp b/storage/connect/tabpivot.cpp
index efd9cf6a950..4ae1b3ceae6 100644..100755
--- a/storage/connect/tabpivot.cpp
+++ b/storage/connect/tabpivot.cpp
@@ -876,7 +876,9 @@ int TDBPIVOT::DeleteDB(PGLOBAL g, int irc)
/***********************************************************************/
void TDBPIVOT::CloseDB(PGLOBAL g)
{
- Tdbp->CloseDB(g);
+ if (Tdbp)
+ Tdbp->CloseDB(g);
+
} // end of CloseDB
#if 0
diff --git a/storage/connect/tabpivot.h b/storage/connect/tabpivot.h
index bed288dc560..bed288dc560 100644..100755
--- a/storage/connect/tabpivot.h
+++ b/storage/connect/tabpivot.h
diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp
index 5a2089d04d6..7b10089ea36 100644
--- a/storage/connect/tabtbl.cpp
+++ b/storage/connect/tabtbl.cpp
@@ -214,8 +214,7 @@ PCOL TDBTBL::InsertSpecialColumn(PGLOBAL g, PCOL scp)
/***********************************************************************/
bool TDBTBL::InitTableList(PGLOBAL g)
{
- char *colname;
- int n, colpos;
+ int n;
PTABLE tp, tabp;
PTDB tdbp;
PCOL colp;
@@ -242,23 +241,9 @@ bool TDBTBL::InitTableList(PGLOBAL g)
// Real initialization will be done later.
for (PCOL cp = Columns; cp; cp = cp->GetNext())
if (!cp->IsSpecial()) {
- colname = cp->GetName();
- colpos = ((PPRXCOL)cp)->Colnum;
-
- // We try first to get the column by name
- if (!(colp = tdbp->ColDB(g, colname, 0)) && colpos)
- // When unsuccessful, if a column number was specified
- // try to get the column by its position in the table
- colp = tdbp->ColDB(g, NULL, colpos);
-
- if (!colp) {
- if (!Accept) {
- sprintf(g->Message, MSG(NO_MATCHING_COL),
- colname, tdbp->GetName());
- return TRUE; // Error return
- } // endif !Accept
-
- } else // this is needed by some tables (which?)
+ if (((PPRXCOL)cp)->Init(g) && !Accept)
+ return TRUE;
+ else // this is needed by some tables (which?)
colp->SetColUse(cp->GetColUse());
} // endif !special
@@ -428,7 +413,7 @@ bool TDBTBL::OpenDB(PGLOBAL g)
for (PCOL cp = Columns; cp; cp = cp->GetNext())
if (cp->GetAmType() == TYPE_AM_TABID)
cp->COLBLK::Reset();
- else if (((PPRXCOL)cp)->Init(g))
+ else if (((PPRXCOL)cp)->Init(g) && !Accept)
return TRUE;
if (trace)
@@ -482,7 +467,7 @@ int TDBTBL::ReadDB(PGLOBAL g)
for (PCOL cp = Columns; cp; cp = cp->GetNext())
if (cp->GetAmType() == TYPE_AM_TABID)
cp->COLBLK::Reset();
- else if (((PPRXCOL)cp)->Init(g))
+ else if (((PPRXCOL)cp)->Init(g) && !Accept)
return RC_FX;
if (trace)
diff --git a/storage/connect/tabutil.h b/storage/connect/tabutil.h
index b99cf959bca..81e2a44464a 100644
--- a/storage/connect/tabutil.h
+++ b/storage/connect/tabutil.h
@@ -14,28 +14,12 @@ typedef class XXLCOL *PXXLCOL;
typedef class PRXCOL *PPRXCOL;
typedef class TBCDEF *PTBCDEF;
typedef class TDBTBC *PTDBTBC;
-typedef class XTDBASE *PTDBX;
-typedef class XCOLBLK *PCOLX;
TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db,
const char *name, bool& mysql);
PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
const char *name, bool info);
-/***********************************************************************/
-/* This class is used to access protected members of TDBASE. */
-/***********************************************************************/
-class XTDBASE : public TDBASE {
- friend class TDBXCL;
- }; // end of class XCOLBLK
-
-/***********************************************************************/
-/* This class is used to access protected members of COLBLK. */
-/***********************************************************************/
-class XCOLBLK : public COLBLK {
- friend class TDBXCL;
- }; // end of class XCOLBLK
-
/* -------------------------- PROXY classes -------------------------- */
/***********************************************************************/