diff options
Diffstat (limited to 'storage/connect/tabtbl.cpp')
-rw-r--r-- | storage/connect/tabtbl.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp index 22ec3849b6f..7f979eaf4be 100644 --- a/storage/connect/tabtbl.cpp +++ b/storage/connect/tabtbl.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to PlugDB Software Development 2008-2014 */ +/* (C) Copyright to PlugDB Software Development 2008-2015 */ /* Author: Olivier BERTRAND */ /* */ /* WHAT THIS PROGRAM DOES: */ @@ -39,7 +39,7 @@ //#include "sql_base.h" #include "my_global.h" #include "table.h" // MySQL table definitions -#if defined(WIN32) +#if defined(__WIN__) #include <stdlib.h> #include <stdio.h> #if defined(__BORLANDC__) @@ -70,21 +70,18 @@ #include "tabcol.h" #include "tabdos.h" // TDBDOS and DOSCOL class dcls #include "tabtbl.h" -#if defined(MYSQL_SUPPORT) #include "tabmysql.h" -#endif // MYSQL_SUPPORT #include "ha_connect.h" -#include "mycat.h" // For GetHandler -#if defined(WIN32) +#if defined(__WIN__) #if defined(__BORLANDC__) #define SYSEXIT void _USERENTRY #else #define SYSEXIT void #endif -#else // !WIN32 +#else // !__WIN__ #define SYSEXIT void * -#endif // !WIN32 +#endif // !__WIN__ /* ---------------------------- Class TBLDEF ---------------------------- */ @@ -104,7 +101,7 @@ TBLDEF::TBLDEF(void) /**************************************************************************/ /* DefineAM: define specific AM block values from XDB file. */ /**************************************************************************/ -bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR, int) { char *tablist, *dbname, *def = NULL; @@ -164,7 +161,7 @@ bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) /***********************************************************************/ /* GetTable: makes a new Table Description Block. */ /***********************************************************************/ -PTDB TBLDEF::GetTable(PGLOBAL g, MODE m) +PTDB TBLDEF::GetTable(PGLOBAL g, MODE) { if (Catfunc == FNC_COL) return new(g) TDBTBC(this); @@ -205,7 +202,7 @@ PCOL TDBTBL::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) /***********************************************************************/ /* InsertSpecialColumn: Put a special column ahead of the column list.*/ /***********************************************************************/ -PCOL TDBTBL::InsertSpecialColumn(PGLOBAL g, PCOL scp) +PCOL TDBTBL::InsertSpecialColumn(PCOL scp) { PCOL colp; @@ -266,7 +263,7 @@ bool TDBTBL::InitTableList(PGLOBAL g) // Real initialization will be done later. for (colp = Columns; colp; colp = colp->GetNext()) if (!colp->IsSpecial()) - if (((PPRXCOL)colp)->Init(g) && !Accept) + if (((PPRXCOL)colp)->Init(g, NULL) && !Accept) return TRUE; if (Tablist) @@ -352,7 +349,9 @@ bool TDBTBL::TestFil(PGLOBAL g, PCFIL filp, PTABLE tabp) /***********************************************************************/ int TDBTBL::Cardinality(PGLOBAL g) { - if (Cardinal < 0) { + if (!g) + return 0; // Cannot make the table list + else if (Cardinal < 0) { int tsz; if (!Tablist && InitTableList(g)) @@ -468,7 +467,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) && !Accept) + else if (((PPRXCOL)cp)->Init(g, NULL) && !Accept) return TRUE; if (trace) @@ -523,7 +522,7 @@ int TDBTBL::ReadDB(PGLOBAL g) if (cp->GetAmType() == TYPE_AM_TABID || cp->GetAmType() == TYPE_AM_SRVID) cp->COLBLK::Reset(); - else if (((PPRXCOL)cp)->Init(g) && !Accept) + else if (((PPRXCOL)cp)->Init(g, NULL) && !Accept) return RC_FX; if (trace) @@ -549,7 +548,7 @@ int TDBTBL::ReadDB(PGLOBAL g) /***********************************************************************/ /* ReadColumn: */ /***********************************************************************/ -void TBTBLK::ReadColumn(PGLOBAL g) +void TBTBLK::ReadColumn(PGLOBAL) { if (trace) htrc("TBT ReadColumn: name=%s\n", Name); @@ -716,7 +715,7 @@ bool TDBTBM::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) && !Accept) + else if (((PPRXCOL)cp)->Init(g, NULL) && !Accept) return TRUE; if (trace) @@ -807,7 +806,7 @@ int TDBTBM::ReadNextRemote(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) && !Accept) + else if (((PPRXCOL)cp)->Init(g, NULL) && !Accept) return RC_FX; if (trace) |