diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2013-05-13 12:20:08 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2013-05-13 12:20:08 +0200 |
commit | 24a7948343c712531236d4ec408178382433caa3 (patch) | |
tree | 6b5cfe16c6765527ae5bad1afc62b730f9d1c5b9 /storage/connect | |
parent | dee955bdee939506804fdc36bf33224e2b104926 (diff) | |
download | mariadb-git-24a7948343c712531236d4ec408178382433caa3.tar.gz |
- Code cleaning. Eliminating unused code, functions, and variables.
modified:
storage/connect/catalog.h
storage/connect/colblk.cpp
storage/connect/colblk.h
storage/connect/mycat.cc
storage/connect/reldef.cpp
storage/connect/tabcol.h
storage/connect/tabsys.cpp
storage/connect/tabsys.h
storage/connect/xobject.h
Diffstat (limited to 'storage/connect')
-rw-r--r-- | storage/connect/catalog.h | 10 | ||||
-rw-r--r-- | storage/connect/colblk.cpp | 13 | ||||
-rw-r--r-- | storage/connect/colblk.h | 1 | ||||
-rw-r--r-- | storage/connect/mycat.cc | 14 | ||||
-rw-r--r-- | storage/connect/reldef.cpp | 11 | ||||
-rw-r--r-- | storage/connect/tabcol.h | 1 | ||||
-rw-r--r-- | storage/connect/tabsys.cpp | 79 | ||||
-rw-r--r-- | storage/connect/tabsys.h | 5 | ||||
-rw-r--r-- | storage/connect/xobject.h | 1 |
9 files changed, 21 insertions, 114 deletions
diff --git a/storage/connect/catalog.h b/storage/connect/catalog.h index 365169100d9..3a06aea7a30 100644 --- a/storage/connect/catalog.h +++ b/storage/connect/catalog.h @@ -62,14 +62,9 @@ class DllExport CATALOG { virtual ~CATALOG() { } // Make -Wdelete-non-virtual-dtor happy // Implementation - void *GetDescp(void) {return Descp;} -//PRELDEF GetTo_Desc(void) {return To_Desc;} -//PSZ GetDescFile(void) {return DescFile;} int GetCblen(void) {return Cblen;} bool GetDefHuge(void) {return DefHuge;} void SetDefHuge(bool b) {DefHuge = b;} -//bool GetSepIndex(void) {return SepIndex;} -//void SetSepIndex(bool b) {SepIndex = b;} char *GetCbuf(void) {return Cbuf;} char *GetDataPath(void) {return (char*)DataPath;} @@ -115,15 +110,10 @@ class DllExport CATALOG { virtual PRELDEF MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am) {return NULL;} // Members -//PRELDEF To_Desc; /* To chain of relation desc. */ - void *Descp; /* To DB description area */ -//AREADEF DescArea; /* Table desc. area size */ char *Cbuf; /* Buffer used for col section */ int Cblen; /* Length of suballoc. buffer */ CURTAB Ctb; /* Used to enumerate tables */ bool DefHuge; /* true: tables default to huge */ -//bool SepIndex; /* true: separate index files */ -//char DescFile[_MAX_PATH]; /* DB description filename */ LPCSTR DataPath; /* Is the Path of DB data dir */ }; // end of class CATALOG diff --git a/storage/connect/colblk.cpp b/storage/connect/colblk.cpp index cdbf6f4b42b..dfdc82e99a7 100644 --- a/storage/connect/colblk.cpp +++ b/storage/connect/colblk.cpp @@ -160,19 +160,6 @@ bool COLBLK::CheckSort(PTDB tdbp) } // end of CheckSort /***********************************************************************/ -/* MarkCol: see PlugMarkCol for column references to mark. */ -/***********************************************************************/ -void COLBLK::MarkCol(ushort bits) - { - ColUse |= bits; - -#ifdef DEBTRACE - htrc(" column R%d.%s marked as %04X\n", - To_Tdb->GetTdb_No(), Name, ColUse); -#endif - } // end of MarkCol - -/***********************************************************************/ /* InitValue: prepare a column block for read operation. */ /* Now we use Format.Length for the len parameter to avoid strings */ /* to be truncated when converting from string to coded string. */ diff --git a/storage/connect/colblk.h b/storage/connect/colblk.h index cf6fb443308..5fbb118fc72 100644 --- a/storage/connect/colblk.h +++ b/storage/connect/colblk.h @@ -64,7 +64,6 @@ class DllExport COLBLK : public XOBJECT { virtual bool IsSpecial(void) {return false;} virtual int CheckSpcCol(PTDB tdbp, int n) {return 2;} virtual bool CheckSort(PTDB tdbp); - virtual void MarkCol(ushort bits); virtual bool Eval(PGLOBAL g); virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); virtual void SetTo_Val(PVAL valp) {} diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index 7b7f79d7b58..35a66f0d1a2 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -256,15 +256,11 @@ uint GetFuncID(const char *func) /***********************************************************************/ CATALOG::CATALOG(void) { -//To_Desc= NULL; -//*DescFile= '\0'; #if defined(WIN32) DataPath= ".\\"; #else // !WIN32 DataPath= "./"; #endif // !WIN32 - Descp= NULL; -//memset(&DescArea, 0, sizeof(AREADEF)); memset(&Ctb, 0, sizeof(CURTAB)); Cbuf= NULL; Cblen= 0; @@ -279,17 +275,14 @@ CATALOG::CATALOG(void) MYCAT::MYCAT(PHC hc) : CATALOG() { Hc= hc; -//To_Desc= NULL; DefHuge= false; -//SepIndex= true; // Temporay until we can store offet and size } // end of MYCAT constructor /***********************************************************************/ -/* When using volatile storage, reset values pointing to Sarea. */ +/* Nothing to do for CONNECT. */ /***********************************************************************/ void MYCAT::Reset(void) { -//To_Desc= NULL; } // end of Reset /***********************************************************************/ @@ -597,10 +590,6 @@ PRELDEF MYCAT::GetTableDesc(PGLOBAL g, LPCSTR name, if (xtrace) printf("GetTableDesc: name=%s am=%s\n", name, SVP(type)); - // Firstly check whether this table descriptor is in memory -//if (To_Desc) -// return To_Desc; - // If not specified get the type of this table if (!type && !(type= Hc->GetStringOption("Type"))) type= (Hc->GetStringOption("Tabname")) ? "PROXY" : "DOS"; @@ -708,7 +697,6 @@ PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode, LPCSTR type) /***********************************************************************/ void MYCAT::ClearDB(PGLOBAL g) { -//To_Desc= NULL; } // end of ClearDB /* ------------------------ End of MYCAT --------------------------- */ diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index 6d16dcde04a..8525fd09cbc 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -90,11 +90,9 @@ TABDEF::TABDEF(void) /***********************************************************************/ bool TABDEF::Define(PGLOBAL g, PCATLG cat, LPCSTR name, LPCSTR am) { -//char buf[8]; int poff = 0; - void *memp = cat->Descp; - Name = (PSZ)PlugSubAlloc(g, memp, strlen(name) + 1); + Name = (PSZ)PlugSubAlloc(g, NULL, strlen(name) + 1); strcpy(Name, name); Cat = cat; Catfunc = GetFuncID(Cat->GetStringCatInfo(g, "Catfunc", NULL)); @@ -127,7 +125,6 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) PTABDEF xdefp; XGETDEF getdef = NULL; PCATLG cat = Cat; - void *memp = cat->Descp; #if defined(WIN32) // Is the DLL already loaded? @@ -189,7 +186,7 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) sprintf(g->Message, MSG(DEF_ALLOC_ERROR), Subtype); // Get the table definition block - if (!(xdefp = getdef(g, memp))) + if (!(xdefp = getdef(g, NULL))) return NULL; // Have the external class do its complete definition @@ -223,15 +220,13 @@ bool OEMDEF::DeleteTableFile(PGLOBAL g) /***********************************************************************/ bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) { - void *memp = Cat->Descp; - Module = Cat->GetStringCatInfo(g, "Module", ""); Subtype = Cat->GetStringCatInfo(g, "Subtype", Module); if (!*Module) Module = Subtype; - Desc = (char*)PlugSubAlloc(g, memp, strlen(Module) + Desc = (char*)PlugSubAlloc(g, NULL, strlen(Module) + strlen(Subtype) + 3); sprintf(Desc, "%s(%s)", Module, Subtype); return false; diff --git a/storage/connect/tabcol.h b/storage/connect/tabcol.h index 8c21fe6d1b2..4680e50f29e 100644 --- a/storage/connect/tabcol.h +++ b/storage/connect/tabcol.h @@ -86,7 +86,6 @@ class DllExport COLUMN: public XOBJECT { // Column Name/Qualifier block. virtual bool Eval(PGLOBAL) {assert(false); return true;} virtual int CheckSpcCol(PTDB, int) {assert(false); return 2;} virtual bool CheckSort(PTDB) {assert(false); return false;} - virtual void MarkCol(ushort) {assert(false);} private: // Members diff --git a/storage/connect/tabsys.cpp b/storage/connect/tabsys.cpp index 9f933e4e2b8..705bb79bcb4 100644 --- a/storage/connect/tabsys.cpp +++ b/storage/connect/tabsys.cpp @@ -65,7 +65,6 @@ INIDEF::INIDEF(void) Pseudo = 3; Fn = NULL; Xname = NULL; - Subtype = '?'; Layout = '?'; Ln = 0; } // end of INIDEF constructor @@ -75,63 +74,23 @@ INIDEF::INIDEF(void) /***********************************************************************/ bool INIDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) { - char buf[8], ds[2]; - void *memp = Cat->GetDescp(); - - if (!stricmp(am, "SYS")) - strcpy(ds, "T"); // SYS tables default to T(able) - else - strcpy(ds, "I"); // INI tables default to I(ni) + char buf[8]; Fn = Cat->GetStringCatInfo(g, "Filename", NULL); - Cat->GetCharCatInfo("Subtype", ds, buf, sizeof(buf)); - Subtype = toupper(*buf); Cat->GetCharCatInfo("Layout", "C", buf, sizeof(buf)); Layout = toupper(*buf); - switch (Subtype) { -#if 0 - case 'C': - case 'T': - // Restricted table - Xname = Cat->GetStringCatInfo(g, "Name", "?"); - - if (!strcmp(Xname, "?")) - Xname = NULL; - - if (*Fn == '?') - Fn = Cat->GetStringCatInfo(g, "Database", "?"); - - if (*Fn != '?') { - char *p = (char*)PlugSubAlloc(g, memp, _MAX_PATH); + if (Fn) { + char *p = (char*)PlugSubAlloc(g, NULL, _MAX_PATH); - if (!PlgSetXdbPath(g, Fn, NULL, p, _MAX_PATH, NULL, 0)) - Fn = p; - - } else - Fn = Cat->GetDescFile(); - - Ln = GetIniSize("Database", "Tabsize", "2K", Fn); - break; -#endif // 0 - case 'I': - if (*Fn != '?') { - char *p = (char*)PlugSubAlloc(g, memp, _MAX_PATH); - - PlugSetPath(p, Fn, GetPath()); - Fn = p; - } else { - strcpy(g->Message, MSG(MISSING_FNAME)); - return true; - } // endif Fn - - Ln = Cat->GetSizeCatInfo("Secsize", "8K"); - break; - default: - sprintf(g->Message, MSG(INV_SUBTYPE), buf); - return true; - } // endswitch Subtype + PlugSetPath(p, Fn, GetPath()); + Fn = p; + } else { + strcpy(g->Message, MSG(MISSING_FNAME)); + return true; + } // endif Fn + Ln = Cat->GetSizeCatInfo("Secsize", "8K"); Desc = Fn; return false; } // end of DefineAM @@ -143,17 +102,10 @@ PTDB INIDEF::GetTable(PGLOBAL g, MODE m) { PTDBASE tdbp; - switch (Subtype) { - case 'I': - if (Layout == 'C') - tdbp = new(g) TDBINI(this); - else - tdbp = new(g) TDBXIN(this); - - break; - default: - return NULL; - } // endswitch Subtype + if (Layout == 'C') + tdbp = new(g) TDBINI(this); + else + tdbp = new(g) TDBXIN(this); if (Multiple) tdbp = new(g) TDBMUL(tdbp); // No block optimization yet @@ -163,7 +115,6 @@ PTDB INIDEF::GetTable(PGLOBAL g, MODE m) /***********************************************************************/ /* DeleteTableFile: Delete INI table files using platform API. */ -/* SysTable and SysColumn tables are readonly and not erasable. */ /***********************************************************************/ bool INIDEF::DeleteTableFile(PGLOBAL g) { @@ -171,7 +122,7 @@ bool INIDEF::DeleteTableFile(PGLOBAL g) bool rc; // Delete the INI table file if not protected - if (Subtype == 'I' && !IsReadOnly()) { + if (!IsReadOnly()) { PlugSetPath(filename, Fn, GetPath()); #if defined(WIN32) rc = !DeleteFile(filename); diff --git a/storage/connect/tabsys.h b/storage/connect/tabsys.h index ac8ae05aee9..2780eb3ca98 100644 --- a/storage/connect/tabsys.h +++ b/storage/connect/tabsys.h @@ -38,7 +38,6 @@ class DllExport INIDEF : public TABDEF { /* INI table description */ // Members char *Fn; /* Path/Name of corresponding file */ char *Xname; /* The eventual table name */ - char Subtype; /* I: INI, T: Table, C: Column */ char Layout; /* R: Row, C: Column */ int Ln; /* Length of section list buffer */ }; // end of INIDEF @@ -83,8 +82,8 @@ class TDBINI : public TDBASE { // Members char *Ifile; // The INI file char *Seclist; // The section list - char *Section; // The current section - int Seclen; // Length of seclist buffer + char *Section; // The current section + int Seclen; // Length of seclist buffer int N; // The current section index }; // end of class TDBINI diff --git a/storage/connect/xobject.h b/storage/connect/xobject.h index c77fb703823..79325f155cf 100644 --- a/storage/connect/xobject.h +++ b/storage/connect/xobject.h @@ -71,7 +71,6 @@ class DllExport XOBJECT : public BLOCK { virtual bool VerifyColumn(PTBX txp) {return false;} virtual bool VerifyTdb(PTDB& tdbp) {return false;} virtual bool IsColInside(PCOL colp) {return false;} - virtual void MarkCol(ushort) {} protected: PVAL Value; // The current value of the object. |