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/tabsys.cpp | |
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/tabsys.cpp')
-rw-r--r-- | storage/connect/tabsys.cpp | 79 |
1 files changed, 15 insertions, 64 deletions
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); |