Commit cd9e1938 authored by Olivier Bertrand's avatar Olivier Bertrand

- Add a new table option SEPINDEX (not used yet) and remove an unused

  parameter to all catalog info functions.

modified:
  storage/connect/catalog.h
  storage/connect/filamvct.cpp
  storage/connect/filamzip.cpp
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/mycat.h
  storage/connect/reldef.cpp
  storage/connect/reldef.h
  storage/connect/tabdos.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabmul.cpp
  storage/connect/tabmysql.cpp
  storage/connect/tabodbc.cpp
  storage/connect/tabsys.cpp
  storage/connect/tabtbl.cpp
  storage/connect/tabvct.cpp
  storage/connect/tabwmi.cpp
  storage/connect/tabxml.cpp
  storage/connect/xindex.cpp
parent 8f0ae632
......@@ -68,21 +68,21 @@ class DllExport CATALOG {
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;}
//bool GetSepIndex(void) {return SepIndex;}
//void SetSepIndex(bool b) {SepIndex = b;}
char *GetCbuf(void) {return Cbuf;}
char *GetDataPath(void) {return (char*)DataPath;}
// Methods
virtual void Reset(void) {}
virtual void SetDataPath(PGLOBAL g, const char *path) {}
virtual bool GetBoolCatInfo(LPCSTR name, PSZ what, bool bdef) {return bdef;}
virtual bool SetIntCatInfo(LPCSTR name, PSZ what, int ival) {return false;}
virtual int GetIntCatInfo(LPCSTR name, PSZ what, int idef) {return idef;}
virtual int GetSizeCatInfo(LPCSTR name, PSZ what, PSZ sdef) {return 0;}
virtual int GetCharCatInfo(LPCSTR name, PSZ what, PSZ sdef, char *buf, int size)
virtual bool GetBoolCatInfo(PSZ what, bool bdef) {return bdef;}
virtual bool SetIntCatInfo(PSZ what, int ival) {return false;}
virtual int GetIntCatInfo(PSZ what, int idef) {return idef;}
virtual int GetSizeCatInfo(PSZ what, PSZ sdef) {return 0;}
virtual int GetCharCatInfo(PSZ what, PSZ sdef, char *buf, int size)
{strncpy(buf, sdef, size); return size;}
virtual char *GetStringCatInfo(PGLOBAL g, PSZ name, PSZ what, PSZ sdef)
virtual char *GetStringCatInfo(PGLOBAL g, PSZ what, PSZ sdef)
{return sdef;}
virtual int GetColCatInfo(PGLOBAL g, PTABDEF defp) {return -1;}
virtual bool GetIndexInfo(PGLOBAL g, PTABDEF defp) {return true;}
......@@ -119,7 +119,7 @@ class DllExport CATALOG {
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 */
//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
......
......@@ -1118,8 +1118,8 @@ bool VCTFAM::ResetTableSize(PGLOBAL g, int block, int last)
defp->SetBlock(Block);
defp->SetLast(Last);
if (!cat->SetIntCatInfo(name, "Blocks", Block) ||
!cat->SetIntCatInfo(name, "Last", Last)) {
if (!cat->SetIntCatInfo("Blocks", Block) ||
!cat->SetIntCatInfo("Last", Last)) {
sprintf(g->Message, MSG(UPDATE_ERROR), "Header");
rc = true;
} // endif
......
......@@ -614,8 +614,8 @@ int ZBKFAM::DeleteRecords(PGLOBAL g, int irc)
defp->SetBlock(0);
defp->SetLast(Nrec);
if (!cat->SetIntCatInfo(name, "Blocks", 0) ||
!cat->SetIntCatInfo(name, "Last", 0)) {
if (!cat->SetIntCatInfo("Blocks", 0) ||
!cat->SetIntCatInfo("Last", 0)) {
sprintf(g->Message, MSG(UPDATE_ERROR), "Header");
return RC_FX;
} else
......@@ -653,8 +653,8 @@ void ZBKFAM::CloseTableFile(PGLOBAL g)
if (rc != RC_FX) {
defp->SetBlock(Block);
defp->SetLast(Last);
cat->SetIntCatInfo(name, "Blocks", Block);
cat->SetIntCatInfo(name, "Last", Last);
cat->SetIntCatInfo("Blocks", Block);
cat->SetIntCatInfo("Last", Last);
} // endif
gzclose(Zfile);
......
......@@ -224,6 +224,7 @@ struct ha_table_option_struct {
bool huge;
bool split;
bool readonly;
bool sepindex;
};
#if defined(MARIADB)
......@@ -257,6 +258,7 @@ ha_create_table_option connect_table_option_list[]=
HA_TOPTION_BOOL("HUGE", huge, 0),
HA_TOPTION_BOOL("SPLIT", split, 0),
HA_TOPTION_BOOL("READONLY", readonly, 0),
HA_TOPTION_BOOL("SEPINDEX", sepindex, 0),
HA_TOPTION_END
};
#endif // MARIADB
......@@ -870,6 +872,8 @@ bool ha_connect::GetBooleanOption(char *opname, bool bdef)
opval= options->split;
else if (!stricmp(opname, "Readonly"))
opval= options->readonly;
else if (!stricmp(opname, "SepIndex"))
opval= options->sepindex;
else if (options->oplist)
if ((pv= GetListOption(opname, options->oplist)))
opval= (!*pv || *pv == 'y' || *pv == 'Y' || atoi(pv) != 0);
......@@ -4035,9 +4039,11 @@ int ha_connect::create(const char *name, TABLE *table_arg,
if (IsFileType(type)) {
table= table_arg; // Used by called functions
if (!options->filename) {
if (!options->filename && type != TAB_XML) {
// The file name is not specified, create a default file in
// the database directory named table_name.table_type.
// (temporarily not done for XML because a void file causes
// the XML parsers to report an error on the first Insert)
char buf[256], fn[_MAX_PATH], dbpath[128];
int h;
......
......@@ -235,7 +235,7 @@ MYCAT::MYCAT(PHC hc) : CATALOG()
Hc= hc;
To_Desc= NULL;
DefHuge= false;
SepIndex= true; // Temporay until we can store offet and size
//SepIndex= true; // Temporay until we can store offet and size
} // end of MYCAT constructor
/***********************************************************************/
......@@ -273,7 +273,7 @@ void MYCAT::SetPath(PGLOBAL g, LPCSTR *datapath, const char *path)
/***********************************************************************/
/* This function sets an integer MYCAT information. */
/***********************************************************************/
bool MYCAT::SetIntCatInfo(LPCSTR name, PSZ what, int n)
bool MYCAT::SetIntCatInfo(PSZ what, int n)
{
return Hc->SetIntegerOption(what, n);
} // end of SetIntCatInfo
......@@ -281,7 +281,7 @@ bool MYCAT::SetIntCatInfo(LPCSTR name, PSZ what, int n)
/***********************************************************************/
/* This function returns integer MYCAT information. */
/***********************************************************************/
int MYCAT::GetIntCatInfo(LPCSTR name, PSZ what, int idef)
int MYCAT::GetIntCatInfo(PSZ what, int idef)
{
int n= Hc->GetIntegerOption(what);
......@@ -291,7 +291,7 @@ int MYCAT::GetIntCatInfo(LPCSTR name, PSZ what, int idef)
/***********************************************************************/
/* This function returns Boolean MYCAT information. */
/***********************************************************************/
bool MYCAT::GetBoolCatInfo(LPCSTR name, PSZ what, bool bdef)
bool MYCAT::GetBoolCatInfo(PSZ what, bool bdef)
{
bool b= Hc->GetBooleanOption(what, bdef);
......@@ -301,7 +301,7 @@ bool MYCAT::GetBoolCatInfo(LPCSTR name, PSZ what, bool bdef)
/***********************************************************************/
/* This function returns size catalog information. */
/***********************************************************************/
int MYCAT::GetSizeCatInfo(LPCSTR name, PSZ what, PSZ sdef)
int MYCAT::GetSizeCatInfo(PSZ what, PSZ sdef)
{
char * s, c;
int i, n= 0;
......@@ -323,8 +323,7 @@ int MYCAT::GetSizeCatInfo(LPCSTR name, PSZ what, PSZ sdef)
/***********************************************************************/
/* This function sets char MYCAT information in buf. */
/***********************************************************************/
int MYCAT::GetCharCatInfo(LPCSTR name, PSZ what,
PSZ sdef, char *buf, int size)
int MYCAT::GetCharCatInfo(PSZ what, PSZ sdef, char *buf, int size)
{
char *s= Hc->GetStringOption(what);
......@@ -336,7 +335,7 @@ int MYCAT::GetCharCatInfo(LPCSTR name, PSZ what,
/* This function returns string MYCAT information. */
/* Default parameter is "*" to get the handler default. */
/***********************************************************************/
char *MYCAT::GetStringCatInfo(PGLOBAL g, PSZ name, PSZ what, PSZ sdef)
char *MYCAT::GetStringCatInfo(PGLOBAL g, PSZ what, PSZ sdef)
{
char *sval, *s= Hc->GetStringOption(what, sdef);
......@@ -359,7 +358,7 @@ char *MYCAT::GetStringCatInfo(PGLOBAL g, PSZ name, PSZ what, PSZ sdef)
/***********************************************************************/
int MYCAT::GetColCatInfo(PGLOBAL g, PTABDEF defp)
{
char *type= GetStringCatInfo(g, NULL, "Type", "DOS");
char *type= GetStringCatInfo(g, "Type", "DOS");
int i, loff, poff, nof, nlg;
void *field= NULL;
TABTYPE tc;
......
......@@ -54,12 +54,12 @@ class MYCAT : public CATALOG {
void Reset(void);
void SetDataPath(PGLOBAL g, const char *path)
{SetPath(g, &DataPath, path);}
bool GetBoolCatInfo(LPCSTR name, PSZ what, bool bdef);
bool SetIntCatInfo(LPCSTR name, PSZ what, int ival);
int GetIntCatInfo(LPCSTR name, PSZ what, int idef);
int GetSizeCatInfo(LPCSTR name, PSZ what, PSZ sdef);
int GetCharCatInfo(LPCSTR name, PSZ what, PSZ sdef, char *buf, int size);
char *GetStringCatInfo(PGLOBAL g, PSZ name, PSZ what, PSZ sdef);
bool GetBoolCatInfo(PSZ what, bool bdef);
bool SetIntCatInfo(PSZ what, int ival);
int GetIntCatInfo(PSZ what, int idef);
int GetSizeCatInfo(PSZ what, PSZ sdef);
int GetCharCatInfo(PSZ what, PSZ sdef, char *buf, int size);
char *GetStringCatInfo(PGLOBAL g, PSZ what, PSZ sdef);
int GetColCatInfo(PGLOBAL g, PTABDEF defp);
bool GetIndexInfo(PGLOBAL g, PTABDEF defp);
bool StoreIndex(PGLOBAL g, PTABDEF defp) {return false;} // Temporary
......
......@@ -97,12 +97,12 @@ bool TABDEF::Define(PGLOBAL g, PCATLG cat, LPCSTR name, LPCSTR am)
Name = (PSZ)PlugSubAlloc(g, memp, strlen(name) + 1);
strcpy(Name, name);
Cat = cat;
Catfunc = GetFuncID(Cat->GetStringCatInfo(g, Name, "Catfunc", NULL));
Elemt = cat->GetIntCatInfo(name, "Elements", 0);
Multiple = cat->GetIntCatInfo(name, "Multiple", 0);
Degree = cat->GetIntCatInfo(name, "Degree", 0);
Read_Only = cat->GetBoolCatInfo(name, "ReadOnly", false);
const char *data_charset_name= cat->GetStringCatInfo(g, Name, "Data_charset", NULL);
Catfunc = GetFuncID(Cat->GetStringCatInfo(g, "Catfunc", NULL));
Elemt = cat->GetIntCatInfo("Elements", 0);
Multiple = cat->GetIntCatInfo("Multiple", 0);
Degree = cat->GetIntCatInfo("Degree", 0);
Read_Only = cat->GetBoolCatInfo("ReadOnly", false);
const char *data_charset_name= cat->GetStringCatInfo(g, "Data_charset", NULL);
m_data_charset= data_charset_name ?
get_charset_by_csname(data_charset_name, MY_CS_PRIMARY, 0):
NULL;
......@@ -195,7 +195,7 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g)
// Have the external class do its complete definition
if (!cat->Cbuf) {
// Suballocate a temporary buffer for the entire column section
cat->Cblen = cat->GetSizeCatInfo("Database", "Colsize", "8K");
cat->Cblen = cat->GetSizeCatInfo("Colsize", "8K");
cat->Cbuf = (char*)PlugSubAlloc(g, NULL, cat->Cblen);
} // endif Cbuf
......@@ -225,8 +225,8 @@ bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{
void *memp = Cat->Descp;
Module = Cat->GetStringCatInfo(g, Name, "Module", "");
Subtype = Cat->GetStringCatInfo(g, Name, "Subtype", Module);
Module = Cat->GetStringCatInfo(g, "Module", "");
Subtype = Cat->GetStringCatInfo(g, "Subtype", Module);
if (!*Module)
Module = Subtype;
......
......@@ -70,7 +70,7 @@ class DllExport TABDEF : public RELDEF { /* Logical table descriptor */
int GetPseudo(void) {return Pseudo;}
PSZ GetPath(void)
{return (Database) ? (PSZ)Database : Cat->GetDataPath();}
bool SepIndex(void) {return Cat->GetSepIndex();}
bool SepIndex(void) {return Cat->GetBoolCatInfo("SepIndex", false);}
bool IsReadOnly(void) {return Read_Only;}
virtual AMT GetDefType(void) {return TYPE_AM_TAB;}
virtual PIXDEF GetIndx(void) {return NULL;}
......
......@@ -160,7 +160,8 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf)
if (!pxdf)
return false; // No index
sep = Cat->GetSepIndex(); // If true indexes are in separate files
// If true indexes are in separate files
sep = Cat->GetBoolCatInfo("SepIndex", false);
if (!sep && To_Indx) {
strcpy(g->Message, MSG(NO_RECOV_SPACE));
......@@ -231,35 +232,35 @@ bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
: (am && (*am == 'B' || *am == 'b')) ? "B"
: (am && !stricmp(am, "DBF")) ? "D" : "V";
Desc = Fn = Cat->GetStringCatInfo(g, Name, "Filename", NULL);
Ofn = Cat->GetStringCatInfo(g, Name, "Optname", Fn);
Cat->GetCharCatInfo(Name, "Recfm", (PSZ)dfm, buf, sizeof(buf));
Desc = Fn = Cat->GetStringCatInfo(g, "Filename", NULL);
Ofn = Cat->GetStringCatInfo(g, "Optname", Fn);
Cat->GetCharCatInfo("Recfm", (PSZ)dfm, buf, sizeof(buf));
Recfm = (toupper(*buf) == 'F') ? RECFM_FIX :
(toupper(*buf) == 'B') ? RECFM_BIN :
(toupper(*buf) == 'D') ? RECFM_DBF : RECFM_VAR;
Lrecl = Cat->GetIntCatInfo(Name, "Lrecl", 0);
Lrecl = Cat->GetIntCatInfo("Lrecl", 0);
if (Recfm != RECFM_DBF)
Compressed = Cat->GetIntCatInfo(Name, "Compressed", 0);
Compressed = Cat->GetIntCatInfo("Compressed", 0);
Mapped = Cat->GetBoolCatInfo(Name, "Mapped", map);
Block = Cat->GetIntCatInfo(Name, "Blocks", 0);
Last = Cat->GetIntCatInfo(Name, "Last", 0);
Ending = Cat->GetIntCatInfo(Name, "Ending", CRLF);
Mapped = Cat->GetBoolCatInfo("Mapped", map);
Block = Cat->GetIntCatInfo("Blocks", 0);
Last = Cat->GetIntCatInfo("Last", 0);
Ending = Cat->GetIntCatInfo("Ending", CRLF);
if (Recfm == RECFM_FIX || Recfm == RECFM_BIN) {
int defhuge = (Cat->GetDefHuge()) ? 1 : 0;
Huge = (Cat->GetIntCatInfo(Name, "Huge", defhuge) != 0);
Padded = (Cat->GetIntCatInfo(Name, "Padded", 0) != 0);
Blksize = Cat->GetIntCatInfo(Name, "Blksize", 0);
Eof = (Cat->GetIntCatInfo(Name, "EOF", 0) != 0);
Huge = (Cat->GetIntCatInfo("Huge", defhuge) != 0);
Padded = (Cat->GetIntCatInfo("Padded", 0) != 0);
Blksize = Cat->GetIntCatInfo("Blksize", 0);
Eof = (Cat->GetIntCatInfo("EOF", 0) != 0);
} else if (Recfm == RECFM_DBF) {
Maxerr = Cat->GetIntCatInfo(Name, "Maxerr", 0);
Accept = (Cat->GetIntCatInfo(Name, "Accept", 0) != 0);
ReadMode = Cat->GetIntCatInfo(Name, "Readmode", 0);
Maxerr = Cat->GetIntCatInfo("Maxerr", 0);
Accept = (Cat->GetIntCatInfo("Accept", 0) != 0);
ReadMode = Cat->GetIntCatInfo("Readmode", 0);
} else // (Recfm == RECFM_VAR)
AvgLen = Cat->GetIntCatInfo(Name, "Avglen", 0);
AvgLen = Cat->GetIntCatInfo("Avglen", 0);
// Ignore wrong Index definitions for catalog commands
return (Cat->GetIndexInfo(g, this) /*&& !Cat->GetCatFnc()*/);
......
......@@ -417,10 +417,10 @@ bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
if (DOSDEF::DefineAM(g, "CSV", poff))
return true;
Cat->GetCharCatInfo(Name, "Separator", ",", buf, sizeof(buf));
Cat->GetCharCatInfo("Separator", ",", buf, sizeof(buf));
Sep = (strlen(buf) == 2 && buf[0] == '\\' && buf[1] == 't') ? '\t' : *buf;
Quoted = Cat->GetIntCatInfo(Name, "Quoted", -1);
Cat->GetCharCatInfo(Name, "Qchar", "", buf, sizeof(buf));
Quoted = Cat->GetIntCatInfo("Quoted", -1);
Cat->GetCharCatInfo("Qchar", "", buf, sizeof(buf));
Qot = *buf;
if (Qot && Quoted < 0)
......@@ -429,9 +429,9 @@ bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
Qot = '"';
Fmtd = (!Sep || (am && (*am == 'F' || *am == 'f')));
Header = (Cat->GetIntCatInfo(Name, "Header", 0) != 0);
Maxerr = Cat->GetIntCatInfo(Name, "Maxerr", 0);
Accept = (Cat->GetIntCatInfo(Name, "Accept", 0) != 0);
Header = (Cat->GetIntCatInfo("Header", 0) != 0);
Maxerr = Cat->GetIntCatInfo("Maxerr", 0);
Accept = (Cat->GetIntCatInfo("Accept", 0) != 0);
return false;
} // end of DefineAM
......
......@@ -560,9 +560,9 @@ void TDBMUL::CloseDB(PGLOBAL g)
/***********************************************************************/
bool DIRDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{
Desc = Fn = Cat->GetStringCatInfo(g, Name, "Filename", NULL);
Incl = (Cat->GetIntCatInfo(Name, "Subdir", 0) != 0);
Huge = (Cat->GetIntCatInfo(Name, "Huge", 0) != 0);
Desc = Fn = Cat->GetStringCatInfo(g, "Filename", NULL);
Incl = (Cat->GetIntCatInfo("Subdir", 0) != 0);
Huge = (Cat->GetIntCatInfo("Huge", 0) != 0);
return false;
} // end of DefineAM
......
......@@ -249,7 +249,7 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url)
Hostname = "localhost";
if (!Database || !*Database)
Database = Cat->GetStringCatInfo(g, Name, "Database", "*");
Database = Cat->GetStringCatInfo(g, "Database", "*");
if (!Tabname || !*Tabname)
Tabname = Name;
......@@ -272,24 +272,24 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url)
/***********************************************************************/
bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{
char *url = Cat->GetStringCatInfo(g, Name, "Connect", NULL);
char *url = Cat->GetStringCatInfo(g, "Connect", NULL);
Desc = "MySQL Table";
if (!url || !*url) {
// Not using the connection URL
Hostname = Cat->GetStringCatInfo(g, Name, "Host", "localhost");
Database = Cat->GetStringCatInfo(g, Name, "Database", "*");
Tabname = Cat->GetStringCatInfo(g, Name, "Name", Name); // Deprecated
Tabname = Cat->GetStringCatInfo(g, Name, "Tabname", Tabname);
Username = Cat->GetStringCatInfo(g, Name, "User", "root");
Password = Cat->GetStringCatInfo(g, Name, "Password", NULL);
Portnumber = Cat->GetIntCatInfo(Name, "Port", MYSQL_PORT);
Hostname = Cat->GetStringCatInfo(g, "Host", "localhost");
Database = Cat->GetStringCatInfo(g, "Database", "*");
Tabname = Cat->GetStringCatInfo(g, "Name", Name); // Deprecated
Tabname = Cat->GetStringCatInfo(g, "Tabname", Tabname);
Username = Cat->GetStringCatInfo(g, "User", "root");
Password = Cat->GetStringCatInfo(g, "Password", NULL);
Portnumber = Cat->GetIntCatInfo("Port", MYSQL_PORT);
} else if (ParseURL(g, url))
return TRUE;
Bind = !!Cat->GetIntCatInfo(Name, "Bind", 0);
Delayed = !!Cat->GetIntCatInfo(Name, "Delayed", 0);
Bind = !!Cat->GetIntCatInfo("Bind", 0);
Delayed = !!Cat->GetIntCatInfo("Delayed", 0);
return FALSE;
} // end of DefineAM
......
......@@ -102,15 +102,15 @@ bool ODBCDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{
int dop = ODBConn::noOdbcDialog; // Default for options
Desc = Connect = Cat->GetStringCatInfo(g, Name, "Connect", "");
Tabname = Cat->GetStringCatInfo(g, Name, "Name",
Desc = Connect = Cat->GetStringCatInfo(g, "Connect", "");
Tabname = Cat->GetStringCatInfo(g, "Name",
(Catfunc & (FNC_TABLE | FNC_COL)) ? NULL : Name);
Tabname = Cat->GetStringCatInfo(g, Name, "Tabname", Tabname);
Tabowner = Cat->GetStringCatInfo(g, Name, "Owner", "");
Tabqual = Cat->GetStringCatInfo(g, Name, "Qualifier", "");
Qchar = Cat->GetStringCatInfo(g, Name, "Qchar", "");
Catver = Cat->GetIntCatInfo(Name, "Catver", 2);
Options = Cat->GetIntCatInfo(Name, "Options", dop);
Tabname = Cat->GetStringCatInfo(g, "Tabname", Tabname);
Tabowner = Cat->GetStringCatInfo(g, "Owner", "");
Tabqual = Cat->GetStringCatInfo(g, "Qualifier", "");
Qchar = Cat->GetStringCatInfo(g, "Qchar", "");
Catver = Cat->GetIntCatInfo("Catver", 2);
Options = Cat->GetIntCatInfo("Options", dop);
Pseudo = 2; // FILID is Ok but not ROWID
return false;
} // end of DefineAM
......
......@@ -83,10 +83,10 @@ bool INIDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
else
strcpy(ds, "I"); // INI tables default to I(ni)
Fn = Cat->GetStringCatInfo(g, Name, "Filename", NULL);
Cat->GetCharCatInfo(Name, "Subtype", ds, buf, sizeof(buf));
Fn = Cat->GetStringCatInfo(g, "Filename", NULL);
Cat->GetCharCatInfo("Subtype", ds, buf, sizeof(buf));
Subtype = toupper(*buf);
Cat->GetCharCatInfo(Name, "Layout", "C", buf, sizeof(buf));
Cat->GetCharCatInfo("Layout", "C", buf, sizeof(buf));
Layout = toupper(*buf);
switch (Subtype) {
......@@ -94,13 +94,13 @@ bool INIDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
case 'C':
case 'T':
// Restricted table
Xname = Cat->GetStringCatInfo(g, Name, "Name", "?");
Xname = Cat->GetStringCatInfo(g, "Name", "?");
if (!strcmp(Xname, "?"))
Xname = NULL;
if (*Fn == '?')
Fn = Cat->GetStringCatInfo(g, Name, "Database", "?");
Fn = Cat->GetStringCatInfo(g, "Database", "?");
if (*Fn != '?') {
char *p = (char*)PlugSubAlloc(g, memp, _MAX_PATH);
......@@ -125,7 +125,7 @@ bool INIDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
return true;
} // endif Fn
Ln = Cat->GetSizeCatInfo((char*)Name, "Secsize", "8K");
Ln = Cat->GetSizeCatInfo("Secsize", "8K");
break;
default:
sprintf(g->Message, MSG(INV_SUBTYPE), buf);
......
......@@ -98,8 +98,8 @@ bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
char *tablist, *dbname;
Desc = "Table list table";
tablist = Cat->GetStringCatInfo(g, Name, "Tablist", "");
dbname = Cat->GetStringCatInfo(g, Name, "Database", NULL);
tablist = Cat->GetStringCatInfo(g, "Tablist", "");
dbname = Cat->GetStringCatInfo(g, "Database", NULL);
Ntables = 0;
if (*tablist) {
......@@ -140,8 +140,8 @@ bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
} // endfor pdb
Maxerr = Cat->GetIntCatInfo(Name, "Maxerr", 0);
Accept = (Cat->GetBoolCatInfo(Name, "Accept", 0) != 0);
Maxerr = Cat->GetIntCatInfo("Maxerr", 0);
Accept = (Cat->GetBoolCatInfo("Accept", 0) != 0);
} // endif fsec || tablist
return FALSE;
......
......@@ -94,9 +94,9 @@ bool VCTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{
DOSDEF::DefineAM(g, "BIN", poff);
Estimate = Cat->GetIntCatInfo(Name, "Estimate", 0);
Split = Cat->GetIntCatInfo(Name, "Split", (Estimate) ? 0 : 1);
Header = Cat->GetIntCatInfo(Name, "Header", 0);
Estimate = Cat->GetIntCatInfo("Estimate", 0);
Split = Cat->GetIntCatInfo("Split", (Estimate) ? 0 : 1);
Header = Cat->GetIntCatInfo("Header", 0);
// CONNECT must have Block/Last info for VEC tables
if (Estimate && !Split && !Header)
......@@ -107,7 +107,7 @@ bool VCTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
// For packed files the logical record length is calculated in poff
if (poff != Lrecl) {
Lrecl = poff;
Cat->SetIntCatInfo(Name, "Lrecl", poff);
Cat->SetIntCatInfo("Lrecl", poff);
} // endif poff
Padded = false;
......
......@@ -337,8 +337,8 @@ PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *cls, bool info)
/***********************************************************************/
bool WMIDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{
Nspace = Cat->GetStringCatInfo(g, Name, "Namespace", "Root\\CimV2");
Wclass = Cat->GetStringCatInfo(g, Name, "Class",
Nspace = Cat->GetStringCatInfo(g, "Namespace", "Root\\CimV2");
Wclass = Cat->GetStringCatInfo(g, "Class",
(!stricmp(Nspace, "root\\cimv2") ? "ComputerSystemProduct" :
!stricmp(Nspace, "root\\cli") ? "Msft_CliAlias" : ""));
......@@ -351,7 +351,7 @@ bool WMIDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
} // endif Wclass
if (Catfunc == FNC_NO)
Ems = Cat->GetIntCatInfo(Name, "Estimate", 100);
Ems = Cat->GetIntCatInfo("Estimate", 100);
return false;
} // end of DefineAM
......
......@@ -92,21 +92,21 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
//void *memp = Cat->GetDescp();
//PSZ dbfile = Cat->GetDescFile();
Fn = Cat->GetStringCatInfo(g, Name, "Filename", NULL);
Encoding = Cat->GetStringCatInfo(g, Name, "Encoding", "UTF-8");
Fn = Cat->GetStringCatInfo(g, "Filename", NULL);
Encoding = Cat->GetStringCatInfo(g, "Encoding", "UTF-8");
if (*Fn == '?') {
strcpy(g->Message, MSG(MISSING_FNAME));
return true;
} // endif fn
if ((signed)Cat->GetIntCatInfo(Name, "Flag", -1) != -1) {
if ((signed)Cat->GetIntCatInfo("Flag", -1) != -1) {
strcpy(g->Message, MSG(DEPREC_FLAG));
return true;
} // endif flag
defrow = defcol = "";
Cat->GetCharCatInfo(Name, "Coltype", "", buf, sizeof(buf));
Cat->GetCharCatInfo("Coltype", "", buf, sizeof(buf));
switch (toupper(*buf)) {
case 'A': // Attribute
......@@ -133,32 +133,39 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
return true;
} // endswitch typname
Tabname = Cat->GetStringCatInfo(g, Name, "Name", Name); // Deprecated
Tabname = Cat->GetStringCatInfo(g, Name, "Table_name", Tabname);
Rowname = Cat->GetStringCatInfo(g, Name, "Rownode", defrow);
Colname = Cat->GetStringCatInfo(g, Name, "Colnode", defcol);
Mulnode = Cat->GetStringCatInfo(g, Name, "Mulnode", "");
XmlDB = Cat->GetStringCatInfo(g, Name, "XmlDB", "");
Nslist = Cat->GetStringCatInfo(g, Name, "Nslist", "");
DefNs = Cat->GetStringCatInfo(g, Name, "DefNs", "");
Limit = Cat->GetIntCatInfo(Name, "Limit", 2);
Xpand = (Cat->GetIntCatInfo(Name, "Expand", 0) != 0);
Header = Cat->GetIntCatInfo(Name, "Header", 0);
Cat->GetCharCatInfo(Name, "Xmlsup", "*", buf, sizeof(buf));
if (*buf == '*') // Try the old (deprecated) option
Cat->GetCharCatInfo(Name, "Method", "*", buf, sizeof(buf));
if (*buf == '*') // Is there a default for the database?
Cat->GetCharCatInfo("Database", "Defxml", XMLSUP,
buf, sizeof(buf));
Tabname = Cat->GetStringCatInfo(g, "Name", Name); // Deprecated
Tabname = Cat->GetStringCatInfo(g, "Table_name", Tabname);
Rowname = Cat->GetStringCatInfo(g, "Rownode", defrow);
Colname = Cat->GetStringCatInfo(g, "Colnode", defcol);
Mulnode = Cat->GetStringCatInfo(g, "Mulnode", "");
XmlDB = Cat->GetStringCatInfo(g, "XmlDB", "");
Nslist = Cat->GetStringCatInfo(g, "Nslist", "");
DefNs = Cat->GetStringCatInfo(g, "DefNs", "");
Limit = Cat->GetIntCatInfo("Limit", 2);
Xpand = (Cat->GetIntCatInfo("Expand", 0) != 0);
Header = Cat->GetIntCatInfo("Header", 0);
Cat->GetCharCatInfo("Xmlsup", "*", buf, sizeof(buf));
//if (*buf == '*') // Try the old (deprecated) option
// Cat->GetCharCatInfo("Method", "*", buf, sizeof(buf));
//if (*buf == '*') // Is there a default for the database?
// Cat->GetCharCatInfo("Defxml", XMLSUP, buf, sizeof(buf));
// Note that if no support is specified, the default is MS-DOM
Usedom = (toupper(*buf) == 'M' || toupper(*buf) == 'D');
// on Windows and libxml2 otherwise
if (*buf == '*')
#if defined(WIN32)
Usedom = true;
#else // !WIN32
Usedom = false;
#endif // !WIN32
else
Usedom = (toupper(*buf) == 'M' || toupper(*buf) == 'D');
// Get eventual table node attribute
Attrib = Cat->GetStringCatInfo(g, Name, "Attribute", "");
Hdattr = Cat->GetStringCatInfo(g, Name, "HeadAttr", "");
Attrib = Cat->GetStringCatInfo(g, "Attribute", "");
Hdattr = Cat->GetStringCatInfo(g, "HeadAttr", "");
return false;
} // end of DefineAM
......
......@@ -723,7 +723,7 @@ bool XINDEX::SaveIndex(PGLOBAL g, PIXDEF sxp)
return true;
} // endswitch Ftype
if (dup->Catalog->GetSepIndex()) {
if (dup->Catalog->GetBoolCatInfo("SepIndex", false)) {
// Index is saved in a separate file
#if !defined(UNIX)
char drive[_MAX_DRIVE];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment