1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

- MRR + Block Indexing

modified:
  storage/connect/array.h
  storage/connect/catalog.h
  storage/connect/colblk.cpp
  storage/connect/colblk.h
  storage/connect/connect.cc
  storage/connect/connect.h
  storage/connect/domdoc.h
  storage/connect/filamap.cpp
  storage/connect/filamap.h
  storage/connect/filamdbf.h
  storage/connect/filamfix.cpp
  storage/connect/filamfix.h
  storage/connect/filamtxt.cpp
  storage/connect/filamtxt.h
  storage/connect/filamvct.cpp
  storage/connect/filamvct.h
  storage/connect/filamzip.cpp
  storage/connect/filamzip.h
  storage/connect/filter.cpp
  storage/connect/filter.h
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/myconn.h
  storage/connect/plgcnx.h
  storage/connect/plgdbsem.h
  storage/connect/plgdbutl.cpp
  storage/connect/plugutil.c
  storage/connect/preparse.h
  storage/connect/reldef.cpp
  storage/connect/reldef.h
  storage/connect/tabcol.h
  storage/connect/tabdos.cpp
  storage/connect/tabdos.h
  storage/connect/tabfix.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabfmt.h
  storage/connect/table.cpp
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
  storage/connect/taboccur.h
  storage/connect/tabodbc.h
  storage/connect/tabsys.h
  storage/connect/tabtbl.h
  storage/connect/tabutil.h
  storage/connect/tabvct.cpp
  storage/connect/tabvct.h
  storage/connect/tabwmi.h
  storage/connect/tabxml.h
  storage/connect/user_connect.cc
  storage/connect/user_connect.h
  storage/connect/valblk.cpp
  storage/connect/valblk.h
  storage/connect/value.cpp
  storage/connect/value.h
  storage/connect/xindex.cpp
  storage/connect/xindex.h
  storage/connect/xobject.cpp
  storage/connect/xobject.h
  storage/connect/xtable.h
This commit is contained in:
Olivier Bertrand
2014-03-20 12:05:47 +01:00
60 changed files with 32618 additions and 33489 deletions

View File

@@ -51,7 +51,7 @@ class DllExport ARRAY : public XOBJECT, public CSORT { // Array descblock
virtual int Qcompare(int *, int *); virtual int Qcompare(int *, int *);
virtual bool Compare(PXOB) {assert(FALSE); return FALSE;} virtual bool Compare(PXOB) {assert(FALSE); return FALSE;}
virtual bool SetFormat(PGLOBAL, FORMAT&) {assert(FALSE); return FALSE;} virtual bool SetFormat(PGLOBAL, FORMAT&) {assert(FALSE); return FALSE;}
virtual int CheckSpcCol(PTDB, int) {return 0;} //virtual int CheckSpcCol(PTDB, int) {return 0;}
virtual void Print(PGLOBAL g, FILE *f, UINT n); virtual void Print(PGLOBAL g, FILE *f, UINT n);
virtual void Print(PGLOBAL g, char *ps, UINT z); virtual void Print(PGLOBAL g, char *ps, UINT z);
void Empty(void); void Empty(void);

View File

@@ -1,7 +1,7 @@
/************* Colblk C++ Functions Source Code File (.CPP) ************/ /************* Colblk C++ Functions Source Code File (.CPP) ************/
/* Name: COLBLK.CPP Version 2.0 */ /* Name: COLBLK.CPP Version 2.1 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 1998-2013 */ /* (C) Copyright to the author Olivier BERTRAND 1998-2014 */
/* */ /* */
/* This file contains the COLBLK class functions. */ /* This file contains the COLBLK class functions. */
/***********************************************************************/ /***********************************************************************/
@@ -124,14 +124,6 @@ bool COLBLK::SetFormat(PGLOBAL g, FORMAT& fmt)
return false; return false;
} // end of SetFormat } // end of SetFormat
/***********************************************************************/
/* CheckColumn: a column descriptor is found, say it by returning 1. */
/***********************************************************************/
int COLBLK::CheckColumn(PGLOBAL g, PSQL sqlp, PXOB &p, int &ag)
{
return 1;
} // end of CheckColumn
/***********************************************************************/ /***********************************************************************/
/* Eval: get the column value from the last read record or from a */ /* Eval: get the column value from the last read record or from a */
/* matching Index column if there is one. */ /* matching Index column if there is one. */
@@ -156,15 +148,6 @@ bool COLBLK::Eval(PGLOBAL g)
return false; return false;
} // end of Eval } // end of Eval
/***********************************************************************/
/* CheckSort: */
/* Used to check that a table is involved in the sort list items. */
/***********************************************************************/
bool COLBLK::CheckSort(PTDB tdbp)
{
return (tdbp == To_Tdb);
} // end of CheckSort
/***********************************************************************/ /***********************************************************************/
/* InitValue: prepare a column block for read operation. */ /* InitValue: prepare a column block for read operation. */
/* Now we use Format.Length for the len parameter to avoid strings */ /* Now we use Format.Length for the len parameter to avoid strings */

View File

@@ -36,15 +36,13 @@ class DllExport COLBLK : public XOBJECT {
virtual int GetAmType() {return TYPE_AM_ERROR;} virtual int GetAmType() {return TYPE_AM_ERROR;}
virtual void SetOk(void) {Status |= BUF_EMPTY;} virtual void SetOk(void) {Status |= BUF_EMPTY;}
virtual PTDB GetTo_Tdb(void) {return To_Tdb;} virtual PTDB GetTo_Tdb(void) {return To_Tdb;}
#if defined(BLK_INDX)
virtual int GetClustered(void) {return 0;} virtual int GetClustered(void) {return 0;}
virtual int IsClustered(void) {return FALSE;} virtual int IsClustered(void) {return FALSE;}
#endif // BLK_INDX
PCOL GetNext(void) {return Next;} PCOL GetNext(void) {return Next;}
PSZ GetName(void) {return Name;} PSZ GetName(void) {return Name;}
int GetIndex(void) {return Index;} int GetIndex(void) {return Index;}
int GetOpt(void) {return Opt;}
ushort GetColUse(void) {return ColUse;} ushort GetColUse(void) {return ColUse;}
int GetOpt(void) {return Opt;}
ushort GetColUse(ushort u) {return (ColUse & u);} ushort GetColUse(ushort u) {return (ColUse & u);}
ushort GetStatus(void) {return Status;} ushort GetStatus(void) {return Status;}
ushort GetStatus(ushort u) {return (Status & u);} ushort GetStatus(ushort u) {return (Status & u);}
@@ -53,9 +51,7 @@ class DllExport COLBLK : public XOBJECT {
void AddColUse(ushort u) {ColUse |= u;} void AddColUse(ushort u) {ColUse |= u;}
void AddStatus(ushort u) {Status |= u;} void AddStatus(ushort u) {Status |= u;}
void SetNext(PCOL cp) {Next = cp;} void SetNext(PCOL cp) {Next = cp;}
#if defined(MRRBKA_SUPPORT)
PXCOL GetKcol(void) {return To_Kcol;} PXCOL GetKcol(void) {return To_Kcol;}
#endif // MRRBKA_SUPPORT
void SetKcol(PXCOL kcp) {To_Kcol = kcp;} void SetKcol(PXCOL kcp) {To_Kcol = kcp;}
PCOLDEF GetCdp(void) {return Cdp;} PCOLDEF GetCdp(void) {return Cdp;}
PSZ GetDomain(void) {return (Cdp) ? Cdp->Decode : NULL;} PSZ GetDomain(void) {return (Cdp) ? Cdp->Decode : NULL;}
@@ -69,10 +65,7 @@ class DllExport COLBLK : public XOBJECT {
virtual void Reset(void); virtual void Reset(void);
virtual bool Compare(PXOB xp); virtual bool Compare(PXOB xp);
virtual bool SetFormat(PGLOBAL, FORMAT&); virtual bool SetFormat(PGLOBAL, FORMAT&);
virtual int CheckColumn(PGLOBAL g, PSQL sqlp, PXOB &xp, int &ag);
virtual bool IsSpecial(void) {return false;} virtual bool IsSpecial(void) {return false;}
virtual int CheckSpcCol(PTDB tdbp, int n) {return 2;}
virtual bool CheckSort(PTDB tdbp);
virtual bool Eval(PGLOBAL g); virtual bool Eval(PGLOBAL g);
virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check);
virtual void SetTo_Val(PVAL valp) {} virtual void SetTo_Val(PVAL valp) {}
@@ -80,10 +73,7 @@ class DllExport COLBLK : public XOBJECT {
virtual void WriteColumn(PGLOBAL g); virtual void WriteColumn(PGLOBAL g);
virtual void Print(PGLOBAL g, FILE *, uint); virtual void Print(PGLOBAL g, FILE *, uint);
virtual void Print(PGLOBAL g, char *, uint); virtual void Print(PGLOBAL g, char *, uint);
#if defined(BLK_INDX)
virtual bool VarSize(void) {return false;} virtual bool VarSize(void) {return false;}
#endif // BLK_INDX
virtual bool IsColInside(PCOL colp) {return this == colp;}
bool InitValue(PGLOBAL g); bool InitValue(PGLOBAL g);
protected: protected:
@@ -160,8 +150,6 @@ class DllExport FIDBLK : public SPCBLK {
// Methods // Methods
virtual void Reset(void) {} // This is a pseudo constant column virtual void Reset(void) {} // This is a pseudo constant column
virtual int CheckSpcCol(PTDB tdbp, int n)
{return (n == 2 && tdbp == To_Tdb) ? 1 : 2;}
virtual void ReadColumn(PGLOBAL g); virtual void ReadColumn(PGLOBAL g);
protected: protected:
@@ -181,8 +169,6 @@ class DllExport TIDBLK : public SPCBLK {
// Methods // Methods
virtual void Reset(void) {} // This is a pseudo constant column virtual void Reset(void) {} // This is a pseudo constant column
virtual int CheckSpcCol(PTDB tdbp, int n)
{return (n == 3 && tdbp == To_Tdb) ? 1 : 2;}
virtual void ReadColumn(PGLOBAL g); virtual void ReadColumn(PGLOBAL g);
protected: protected:
@@ -206,8 +192,6 @@ class DllExport SIDBLK : public SPCBLK {
// Methods // Methods
virtual void Reset(void) {} // This is a pseudo constant column virtual void Reset(void) {} // This is a pseudo constant column
virtual int CheckSpcCol(PTDB tdbp, int n)
{return (n == 3 && tdbp == To_Tdb) ? 1 : 2;}
virtual void ReadColumn(PGLOBAL g); virtual void ReadColumn(PGLOBAL g);
protected: protected:

View File

@@ -415,11 +415,7 @@ RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool mrr)
colp->Reset(); colp->Reset();
// Virtual columns are computed by MariaDB // Virtual columns are computed by MariaDB
#if defined(MRRBKA_SUPPORT)
if (!colp->GetColUse(U_VIRTUAL) && (!mrr || colp->GetKcol())) if (!colp->GetColUse(U_VIRTUAL) && (!mrr || colp->GetKcol()))
#else // !MRRBKA_SUPPORT
if (!colp->GetColUse(U_VIRTUAL))
#endif // !MRRBKA_SUPPORT
if (colp->Eval(g)) if (colp->Eval(g))
rc= RC_FX; rc= RC_FX;

View File

@@ -17,7 +17,6 @@
/* Name: CONNECT.H Version 2.4 */ /* Name: CONNECT.H Version 2.4 */
/* This file contains the some based classes declares. */ /* This file contains the some based classes declares. */
/***********************************************************************/ /***********************************************************************/
//#include "xtable.h" // Base class declares
#include "filamtxt.h" #include "filamtxt.h"
#include "tabdos.h" #include "tabdos.h"
@@ -52,8 +51,6 @@ PGLOBAL CntExit(PGLOBAL g);
/* These classes purpose is chiefly to access protected items! */ /* These classes purpose is chiefly to access protected items! */
/***********************************************************************/ /***********************************************************************/
class DOXDEF: public DOSDEF { class DOXDEF: public DOSDEF {
//friend class TDBDOX;
//friend int MakeIndex(PGLOBAL, PTDB, PIXDEF);
friend int CntIndexInit(PGLOBAL, PTDB, int); friend int CntIndexInit(PGLOBAL, PTDB, int);
}; // end of class DOXDEF }; // end of class DOXDEF
@@ -74,10 +71,7 @@ class TDBDOX: public TDBDOS {
class XKPDEF: public KPARTDEF { class XKPDEF: public KPARTDEF {
friend class TDBDOX; friend class TDBDOX;
friend class ha_connect; friend class ha_connect;
//friend int CntMakeIndex(PGLOBAL, const char *, PIXDEF);
friend int CntIndexInit(PGLOBAL, PTDB, int); friend int CntIndexInit(PGLOBAL, PTDB, int);
public: public:
XKPDEF(const char *name, int n) : KPARTDEF((PSZ)name, n) {} XKPDEF(const char *name, int n) : KPARTDEF((PSZ)name, n) {}
}; // end of class XKPDEF }; // end of class XKPDEF
//RCODE CheckRecord(PGLOBAL g, PTDB tdbp, char *oldbuf, char *newbuf);

View File

@@ -20,7 +20,6 @@ typedef struct _xblock { /* Loaded XML file block */
short Type; /* TYPE_FB_XML */ short Type; /* TYPE_FB_XML */
int Retcode; /* Return code from Load */ int Retcode; /* Return code from Load */
MSXML2::IXMLDOMDocumentPtr Docp;/* Document interface pointer */ MSXML2::IXMLDOMDocumentPtr Docp;/* Document interface pointer */
//IXMLDOMNodeListPtr Nlist;
} XBLOCK, *PXBLOCK; } XBLOCK, *PXBLOCK;
/******************************************************************/ /******************************************************************/
@@ -123,9 +122,6 @@ class DOMATTR : public XMLATTRIBUTE {
friend class DOMDOC; friend class DOMDOC;
friend class DOMNODE; friend class DOMNODE;
public: public:
// Properties
//virtual char *GetText(void);
// Methods // Methods
virtual bool SetText(PGLOBAL g, char *txtp, int len); virtual bool SetText(PGLOBAL g, char *txtp, int len);

View File

@@ -322,15 +322,12 @@ int MAPFAM::ReadBuffer(PGLOBAL g)
/*******************************************************************/ /*******************************************************************/
/* Record file position in case of UPDATE or DELETE. */ /* Record file position in case of UPDATE or DELETE. */
/*******************************************************************/ /*******************************************************************/
#if defined(BLK_INDX)
int rc; int rc;
next: next:
#endif // BLK_INDX
Fpos = Mempos; Fpos = Mempos;
CurBlk = (int)Rows++; CurBlk = (int)Rows++;
#if defined(BLK_INDX)
/*******************************************************************/ /*******************************************************************/
/* Check whether optimization on ROWID */ /* Check whether optimization on ROWID */
/* can be done, as well as for join as for local filtering. */ /* can be done, as well as for join as for local filtering. */
@@ -345,7 +342,6 @@ int MAPFAM::ReadBuffer(PGLOBAL g)
goto next; goto next;
} // endswitch rc } // endswitch rc
#endif // BLK_INDX
} else } else
Placed = false; Placed = false;
@@ -513,11 +509,7 @@ MBKFAM::MBKFAM(PDOSDEF tdp) : MAPFAM(tdp)
Block = tdp->GetBlock(); Block = tdp->GetBlock();
Last = tdp->GetLast(); Last = tdp->GetLast();
Nrec = tdp->GetElemt(); Nrec = tdp->GetElemt();
#if defined(BLK_INDX)
BlkPos = tdp->GetTo_Pos(); BlkPos = tdp->GetTo_Pos();
#else // !BLK_INDX
BlkPos = NULL;
#endif // !BLK_INDX
CurNum = Nrec; CurNum = Nrec;
} // end of MBKFAM standard constructor } // end of MBKFAM standard constructor
@@ -537,9 +529,7 @@ void MBKFAM::Reset(void)
/***********************************************************************/ /***********************************************************************/
int MBKFAM::Cardinality(PGLOBAL g) int MBKFAM::Cardinality(PGLOBAL g)
{ {
// Should not be called in this version return (g) ? (int)((Block - 1) * Nrec + Last) : 1;
return (g) ? -1 : 0;
//return (g) ? (int)((Block - 1) * Nrec + Last) : 1;
} // end of Cardinality } // end of Cardinality
/***********************************************************************/ /***********************************************************************/
@@ -563,7 +553,6 @@ int MBKFAM::GetRowID(void)
/***********************************************************************/ /***********************************************************************/
int MBKFAM::ReadBuffer(PGLOBAL g) int MBKFAM::ReadBuffer(PGLOBAL g)
{ {
#if defined(BLK_INDX)
int len; int len;
/*********************************************************************/ /*********************************************************************/
@@ -607,10 +596,6 @@ int MBKFAM::ReadBuffer(PGLOBAL g)
memcpy(Tdbp->GetLine(), Fpos, len); memcpy(Tdbp->GetLine(), Fpos, len);
Tdbp->GetLine()[len] = '\0'; Tdbp->GetLine()[len] = '\0';
return RC_OK; return RC_OK;
#else // !BLK_POS
strcpy(g->Message, "This AM cannot be used in this version");
return RC_FX;
#endif // !BLK_POS
} // end of ReadBuffer } // end of ReadBuffer
/***********************************************************************/ /***********************************************************************/
@@ -701,13 +686,10 @@ int MPXFAM::ReadBuffer(PGLOBAL g)
/*******************************************************************/ /*******************************************************************/
CurNum = 0; CurNum = 0;
#if defined(BLK_INDX)
next: next:
#endif // BLK_INDX
if (++CurBlk >= Block) if (++CurBlk >= Block)
return RC_EF; return RC_EF;
#if defined(BLK_INDX)
/*******************************************************************/ /*******************************************************************/
/* Before reading a new block, check whether block optimization */ /* Before reading a new block, check whether block optimization */
/* can be done, as well as for join as for local filtering. */ /* can be done, as well as for join as for local filtering. */
@@ -718,7 +700,6 @@ int MPXFAM::ReadBuffer(PGLOBAL g)
case RC_NF: case RC_NF:
goto next; goto next;
} // endswitch rc } // endswitch rc
#endif // BLK_INDX
Fpos = Mempos = Headlen + Memory + CurBlk * Blksize; Fpos = Mempos = Headlen + Memory + CurBlk * Blksize;
} // endif's } // endif's

View File

@@ -101,7 +101,6 @@ class DllExport MPXFAM : public MBKFAM {
virtual int Cardinality(PGLOBAL g) {return TXTFAM::Cardinality(g);} virtual int Cardinality(PGLOBAL g) {return TXTFAM::Cardinality(g);}
virtual int MaxBlkSize(PGLOBAL g, int s) virtual int MaxBlkSize(PGLOBAL g, int s)
{return TXTFAM::MaxBlkSize(g, s);} {return TXTFAM::MaxBlkSize(g, s);}
//virtual int GetRowID(void);
virtual bool SetPos(PGLOBAL g, int recpos); virtual bool SetPos(PGLOBAL g, int recpos);
virtual bool DeferReading(void) {return false;} virtual bool DeferReading(void) {return false;}
virtual int ReadBuffer(PGLOBAL g); virtual int ReadBuffer(PGLOBAL g);

View File

@@ -43,7 +43,6 @@ class DllExport DBFBASE {
int Nerr; /* Number of bad records */ int Nerr; /* Number of bad records */
int Maxerr; /* Maximum number of bad records */ int Maxerr; /* Maximum number of bad records */
int ReadMode; /* 1: ALL 2: DEL 0: NOT DEL */ int ReadMode; /* 1: ALL 2: DEL 0: NOT DEL */
//PSZ Defpath; /* Default data path */
}; // end of class DBFBASE }; // end of class DBFBASE
/****************************************************************************/ /****************************************************************************/
@@ -63,22 +62,18 @@ class DllExport DBFFAM : public FIXFAM, public DBFBASE {
// Methods // Methods
virtual int GetNerr(void) {return Nerr;} virtual int GetNerr(void) {return Nerr;}
virtual int Cardinality(PGLOBAL g); virtual int Cardinality(PGLOBAL g);
//virtual int GetRowID(void); // Temporarily suppressed
virtual bool OpenTableFile(PGLOBAL g); virtual bool OpenTableFile(PGLOBAL g);
virtual bool AllocateBuffer(PGLOBAL g); virtual bool AllocateBuffer(PGLOBAL g);
virtual void ResetBuffer(PGLOBAL g); virtual void ResetBuffer(PGLOBAL g);
virtual int ReadBuffer(PGLOBAL g); virtual int ReadBuffer(PGLOBAL g);
//virtual int WriteBuffer(PGLOBAL g);
virtual int DeleteRecords(PGLOBAL g, int irc); virtual int DeleteRecords(PGLOBAL g, int irc);
virtual void CloseTableFile(PGLOBAL g); virtual void CloseTableFile(PGLOBAL g);
virtual void Rewind(void); virtual void Rewind(void);
protected: protected:
// Members
virtual bool CopyHeader(PGLOBAL g); virtual bool CopyHeader(PGLOBAL g);
//int Records; in TXTFAM // Members
//int Headlen; in TXTFAM
}; // end of class DBFFAM }; // end of class DBFFAM
/****************************************************************************/ /****************************************************************************/
@@ -100,17 +95,13 @@ class DllExport DBMFAM : public MPXFAM, public DBFBASE {
// Methods // Methods
virtual int GetNerr(void) {return Nerr;} virtual int GetNerr(void) {return Nerr;}
virtual int Cardinality(PGLOBAL g); virtual int Cardinality(PGLOBAL g);
//virtual int GetRowID(void); // Temporarily suppressed
virtual bool AllocateBuffer(PGLOBAL g); virtual bool AllocateBuffer(PGLOBAL g);
virtual int ReadBuffer(PGLOBAL g); virtual int ReadBuffer(PGLOBAL g);
//virtual int WriteBuffer(PGLOBAL g);
virtual int DeleteRecords(PGLOBAL g, int irc); virtual int DeleteRecords(PGLOBAL g, int irc);
virtual void Rewind(void); virtual void Rewind(void);
protected: protected:
// Members // Members
//int Records; in TXTFAM
//int Headlen; in TXTFAM
}; // end of class DBFFAM }; // end of class DBFFAM
#endif // __FILAMDBF_H #endif // __FILAMDBF_H

View File

@@ -168,13 +168,10 @@ int FIXFAM::ReadBuffer(PGLOBAL g)
CurNum = 0; CurNum = 0;
Tdbp->SetLine(To_Buf); Tdbp->SetLine(To_Buf);
#if defined(BLK_INDX)
next: next:
#endif // BLK_INDX
if (++CurBlk >= Block) if (++CurBlk >= Block)
return RC_EF; return RC_EF;
#if defined(BLK_INDX)
/*****************************************************************/ /*****************************************************************/
/* Before reading a new block, check whether block indexing */ /* Before reading a new block, check whether block indexing */
/* can be done, as well as for join as for local filtering. */ /* can be done, as well as for join as for local filtering. */
@@ -185,7 +182,6 @@ int FIXFAM::ReadBuffer(PGLOBAL g)
case RC_NF: case RC_NF:
goto next; goto next;
} // endswitch rc } // endswitch rc
#endif // BLK_INDX
} // endif's } // endif's
if (OldBlk == CurBlk) { if (OldBlk == CurBlk) {
@@ -1043,13 +1039,10 @@ int BGXFAM::ReadBuffer(PGLOBAL g)
CurNum = 0; CurNum = 0;
Tdbp->SetLine(To_Buf); Tdbp->SetLine(To_Buf);
#if defined(BLK_INDX)
next: next:
#endif // BLK_INDX
if (++CurBlk >= Block) if (++CurBlk >= Block)
return RC_EF; return RC_EF;
#if defined(BLK_INDX)
/*****************************************************************/ /*****************************************************************/
/* Before reading a new block, check whether block optimization */ /* Before reading a new block, check whether block optimization */
/* can be done, as well as for join as for local filtering. */ /* can be done, as well as for join as for local filtering. */
@@ -1060,7 +1053,7 @@ int BGXFAM::ReadBuffer(PGLOBAL g)
case RC_NF: case RC_NF:
goto next; goto next;
} // endswitch rc } // endswitch rc
#endif // BLK_INDX
} // endif's } // endif's
if (OldBlk == CurBlk) { if (OldBlk == CurBlk) {

View File

@@ -1,7 +1,7 @@
/************** FilAMFix H Declares Source Code File (.H) **************/ /************** FilAMFix H Declares Source Code File (.H) **************/
/* Name: FILAMFIX.H Version 1.2 */ /* Name: FILAMFIX.H Version 1.3 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 2005 - 2012 */ /* (C) Copyright to the author Olivier BERTRAND 2005 - 2014 */
/* */ /* */
/* This file contains the FIX file access method classes declares. */ /* This file contains the FIX file access method classes declares. */
/***********************************************************************/ /***********************************************************************/
@@ -64,7 +64,6 @@ class BGXFAM : public FIXFAM {
{return (PTXF)new(g) BGXFAM(this);} {return (PTXF)new(g) BGXFAM(this);}
// Methods // Methods
//virtual void Reset(void);
virtual int Cardinality(PGLOBAL g); virtual int Cardinality(PGLOBAL g);
virtual bool OpenTableFile(PGLOBAL g); virtual bool OpenTableFile(PGLOBAL g);
virtual int ReadBuffer(PGLOBAL g); virtual int ReadBuffer(PGLOBAL g);
@@ -84,7 +83,6 @@ class BGXFAM : public FIXFAM {
// Members // Members
HANDLE Hfile; // Handle(descriptor) to big file HANDLE Hfile; // Handle(descriptor) to big file
HANDLE Tfile; // Handle(descriptor) to big temp file HANDLE Tfile; // Handle(descriptor) to big temp file
//BIGINT Xpos; // Current file position
}; // end of class BGXFAM }; // end of class BGXFAM
#endif // __FILAMFIX_H #endif // __FILAMFIX_H

View File

@@ -241,14 +241,10 @@ int TXTFAM::MaxBlkSize(PGLOBAL g, int s)
// Roughly estimate the table size as the sum of blocks // Roughly estimate the table size as the sum of blocks
// that can contain good rows // that can contain good rows
for (size = 0, CurBlk = 0; CurBlk < Block; CurBlk++) for (size = 0, CurBlk = 0; CurBlk < Block; CurBlk++)
#if defined(BLK_INDX)
if ((rc = Tdbp->TestBlock(g)) == RC_OK) if ((rc = Tdbp->TestBlock(g)) == RC_OK)
size += (CurBlk == blm1) ? last : Nrec; size += (CurBlk == blm1) ? last : Nrec;
else if (rc == RC_EF) else if (rc == RC_EF)
break; break;
#else // !BLK_INDX
size += (CurBlk == blm1) ? last : Nrec;
#endif // !BLK_INDX
CurBlk = savcur; CurBlk = savcur;
return size; return size;
@@ -550,9 +546,7 @@ int DOSFAM::ReadBuffer(PGLOBAL g)
/*******************************************************************/ /*******************************************************************/
/* Record file position in case of UPDATE or DELETE. */ /* Record file position in case of UPDATE or DELETE. */
/*******************************************************************/ /*******************************************************************/
#if defined(BLK_INDX)
next: next:
#endif // BLK_INDX
if (RecordPos(g)) if (RecordPos(g))
return RC_FX; return RC_FX;
@@ -561,7 +555,6 @@ int DOSFAM::ReadBuffer(PGLOBAL g)
if (trace > 1) if (trace > 1)
htrc("ReadBuffer: CurBlk=%d\n", CurBlk); htrc("ReadBuffer: CurBlk=%d\n", CurBlk);
#if defined(BLK_INDX)
/*******************************************************************/ /*******************************************************************/
/* Check whether optimization on ROWID */ /* Check whether optimization on ROWID */
/* can be done, as well as for join as for local filtering. */ /* can be done, as well as for join as for local filtering. */
@@ -576,7 +569,7 @@ int DOSFAM::ReadBuffer(PGLOBAL g)
goto next; goto next;
} // endswitch rc } // endswitch rc
#endif // BLK_INDX
} else } else
Placed = false; Placed = false;
@@ -1019,11 +1012,7 @@ BLKFAM::BLKFAM(PDOSDEF tdp) : DOSFAM(tdp)
Last = tdp->GetLast(); Last = tdp->GetLast();
Nrec = tdp->GetElemt(); Nrec = tdp->GetElemt();
Closing = false; Closing = false;
#if defined(BLK_INDX)
BlkPos = tdp->GetTo_Pos(); BlkPos = tdp->GetTo_Pos();
#else // !BLK_INDX
BlkPos = NULL;
#endif // !BLK_INDX
CurLine = NULL; CurLine = NULL;
NxtLine = NULL; NxtLine = NULL;
OutBuf = NULL; OutBuf = NULL;
@@ -1069,14 +1058,10 @@ int BLKFAM::MaxBlkSize(PGLOBAL g, int s)
// Roughly estimate the table size as the sum of blocks // Roughly estimate the table size as the sum of blocks
// that can contain good rows // that can contain good rows
for (size = 0, CurBlk = 0; CurBlk < Block; CurBlk++) for (size = 0, CurBlk = 0; CurBlk < Block; CurBlk++)
#if defined(BLK_INDX)
if ((rc = Tdbp->TestBlock(g)) == RC_OK) if ((rc = Tdbp->TestBlock(g)) == RC_OK)
size += (CurBlk == Block - 1) ? Last : Nrec; size += (CurBlk == Block - 1) ? Last : Nrec;
else if (rc == RC_EF) else if (rc == RC_EF)
break; break;
#else // !BLK_INDX
size += (CurBlk == Block - 1) ? Last : Nrec;
#endif // !BLK_INDX
CurBlk = savcur; CurBlk = savcur;
return size; return size;
@@ -1187,7 +1172,6 @@ int BLKFAM::SkipRecord(PGLOBAL g, bool header)
/***********************************************************************/ /***********************************************************************/
int BLKFAM::ReadBuffer(PGLOBAL g) int BLKFAM::ReadBuffer(PGLOBAL g)
{ {
#if defined(BLK_INDX)
int i, n, rc = RC_OK; int i, n, rc = RC_OK;
/*********************************************************************/ /*********************************************************************/
@@ -1291,10 +1275,6 @@ int BLKFAM::ReadBuffer(PGLOBAL g)
// Store the current record file position for Delete and Update // Store the current record file position for Delete and Update
Fpos = BlkPos[CurBlk] + CurLine - To_Buf; Fpos = BlkPos[CurBlk] + CurLine - To_Buf;
return rc; return rc;
#else // !BLK_POS
strcpy(g->Message, "This AM cannot be used in this version");
return RC_FX;
#endif // !BLK_POS
} // end of ReadBuffer } // end of ReadBuffer
/***********************************************************************/ /***********************************************************************/

View File

@@ -255,14 +255,10 @@ int VCTFAM::MaxBlkSize(PGLOBAL g, int s)
// Roughly estimate the table size as the sum of blocks // Roughly estimate the table size as the sum of blocks
// that can contain good rows // that can contain good rows
for (size = 0, CurBlk = 0; CurBlk < Block; CurBlk++) for (size = 0, CurBlk = 0; CurBlk < Block; CurBlk++)
#if defined(BLK_INDX)
if ((rc = Tdbp->TestBlock(g)) == RC_OK) if ((rc = Tdbp->TestBlock(g)) == RC_OK)
size += (CurBlk == Block - 1) ? Last : Nrec; size += (CurBlk == Block - 1) ? Last : Nrec;
else if (rc == RC_EF) else if (rc == RC_EF)
break; break;
#else // !BLK_INDX
size += (CurBlk == Block - 1) ? Last : Nrec;
#endif // !BLK_INDX
CurBlk = savcur; CurBlk = savcur;
return size; return size;
@@ -579,13 +575,10 @@ int VCTFAM::ReadBuffer(PGLOBAL g)
/*******************************************************************/ /*******************************************************************/
CurNum = 0; CurNum = 0;
#if defined(BLK_INDX)
next: next:
#endif // BLK_INDX
if (++CurBlk == Block) if (++CurBlk == Block)
return RC_EF; // End of file return RC_EF; // End of file
#if defined(BLK_INDX)
/*******************************************************************/ /*******************************************************************/
/* Before reading a new block, check whether block optimizing */ /* Before reading a new block, check whether block optimizing */
/* can be done, as well as for join as for local filtering. */ /* can be done, as well as for join as for local filtering. */
@@ -596,7 +589,6 @@ int VCTFAM::ReadBuffer(PGLOBAL g)
case RC_NF: case RC_NF:
goto next; goto next;
} // endswitch rc } // endswitch rc
#endif // BLK_INDX
num_there++; num_there++;
} // endif CurNum } // endif CurNum

View File

@@ -1,11 +1,11 @@
/*********** File AM Zip C++ Program Source Code File (.CPP) ***********/ /*********** File AM Zip C++ Program Source Code File (.CPP) ***********/
/* PROGRAM NAME: FILAMZIP */ /* PROGRAM NAME: FILAMZIP */
/* ------------- */ /* ------------- */
/* Version 1.4 */ /* Version 1.5 */
/* */ /* */
/* COPYRIGHT: */ /* COPYRIGHT: */
/* ---------- */ /* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2005-2013 */ /* (C) Copyright to the author Olivier BERTRAND 2005-2014 */
/* */ /* */
/* WHAT THIS PROGRAM DOES: */ /* WHAT THIS PROGRAM DOES: */
/* ----------------------- */ /* ----------------------- */
@@ -306,15 +306,12 @@ int ZIPFAM::ReadBuffer(PGLOBAL g)
/*******************************************************************/ /*******************************************************************/
/* Record file position in case of UPDATE or DELETE. */ /* Record file position in case of UPDATE or DELETE. */
/*******************************************************************/ /*******************************************************************/
#if defined(BLK_INDX)
next: next:
#endif // BLK_INDX
if (RecordPos(g)) if (RecordPos(g))
return RC_FX; return RC_FX;
CurBlk = Rows++; // Update RowID CurBlk = Rows++; // Update RowID
#if defined(BLK_INDX)
/*******************************************************************/ /*******************************************************************/
/* Check whether optimization on ROWID */ /* Check whether optimization on ROWID */
/* can be done, as well as for join as for local filtering. */ /* can be done, as well as for join as for local filtering. */
@@ -329,7 +326,7 @@ int ZIPFAM::ReadBuffer(PGLOBAL g)
goto next; goto next;
} // endswitch rc } // endswitch rc
#endif // BLK_INDX
} else } else
Placed = false; Placed = false;
@@ -423,11 +420,7 @@ ZBKFAM::ZBKFAM(PDOSDEF tdp) : ZIPFAM(tdp)
CurLine = NULL; CurLine = NULL;
NxtLine = NULL; NxtLine = NULL;
Closing = false; Closing = false;
#if defined(BLK_INDX)
BlkPos = tdp->GetTo_Pos(); BlkPos = tdp->GetTo_Pos();
#else // !BLK_INDX
BlkPos = NULL;
#endif // !BLK_INDX
} // end of ZBKFAM standard constructor } // end of ZBKFAM standard constructor
ZBKFAM::ZBKFAM(PZBKFAM txfp) : ZIPFAM(txfp) ZBKFAM::ZBKFAM(PZBKFAM txfp) : ZIPFAM(txfp)
@@ -448,14 +441,10 @@ int ZBKFAM::MaxBlkSize(PGLOBAL g, int s)
// Roughly estimate the table size as the sum of blocks // Roughly estimate the table size as the sum of blocks
// that can contain good rows // that can contain good rows
for (size = 0, CurBlk = 0; CurBlk < Block; CurBlk++) for (size = 0, CurBlk = 0; CurBlk < Block; CurBlk++)
#if defined(BLK_INDX)
if ((rc = Tdbp->TestBlock(g)) == RC_OK) if ((rc = Tdbp->TestBlock(g)) == RC_OK)
size += (CurBlk == Block - 1) ? Last : Nrec; size += (CurBlk == Block - 1) ? Last : Nrec;
else if (rc == RC_EF) else if (rc == RC_EF)
break; break;
#else // !BLK_INDX
size += (CurBlk == Block - 1) ? Last : Nrec;
#endif // !BLK_INDX
CurBlk = savcur; CurBlk = savcur;
return size; return size;
@@ -540,7 +529,6 @@ int ZBKFAM::SkipRecord(PGLOBAL g, bool header)
/***********************************************************************/ /***********************************************************************/
int ZBKFAM::ReadBuffer(PGLOBAL g) int ZBKFAM::ReadBuffer(PGLOBAL g)
{ {
#if defined(BLK_INDX)
int n, skip, rc = RC_OK; int n, skip, rc = RC_OK;
/*********************************************************************/ /*********************************************************************/
@@ -615,10 +603,6 @@ int ZBKFAM::ReadBuffer(PGLOBAL g)
rc = Zerror(g); rc = Zerror(g);
return rc; return rc;
#else // !BLK_POS
strcpy(g->Message, "This AM cannot be used in this version");
return RC_FX;
#endif // !BLK_POS
} // end of ReadBuffer } // end of ReadBuffer
/***********************************************************************/ /***********************************************************************/
@@ -830,7 +814,6 @@ int ZIXFAM::ReadBuffer(PGLOBAL g)
CurNum = 0; CurNum = 0;
Tdbp->SetLine(To_Buf); Tdbp->SetLine(To_Buf);
#if defined(BLK_INDX)
int skip = 0; int skip = 0;
next: next:
@@ -856,7 +839,6 @@ int ZIXFAM::ReadBuffer(PGLOBAL g)
return Zerror(g); return Zerror(g);
} // endfor i } // endfor i
#endif // BLK_INDX
if (!(n = gzread(Zfile, To_Buf, Buflen))) { if (!(n = gzread(Zfile, To_Buf, Buflen))) {
rc = RC_EF; rc = RC_EF;
@@ -903,7 +885,6 @@ int ZIXFAM::WriteBuffer(PGLOBAL g)
return RC_OK; return RC_OK;
} // end of WriteBuffer } // end of WriteBuffer
#if defined(BLK_INDX)
/* --------------------------- Class ZLBFAM -------------------------- */ /* --------------------------- Class ZLBFAM -------------------------- */
/***********************************************************************/ /***********************************************************************/
@@ -1420,5 +1401,5 @@ void ZLBFAM::Rewind(void)
//OldBlk = -1; //OldBlk = -1;
//Rbuf = 0; commented out in case we reuse last read block //Rbuf = 0; commented out in case we reuse last read block
} // end of Rewind } // end of Rewind
#endif // BLK_INDX
/* ------------------------ End of ZipFam ---------------------------- */ /* ------------------------ End of ZipFam ---------------------------- */

View File

@@ -1,7 +1,7 @@
/************** FilAmZip H Declares Source Code File (.H) **************/ /************** FilAmZip H Declares Source Code File (.H) **************/
/* Name: FILAMZIP.H Version 1.1 */ /* Name: FILAMZIP.H Version 1.2 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 2005-2012 */ /* (C) Copyright to the author Olivier BERTRAND 2005-2014 */
/* */ /* */
/* This file contains the GZIP access method classes declares. */ /* This file contains the GZIP access method classes declares. */
/***********************************************************************/ /***********************************************************************/
@@ -122,7 +122,6 @@ class DllExport ZIXFAM : public ZBKFAM {
// No additional Members // No additional Members
}; // end of class ZIXFAM }; // end of class ZIXFAM
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* This is the DOS/UNIX Access Method class declaration for PlugDB */ /* This is the DOS/UNIX Access Method class declaration for PlugDB */
/* fixed/variable files compressed using the zlib library functions. */ /* fixed/variable files compressed using the zlib library functions. */
@@ -166,6 +165,5 @@ class DllExport ZLBFAM : public BLKFAM {
int *Zlenp; // Pointer to block length int *Zlenp; // Pointer to block length
bool Optimized; // true when opt file is available bool Optimized; // true when opt file is available
}; // end of class ZLBFAM }; // end of class ZLBFAM
#endif // BLK_INDX
#endif // __FILAMZIP_H #endif // __FILAMZIP_H

View File

@@ -68,7 +68,7 @@ PPARM MakeParm(PGLOBAL g, PXOB xp)
bool PlugEvalLike(PGLOBAL, LPCSTR, LPCSTR, bool); bool PlugEvalLike(PGLOBAL, LPCSTR, LPCSTR, bool);
//bool ReadSubQuery(PGLOBAL, PSUBQ); //bool ReadSubQuery(PGLOBAL, PSUBQ);
//PSUBQ OpenSubQuery(PGLOBAL, PSQL); //PSUBQ OpenSubQuery(PGLOBAL, PSQL);
void PlugCloseDB(PGLOBAL, PSQL); //void PlugCloseDB(PGLOBAL, PSQL);
BYTE OpBmp(PGLOBAL g, OPVAL opc); BYTE OpBmp(PGLOBAL g, OPVAL opc);
PARRAY MakeValueArray(PGLOBAL g, PPARM pp); PARRAY MakeValueArray(PGLOBAL g, PPARM pp);
@@ -201,6 +201,7 @@ FILTER::FILTER(PFIL fil1)
Test[1] = fil1->Test[1]; Test[1] = fil1->Test[1];
} // end of FILTER copy constructor } // end of FILTER copy constructor
#if 0
/***********************************************************************/ /***********************************************************************/
/* Linearize: Does the linearization of the filter tree: */ /* Linearize: Does the linearization of the filter tree: */
/* Independent filters (not implied in OR/NOT) will be separated */ /* Independent filters (not implied in OR/NOT) will be separated */
@@ -388,7 +389,6 @@ int FILTER::RefNum(PSQL sqlp)
return n; return n;
} // end of RefNum } // end of RefNum
#if 0
/***********************************************************************/ /***********************************************************************/
/* CheckSubQuery: see SUBQUERY::CheckSubQuery for comment. */ /* CheckSubQuery: see SUBQUERY::CheckSubQuery for comment. */
/***********************************************************************/ /***********************************************************************/
@@ -747,7 +747,6 @@ bool FILTER::CheckHaving(PGLOBAL g, PSQL sqlp)
sqlp->SetOk(FALSE); sqlp->SetOk(FALSE);
return FALSE; return FALSE;
} // end of CheckHaving } // end of CheckHaving
#endif // 0
/***********************************************************************/ /***********************************************************************/
/* Used while building a table index. This function split the filter */ /* Used while building a table index. This function split the filter */
@@ -924,6 +923,7 @@ int FILTER::CheckSpcCol(PTDB tdbp, int n)
return max(n1, n2); return max(n1, n2);
} // end of CheckSpcCol } // end of CheckSpcCol
#endif // 0
/***********************************************************************/ /***********************************************************************/
/* Reset the filter arguments to non evaluated yet. */ /* Reset the filter arguments to non evaluated yet. */

View File

@@ -53,25 +53,25 @@ class DllExport FILTER : public XOBJECT { /* Filter description block */
virtual bool Init(PGLOBAL); virtual bool Init(PGLOBAL);
virtual bool Eval(PGLOBAL); virtual bool Eval(PGLOBAL);
virtual bool SetFormat(PGLOBAL, FORMAT&) {return TRUE;} // NUY virtual bool SetFormat(PGLOBAL, FORMAT&) {return TRUE;} // NUY
virtual int CheckColumn(PGLOBAL g, PSQL sqlp, PXOB &xp, int &ag); //virtual int CheckColumn(PGLOBAL g, PSQL sqlp, PXOB &xp, int &ag);
virtual int RefNum(PSQL); //virtual int RefNum(PSQL);
virtual PXOB SetSelect(PGLOBAL, PSQL, bool) {return NULL;} // NUY //virtual PXOB SetSelect(PGLOBAL, PSQL, bool) {return NULL;} // NUY
//virtual PXOB CheckSubQuery(PGLOBAL, PSQL); //virtual PXOB CheckSubQuery(PGLOBAL, PSQL);
virtual bool CheckLocal(PTDB); //virtual bool CheckLocal(PTDB);
virtual int CheckSpcCol(PTDB tdbp, int n); //virtual int CheckSpcCol(PTDB tdbp, int n);
virtual void Print(PGLOBAL g, FILE *f, UINT n); virtual void Print(PGLOBAL g, FILE *f, UINT n);
virtual void Print(PGLOBAL g, char *ps, UINT z); virtual void Print(PGLOBAL g, char *ps, UINT z);
PFIL Linearize(bool nosep); // PFIL Linearize(bool nosep);
PFIL Link(PGLOBAL g, PFIL fil2); // PFIL Link(PGLOBAL g, PFIL fil2);
PFIL RemoveLastSep(void); // PFIL RemoveLastSep(void);
// PFIL SortJoin(PGLOBAL g); // PFIL SortJoin(PGLOBAL g);
// bool FindJoinFilter(POPJOIN opj, PFIL fprec, bool teq, // bool FindJoinFilter(POPJOIN opj, PFIL fprec, bool teq,
// bool tek, bool tk2, bool tc2, bool tix, bool thx); // bool tek, bool tk2, bool tc2, bool tix, bool thx);
// bool CheckHaving(PGLOBAL g, PSQL sqlp); // bool CheckHaving(PGLOBAL g, PSQL sqlp);
bool Convert(PGLOBAL g, bool having); bool Convert(PGLOBAL g, bool having);
int SplitFilter(PFIL *fp); // int SplitFilter(PFIL *fp);
int SplitFilter(PFIL *fp, PTDB tp, int n); // int SplitFilter(PFIL *fp, PTDB tp, int n);
PFIL LinkFilter(PGLOBAL g, PFIL fp2); // PFIL LinkFilter(PGLOBAL g, PFIL fp2);
// PFIL Copy(PTABS t); // PFIL Copy(PTABS t);
protected: protected:

View File

@@ -222,9 +222,7 @@ typedef struct _global { /* Global structure */
int Createas; /* To pass info to created table */ int Createas; /* To pass info to created table */
void *Xchk; /* indexes in create/alter */ void *Xchk; /* indexes in create/alter */
short Alchecked; /* Checked for ALTER */ short Alchecked; /* Checked for ALTER */
#if defined(MRRBKA_SUPPORT)
short Mrr; /* True when doing mrr */ short Mrr; /* True when doing mrr */
#endif // MRRBKA_SUPPORT
short Trace; short Trace;
int jump_level; int jump_level;
jmp_buf jumper[MAX_JUMP + 2]; jmp_buf jumper[MAX_JUMP + 2];

View File

@@ -332,10 +332,7 @@ DllExport LPCSTR PlugSetPath(LPSTR to, LPCSTR name, LPCSTR dir)
*/ */
static const char *ha_connect_exts[]= { static const char *ha_connect_exts[]= {
".dos", ".fix", ".csv", ".bin", ".fmt", ".dbf", ".xml", ".ini", ".vec", ".dos", ".fix", ".csv", ".bin", ".fmt", ".dbf", ".xml", ".ini", ".vec",
".dnx", ".fnx", ".bnx", ".vnx", ".dbx", ".dnx", ".fnx", ".bnx", ".vnx", ".dbx", ".dop", ".fop", ".bop", ".vop",
#if defined(BLK_INDX)
".dop", ".fop", ".bop", ".vop",
#endif // BLK_INDX
NULL}; NULL};
/** /**
@@ -1358,20 +1355,14 @@ int ha_connect::MakeRecord(char *buf)
if (bitmap_is_set(map, fp->field_index) || alter) { if (bitmap_is_set(map, fp->field_index) || alter) {
// This is a used field, fill the buffer with value // This is a used field, fill the buffer with value
for (colp= tdbp->GetColumns(); colp; colp= colp->GetNext()) for (colp= tdbp->GetColumns(); colp; colp= colp->GetNext())
#if defined(MRRBKA_SUPPORT)
if ((!mrr || colp->GetKcol()) && if ((!mrr || colp->GetKcol()) &&
!stricmp(colp->GetName(), (char*)fp->field_name)) !stricmp(colp->GetName(), (char*)fp->field_name))
break; break;
#else // !MRRBKA_SUPPORT
if (!stricmp(colp->GetName(), (char*)fp->field_name))
break;
#endif // !MRRBKA_SUPPORT
if (!colp) { if (!colp) {
#if defined(MRRBKA_SUPPORT)
if (mrr) if (mrr)
continue; continue;
#endif // MRRBKA_SUPPORT
htrc("Column %s not found\n", fp->field_name); htrc("Column %s not found\n", fp->field_name);
dbug_tmp_restore_column_map(table->write_set, org_bitmap); dbug_tmp_restore_column_map(table->write_set, org_bitmap);
DBUG_RETURN(HA_ERR_WRONG_IN_RECORD); DBUG_RETURN(HA_ERR_WRONG_IN_RECORD);
@@ -1656,7 +1647,6 @@ const char *ha_connect::GetValStr(OPVAL vop, bool neg)
} // end of GetValStr } // end of GetValStr
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Check the WHERE condition and return a CONNECT filter. */ /* Check the WHERE condition and return a CONNECT filter. */
/***********************************************************************/ /***********************************************************************/
@@ -1837,7 +1827,6 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond)
return filp; return filp;
} // end of CondFilter } // end of CondFilter
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* Check the WHERE condition and return a MYSQL/ODBC/WQL filter. */ /* Check the WHERE condition and return a MYSQL/ODBC/WQL filter. */
@@ -2094,19 +2083,12 @@ const COND *ha_connect::cond_push(const COND *cond)
DBUG_ENTER("ha_connect::cond_push"); DBUG_ENTER("ha_connect::cond_push");
if (tdbp) { if (tdbp) {
PGLOBAL& g= xp->g;
AMT tty= tdbp->GetAmType(); AMT tty= tdbp->GetAmType();
bool x= (tty == TYPE_AM_MYX || tty == TYPE_AM_XDBC); bool x= (tty == TYPE_AM_MYX || tty == TYPE_AM_XDBC);
bool b= (tty == TYPE_AM_WMI || tty == TYPE_AM_ODBC || bool b= (tty == TYPE_AM_WMI || tty == TYPE_AM_ODBC ||
tty == TYPE_AM_TBL || tty == TYPE_AM_MYSQL || tty == TYPE_AM_TBL || tty == TYPE_AM_MYSQL ||
tty == TYPE_AM_PLG || x); tty == TYPE_AM_PLG || x);
#if defined(BLK_INDX)
bool go= true;
#else // !BLK_INDX)
bool go= b;
#endif // !BLK_INDX
if (go) {
PGLOBAL& g= xp->g;
if (b) { if (b) {
PCFIL filp= (PCFIL)PlugSubAlloc(g, NULL, sizeof(CONDFIL)); PCFIL filp= (PCFIL)PlugSubAlloc(g, NULL, sizeof(CONDFIL));
@@ -2129,12 +2111,8 @@ const COND *ha_connect::cond_push(const COND *cond)
} else if (x && cond) } else if (x && cond)
tdbp->SetCondFil(filp); // Wrong filter tdbp->SetCondFil(filp); // Wrong filter
} // endif b } else
#if defined(BLK_INDX)
else
tdbp->SetFilter(CondFilter(g, (Item *)cond)); tdbp->SetFilter(CondFilter(g, (Item *)cond));
#endif // BLK_INDX
} // endif go
} // endif tdbp } // endif tdbp
@@ -2230,14 +2208,14 @@ int ha_connect::open(const char *name, int mode, uint test_if_locked)
// Try to set the database environment // Try to set the database environment
if (g) { if (g) {
rc= (CntCheckDB(g, this, name)) ? (-2) : 0; rc= (CntCheckDB(g, this, name)) ? (-2) : 0;
#if defined(MRRBKA_SUPPORT)
if (g->Mrr) { if (g->Mrr) {
// This should only happen for the mrr secondary handler // This should only happen for the mrr secondary handler
mrr= true; mrr= true;
g->Mrr= false; g->Mrr= false;
} else } else
mrr= false; mrr= false;
#endif // MRRBKA_SUPPORT
} else } else
rc= HA_ERR_INTERNAL_ERROR; rc= HA_ERR_INTERNAL_ERROR;
@@ -2259,8 +2237,7 @@ int ha_connect::optimize(THD* thd, HA_CHECK_OPT* check_opt)
tdbp= GetTDB(g); tdbp= GetTDB(g);
dup->Check |= CHK_OPT; dup->Check |= CHK_OPT;
if (tdbp || (tdbp= GetTDB(g))) { if (tdbp) {
#if defined(BLK_INDX)
bool b= ((PTDBASE)tdbp)->GetDef()->Indexable(); bool b= ((PTDBASE)tdbp)->GetDef()->Indexable();
if ((rc= ((PTDBASE)tdbp)->ResetTableOpt(g, true, b))) { if ((rc= ((PTDBASE)tdbp)->ResetTableOpt(g, true, b))) {
@@ -2271,21 +2248,6 @@ int ha_connect::optimize(THD* thd, HA_CHECK_OPT* check_opt)
rc= HA_ERR_INTERNAL_ERROR; rc= HA_ERR_INTERNAL_ERROR;
} // endif rc } // endif rc
#else // !BLK_INDX
if (!((PTDBASE)tdbp)->GetDef()->Indexable()) {
sprintf(g->Message, "optimize: Table %s is not indexable", tdbp->GetName());
my_message(ER_INDEX_REBUILD, g->Message, MYF(0));
rc= HA_ERR_UNSUPPORTED;
} else if ((rc= ((PTDBASE)tdbp)->ResetTableOpt(g, false, true))) {
if (rc == RC_INFO) {
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
rc= 0;
} else
rc= HA_ERR_INTERNAL_ERROR;
} // endif's
#endif // !BLK_INDX
} else } else
rc= HA_ERR_INTERNAL_ERROR; rc= HA_ERR_INTERNAL_ERROR;
@@ -2531,9 +2493,7 @@ int ha_connect::index_end()
{ {
DBUG_ENTER("index_end"); DBUG_ENTER("index_end");
active_index= MAX_KEY; active_index= MAX_KEY;
#if defined(MRRBKA_SUPPORT)
ds_mrr.dsmrr_close(); ds_mrr.dsmrr_close();
#endif // MRRBKA_SUPPORT
DBUG_RETURN(rnd_end()); DBUG_RETURN(rnd_end());
} // end of index_end } // end of index_end
@@ -2800,9 +2760,7 @@ int ha_connect::rnd_end()
// if (tdbp && xp->last_query_id == valid_query_id) // if (tdbp && xp->last_query_id == valid_query_id)
// rc= CloseTable(xp->g); // rc= CloseTable(xp->g);
#if defined(MRRBKA_SUPPORT)
ds_mrr.dsmrr_close(); ds_mrr.dsmrr_close();
#endif // MRRBKA_SUPPORT
DBUG_RETURN(rc); DBUG_RETURN(rc);
} // end of rnd_end } // end of rnd_end
@@ -5630,9 +5588,6 @@ bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *info,
DBUG_RETURN(COMPATIBLE_DATA_NO); DBUG_RETURN(COMPATIBLE_DATA_NO);
} // end of check_if_incompatible_data } // end of check_if_incompatible_data
#if defined(MRRBKA_SUPPORT)
//#error This is not implemented yet
/**************************************************************************** /****************************************************************************
* CONNECT MRR implementation: use DS-MRR * CONNECT MRR implementation: use DS-MRR
This is just copied from myisam This is just copied from myisam
@@ -5709,7 +5664,7 @@ Item *ha_connect::idx_cond_push(uint keyno_arg, Item* idx_cond_arg)
return NULL; return NULL;
} }
#endif // 0 #endif // 0
#endif // MRRBKA_SUPPORT
struct st_mysql_storage_engine connect_storage_engine= struct st_mysql_storage_engine connect_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION }; { MYSQL_HANDLERTON_INTERFACE_VERSION };
@@ -5724,10 +5679,10 @@ maria_declare_plugin(connect)
PLUGIN_LICENSE_GPL, PLUGIN_LICENSE_GPL,
connect_init_func, /* Plugin Init */ connect_init_func, /* Plugin Init */
connect_done_func, /* Plugin Deinit */ connect_done_func, /* Plugin Deinit */
0x0102, /* version number (1.02) */ 0x0103, /* version number (1.03) */
NULL, /* status variables */ NULL, /* status variables */
NULL, /* system variables */ NULL, /* system variables */
"1.02", /* string version */ "1.03", /* string version */
MariaDB_PLUGIN_MATURITY_BETA /* maturity */ MariaDB_PLUGIN_MATURITY_BETA /* maturity */
} }
maria_declare_plugin_end; maria_declare_plugin_end;

View File

@@ -1,4 +1,4 @@
/* Copyright (C) Olivier Bertrand 2004 - 2013 /* Copyright (C) Olivier Bertrand 2004 - 2014
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -122,8 +122,8 @@ struct ha_table_option_struct {
struct ha_field_option_struct struct ha_field_option_struct
{ {
ulonglong offset; ulonglong offset;
ulonglong freq; // Not used by this version ulonglong freq;
ulonglong opt; // Not used by this version ulonglong opt;
ulonglong fldlen; ulonglong fldlen;
const char *dateformat; const char *dateformat;
const char *fieldformat; const char *fieldformat;
@@ -243,11 +243,7 @@ public:
*/ */
ulong index_flags(uint inx, uint part, bool all_parts) const ulong index_flags(uint inx, uint part, bool all_parts) const
{ {
return HA_READ_NEXT | HA_READ_RANGE | HA_READ_ORDER return HA_READ_NEXT | HA_READ_RANGE | HA_READ_ORDER | HA_KEYREAD_ONLY;
#if defined(MRRBKA_SUPPORT)
| HA_KEYREAD_ONLY
#endif // MRRBKA_SUPPORT
;
} // end of index_flags } // end of index_flags
/** @brief /** @brief
@@ -336,9 +332,7 @@ public:
virtual const COND *cond_push(const COND *cond); virtual const COND *cond_push(const COND *cond);
PCFIL CheckCond(PGLOBAL g, PCFIL filp, AMT tty, Item *cond); PCFIL CheckCond(PGLOBAL g, PCFIL filp, AMT tty, Item *cond);
const char *GetValStr(OPVAL vop, bool neg); const char *GetValStr(OPVAL vop, bool neg);
#if defined(BLK_INDX)
PFIL CondFilter(PGLOBAL g, Item *cond); PFIL CondFilter(PGLOBAL g, Item *cond);
#endif // BLK_INDX
/** /**
Number of rows in table. It will only be called if Number of rows in table. It will only be called if
@@ -427,6 +421,9 @@ PFIL CondFilter(PGLOBAL g, Item *cond);
*/ */
//int index_last(uchar *buf); //int index_last(uchar *buf);
/* Index condition pushdown implementation */
//Item *idx_cond_push(uint keyno, Item* idx_cond);
/** @brief /** @brief
Unlike index_init(), rnd_init() can be called two consecutive times Unlike index_init(), rnd_init() can be called two consecutive times
without rnd_end() in between (it only makes sense if scan=1). In this without rnd_end() in between (it only makes sense if scan=1). In this
@@ -470,6 +467,28 @@ PFIL CondFilter(PGLOBAL g, Item *cond);
enum thr_lock_type lock_type); ///< required enum thr_lock_type lock_type); ///< required
int optimize(THD* thd, HA_CHECK_OPT* check_opt); int optimize(THD* thd, HA_CHECK_OPT* check_opt);
/**
* Multi Range Read interface
*/
int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
uint n_ranges, uint mode, HANDLER_BUFFER *buf);
int multi_range_read_next(range_id_t *range_info);
ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
void *seq_init_param,
uint n_ranges, uint *bufsz,
uint *flags, Cost_estimate *cost);
ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
uint key_parts, uint *bufsz,
uint *flags, Cost_estimate *cost);
int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size);
int reset(void) {ds_mrr.dsmrr_close(); return 0;}
/* Index condition pushdown implementation */
// Item *idx_cond_push(uint keyno, Item* idx_cond);
private:
DsMrr_impl ds_mrr;
protected: protected:
bool check_privileges(THD *thd, PTOS options, char *dbn); bool check_privileges(THD *thd, PTOS options, char *dbn);
MODE CheckMode(PGLOBAL g, THD *thd, MODE newmode, bool *chk, bool *cras); MODE CheckMode(PGLOBAL g, THD *thd, MODE newmode, bool *chk, bool *cras);
@@ -502,28 +521,4 @@ public:
char *index_file_name; char *index_file_name;
uint int_table_flags; // Inherited from MyISAM uint int_table_flags; // Inherited from MyISAM
bool enable_activate_all_index; // Inherited from MyISAM bool enable_activate_all_index; // Inherited from MyISAM
#if defined(MRRBKA_SUPPORT)
/**
* Multi Range Read interface
*/
int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
uint n_ranges, uint mode, HANDLER_BUFFER *buf);
int multi_range_read_next(range_id_t *range_info);
ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
void *seq_init_param,
uint n_ranges, uint *bufsz,
uint *flags, Cost_estimate *cost);
ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
uint key_parts, uint *bufsz,
uint *flags, Cost_estimate *cost);
int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size);
int reset(void) {ds_mrr.dsmrr_close(); return 0;}
/* Index condition pushdown implementation */
// Item *idx_cond_push(uint keyno, Item* idx_cond);
private:
DsMrr_impl ds_mrr;
#endif // MRRBKA_SUPPORT
}; // end of ha_connect class definition }; // end of ha_connect class definition

View File

@@ -63,15 +63,10 @@ class DllItem MYSQLC {
bool Connected(void); bool Connected(void);
// Methods // Methods
// int GetCurPos(void) {return (m_Res) ? N : 0;}
// int GetProgCur(void) {return N;}
int GetResultSize(PGLOBAL g, PSZ sql); int GetResultSize(PGLOBAL g, PSZ sql);
int Open(PGLOBAL g, const char *host, const char *db, int Open(PGLOBAL g, const char *host, const char *db,
const char *user= "root", const char *pwd= "*", const char *user= "root", const char *pwd= "*",
int pt= 0); int pt= 0);
//ulong GetThreadID(void);
//ulong ServerVersion(void);
//const char *ServerInfo(void);
int KillQuery(ulong id); int KillQuery(ulong id);
int ExecSQL(PGLOBAL g, const char *query, int *w = NULL); int ExecSQL(PGLOBAL g, const char *query, int *w = NULL);
int ExecSQLcmd(PGLOBAL g, const char *query, int *w); int ExecSQLcmd(PGLOBAL g, const char *query, int *w);
@@ -87,7 +82,6 @@ class DllItem MYSQLC {
void Rewind(void); void Rewind(void);
void FreeResult(void); void FreeResult(void);
void Close(void); void Close(void);
//void DiscardResults(void);
protected: protected:
MYSQL_FIELD *GetNextField(void); MYSQL_FIELD *GetNextField(void);

View File

@@ -62,146 +62,6 @@ enum INFO {INDX_RC, /* Index of PlugDB return code field */
INDX_SIZE, /* Index of returned data size field */ INDX_SIZE, /* Index of returned data size field */
INDX_MAX}; /* Size of info array */ INDX_MAX}; /* Size of info array */
#ifdef NOT_USED
/**************************************************************************/
/* Internal message types. */
/**************************************************************************/
enum MSGTYP {MST_OPEN = 10, /* Code for old connecting message */
MST_COMMAND = 11, /* Code for send command message */
MST_RESULT = 12, /* Code for get result message */
MST_CLOSE = 13, /* Code for disconnecting message */
MST_PROGRESS = 14, /* Code for progress message */
MST_CANCEL = 15, /* Code for cancel message */
MST_PROCESSED = 16, /* Code for already processed msg */
MST_ERROR = 17, /* Code for get error message */
MST_CHAR = 18, /* Code for get char value message */
MST_LONG = 19, /* Code for get int value message */
MST_COLUMN = 20, /* Code for get col value message */
MST_MESSAGE = 21, /* Code for get message message */
MST_HEADER = 22, /* Code for get header message */
MST_SOCKET = 23, /* Code for socket error message */
MST_SHUTDOWN = 24, /* Code for shutdown message */
MST_SOCKPROG = 25, /* Code for socket progress message */
MST_POST = 26, /* Code for post command message */
MST_NEW_OPEN = 27, /* Code for new connecting message */
MST_PROG_NUM = 5}; /* Num of integers in progress msg */
/**************************************************************************/
/* Vendors. */
/**************************************************************************/
enum VENDOR {VDR_UNKNOWN = -2, /* Not known or not connected */
VDR_PlugDB = -1, /* PlugDB */
VDR_OTHER = 0}; /* OEM */
/**************************************************************************/
/* Attribute keys of Result Description structure (arranged by type). */
/**************************************************************************/
enum CKEYS {K_ProgMsg, K_Lang, K_ActiveDB, K_Cmax};
enum LKEYS {K_NBcol, K_NBlin, K_CurPos, K_RC, K_Result, K_Elapsed,
K_Continued, K_Maxsize, K_Affrows, K_Lmax, K_Maxcol,
K_Maxres, K_Maxlin, K_NBparm};
enum NKEYS {K_Type, K_Length, K_Prec, K_DataLen, K_Unsigned, K_Nmax};
/**************************************************************************/
/* Result description structures. */
/**************************************************************************/
typedef struct _MsgTagAttr {
bool fSupplied;
char Attr[MAXMESSAGE];
} MTAG, *PMTAG;
typedef struct _CharTagAttr {
bool fSupplied;
char Attr[MAXDBNAME];
} CTAG, *PCTAG;
typedef struct _LongTagAttr {
bool fSupplied;
int Attr;
} LTAG, *PLTAG;
typedef struct _ColVar {
LTAG Lat[K_Nmax];
CTAG Cat;
} COLVAR, *LPCOLVAR;
typedef struct _ResDesc {
int Maxcol; /* Max number of columns */
int Colnum; /* Number of columns */
MTAG Mat; /* Message */
CTAG Cat[K_Cmax]; /* Character attributes */
LTAG Lat[K_Lmax]; /* Long int attributes */
COLVAR Col[1]; /* Column attributes */
} RDESC, *PRDESC;
/**************************************************************************/
/* Exported PlugDB client functions in Plgcnx DLL. */
/**************************************************************************/
#if !defined(CNXFUNC)
#if defined(UNIX) || defined(UNIV_LINUX)
#undef __stdcall
#define __stdcall
#endif
#if defined(NOLIB) /* Dynamic link of plgcnx.dll */
#define CNXFUNC(f) (__stdcall *f)
#else /* LIB */ /* Static link with plgcnx.lib */
#define CNXFUNC(f) __stdcall f
#endif
#endif
#if !defined(CNXKEY)
#define CNXKEY uint
#endif
#if !defined(XTRN)
#define XTRN
#endif
//#if !defined(NO_FUNC)
#ifdef __cplusplus
extern "C" {
#endif
XTRN int CNXFUNC(PLGConnect) (CNXKEY *, const char *, bool);
XTRN int CNXFUNC(PLGSendCommand) (CNXKEY, const char *, void *, int, int *);
XTRN int CNXFUNC(PLGGetResult) (CNXKEY, void *, int, int *, bool);
XTRN int CNXFUNC(PLGDisconnect) (CNXKEY);
XTRN int CNXFUNC(PLGGetErrorMsg) (CNXKEY, char *, int, int *);
XTRN bool CNXFUNC(PLGGetCharValue)(CNXKEY, char *, int, int);
XTRN bool CNXFUNC(PLGGetIntValue)(CNXKEY, int *, int);
XTRN bool CNXFUNC(PLGGetColValue) (CNXKEY, int *, int, int);
XTRN bool CNXFUNC(PLGGetMessage) (CNXKEY, char *, int);
XTRN bool CNXFUNC(PLGGetHeader) (CNXKEY, char *, int, int, int);
#ifdef __cplusplus
}
#endif
//#endif /* !NO_FUNC */
/**************************************************************************/
/* Convenience function Definitions */
/**************************************************************************/
#define PLGPostCommand(T,C) PLGSendCommand(T,C,NULL,0,NULL)
#if defined(FNCMAC)
#define PLGGetProgMsg(T,C,S) PLGGetCharValue(T,C,S,K_ProgMsg)
#define PLGGetLangID(T,C,S) PLGGetCharValue(T,C,S,K_Lang)
#define PLGGetActiveDB(T,C,S) PLGGetCharValue(T,C,S,K_ActiveDB)
#define PLGGetCursorPos(T,L) PLGGetIntValue(T,L,K_CurPos)
#define PLGGetResultType(T,L) PLGGetIntValue(T,L,K_Result)
#define PLGGetNBcol(T,L) PLGGetIntValue(T,L,K_NBcol)
#define PLGGetNBlin(T,L) PLGGetIntValue(T,L,K_NBlin)
#define PLGGetRetCode(T,L) PLGGetIntValue(T,L,K_RC)
#define PLGGetElapsed(T,L) PLGGetIntValue(T,L,K_Elapsed)
#define PLGGetContinued(T,L) PLGGetIntValue(T,L,K_Continued)
#define PLGGetMaxSize(T,L) PLGGetIntValue(T,L,K_Maxsize)
#define PLGGetLength(T,L,C) PLGGetColValue(T,L,K_Length,C)
#define PLGGetDataSize(T,L,C) PLGGetColValue(T,L,K_DataLen,C)
#define PLGGetDecimal(T,L,C) PLGGetColValue(T,L,K_Prec,C)
#define PLGGetType(T,L,C) PLGGetColValue(T,L,K_Type,C)
#endif /* FNCMAC */
#endif // NOT_USED
#endif /* !_PLGCNX_H */ #endif /* !_PLGCNX_H */
/* ------------------------- End of Plgcnx.h ---------------------------- */ /* ------------------------- End of Plgcnx.h ---------------------------- */

View File

@@ -26,20 +26,15 @@
enum BLKTYP {TYPE_TABLE = 50, /* Table Name/Srcdef/... Block */ enum BLKTYP {TYPE_TABLE = 50, /* Table Name/Srcdef/... Block */
TYPE_COLUMN = 51, /* Column Name/Qualifier Block */ TYPE_COLUMN = 51, /* Column Name/Qualifier Block */
// TYPE_OPVAL = 52, /* Operator value (OPVAL) */
TYPE_TDB = 53, /* Table Description Block */ TYPE_TDB = 53, /* Table Description Block */
TYPE_COLBLK = 54, /* Column Description Block */ TYPE_COLBLK = 54, /* Column Description Block */
#if defined(BLK_INDX)
TYPE_FILTER = 55, /* Filter Description Block */ TYPE_FILTER = 55, /* Filter Description Block */
TYPE_ARRAY = 63, /* General array type */ TYPE_ARRAY = 63, /* General array type */
#endif // BLK_INDX
TYPE_PSZ = 64, /* Pointer to String ended by 0 */ TYPE_PSZ = 64, /* Pointer to String ended by 0 */
TYPE_SQL = 65, /* Pointer to SQL block */ TYPE_SQL = 65, /* Pointer to SQL block */
TYPE_XOBJECT = 69, /* Extended DB object */ TYPE_XOBJECT = 69, /* Extended DB object */
TYPE_COLCRT = 71, /* Column creation block */ TYPE_COLCRT = 71, /* Column creation block */
TYPE_CONST = 72, /* Constant */ TYPE_CONST = 72, /* Constant */
// TYPE_INDEXDEF = 73, /* Index definition block */
// TYPE_OPER = 74, /* Operator block (OPER) */
/*-------------------- type tokenized string --------------------------*/ /*-------------------- type tokenized string --------------------------*/
TYPE_DATE = 8, /* Timestamp */ TYPE_DATE = 8, /* Timestamp */
@@ -344,9 +339,7 @@ typedef class XTAB *PTABLE;
typedef class COLUMN *PCOLUMN; typedef class COLUMN *PCOLUMN;
typedef class XOBJECT *PXOB; typedef class XOBJECT *PXOB;
typedef class COLBLK *PCOL; typedef class COLBLK *PCOL;
//pedef class TBX *PTBX;
typedef class TDB *PTDB; typedef class TDB *PTDB;
typedef void *PSQL; // Not used
typedef class TDBASE *PTDBASE; typedef class TDBASE *PTDBASE;
typedef class TDBDOS *PTDBDOS; typedef class TDBDOS *PTDBDOS;
typedef class TDBFIX *PTDBFIX; typedef class TDBFIX *PTDBFIX;
@@ -378,9 +371,7 @@ typedef class COLDEF *PCOLDEF;
typedef class CONSTANT *PCONST; typedef class CONSTANT *PCONST;
typedef class VALUE *PVAL; typedef class VALUE *PVAL;
typedef class VALBLK *PVBLK; typedef class VALBLK *PVBLK;
#if defined(BLK_INDX)
typedef class FILTER *PFIL; typedef class FILTER *PFIL;
#endif // BLK_INDX
typedef struct _fblock *PFBLOCK; typedef struct _fblock *PFBLOCK;
typedef struct _mblock *PMBLOCK; typedef struct _mblock *PMBLOCK;
@@ -418,43 +409,26 @@ typedef struct _mblock { /* Memory block */
/* The QUERY application User Block. */ /* The QUERY application User Block. */
/***********************************************************************/ /***********************************************************************/
typedef struct { /* User application block */ typedef struct { /* User application block */
//void *Act2; /* RePoint to activity block */
//short LineLen; /* Current output line len */
NAME Name; /* User application name */ NAME Name; /* User application name */
//NAME Password; /* User application password */
//PSZ UserFile; /* User application filename */
char Server[17]; /* Server name */ char Server[17]; /* Server name */
char DBName[17]; /* Current database name */ char DBName[17]; /* Current database name */
//char Host[65]; /* Caller's host name */
//char User[17]; /* Caller's user name */
//uint Granted; /* Grant bitmap */
PCATLG Catalog; /* To CATALOG class */ PCATLG Catalog; /* To CATALOG class */
PQRYRES Result; /* To query result blocks */ PQRYRES Result; /* To query result blocks */
PFBLOCK Openlist; /* To file/map open list */ PFBLOCK Openlist; /* To file/map open list */
PMBLOCK Memlist; /* To memory block list */ PMBLOCK Memlist; /* To memory block list */
PXUSED Xlist; /* To used index list */ PXUSED Xlist; /* To used index list */
//int Maxres; /* Result Max nb of lines */
//int Maxtmp; /* Intermediate tables Maxres */
//int Maxlin; /* Query Max nb of data lines */
#if defined(BLK_INDX)
int Maxbmp; /* Maximum XDB2 bitmap size */ int Maxbmp; /* Maximum XDB2 bitmap size */
#endif // BLK_INDX
int Check; /* General level of checking */ int Check; /* General level of checking */
int Numlines; /* Number of lines involved */ int Numlines; /* Number of lines involved */
//ALGMOD AlgChoice; /* Choice of algorithm mode */
//AREADEF DescArea; /* Table desc. area size */
USETEMP UseTemp; /* Use temporary file */ USETEMP UseTemp; /* Use temporary file */
//int Curtype; /* 0: static else: dynamic */
int Vtdbno; /* Used for TDB number setting */ int Vtdbno; /* Used for TDB number setting */
bool Remote; /* true: if remotely called */ bool Remote; /* true: if remotely called */
//bool NotFinal; /* true: for intermediate table */
bool Proginfo; /* true: return progress info */ bool Proginfo; /* true: return progress info */
bool Subcor; /* Used for Progress info */ bool Subcor; /* Used for Progress info */
size_t ProgMax; /* Used for Progress info */ size_t ProgMax; /* Used for Progress info */
size_t ProgCur; /* Used for Progress info */ size_t ProgCur; /* Used for Progress info */
size_t ProgSav; /* Used for Progress info */ size_t ProgSav; /* Used for Progress info */
LPCSTR Step; /* Execution step name */ LPCSTR Step; /* Execution step name */
//char Work[_MAX_PATH]; /* Local work path */
} DBUSERBLK, *PDBUSER; } DBUSERBLK, *PDBUSER;
/***********************************************************************/ /***********************************************************************/
@@ -488,7 +462,6 @@ typedef struct _tabs {
PTABADR P3; PTABADR P3;
} TABS; } TABS;
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Argument of expression, function, filter etc. (Xobject) */ /* Argument of expression, function, filter etc. (Xobject) */
/***********************************************************************/ /***********************************************************************/
@@ -504,22 +477,6 @@ typedef struct _oper { /* Operator */
int Mod; /* The modificator */ int Mod; /* The modificator */
} OPER, *POPER; } OPER, *POPER;
#if 0
/***********************************************************************/
/* Definitions and table of Scalar Functions. */
/***********************************************************************/
typedef struct _sfdsc { /* Scalar function description block*/
char Name[16]; /* Scalar function name */
EVAL EvalType; /* Type of Init and Eval functions */
OPVAL Op; /* Equivalent operator number */
int R_Type; /* Result Type */
int R_Length; /* Result Length */
int R_Prec; /* Result Precision */
int Numarg; /* Number of arguments */
} SFDSC, *PSFDSC;
#endif // 0
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* Following definitions are used to define table fields (columns). */ /* Following definitions are used to define table fields (columns). */
/***********************************************************************/ /***********************************************************************/
@@ -617,9 +574,6 @@ DllExport void PlgDBfree(MBLOCK&);
DllExport void *PlgDBSubAlloc(PGLOBAL g, void *memp, size_t size); DllExport void *PlgDBSubAlloc(PGLOBAL g, void *memp, size_t size);
DllExport void *PlgDBalloc(PGLOBAL, void *, MBLOCK&); DllExport void *PlgDBalloc(PGLOBAL, void *, MBLOCK&);
DllExport void *PlgDBrealloc(PGLOBAL, void *, MBLOCK&, size_t); DllExport void *PlgDBrealloc(PGLOBAL, void *, MBLOCK&, size_t);
//lExport PSZ GetIniString(PGLOBAL, void *, LPCSTR, LPCSTR, LPCSTR, LPCSTR);
//lExport int GetIniSize(char *, char *, char *, char *);
//lExport bool WritePrivateProfileInt(LPCSTR, LPCSTR, int, LPCSTR);
DllExport void NewPointer(PTABS, void *, void *); DllExport void NewPointer(PTABS, void *, void *);
DllExport char *GetIni(int n= 0); DllExport char *GetIni(int n= 0);
DllExport void SetTrc(void); DllExport void SetTrc(void);

View File

@@ -374,18 +374,7 @@ PDBUSER PlgMakeUser(PGLOBAL g)
} // endif dbuserp } // endif dbuserp
memset(dbuserp, 0, sizeof(DBUSERBLK)); memset(dbuserp, 0, sizeof(DBUSERBLK));
//dbuserp->Act2 = g->Activityp;
//#if defined(UNIX)
// dbuserp->LineLen = 160;
//#else
// dbuserp->LineLen = 78;
//#endif
//dbuserp->Maxres = MAXRES;
//dbuserp->Maxlin = MAXLIN;
#if defined(BLK_INDX)
dbuserp->Maxbmp = MAXBMP; dbuserp->Maxbmp = MAXBMP;
#endif // BLK_INDX
//dbuserp->AlgChoice = AMOD_AUTO;
dbuserp->UseTemp = TMP_AUTO; dbuserp->UseTemp = TMP_AUTO;
dbuserp->Check = CHK_ALL; dbuserp->Check = CHK_ALL;
strcpy(dbuserp->Server, "CONNECT"); strcpy(dbuserp->Server, "CONNECT");

View File

@@ -2,11 +2,11 @@
/* */ /* */
/* PROGRAM NAME: PLUGUTIL */ /* PROGRAM NAME: PLUGUTIL */
/* ------------- */ /* ------------- */
/* Version 2.7 */ /* Version 2.8 */
/* */ /* */
/* COPYRIGHT: */ /* COPYRIGHT: */
/* ---------- */ /* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 1993-2012 */ /* (C) Copyright to the author Olivier BERTRAND 1993-2014 */
/* */ /* */
/* WHAT THIS PROGRAM DOES: */ /* WHAT THIS PROGRAM DOES: */
/* ----------------------- */ /* ----------------------- */
@@ -153,9 +153,7 @@ PGLOBAL PlugInit(LPCSTR Language, uint worksize)
g->Trace = 0; g->Trace = 0;
g->Createas = 0; g->Createas = 0;
g->Alchecked = 0; g->Alchecked = 0;
#if defined(MRRBKA_SUPPORT)
g->Mrr = 0; g->Mrr = 0;
#endif // MRRBKA_SUPPORT
g->Activityp = g->ActivityStart = NULL; g->Activityp = g->ActivityStart = NULL;
g->Xchk = NULL; g->Xchk = NULL;
strcpy(g->Message, ""); strcpy(g->Message, "");

View File

@@ -3,31 +3,6 @@
#include "checklvl.h" #include "checklvl.h"
/***********************************************************************/
/* Struct of variables used by the SQL pre-parsers. */
/***********************************************************************/
typedef struct _prepar {
struct _prepar *Next;
char *Debinp; // Start of input buffer
char *Endinp; // End of input buffer
char *Pluginp; // Points on current parsing position
char *Plugbuf; // Start of output buffer
char *Plugptr; // Current output position
char *Debchar; // Next/current start of command
char *Debselp; // Beginning of selection
char *Debline; // Start of current line
char *Plugpar[32]; // Parameters
int Numparms; // Number of defined parameters
int Nprms; // Number of ODBC parameters
int Lines; // Line number
int Chars; // Index of selection start in line
int Endchars; // Index of selection end in line
int Frinp, Frbuf; // 0: no, 1: free, 2: delete Debinp/Plugbuf
int Outsize; // Size of output buffer
FILE *Argfile; // File containing arguments
int Addargs; // 1 if arguments are added to the list
} PREPAR, *PPREP;
/***********************************************************************/ /***********************************************************************/
/* Struct of variables used by the date format pre-parser. */ /* Struct of variables used by the date format pre-parser. */
/***********************************************************************/ /***********************************************************************/
@@ -49,8 +24,6 @@ typedef struct _datpar {
extern "C" { extern "C" {
#endif #endif
int sqlflex(PPREP pp);
int sqpflex(PPREP pp);
int fmdflex(PDTP pp); int fmdflex(PDTP pp);
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -1,11 +1,11 @@
/************* RelDef CPP Program Source Code File (.CPP) **************/ /************* RelDef CPP Program Source Code File (.CPP) **************/
/* PROGRAM NAME: REFDEF */ /* PROGRAM NAME: REFDEF */
/* ------------- */ /* ------------- */
/* Version 1.3 */ /* Version 1.4 */
/* */ /* */
/* COPYRIGHT: */ /* COPYRIGHT: */
/* ---------- */ /* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2004-2012 */ /* (C) Copyright to the author Olivier BERTRAND 2004-2014 */
/* */ /* */
/* WHAT THIS PROGRAM DOES: */ /* WHAT THIS PROGRAM DOES: */
/* ----------------------- */ /* ----------------------- */
@@ -286,14 +286,8 @@ PTDB OEMDEF::GetTable(PGLOBAL g, MODE mode)
#if defined(ZIP_SUPPORT) #if defined(ZIP_SUPPORT)
if (cmpr == 1) if (cmpr == 1)
txfp = new(g) ZIPFAM(defp); txfp = new(g) ZIPFAM(defp);
else { else
#if defined(BLK_INDX)
txfp = new(g) ZLBFAM(defp); txfp = new(g) ZLBFAM(defp);
#else // !BLK_INDX
strcpy(g->Message, "Compress 2 not supported yet");
#endif // !BLK_INDX
return NULL;
} // endelse
#else // !ZIP_SUPPORT #else // !ZIP_SUPPORT
strcpy(g->Message, "Compress not supported"); strcpy(g->Message, "Compress not supported");
return NULL; return NULL;
@@ -375,7 +369,6 @@ COLCRT::COLCRT(void)
/***********************************************************************/ /***********************************************************************/
COLDEF::COLDEF(void) : COLCRT() COLDEF::COLDEF(void) : COLCRT()
{ {
#if defined(BLK_INDX)
To_Min = NULL; To_Min = NULL;
To_Max = NULL; To_Max = NULL;
To_Pos = NULL; To_Pos = NULL;
@@ -384,7 +377,6 @@ COLDEF::COLDEF(void) : COLCRT()
To_Dval = NULL; To_Dval = NULL;
Ndv = 0; Ndv = 0;
Nbm = 0; Nbm = 0;
#endif // BLK_INDX
Buf_Type = TYPE_ERROR; Buf_Type = TYPE_ERROR;
Clen = 0; Clen = 0;
Poff = 0; Poff = 0;

View File

@@ -1,7 +1,7 @@
/*************** RelDef H Declares Source Code File (.H) ***************/ /*************** RelDef H Declares Source Code File (.H) ***************/
/* Name: RELDEF.H Version 1.3 */ /* Name: RELDEF.H Version 1.4 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 2004-2012 */ /* (C) Copyright to the author Olivier BERTRAND 2004-2014 */
/* */ /* */
/* This file contains the DEF classes definitions. */ /* This file contains the DEF classes definitions. */
/***********************************************************************/ /***********************************************************************/
@@ -38,7 +38,6 @@ class DllExport RELDEF : public BLOCK { // Relation definition block
void SetCat(PCATLG cat) { Cat=cat; } void SetCat(PCATLG cat) { Cat=cat; }
// Methods // Methods
//virtual bool DeleteTableFile(PGLOBAL g) {return true;}
virtual bool Indexable(void) {return false;} virtual bool Indexable(void) {return false;}
virtual bool Define(PGLOBAL g, PCATLG cat, LPCSTR name, LPCSTR am) = 0; virtual bool Define(PGLOBAL g, PCATLG cat, LPCSTR name, LPCSTR am) = 0;
virtual PTDB GetTable(PGLOBAL g, MODE mode) = 0; virtual PTDB GetTable(PGLOBAL g, MODE mode) = 0;
@@ -116,7 +115,6 @@ class DllExport OEMDEF : public TABDEF { /* OEM table */
virtual AMT GetDefType(void) {return TYPE_AM_OEM;} virtual AMT GetDefType(void) {return TYPE_AM_OEM;}
// Methods // Methods
//virtual bool DeleteTableFile(PGLOBAL g);
virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
virtual PTDB GetTable(PGLOBAL g, MODE mode); virtual PTDB GetTable(PGLOBAL g, MODE mode);
@@ -190,7 +188,6 @@ class DllExport COLDEF : public COLCRT { /* Column description block
int GetClen(void) {return Clen;} int GetClen(void) {return Clen;}
int GetType(void) {return Buf_Type;} int GetType(void) {return Buf_Type;}
int GetPoff(void) {return Poff;} int GetPoff(void) {return Poff;}
#if defined(BLK_INDX)
void *GetMin(void) {return To_Min;} void *GetMin(void) {return To_Min;}
void SetMin(void *minp) {To_Min = minp;} void SetMin(void *minp) {To_Min = minp;}
void *GetMax(void) {return To_Max;} void *GetMax(void) {return To_Max;}
@@ -205,12 +202,10 @@ class DllExport COLDEF : public COLCRT { /* Column description block
void SetNdv(int ndv) {Ndv = ndv;} void SetNdv(int ndv) {Ndv = ndv;}
int GetNbm(void) {return Nbm;} int GetNbm(void) {return Nbm;}
void SetNbm(int nbm) {Nbm = nbm;} void SetNbm(int nbm) {Nbm = nbm;}
#endif // BLK_INDX
int Define(PGLOBAL g, void *memp, PCOLINFO cfp, int poff); int Define(PGLOBAL g, void *memp, PCOLINFO cfp, int poff);
void Define(PGLOBAL g, PCOL colp); void Define(PGLOBAL g, PCOL colp);
protected: protected:
#if defined(BLK_INDX)
void *To_Min; /* Point to array of block min values */ void *To_Min; /* Point to array of block min values */
void *To_Max; /* Point to array of block max values */ void *To_Max; /* Point to array of block max values */
int *To_Pos; /* Point to array of block positions */ int *To_Pos; /* Point to array of block positions */
@@ -219,7 +214,6 @@ class DllExport COLDEF : public COLCRT { /* Column description block
void *To_Dval; /* To array of column distinct values */ void *To_Dval; /* To array of column distinct values */
int Ndv; /* Number of distinct values */ int Ndv; /* Number of distinct values */
int Nbm; /* Number of ULONG in bitmap (XDB2) */ int Nbm; /* Number of ULONG in bitmap (XDB2) */
#endif // BLK_INDX
int Buf_Type; /* Internal data type */ int Buf_Type; /* Internal data type */
int Clen; /* Internal data size in chars (bytes) */ int Clen; /* Internal data size in chars (bytes) */
int Poff; /* Calculated offset for Packed tables */ int Poff; /* Calculated offset for Packed tables */

View File

@@ -85,8 +85,6 @@ class DllExport COLUMN: public XOBJECT { // Column Name/Qualifier block.
virtual bool Compare(PXOB) {assert(false); return false;} virtual bool Compare(PXOB) {assert(false); return false;}
virtual bool SetFormat(PGLOBAL, FORMAT&); virtual bool SetFormat(PGLOBAL, FORMAT&);
virtual bool Eval(PGLOBAL) {assert(false); return true;} 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;}
private: private:
// Members // Members

View File

@@ -57,12 +57,8 @@
#include "tabdos.h" #include "tabdos.h"
#include "tabfix.h" #include "tabfix.h"
#include "tabmul.h" #include "tabmul.h"
#if defined(BLK_INDX)
#include "array.h" #include "array.h"
#include "blkfil.h" #include "blkfil.h"
//nclude "token.h"
//#include "scalfnc.h"
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* DB static variables. */ /* DB static variables. */
@@ -70,7 +66,6 @@
int num_read, num_there, num_eq[2]; // Statistics int num_read, num_there, num_eq[2]; // Statistics
extern "C" int trace; extern "C" int trace;
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Size of optimize file header. */ /* Size of optimize file header. */
/***********************************************************************/ /***********************************************************************/
@@ -82,7 +77,6 @@ extern "C" int trace;
/***********************************************************************/ /***********************************************************************/
PVBLK AllocValBlock(PGLOBAL, void *, int, int, int len = 0, int prec = 0, PVBLK AllocValBlock(PGLOBAL, void *, int, int, int len = 0, int prec = 0,
bool check = TRUE, bool blank = FALSE, bool un = FALSE); bool check = TRUE, bool blank = FALSE, bool un = FALSE);
#endif // BLK_INDX
/* --------------------------- Class DOSDEF -------------------------- */ /* --------------------------- Class DOSDEF -------------------------- */
@@ -101,11 +95,9 @@ DOSDEF::DOSDEF(void)
Huge = false; Huge = false;
Accept = false; Accept = false;
Eof = false; Eof = false;
#if defined(BLK_INDX)
To_Pos = NULL; To_Pos = NULL;
Optimized = 0; Optimized = 0;
AllocBlks = 0; AllocBlks = 0;
#endif // BLK_INDX
Compressed = 0; Compressed = 0;
Lrecl = 0; Lrecl = 0;
AvgLen = 0; AvgLen = 0;
@@ -115,7 +107,6 @@ DOSDEF::DOSDEF(void)
Maxerr = 0; Maxerr = 0;
ReadMode = 0; ReadMode = 0;
Ending = 0; Ending = 0;
//Mtime = 0;
} // end of DOSDEF constructor } // end of DOSDEF constructor
/***********************************************************************/ /***********************************************************************/
@@ -161,97 +152,6 @@ bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
return (Cat->GetIndexInfo(g, this) /*&& !Cat->GetCatFnc()*/); return (Cat->GetIndexInfo(g, this) /*&& !Cat->GetCatFnc()*/);
} // end of DefineAM } // end of DefineAM
#if 0
#if defined(BLK_INDX)
/***********************************************************************/
/* DeleteTableFile: Delete DOS/UNIX table files using platform API. */
/* If the table file is protected (declared as read/only) we still */
/* erase the the eventual optimize and index files but return TRUE. */
/***********************************************************************/
bool DOSDEF::DeleteTableFile(PGLOBAL g)
{
char filename[_MAX_PATH];
bool rc, irc, orc = FALSE;
PIXDEF pxd;
PCOLDEF cdp = NULL;
/*********************************************************************/
/* Check for potential optimization. These tests are done */
/* because Optimized is set to 1 only after the first use of an */
/* optimized table and can be 0 if it has not been used yet. */
/*********************************************************************/
if (!Optimized)
for (cdp = To_Cols; cdp; cdp = cdp->GetNext())
if (cdp->GetOpt())
break;
if (IsOptimized() || cdp || (Recfm == RECFM_VAR && Elemt > 1 && Block))
if (!GetOptFileName(g, filename))
#if defined(WIN32)
orc = !DeleteFile(filename);
#else // UNIX
orc = remove(filename);
#endif // WIN32
// Now delete the table file itself if not protected
if (!IsReadOnly()) {
rc = Erase(filename);
} else
rc = true;
// Delete eventual index file(s)
if ((pxd = To_Indx)) {
To_Indx = NULL; // So file can be erase
irc = DeleteIndexFile(g, pxd);
} else
irc = false;
return rc || orc || irc; // Return TRUE if error
} // end of DeleteTableFile
#else // !BLK_INDX
/***********************************************************************/
/* DeleteTableFile: Delete DOS/UNIX table files using platform API. */
/* If the table file is protected (declared as read/only) we still */
/* erase the the eventual optimize and index files but return true. */
/***********************************************************************/
bool DOSDEF::DeleteTableFile(PGLOBAL g)
{
char filename[_MAX_PATH];
bool rc = false;
// Now delete the table file itself if not protected
if (!IsReadOnly()) {
rc = Erase(filename);
} else
rc =true;
return rc; // Return true if error
} // end of DeleteTableFile
#endif // !BLK_INDX
/***********************************************************************/
/* Erase: This was made a separate routine because a strange thing */
/* happened when DeleteTablefile was defined for the VCTDEF class: */
/* when called from Catalog, the DOSDEF routine was still called even */
/* when the class was VCTDEF. It also minimizes the specific code. */
/***********************************************************************/
bool DOSDEF::Erase(char *filename)
{
bool rc;
PlugSetPath(filename, Fn, GetPath());
#if defined(WIN32)
rc = !DeleteFile(filename);
#else // UNIX
rc = remove(filename);
#endif // UNIX
return rc; // Return true if error
} // end of Erase
#endif // 0
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Get the full path/name of the optization file. */ /* Get the full path/name of the optization file. */
/***********************************************************************/ /***********************************************************************/
@@ -308,7 +208,6 @@ void DOSDEF::RemoveOptValues(PGLOBAL g)
Optimized = 0; Optimized = 0;
} // end of RemoveOptValues } // end of RemoveOptValues
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* DeleteIndexFile: Delete DOS/UNIX index file(s) using platform API. */ /* DeleteIndexFile: Delete DOS/UNIX index file(s) using platform API. */
@@ -446,14 +345,9 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode)
#if defined(ZIP_SUPPORT) #if defined(ZIP_SUPPORT)
if (Compressed == 1) if (Compressed == 1)
txfp = new(g) ZIPFAM(this); txfp = new(g) ZIPFAM(this);
else { else
#if defined(BLK_INDX)
txfp = new(g) ZLBFAM(this); txfp = new(g) ZLBFAM(this);
#else // !BLK_INDX
strcpy(g->Message, "Compress 2 not supported yet");
return NULL;
#endif // !BLK_INDX
} // endelse
#else // !ZIP_SUPPORT #else // !ZIP_SUPPORT
sprintf(g->Message, MSG(NO_FEAT_SUPPORT), "ZIP"); sprintf(g->Message, MSG(NO_FEAT_SUPPORT), "ZIP");
return NULL; return NULL;
@@ -470,7 +364,6 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode)
if (Multiple) if (Multiple)
tdbp = new(g) TDBMUL(tdbp); tdbp = new(g) TDBMUL(tdbp);
#if defined(BLK_INDX)
else else
/*******************************************************************/ /*******************************************************************/
/* For block tables, get eventually saved optimization values. */ /* For block tables, get eventually saved optimization values. */
@@ -501,7 +394,6 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode)
} // endif Optimized } // endif Optimized
} // endif Recfm } // endif Recfm
#endif // BLK_INDX
return tdbp; return tdbp;
} // end of GetTable } // end of GetTable
@@ -522,13 +414,11 @@ TDBDOS::TDBDOS(PDOSDEF tdp, PTXF txfp) : TDBASE(tdp)
Ftype = tdp->Recfm; Ftype = tdp->Recfm;
To_Line = NULL; To_Line = NULL;
Cardinal = -1; Cardinal = -1;
#if defined(BLK_INDX)
//To_BlkIdx = NULL; //To_BlkIdx = NULL;
To_BlkFil = NULL; To_BlkFil = NULL;
SavFil = NULL; SavFil = NULL;
//Xeval = 0; //Xeval = 0;
Beval = 0; Beval = 0;
#endif // BLK_INDX
} // end of TDBDOS standard constructor } // end of TDBDOS standard constructor
TDBDOS::TDBDOS(PGLOBAL g, PTDBDOS tdbp) : TDBASE(tdbp) TDBDOS::TDBDOS(PGLOBAL g, PTDBDOS tdbp) : TDBASE(tdbp)
@@ -539,13 +429,11 @@ TDBDOS::TDBDOS(PGLOBAL g, PTDBDOS tdbp) : TDBASE(tdbp)
Ftype = tdbp->Ftype; Ftype = tdbp->Ftype;
To_Line = tdbp->To_Line; To_Line = tdbp->To_Line;
Cardinal = tdbp->Cardinal; Cardinal = tdbp->Cardinal;
#if defined(BLK_INDX)
//To_BlkIdx = tdbp->To_BlkIdx; //To_BlkIdx = tdbp->To_BlkIdx;
To_BlkFil = tdbp->To_BlkFil; To_BlkFil = tdbp->To_BlkFil;
SavFil = tdbp->SavFil; SavFil = tdbp->SavFil;
//Xeval = tdbp->Xeval; //Xeval = tdbp->Xeval;
Beval = tdbp->Beval; Beval = tdbp->Beval;
#endif // BLK_INDX
} // end of TDBDOS copy constructor } // end of TDBDOS copy constructor
// Method // Method
@@ -595,7 +483,6 @@ int TDBDOS::ResetTableOpt(PGLOBAL g, bool dop, bool dox)
MaxSize = -1; // Size must be recalculated MaxSize = -1; // Size must be recalculated
Cardinal = -1; // as well as Cardinality Cardinal = -1; // as well as Cardinality
#if defined(BLK_INDX)
PTXF xp = Txfp; PTXF xp = Txfp;
To_Filter = NULL; // Disable filtering To_Filter = NULL; // Disable filtering
@@ -628,7 +515,6 @@ int TDBDOS::ResetTableOpt(PGLOBAL g, bool dop, bool dox)
Mode = MODE_ANY; // Just to be clean Mode = MODE_ANY; // Just to be clean
rc = MakeBlockValues(g); // Redo optimization rc = MakeBlockValues(g); // Redo optimization
} // endif dop } // endif dop
#endif // BLK_INDX
if (dox && (rc == RC_OK || rc == RC_INFO)) { if (dox && (rc == RC_OK || rc == RC_INFO)) {
// Remake eventual indexes // Remake eventual indexes
@@ -649,15 +535,12 @@ int TDBDOS::ResetTableOpt(PGLOBAL g, bool dop, bool dox)
// ... or we should remake them. // ... or we should remake them.
rc = MakeIndex(g, NULL, false); rc = MakeIndex(g, NULL, false);
#if defined(BLK_INDX)
rc = (rc == RC_INFO) ? prc : rc; rc = (rc == RC_INFO) ? prc : rc;
#endif // BLK_INDX
} // endif dox } // endif dox
return rc; return rc;
} // end of ResetTableOpt } // end of ResetTableOpt
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Calculate the block sizes so block I/O can be used and also the */ /* Calculate the block sizes so block I/O can be used and also the */
/* Min/Max values for clustered/sorted table columns. */ /* Min/Max values for clustered/sorted table columns. */
@@ -1661,7 +1544,6 @@ int TDBDOS::TestBlock(PGLOBAL g)
return rc; return rc;
} // end of TestBlock } // end of TestBlock
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* Check whether we have to create/update permanent indexes. */ /* Check whether we have to create/update permanent indexes. */
@@ -1959,9 +1841,7 @@ bool TDBDOS::OpenDB(PGLOBAL g)
/*****************************************************************/ /*****************************************************************/
To_Kindex->Reset(); To_Kindex->Reset();
#if defined(BLK_INDX)
ResetBlockFilter(g); ResetBlockFilter(g);
#endif // BLK_INDX
return false; return false;
} // endif use } // endif use
@@ -1997,12 +1877,10 @@ bool TDBDOS::OpenDB(PGLOBAL g)
Use = USE_OPEN; // Do it now in case we are recursively called Use = USE_OPEN; // Do it now in case we are recursively called
#if defined(BLK_INDX)
/*********************************************************************/ /*********************************************************************/
/* Allocate the block filter tree if evaluation is possible. */ /* Allocate the block filter tree if evaluation is possible. */
/*********************************************************************/ /*********************************************************************/
To_BlkFil = InitBlockFilter(g, To_Filter); To_BlkFil = InitBlockFilter(g, To_Filter);
#endif // BLK_INDX
/*********************************************************************/ /*********************************************************************/
/* Allocate the line buffer plus a null character. */ /* Allocate the line buffer plus a null character. */
@@ -2161,8 +2039,6 @@ DOSCOL::DOSCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am)
Deplac = cdp->GetOffset(); Deplac = cdp->GetOffset();
Long = cdp->GetLong(); Long = cdp->GetLong();
To_Val = NULL; To_Val = NULL;
#if defined(BLK_INDX)
Clustered = 0; Clustered = 0;
Sorted = 0; Sorted = 0;
Ndv = 0; // Currently used only for XDB2 Ndv = 0; // Currently used only for XDB2
@@ -2196,7 +2072,6 @@ DOSCOL::DOSCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am)
} // endif Clustered } // endif Clustered
} // endif Opt } // endif Opt
#endif // BLK_INDX
OldVal = NULL; // Currently used only in MinMax OldVal = NULL; // Currently used only in MinMax
Ldz = false; Ldz = false;
@@ -2239,7 +2114,6 @@ DOSCOL::DOSCOL(DOSCOL *col1, PTDB tdbp) : COLBLK(col1, tdbp)
Dcm = col1->Dcm; Dcm = col1->Dcm;
OldVal = col1->OldVal; OldVal = col1->OldVal;
Buf = col1->Buf; Buf = col1->Buf;
#if defined(BLK_INDX)
Clustered = col1->Clustered; Clustered = col1->Clustered;
Sorted = col1->Sorted; Sorted = col1->Sorted;
Min = col1->Min; Min = col1->Min;
@@ -2248,10 +2122,8 @@ DOSCOL::DOSCOL(DOSCOL *col1, PTDB tdbp) : COLBLK(col1, tdbp)
Dval = col1->Dval; Dval = col1->Dval;
Ndv = col1->Ndv; Ndv = col1->Ndv;
Nbm = col1->Nbm; Nbm = col1->Nbm;
#endif // BLK_INDX
} // end of DOSCOL copy constructor } // end of DOSCOL copy constructor
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* VarSize: This function tells UpdateDB whether or not the block */ /* VarSize: This function tells UpdateDB whether or not the block */
/* optimization file must be redone if this column is updated, even */ /* optimization file must be redone if this column is updated, even */
@@ -2273,7 +2145,6 @@ bool DOSCOL::VarSize(void)
return false; return false;
} // end VarSize } // end VarSize
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* SetBuffer: prepare a column block for write operation. */ /* SetBuffer: prepare a column block for write operation. */
@@ -2558,7 +2429,6 @@ void DOSCOL::WriteColumn(PGLOBAL g)
} // end of WriteColumn } // end of WriteColumn
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* SetMinMax: Calculate minimum and maximum values for one block. */ /* SetMinMax: Calculate minimum and maximum values for one block. */
/* Note: TYPE_STRING is stored and processed with zero ended strings */ /* Note: TYPE_STRING is stored and processed with zero ended strings */
@@ -2696,7 +2566,6 @@ bool DOSCOL::AddDistinctValue(PGLOBAL g)
return FALSE; return FALSE;
} // end of AddDistinctValue } // end of AddDistinctValue
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* Make file output of a Dos column descriptor block. */ /* Make file output of a Dos column descriptor block. */

View File

@@ -12,16 +12,12 @@
#include "xtable.h" // Table base class declares #include "xtable.h" // Table base class declares
#include "colblk.h" // Column base class declares #include "colblk.h" // Column base class declares
#include "xindex.h" #include "xindex.h"
#if defined(BLK_INDX)
#include "filter.h" #include "filter.h"
#endif // BLK_INDX
//pedef struct _tabdesc *PTABD; // For friend setting //pedef struct _tabdesc *PTABD; // For friend setting
typedef class TXTFAM *PTXF; typedef class TXTFAM *PTXF;
#if defined(BLK_INDX)
typedef class BLOCKFILTER *PBF; typedef class BLOCKFILTER *PBF;
typedef class BLOCKINDEX *PBX; typedef class BLOCKINDEX *PBX;
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* DOS table. */ /* DOS table. */
@@ -54,25 +50,20 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */
bool GetEof(void) {return Eof;} bool GetEof(void) {return Eof;}
int GetBlksize(void) {return Blksize;} int GetBlksize(void) {return Blksize;}
int GetEnding(void) {return Ending;} int GetEnding(void) {return Ending;}
#if defined(BLK_INDX)
bool IsOptimized(void) {return (Optimized == 1);} bool IsOptimized(void) {return (Optimized == 1);}
void SetOptimized(int opt) {Optimized = opt;} void SetOptimized(int opt) {Optimized = opt;}
void SetAllocBlks(int blks) {AllocBlks = blks;} void SetAllocBlks(int blks) {AllocBlks = blks;}
int GetAllocBlks(void) {return AllocBlks;} int GetAllocBlks(void) {return AllocBlks;}
int *GetTo_Pos(void) {return To_Pos;} int *GetTo_Pos(void) {return To_Pos;}
#endif // BLK_INDX
// Methods // Methods
//virtual bool DeleteTableFile(PGLOBAL g);
virtual bool Indexable(void) {return Compressed != 1;} virtual bool Indexable(void) {return Compressed != 1;}
virtual bool DeleteIndexFile(PGLOBAL g, PIXDEF pxdf); virtual bool DeleteIndexFile(PGLOBAL g, PIXDEF pxdf);
virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
virtual PTDB GetTable(PGLOBAL g, MODE mode); virtual PTDB GetTable(PGLOBAL g, MODE mode);
bool InvalidateIndex(PGLOBAL g); bool InvalidateIndex(PGLOBAL g);
#if defined(BLK_INDX)
bool GetOptFileName(PGLOBAL g, char *filename); bool GetOptFileName(PGLOBAL g, char *filename);
void RemoveOptValues(PGLOBAL g); void RemoveOptValues(PGLOBAL g);
#endif // BLK_INDX
protected: protected:
//virtual bool Erase(char *filename); //virtual bool Erase(char *filename);
@@ -87,11 +78,9 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */
bool Huge; /* true for files larger than 2GB */ bool Huge; /* true for files larger than 2GB */
bool Accept; /* true if wrong lines are accepted (DBF)*/ bool Accept; /* true if wrong lines are accepted (DBF)*/
bool Eof; /* true if an EOF (0xA) character exists */ bool Eof; /* true if an EOF (0xA) character exists */
#if defined(BLK_INDX)
int *To_Pos; /* To array of block starting positions */ int *To_Pos; /* To array of block starting positions */
int Optimized; /* 0: No, 1:Yes, 2:Redo optimization */ int Optimized; /* 0: No, 1:Yes, 2:Redo optimization */
int AllocBlks; /* Number of suballocated opt blocks */ int AllocBlks; /* Number of suballocated opt blocks */
#endif // BLK_INDX
int Compressed; /* 0: No, 1: gz, 2:zlib compressed file */ int Compressed; /* 0: No, 1: gz, 2:zlib compressed file */
int Lrecl; /* Size of biggest record */ int Lrecl; /* Size of biggest record */
int AvgLen; /* Average size of records */ int AvgLen; /* Average size of records */
@@ -109,14 +98,12 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */
/* The last column (and record) is of variable length. */ /* The last column (and record) is of variable length. */
/***********************************************************************/ /***********************************************************************/
class DllExport TDBDOS : public TDBASE { class DllExport TDBDOS : public TDBASE {
//friend class KINDEX;
friend class XINDEX; friend class XINDEX;
friend class DOSCOL; friend class DOSCOL;
friend class MAPCOL; friend class MAPCOL;
friend class TXTFAM; friend class TXTFAM;
friend class DOSFAM; friend class DOSFAM;
friend class VCTCOL; friend class VCTCOL;
//friend class TDBMUL;
friend RCODE CntDeleteRow(PGLOBAL, PTDB, bool); friend RCODE CntDeleteRow(PGLOBAL, PTDB, bool);
public: public:
// Constructors // Constructors
@@ -132,7 +119,6 @@ class DllExport TDBDOS : public TDBASE {
inline void IncLine(int inc) {To_Line += inc;} inline void IncLine(int inc) {To_Line += inc;}
inline bool IsRead(void) {return Txfp->IsRead;} inline bool IsRead(void) {return Txfp->IsRead;}
inline PXOB *GetLink(void) {return To_Link;} inline PXOB *GetLink(void) {return To_Link;}
//inline PCOL *GetKeyCol(void) {return To_Key_Col;}
// Implementation // Implementation
virtual AMT GetAmType(void) {return Txfp->GetAmType();} virtual AMT GetAmType(void) {return Txfp->GetAmType();}
@@ -148,17 +134,14 @@ class DllExport TDBDOS : public TDBASE {
virtual PTDB CopyOne(PTABS t); virtual PTDB CopyOne(PTABS t);
virtual void ResetDB(void) {Txfp->Reset();} virtual void ResetDB(void) {Txfp->Reset();}
virtual bool IsUsingTemp(PGLOBAL g); virtual bool IsUsingTemp(PGLOBAL g);
//virtual bool NeedIndexing(PGLOBAL g);
virtual void ResetSize(void) {MaxSize = Cardinal = -1;} virtual void ResetSize(void) {MaxSize = Cardinal = -1;}
virtual int ResetTableOpt(PGLOBAL g, bool dop, bool dox); virtual int ResetTableOpt(PGLOBAL g, bool dop, bool dox);
#if defined(BLK_INDX)
virtual int MakeBlockValues(PGLOBAL g); virtual int MakeBlockValues(PGLOBAL g);
virtual bool SaveBlockValues(PGLOBAL g); virtual bool SaveBlockValues(PGLOBAL g);
virtual bool GetBlockValues(PGLOBAL g); virtual bool GetBlockValues(PGLOBAL g);
virtual PBF InitBlockFilter(PGLOBAL g, PFIL filp); virtual PBF InitBlockFilter(PGLOBAL g, PFIL filp);
//virtual PBX InitBlockIndex(PGLOBAL g); //virtual PBX InitBlockIndex(PGLOBAL g);
virtual int TestBlock(PGLOBAL g); virtual int TestBlock(PGLOBAL g);
#endif // BLK_INDX
virtual void PrintAM(FILE *f, char *m); virtual void PrintAM(FILE *f, char *m);
// Database routines // Database routines
@@ -186,30 +169,24 @@ class DllExport TDBDOS : public TDBASE {
// Optimization routines // Optimization routines
int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add); int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add);
#if defined(BLK_INDX)
void ResetBlockFilter(PGLOBAL g); void ResetBlockFilter(PGLOBAL g);
bool GetDistinctColumnValues(PGLOBAL g, int nrec); bool GetDistinctColumnValues(PGLOBAL g, int nrec);
protected: protected:
PBF CheckBlockFilari(PGLOBAL g, PXOB *arg, int op, bool *cnv); PBF CheckBlockFilari(PGLOBAL g, PXOB *arg, int op, bool *cnv);
#endif // BLK_INDX
// Members // Members
PTXF Txfp; // To the File access method class PTXF Txfp; // To the File access method class
#if defined(BLK_INDX)
//PBX To_BlkIdx; // To index test block //PBX To_BlkIdx; // To index test block
PBF To_BlkFil; // To evaluation block filter PBF To_BlkFil; // To evaluation block filter
PFIL SavFil; // Saved hidden filter PFIL SavFil; // Saved hidden filter
#endif // BLK_INDX
char *To_Line; // Points to current processed line char *To_Line; // Points to current processed line
int Cardinal; // Table Cardinality int Cardinal; // Table Cardinality
RECFM Ftype; // File type: 0-var 1-fixed 2-binary (VCT) RECFM Ftype; // File type: 0-var 1-fixed 2-binary (VCT)
int Lrecl; // Logical Record Length int Lrecl; // Logical Record Length
int AvgLen; // Logical Record Average Length int AvgLen; // Logical Record Average Length
#if defined(BLK_INDX)
//int Xeval; // BlockTest return value //int Xeval; // BlockTest return value
int Beval; // BlockEval return value int Beval; // BlockEval return value
#endif // BLK_INDX
}; // end of class TDBDOS }; // end of class TDBDOS
/***********************************************************************/ /***********************************************************************/
@@ -228,7 +205,6 @@ class DllExport DOSCOL : public COLBLK {
// Implementation // Implementation
virtual int GetAmType(void) {return TYPE_AM_DOS;} virtual int GetAmType(void) {return TYPE_AM_DOS;}
virtual void SetTo_Val(PVAL valp) {To_Val = valp;} virtual void SetTo_Val(PVAL valp) {To_Val = valp;}
#if defined(BLK_INDX)
virtual int GetClustered(void) {return Clustered;} virtual int GetClustered(void) {return Clustered;}
virtual int IsClustered(void) {return (Clustered && virtual int IsClustered(void) {return (Clustered &&
((PDOSDEF)(((PTDBDOS)To_Tdb)->To_Def))->IsOptimized());} ((PDOSDEF)(((PTDBDOS)To_Tdb)->To_Def))->IsOptimized());}
@@ -239,35 +215,28 @@ class DllExport DOSCOL : public COLBLK {
virtual int GetNbm(void) {return Nbm;} virtual int GetNbm(void) {return Nbm;}
virtual PVBLK GetBmap(void) {return Bmap;} virtual PVBLK GetBmap(void) {return Bmap;}
virtual PVBLK GetDval(void) {return Dval;} virtual PVBLK GetDval(void) {return Dval;}
#endif // BLK_INDX
// Methods // Methods
#if defined(BLK_INDX)
virtual bool VarSize(void); virtual bool VarSize(void);
#endif // BLK_INDX
virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check);
virtual void ReadColumn(PGLOBAL g); virtual void ReadColumn(PGLOBAL g);
virtual void WriteColumn(PGLOBAL g); virtual void WriteColumn(PGLOBAL g);
virtual void Print(PGLOBAL g, FILE *, uint); virtual void Print(PGLOBAL g, FILE *, uint);
protected: protected:
#if defined(BLK_INDX)
virtual bool SetMinMax(PGLOBAL g); virtual bool SetMinMax(PGLOBAL g);
virtual bool SetBitMap(PGLOBAL g); virtual bool SetBitMap(PGLOBAL g);
bool CheckSorted(PGLOBAL g); bool CheckSorted(PGLOBAL g);
bool AddDistinctValue(PGLOBAL g); bool AddDistinctValue(PGLOBAL g);
#endif // BLK_INDX
// Default constructor not to be used // Default constructor not to be used
DOSCOL(void) {} DOSCOL(void) {}
// Members // Members
#if defined(BLK_INDX)
PVBLK Min; // Array of block min values PVBLK Min; // Array of block min values
PVBLK Max; // Array of block max values PVBLK Max; // Array of block max values
PVBLK Bmap; // Array of block bitmap values PVBLK Bmap; // Array of block bitmap values
PVBLK Dval; // Array of column distinct values PVBLK Dval; // Array of column distinct values
#endif // BLK_INDX
PVAL To_Val; // To value used for Update/Insert PVAL To_Val; // To value used for Update/Insert
PVAL OldVal; // The previous value of the object. PVAL OldVal; // The previous value of the object.
char *Buf; // Buffer used in write operations char *Buf; // Buffer used in write operations
@@ -275,12 +244,10 @@ class DllExport DOSCOL : public COLBLK {
bool Nod; // True if no decimal point bool Nod; // True if no decimal point
int Dcm; // Last Dcm digits are decimals int Dcm; // Last Dcm digits are decimals
int Deplac; // Offset in dos_buf int Deplac; // Offset in dos_buf
#if defined(BLK_INDX)
int Clustered; // 0:No 1:Yes int Clustered; // 0:No 1:Yes
int Sorted; // 0:No 1:Asc (2:Desc - NIY) int Sorted; // 0:No 1:Asc (2:Desc - NIY)
int Ndv; // Number of distinct values int Ndv; // Number of distinct values
int Nbm; // Number of uint in bitmap int Nbm; // Number of uint in bitmap
#endif // BLK_INDX
}; // end of class DOSCOL }; // end of class DOSCOL
#endif // __TABDOS_H #endif // __TABDOS_H

View File

@@ -45,10 +45,8 @@
#include "filamfix.h" #include "filamfix.h"
#include "filamdbf.h" #include "filamdbf.h"
#include "tabfix.h" // TDBFIX, FIXCOL classes declares #include "tabfix.h" // TDBFIX, FIXCOL classes declares
#if defined(BLK_INDX)
#include "array.h" #include "array.h"
#include "blkfil.h" #include "blkfil.h"
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* DB static variables. */ /* DB static variables. */
@@ -129,7 +127,6 @@ PCOL TDBFIX::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
/***********************************************************************/ /***********************************************************************/
int TDBFIX::ResetTableOpt(PGLOBAL g, bool dop, bool dox) int TDBFIX::ResetTableOpt(PGLOBAL g, bool dop, bool dox)
{ {
#if defined(BLK_INDX)
int prc, rc = RC_OK; int prc, rc = RC_OK;
To_Filter = NULL; // Disable filtering To_Filter = NULL; // Disable filtering
@@ -169,10 +166,6 @@ int TDBFIX::ResetTableOpt(PGLOBAL g, bool dop, bool dox)
} // endif dox } // endif dox
return rc; return rc;
#else // !BLK_INDX
RestoreNrec(); // May have been modified
return TDBDOS::ResetTableOpt(g, dop, dox);
#endif // !BLK_INDX
} // end of ResetTableOpt } // end of ResetTableOpt
/***********************************************************************/ /***********************************************************************/
@@ -211,14 +204,14 @@ int TDBFIX::GetMaxSize(PGLOBAL g)
{ {
if (MaxSize < 0) { if (MaxSize < 0) {
MaxSize = Cardinality(g); MaxSize = Cardinality(g);
#if defined(BLK_INDX)
if (MaxSize > 0 && (To_BlkFil = InitBlockFilter(g, To_Filter)) if (MaxSize > 0 && (To_BlkFil = InitBlockFilter(g, To_Filter))
&& !To_BlkFil->Correlated()) { && !To_BlkFil->Correlated()) {
// Use BlockTest to reduce the estimated size // Use BlockTest to reduce the estimated size
MaxSize = Txfp->MaxBlkSize(g, MaxSize); MaxSize = Txfp->MaxBlkSize(g, MaxSize);
ResetBlockFilter(g); ResetBlockFilter(g);
} // endif To_BlkFil } // endif To_BlkFil
#endif // BLK_INDX
} // endif MaxSize } // endif MaxSize
return MaxSize; return MaxSize;
@@ -301,9 +294,7 @@ bool TDBFIX::OpenDB(PGLOBAL g)
else else
Txfp->Rewind(); // see comment in Work.log Txfp->Rewind(); // see comment in Work.log
#if defined(BLK_INDX)
ResetBlockFilter(g); ResetBlockFilter(g);
#endif // BLK_INDX
return false; return false;
} // endif use } // endif use
@@ -335,12 +326,10 @@ bool TDBFIX::OpenDB(PGLOBAL g)
/*********************************************************************/ /*********************************************************************/
To_Line = Txfp->GetBuf(); // For WriteDB To_Line = Txfp->GetBuf(); // For WriteDB
#if defined(BLK_INDX)
/*********************************************************************/ /*********************************************************************/
/* Allocate the block filter tree if evaluation is possible. */ /* Allocate the block filter tree if evaluation is possible. */
/*********************************************************************/ /*********************************************************************/
To_BlkFil = InitBlockFilter(g, To_Filter); To_BlkFil = InitBlockFilter(g, To_Filter);
#endif // BLK_INDX
if (trace) if (trace)
htrc("OpenDos: R%hd mode=%d\n", Tdb_No, Mode); htrc("OpenDos: R%hd mode=%d\n", Tdb_No, Mode);

View File

@@ -1,11 +1,11 @@
/************* TabFmt C++ Program Source Code File (.CPP) **************/ /************* TabFmt C++ Program Source Code File (.CPP) **************/
/* PROGRAM NAME: TABFMT */ /* PROGRAM NAME: TABFMT */
/* ------------- */ /* ------------- */
/* Version 3.8 */ /* Version 3.9 */
/* */ /* */
/* COPYRIGHT: */ /* COPYRIGHT: */
/* ---------- */ /* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2001 - 2013 */ /* (C) Copyright to the author Olivier BERTRAND 2001 - 2014 */
/* */ /* */
/* WHAT THIS PROGRAM DOES: */ /* WHAT THIS PROGRAM DOES: */
/* ----------------------- */ /* ----------------------- */
@@ -458,14 +458,9 @@ PTDB CSVDEF::GetTable(PGLOBAL g, MODE mode)
#if defined(ZIP_SUPPORT) #if defined(ZIP_SUPPORT)
if (Compressed == 1) if (Compressed == 1)
txfp = new(g) ZIPFAM(this); txfp = new(g) ZIPFAM(this);
else { else
#if defined(BLK_INDX)
txfp = new(g) ZLBFAM(this); txfp = new(g) ZLBFAM(this);
#else // !BLK_INDX
strcpy(g->Message, "Compress 2 not supported yet");
return NULL;
#endif // !BLK_INDX
} // endelse
#else // !ZIP_SUPPORT #else // !ZIP_SUPPORT
strcpy(g->Message, "Compress not supported"); strcpy(g->Message, "Compress not supported");
return NULL; return NULL;
@@ -1275,7 +1270,6 @@ CSVCOL::CSVCOL(CSVCOL *col1, PTDB tdbp) : DOSCOL(col1, tdbp)
Fldnum = col1->Fldnum; Fldnum = col1->Fldnum;
} // end of CSVCOL copy constructor } // end of CSVCOL copy constructor
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* VarSize: This function tells UpdateDB whether or not the block */ /* VarSize: This function tells UpdateDB whether or not the block */
/* optimization file must be redone if this column is updated, even */ /* optimization file must be redone if this column is updated, even */
@@ -1294,7 +1288,6 @@ bool CSVCOL::VarSize(void)
return false; return false;
} // end VarSize } // end VarSize
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* ReadColumn: call DOSCOL::ReadColumn after having set the offet */ /* ReadColumn: call DOSCOL::ReadColumn after having set the offet */

View File

@@ -1,14 +1,13 @@
/*************** TabFmt H Declares Source Code File (.H) ***************/ /*************** TabFmt H Declares Source Code File (.H) ***************/
/* Name: TABFMT.H Version 2.3 */ /* Name: TABFMT.H Version 2.4 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 2001-2013 */ /* (C) Copyright to the author Olivier BERTRAND 2001-2014 */
/* */ /* */
/* This file contains the CSV and FMT classes declares. */ /* This file contains the CSV and FMT classes declares. */
/***********************************************************************/ /***********************************************************************/
#include "xtable.h" // Base class declares #include "xtable.h" // Base class declares
#include "tabdos.h" #include "tabdos.h"
//pedef struct _tabdesc *PTABD; // For friend setting
typedef class TDBFMT *PTDBFMT; typedef class TDBFMT *PTDBFMT;
/***********************************************************************/ /***********************************************************************/
@@ -112,12 +111,9 @@ class CSVCOL : public DOSCOL {
virtual int GetAmType() {return TYPE_AM_CSV;} virtual int GetAmType() {return TYPE_AM_CSV;}
// Methods // Methods
#if defined(BLK_INDX)
virtual bool VarSize(void); virtual bool VarSize(void);
#endif // BLK_INDX
virtual void ReadColumn(PGLOBAL g); virtual void ReadColumn(PGLOBAL g);
virtual void WriteColumn(PGLOBAL g); virtual void WriteColumn(PGLOBAL g);
// void Print(FILE *, uint);
protected: protected:
// Default constructor not to be used // Default constructor not to be used

View File

@@ -45,9 +45,7 @@ TDB::TDB(PTABDEF tdp) : Tdb_No(++Tnum)
{ {
Use = USE_NO; Use = USE_NO;
To_Orig = NULL; To_Orig = NULL;
#if defined(BLK_INDX)
To_Filter = NULL; To_Filter = NULL;
#endif // BLK_FILTER
To_CondFil = NULL; To_CondFil = NULL;
Next = NULL; Next = NULL;
Name = (tdp) ? tdp->GetName() : NULL; Name = (tdp) ? tdp->GetName() : NULL;
@@ -61,9 +59,7 @@ TDB::TDB(PTDB tdbp) : Tdb_No(++Tnum)
{ {
Use = tdbp->Use; Use = tdbp->Use;
To_Orig = tdbp; To_Orig = tdbp;
#if defined(BLK_INDX)
To_Filter = NULL; To_Filter = NULL;
#endif // BLK_FILTER
To_CondFil = NULL; To_CondFil = NULL;
Next = NULL; Next = NULL;
Name = tdbp->Name; Name = tdbp->Name;
@@ -73,92 +69,6 @@ TDB::TDB(PTDB tdbp) : Tdb_No(++Tnum)
Mode = tdbp->Mode; Mode = tdbp->Mode;
} // end of TDB copy constructor } // end of TDB copy constructor
/***********************************************************************/
/* OpenTable: Call AM open routine. */
/***********************************************************************/
bool TDB::OpenTable(PGLOBAL g, PSQL sqlp, MODE mode)
{
if (trace)
htrc("Open Tdb_No=%d use=%d type=%d tdb.Mode=%d mode=%d\n",
Tdb_No, Use, GetAmType(), Mode, mode);
switch (Use) {
case USE_LIN:
/*****************************************************************/
/* If table is read/only, only MODE_READ is allowed. */
/*****************************************************************/
if (IsReadOnly() && mode != MODE_READ) {
strcpy(g->Message, MSG(READ_ONLY));
return true;
} // endif ReadOnly
/*****************************************************************/
/* This could be done in any order. */
/* Note: for not Read only first table in open in that mode. */
/*****************************************************************/
if (Next)
Next->OpenTable(g, sqlp, MODE_READ);
Mode = mode;
/*****************************************************************/
/* Pre-opening is done, allocate select buffers now. */
/*****************************************************************/
Use = USE_READY;
break;
case USE_READY:
/*****************************************************************/
/* This is to open files in reverse order. */
/*****************************************************************/
if (Next)
if (Next->OpenTable(g, sqlp, mode))
return true;
/*****************************************************************/
/* This was moved after filter conversion so filtering can be */
/* done when making index tables for DOS files. */
/* Also it was moved after allocating select buffers so some */
/* data can be pre-read during open to allow storage sorting. */
/*****************************************************************/
if (OpenDB(g)) // Do open the table file
return true;
Use = USE_OPEN;
break;
case USE_OPEN:
/*****************************************************************/
/* Table is already open. */
/* Call open routine that will just "rewind" the files. */
/*****************************************************************/
if (OpenDB(g)) // Rewind the table file
return true;
break;
default:
sprintf(g->Message, MSG(TDB_USE_ERROR), Use);
return true;
} // endswitch Use
return false;
} // end of OpenTable
/***********************************************************************/
/* CloseTable: Close a table of any AM type. */
/***********************************************************************/
void TDB::CloseTable(PGLOBAL g)
{
if (trace)
htrc("CloseTable: tdb_no %d use=%d amtype=%d am.Mode=%d\n",
Tdb_No, Use, GetAmType(), Mode);
CloseDB(g);
Use = USE_READY; // x'7FFD'
Mode = MODE_ANY;
} // end of CloseTable
// Methods // Methods
/***********************************************************************/ /***********************************************************************/

View File

@@ -185,14 +185,7 @@ class TDBMYEXC : public TDBMYSQL {
// Methods // Methods
virtual PTDB CopyOne(PTABS t); virtual PTDB CopyOne(PTABS t);
//virtual int GetAffectedRows(void) {return AftRows;}
//virtual int GetRecpos(void) {return N;}
//virtual int GetProgMax(PGLOBAL g);
//virtual void ResetDB(void) {N = 0;}
//virtual int RowNumber(PGLOBAL g, bool b = FALSE);
virtual bool IsView(void) {return Isview;} virtual bool IsView(void) {return Isview;}
//virtual PSZ GetServer(void) {return Server;}
// void SetDatabase(LPCSTR db) {Database = (char*)db;}
// Database routines // Database routines
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
@@ -200,20 +193,10 @@ class TDBMYEXC : public TDBMYSQL {
virtual bool OpenDB(PGLOBAL g); virtual bool OpenDB(PGLOBAL g);
virtual int ReadDB(PGLOBAL g); virtual int ReadDB(PGLOBAL g);
virtual int WriteDB(PGLOBAL g); virtual int WriteDB(PGLOBAL g);
//virtual int DeleteDB(PGLOBAL g, int irc);
//virtual void CloseDB(PGLOBAL g);
// Specific routines
// bool SetColumnRanks(PGLOBAL g);
// PCOL MakeFieldColumn(PGLOBAL g, char *name);
// PSZ FindFieldColumn(char *name);
protected: protected:
// Internal functions // Internal functions
PCMD MakeCMD(PGLOBAL g); PCMD MakeCMD(PGLOBAL g);
//bool MakeSelect(PGLOBAL g);
//bool MakeInsert(PGLOBAL g);
//int BindColumns(PGLOBAL g);
// Members // Members
PCMD Cmdlist; // The commands to execute PCMD Cmdlist; // The commands to execute
@@ -237,15 +220,9 @@ class MYXCOL : public MYSQLCOL {
MYXCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PSZ am = "MYSQL"); MYXCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PSZ am = "MYSQL");
MYXCOL(MYXCOL *colp, PTDB tdbp); // Constructor used in copy process MYXCOL(MYXCOL *colp, PTDB tdbp); // Constructor used in copy process
// Implementation
//virtual int GetAmType(void) {return TYPE_AM_MYSQL;}
// void InitBind(PGLOBAL g);
// Methods // Methods
//virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check);
virtual void ReadColumn(PGLOBAL g); virtual void ReadColumn(PGLOBAL g);
virtual void WriteColumn(PGLOBAL g); virtual void WriteColumn(PGLOBAL g);
// bool FindRank(PGLOBAL g);
protected: protected:
// Default constructor not to be used // Default constructor not to be used

View File

@@ -68,7 +68,6 @@ class TDBOCCUR : public TDBPRX {
protected: protected:
// Members // Members
//PTDBASE Tdbp; // To the source table or view
LPCSTR Tabname; // Name of source table LPCSTR Tabname; // Name of source table
char *Colist; // Source column list char *Colist; // Source column list
char *Xcolumn; // Occurence column name char *Xcolumn; // Occurence column name

View File

@@ -158,7 +158,6 @@ class ODBCCOL : public COLBLK {
// PVBLK GetBlkp(void) {return Blkp;} // PVBLK GetBlkp(void) {return Blkp;}
// Methods // Methods
//virtual bool CheckLocal(PTDB tdbp);
virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check);
virtual void ReadColumn(PGLOBAL g); virtual void ReadColumn(PGLOBAL g);
virtual void WriteColumn(PGLOBAL g); virtual void WriteColumn(PGLOBAL g);

View File

@@ -32,7 +32,6 @@ class DllExport INIDEF : public TABDEF { /* INI table description */
// Methods // Methods
virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
virtual PTDB GetTable(PGLOBAL g, MODE m); virtual PTDB GetTable(PGLOBAL g, MODE m);
//virtual bool DeleteTableFile(PGLOBAL g);
protected: protected:
// Members // Members

View File

@@ -133,26 +133,17 @@ class DllExport TDBTBM : public TDBTBL {
// Constructor // Constructor
TDBTBM(PTBLDEF tdp = NULL); TDBTBM(PTBLDEF tdp = NULL);
// Implementation
//virtual AMT GetAmType(void) {return TYPE_AM_TBL;}
// Methods // Methods
virtual void ResetDB(void); virtual void ResetDB(void);
//virtual int GetRecpos(void) {return Rows;}
//virtual int GetBadLines(void) {return (int)Nbc;}
// Database routines // Database routines
//virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
virtual int GetMaxSize(PGLOBAL g) {return 10;} // Temporary virtual int GetMaxSize(PGLOBAL g) {return 10;} // Temporary
virtual int RowNumber(PGLOBAL g, bool b = FALSE); virtual int RowNumber(PGLOBAL g, bool b = FALSE);
//virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL scp);
virtual bool OpenDB(PGLOBAL g); virtual bool OpenDB(PGLOBAL g);
virtual int ReadDB(PGLOBAL g); virtual int ReadDB(PGLOBAL g);
protected: protected:
// Internal functions // Internal functions
//bool InitTableList(PGLOBAL g);
//bool TestFil(PGLOBAL g, PCFIL filp, PTABLE tabp);
bool OpenTables(PGLOBAL g); bool OpenTables(PGLOBAL g);
int ReadNextRemote(PGLOBAL g); int ReadNextRemote(PGLOBAL g);
@@ -165,5 +156,4 @@ class DllExport TDBTBM : public TDBTBL {
int Nlc; // Number of local connections int Nlc; // Number of local connections
}; // end of class TDBTBM }; // end of class TDBTBM
pthread_handler_t ThreadOpen(void *p); pthread_handler_t ThreadOpen(void *p);

View File

@@ -54,7 +54,6 @@ class DllExport PRXDEF : public TABDEF { /* Logical table description */
/* This is the class declaration for the XCSV table. */ /* This is the class declaration for the XCSV table. */
/***********************************************************************/ /***********************************************************************/
class DllExport TDBPRX : public TDBASE { class DllExport TDBPRX : public TDBASE {
//friend class MULINDX;
friend class PRXDEF; friend class PRXDEF;
friend class PRXCOL; friend class PRXCOL;
public: public:
@@ -126,8 +125,6 @@ class TDBTBC : public TDBCAT {
public: public:
// Constructors // Constructors
TDBTBC(PPRXDEF tdp); TDBTBC(PPRXDEF tdp);
//TDBTBC(PTBLDEF tdp);
//TDBTBC(PXCLDEF tdp);
protected: protected:
// Specific routines // Specific routines

View File

@@ -301,9 +301,7 @@ bool TDBVCT::OpenDB(PGLOBAL g)
To_Kindex->Reset(); To_Kindex->Reset();
Txfp->Rewind(); Txfp->Rewind();
#if defined(BLK_INDX)
ResetBlockFilter(g); ResetBlockFilter(g);
#endif // BLK_INDX
return false; return false;
} // endif Use } // endif Use
@@ -325,12 +323,10 @@ bool TDBVCT::OpenDB(PGLOBAL g)
// This was not done in previous version // This was not done in previous version
Use = USE_OPEN; // Do it now in case we are recursively called Use = USE_OPEN; // Do it now in case we are recursively called
#if defined(BLK_INDX)
/*********************************************************************/ /*********************************************************************/
/* Allocate the block filter tree if evaluation is possible. */ /* Allocate the block filter tree if evaluation is possible. */
/*********************************************************************/ /*********************************************************************/
To_BlkFil = InitBlockFilter(g, To_Filter); To_BlkFil = InitBlockFilter(g, To_Filter);
#endif // BLK_INDX
/*********************************************************************/ /*********************************************************************/
/* Reset buffer access according to indexing and to mode. */ /* Reset buffer access according to indexing and to mode. */

View File

@@ -36,8 +36,6 @@ class DllExport VCTDEF : public DOSDEF { /* Logical table description */
virtual PTDB GetTable(PGLOBAL g, MODE mode); virtual PTDB GetTable(PGLOBAL g, MODE mode);
protected: protected:
// Specific file erase routine for vertical tables
//virtual bool Erase(char *filename);
int MakeFnPattern(char *fpat); int MakeFnPattern(char *fpat);
// Members // Members

View File

@@ -48,7 +48,6 @@ class WMIDEF : public TABDEF { /* Logical table description */
// Methods // Methods
virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
virtual PTDB GetTable(PGLOBAL g, MODE m); virtual PTDB GetTable(PGLOBAL g, MODE m);
//virtual bool DeleteTableFile(PGLOBAL g) {return true;}
protected: protected:
// Members // Members

View File

@@ -10,9 +10,6 @@ typedef class XMLDEF *PXMLDEF;
typedef class TDBXML *PTDBXML; typedef class TDBXML *PTDBXML;
typedef class XMLCOL *PXMLCOL; typedef class XMLCOL *PXMLCOL;
// These functions are exported from the Extended.dll
//PTABDEF __stdcall GetXML(PGLOBAL g, void *memp);
/* --------------------------- XML classes --------------------------- */ /* --------------------------- XML classes --------------------------- */
/***********************************************************************/ /***********************************************************************/
@@ -30,7 +27,6 @@ class DllExport XMLDEF : public TABDEF { /* Logical table description */
// Methods // Methods
virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
virtual PTDB GetTable(PGLOBAL g, MODE m); virtual PTDB GetTable(PGLOBAL g, MODE m);
//virtual bool DeleteTableFile(PGLOBAL g);
protected: protected:
// Members // Members
@@ -53,7 +49,6 @@ class DllExport XMLDEF : public TABDEF { /* Logical table description */
}; // end of XMLDEF }; // end of XMLDEF
#if defined(INCLUDE_TDBXML) #if defined(INCLUDE_TDBXML)
/***********************************************************************/ /***********************************************************************/
/* This is the class declaration for the simple XML tables. */ /* This is the class declaration for the simple XML tables. */
/***********************************************************************/ /***********************************************************************/
@@ -242,5 +237,4 @@ class XPOSCOL : public XMLCOLX {
virtual void ReadColumn(PGLOBAL g); virtual void ReadColumn(PGLOBAL g);
virtual void WriteColumn(PGLOBAL g); virtual void WriteColumn(PGLOBAL g);
}; // end of class XPOSCOL }; // end of class XPOSCOL
#endif // INCLUDE_TDBXML #endif // INCLUDE_TDBXML

View File

@@ -147,9 +147,7 @@ bool user_connect::CheckCleanup(void)
g->Xchk = NULL; g->Xchk = NULL;
g->Createas = 0; g->Createas = 0;
g->Alchecked = 0; g->Alchecked = 0;
#if defined(MRRBKA_SUPPORT)
g->Mrr = 0; g->Mrr = 0;
#endif // MRRBKA_SUPPORT
last_query_id= thdp->query_id; last_query_id= thdp->query_id;
if (xtrace) if (xtrace)

View File

@@ -63,7 +63,6 @@ public:
PCONNECT next; // Next user in chain PCONNECT next; // Next user in chain
PCONNECT previous; // Previous user in chain PCONNECT previous; // Previous user in chain
PGLOBAL g; // The common handle to CONNECT PGLOBAL g; // The common handle to CONNECT
//char dbname[32]; // The DBCONNECT database
query_id_t last_query_id; // the latest user query id query_id_t last_query_id; // the latest user query id
int count; // if used by several handlers int count; // if used by several handlers
// Statistics // Statistics

View File

@@ -448,7 +448,6 @@ template <>
uchar TYPBLK<uchar>::GetTypedValue(PVBLK blk, int n) uchar TYPBLK<uchar>::GetTypedValue(PVBLK blk, int n)
{return blk->GetUTinyValue(n);} {return blk->GetUTinyValue(n);}
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Set one value in a block if val is less than the current value. */ /* Set one value in a block if val is less than the current value. */
/***********************************************************************/ /***********************************************************************/
@@ -478,7 +477,6 @@ void TYPBLK<TYPE>::SetMax(PVAL valp, int n)
tmin = tval; tmin = tval;
} // end of SetMax } // end of SetMax
#endif // BLK_INDX
#if 0 #if 0
/***********************************************************************/ /***********************************************************************/
@@ -812,7 +810,6 @@ void CHRBLK::SetValue(PVBLK pv, int n1, int n2)
SetNull(n1, b); SetNull(n1, b);
} // end of SetValue } // end of SetValue
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Set one value in a block if val is less than the current value. */ /* Set one value in a block if val is less than the current value. */
/***********************************************************************/ /***********************************************************************/
@@ -842,7 +839,6 @@ void CHRBLK::SetMax(PVAL valp, int n)
memcpy(bp, vp, Long); memcpy(bp, vp, Long);
} // end of SetMax } // end of SetMax
#endif // BLK_INDX
#if 0 #if 0
/***********************************************************************/ /***********************************************************************/
@@ -1166,7 +1162,6 @@ void STRBLK::SetValue(char *sp, uint len, int n)
Strp[n] = p; Strp[n] = p;
} // end of SetValue } // end of SetValue
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Set one value in a block if val is less than the current value. */ /* Set one value in a block if val is less than the current value. */
/***********************************************************************/ /***********************************************************************/
@@ -1194,7 +1189,6 @@ void STRBLK::SetMax(PVAL valp, int n)
SetValue(valp, n); SetValue(valp, n);
} // end of SetMax } // end of SetMax
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* Move one value from i to j. */ /* Move one value from i to j. */
@@ -1335,7 +1329,6 @@ void DATBLK::SetValue(PSZ p, int n)
} // end of SetValue } // end of SetValue
#if defined(BLK_INDX)
/* -------------------------- Class MBVALS --------------------------- */ /* -------------------------- Class MBVALS --------------------------- */
/***********************************************************************/ /***********************************************************************/
@@ -1379,7 +1372,6 @@ void MBVALS::Free(void)
PlgDBfree(Mblk); PlgDBfree(Mblk);
Vblk = NULL; Vblk = NULL;
} // end of Free } // end of Free
#endif // BLK_INDX
/* ------------------------- End of Valblk --------------------------- */ /* ------------------------- End of Valblk --------------------------- */

View File

@@ -22,7 +22,6 @@ DllExport PVBLK AllocValBlock(PGLOBAL, void*, int, int, int, int,
bool, bool, bool); bool, bool, bool);
const char *GetFmt(int type, bool un = false); const char *GetFmt(int type, bool un = false);
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* DB static external variables. */ /* DB static external variables. */
/***********************************************************************/ /***********************************************************************/
@@ -52,13 +51,11 @@ class MBVALS : public BLOCK {
}; // end of class MBVALS }; // end of class MBVALS
typedef class MBVALS *PMBV; typedef class MBVALS *PMBV;
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* Class VALBLK represent a base class for variable blocks. */ /* Class VALBLK represent a base class for variable blocks. */
/***********************************************************************/ /***********************************************************************/
class VALBLK : public BLOCK { class VALBLK : public BLOCK {
//friend void SemColData(PGLOBAL g, PSEM semp);
public: public:
// Constructors // Constructors
VALBLK(void *mp, int type, int nval, bool un = false); VALBLK(void *mp, int type, int nval, bool un = false);
@@ -111,14 +108,8 @@ class VALBLK : public BLOCK {
virtual void SetValue(char *sp, uint len, int n) {assert(false);} virtual void SetValue(char *sp, uint len, int n) {assert(false);}
virtual void SetValue(PVAL valp, int n) = 0; virtual void SetValue(PVAL valp, int n) = 0;
virtual void SetValue(PVBLK pv, int n1, int n2) = 0; virtual void SetValue(PVBLK pv, int n1, int n2) = 0;
#if defined(BLK_INDX)
virtual void SetMin(PVAL valp, int n) = 0; virtual void SetMin(PVAL valp, int n) = 0;
virtual void SetMax(PVAL valp, int n) = 0; virtual void SetMax(PVAL valp, int n) = 0;
#endif // BLK_INDX
#if 0
virtual void SetValues(PVBLK pv, int i, int n) = 0;
virtual void AddMinus1(PVBLK pv, int n1, int n2) {assert(false);}
#endif // 0
virtual void Move(int i, int j) = 0; virtual void Move(int i, int j) = 0;
virtual int CompVal(PVAL vp, int n) = 0; virtual int CompVal(PVAL vp, int n) = 0;
virtual int CompVal(int i1, int i2) = 0; virtual int CompVal(int i1, int i2) = 0;
@@ -153,12 +144,10 @@ class TYPBLK : public VALBLK {
public: public:
// Constructors // Constructors
TYPBLK(void *mp, int size, int type, int prec = 0, bool un = false); TYPBLK(void *mp, int size, int type, int prec = 0, bool un = false);
//TYPBLK(void *mp, int size, int prec, int type);
// Implementation // Implementation
virtual void Init(PGLOBAL g, bool check); virtual void Init(PGLOBAL g, bool check);
virtual int GetVlen(void) {return sizeof(TYPE);} virtual int GetVlen(void) {return sizeof(TYPE);}
//virtual PSZ GetCharValue(int n);
virtual char GetTinyValue(int n) {return (char)Typp[n];} virtual char GetTinyValue(int n) {return (char)Typp[n];}
virtual uchar GetUTinyValue(int n) {return (uchar)Typp[n];} virtual uchar GetUTinyValue(int n) {return (uchar)Typp[n];}
virtual short GetShortValue(int n) {return (short)Typp[n];} virtual short GetShortValue(int n) {return (short)Typp[n];}
@@ -194,11 +183,8 @@ class TYPBLK : public VALBLK {
{Typp[n] = (TYPE)cval; SetNull(n, false);} {Typp[n] = (TYPE)cval; SetNull(n, false);}
virtual void SetValue(PVAL valp, int n); virtual void SetValue(PVAL valp, int n);
virtual void SetValue(PVBLK pv, int n1, int n2); virtual void SetValue(PVBLK pv, int n1, int n2);
//virtual void SetValues(PVBLK pv, int k, int n);
#if defined(BLK_INDX)
virtual void SetMin(PVAL valp, int n); virtual void SetMin(PVAL valp, int n);
virtual void SetMax(PVAL valp, int n); virtual void SetMax(PVAL valp, int n);
#endif // BLK_INDX
virtual void Move(int i, int j); virtual void Move(int i, int j);
virtual int CompVal(PVAL vp, int n); virtual int CompVal(PVAL vp, int n);
virtual int CompVal(int i1, int i2); virtual int CompVal(int i1, int i2);
@@ -249,11 +235,8 @@ class CHRBLK : public VALBLK {
virtual void SetValue(char *sp, uint len, int n); virtual void SetValue(char *sp, uint len, int n);
virtual void SetValue(PVAL valp, int n); virtual void SetValue(PVAL valp, int n);
virtual void SetValue(PVBLK pv, int n1, int n2); virtual void SetValue(PVBLK pv, int n1, int n2);
//virtual void SetValues(PVBLK pv, int k, int n);
#if defined(BLK_INDX)
virtual void SetMin(PVAL valp, int n); virtual void SetMin(PVAL valp, int n);
virtual void SetMax(PVAL valp, int n); virtual void SetMax(PVAL valp, int n);
#endif // BLK_INDX
virtual void Move(int i, int j); virtual void Move(int i, int j);
virtual int CompVal(PVAL vp, int n); virtual int CompVal(PVAL vp, int n);
virtual int CompVal(int i1, int i2); virtual int CompVal(int i1, int i2);
@@ -305,11 +288,8 @@ class STRBLK : public VALBLK {
virtual void SetValue(char *sp, uint len, int n); virtual void SetValue(char *sp, uint len, int n);
virtual void SetValue(PVAL valp, int n); virtual void SetValue(PVAL valp, int n);
virtual void SetValue(PVBLK pv, int n1, int n2); virtual void SetValue(PVBLK pv, int n1, int n2);
//virtual void SetValues(PVBLK pv, int k, int n);
#if defined(BLK_INDX)
virtual void SetMin(PVAL valp, int n); virtual void SetMin(PVAL valp, int n);
virtual void SetMax(PVAL valp, int n); virtual void SetMax(PVAL valp, int n);
#endif // BLK_INDX
virtual void Move(int i, int j); virtual void Move(int i, int j);
virtual int CompVal(PVAL vp, int n); virtual int CompVal(PVAL vp, int n);
virtual int CompVal(int i1, int i2); virtual int CompVal(int i1, int i2);

View File

@@ -91,7 +91,6 @@ PSZ strlwr(PSZ s);
} }
#endif // !WIN32 #endif // !WIN32
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Returns the bitmap representing the conditions that must not be */ /* Returns the bitmap representing the conditions that must not be */
/* met when returning from TestValue for a given operator. */ /* met when returning from TestValue for a given operator. */
@@ -117,7 +116,6 @@ BYTE OpBmp(PGLOBAL g, OPVAL opc)
return bt; return bt;
} // end of OpBmp } // end of OpBmp
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* Get a long long number from its character representation. */ /* Get a long long number from its character representation. */
@@ -306,7 +304,6 @@ const char *GetFmt(int type, bool un)
return fmt; return fmt;
} // end of GetFmt } // end of GetFmt
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* ConvertType: what this function does is to determine the type to */ /* ConvertType: what this function does is to determine the type to */
/* which should be converted a value so no precision would be lost. */ /* which should be converted a value so no precision would be lost. */
@@ -353,7 +350,6 @@ int ConvertType(int target, int type, CONV kind, bool match)
} // endswitch kind } // endswitch kind
} // end of ConvertType } // end of ConvertType
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* AllocateConstant: allocates a constant Value. */ /* AllocateConstant: allocates a constant Value. */
@@ -451,7 +447,6 @@ PVAL AllocateValue(PGLOBAL g, int type, int len, int prec,
return valp; return valp;
} // end of AllocateValue } // end of AllocateValue
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Allocate a constant Value converted to newtype. */ /* Allocate a constant Value converted to newtype. */
/* Can also be used to copy a Value eventually converted. */ /* Can also be used to copy a Value eventually converted. */
@@ -519,7 +514,6 @@ PVAL AllocateValue(PGLOBAL g, PVAL valp, int newtype, int uns)
valp->SetGlobal(g); valp->SetGlobal(g);
return valp; return valp;
} // end of AllocateValue } // end of AllocateValue
#endif // BLK_INDX
/* -------------------------- Class VALUE ---------------------------- */ /* -------------------------- Class VALUE ---------------------------- */
@@ -556,7 +550,6 @@ const char *VALUE::GetXfmt(void)
return fmt; return fmt;
} // end of GetFmt } // end of GetFmt
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Returns a BYTE indicating the comparison between two values. */ /* Returns a BYTE indicating the comparison between two values. */
/* Bit 1 indicates equality, Bit 2 less than, and Bit3 greater than. */ /* Bit 1 indicates equality, Bit 2 less than, and Bit3 greater than. */
@@ -568,7 +561,6 @@ BYTE VALUE::TestValue(PVAL vp)
return (n > 0) ? 0x04 : (n < 0) ? 0x02 : 0x01; return (n > 0) ? 0x04 : (n < 0) ? 0x02 : 0x01;
} // end of TestValue } // end of TestValue
#endif // BLK_INDX
/* -------------------------- Class TYPVAL ---------------------------- */ /* -------------------------- Class TYPVAL ---------------------------- */
@@ -940,7 +932,6 @@ bool TYPVAL<TYPE>::IsEqual(PVAL vp, bool chktype)
} // end of IsEqual } // end of IsEqual
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Compare values and returns 1, 0 or -1 according to comparison. */ /* Compare values and returns 1, 0 or -1 according to comparison. */
/* This function is used for evaluation of numeric filters. */ /* This function is used for evaluation of numeric filters. */
@@ -958,7 +949,6 @@ int TYPVAL<TYPE>::CompareValue(PVAL vp)
return (Tval > n) ? 1 : (Tval < n) ? (-1) : 0; return (Tval > n) ? 1 : (Tval < n) ? (-1) : 0;
} // end of CompareValue } // end of CompareValue
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* FormatValue: This function set vp (a STRING value) to the string */ /* FormatValue: This function set vp (a STRING value) to the string */
@@ -1410,7 +1400,6 @@ bool TYPVAL<PSZ>::IsEqual(PVAL vp, bool chktype)
} // end of IsEqual } // end of IsEqual
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Compare values and returns 1, 0 or -1 according to comparison. */ /* Compare values and returns 1, 0 or -1 according to comparison. */
/* This function is used for evaluation of numeric filters. */ /* This function is used for evaluation of numeric filters. */
@@ -1436,7 +1425,6 @@ int TYPVAL<PSZ>::CompareValue(PVAL vp)
return (n > 0) ? 1 : (n < 0) ? -1 : 0; return (n > 0) ? 1 : (n < 0) ? -1 : 0;
} // end of CompareValue } // end of CompareValue
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* FormatValue: This function set vp (a STRING value) to the string */ /* FormatValue: This function set vp (a STRING value) to the string */
@@ -1664,7 +1652,6 @@ bool DECVAL::IsEqual(PVAL vp, bool chktype)
return !strcmp(Strp, vp->GetCharString(buf)); return !strcmp(Strp, vp->GetCharString(buf));
} // end of IsEqual } // end of IsEqual
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Compare values and returns 1, 0 or -1 according to comparison. */ /* Compare values and returns 1, 0 or -1 according to comparison. */
/* This function is used for evaluation of numeric filters. */ /* This function is used for evaluation of numeric filters. */
@@ -1681,7 +1668,6 @@ int DECVAL::CompareValue(PVAL vp)
return (f > n) ? 1 : (f < n) ? (-1) : 0; return (f > n) ? 1 : (f < n) ? (-1) : 0;
} // end of CompareValue } // end of CompareValue
#endif // BLK_INDX
#if 0 #if 0
/***********************************************************************/ /***********************************************************************/

View File

@@ -46,10 +46,8 @@ DllExport char *GetFormatType(int);
DllExport int GetFormatType(char); DllExport int GetFormatType(char);
DllExport bool IsTypeChar(int type); DllExport bool IsTypeChar(int type);
DllExport bool IsTypeNum(int type); DllExport bool IsTypeNum(int type);
#if defined(BLK_INDX)
DllExport int ConvertType(int, int, CONV, bool match = false); DllExport int ConvertType(int, int, CONV, bool match = false);
DllExport PVAL AllocateValue(PGLOBAL, PVAL, int = TYPE_VOID, int = 0); DllExport PVAL AllocateValue(PGLOBAL, PVAL, int = TYPE_VOID, int = 0);
#endif // BLK_INDX
DllExport PVAL AllocateValue(PGLOBAL, int, int len = 0, int prec = 0, DllExport PVAL AllocateValue(PGLOBAL, int, int len = 0, int prec = 0,
bool uns = false, PSZ fmt = NULL); bool uns = false, PSZ fmt = NULL);
DllExport ulonglong CharToNumber(char *, int, ulonglong, bool, DllExport ulonglong CharToNumber(char *, int, ulonglong, bool,
@@ -97,11 +95,9 @@ class DllExport VALUE : public BLOCK {
virtual bool SetValue_pval(PVAL valp, bool chktype = false) = 0; virtual bool SetValue_pval(PVAL valp, bool chktype = false) = 0;
virtual bool SetValue_char(char *p, int n) = 0; virtual bool SetValue_char(char *p, int n) = 0;
virtual void SetValue_psz(PSZ s) = 0; virtual void SetValue_psz(PSZ s) = 0;
#if defined(BLK_INDX)
virtual void SetValue_bool(bool b) {assert(FALSE);} virtual void SetValue_bool(bool b) {assert(FALSE);}
virtual int CompareValue(PVAL vp) = 0; virtual int CompareValue(PVAL vp) = 0;
virtual BYTE TestValue(PVAL vp); virtual BYTE TestValue(PVAL vp);
#endif // BLK_INDX
virtual void SetValue(char c) {assert(false);} virtual void SetValue(char c) {assert(false);}
virtual void SetValue(uchar c) {assert(false);} virtual void SetValue(uchar c) {assert(false);}
virtual void SetValue(short i) {assert(false);} virtual void SetValue(short i) {assert(false);}
@@ -170,10 +166,8 @@ class DllExport TYPVAL : public VALUE {
virtual bool SetValue_pval(PVAL valp, bool chktype); virtual bool SetValue_pval(PVAL valp, bool chktype);
virtual bool SetValue_char(char *p, int n); virtual bool SetValue_char(char *p, int n);
virtual void SetValue_psz(PSZ s); virtual void SetValue_psz(PSZ s);
#if defined(BLK_INDX)
virtual void SetValue_bool(bool b) {Tval = (b) ? 1 : 0;} virtual void SetValue_bool(bool b) {Tval = (b) ? 1 : 0;}
virtual int CompareValue(PVAL vp); virtual int CompareValue(PVAL vp);
#endif // BLK_INDX
virtual void SetValue(char c) {Tval = (TYPE)c; Null = false;} virtual void SetValue(char c) {Tval = (TYPE)c; Null = false;}
virtual void SetValue(uchar c) {Tval = (TYPE)c; Null = false;} virtual void SetValue(uchar c) {Tval = (TYPE)c; Null = false;}
virtual void SetValue(short i) {Tval = (TYPE)i; Null = false;} virtual void SetValue(short i) {Tval = (TYPE)i; Null = false;}
@@ -253,9 +247,7 @@ class DllExport TYPVAL<PSZ>: public VALUE {
virtual void SetValue(ulonglong n); virtual void SetValue(ulonglong n);
virtual void SetValue(double f); virtual void SetValue(double f);
virtual void SetBinValue(void *p); virtual void SetBinValue(void *p);
#if defined(BLK_INDX)
virtual int CompareValue(PVAL vp); virtual int CompareValue(PVAL vp);
#endif // BLK_INDX
virtual bool GetBinValue(void *buf, int buflen, bool go); virtual bool GetBinValue(void *buf, int buflen, bool go);
virtual char *ShowValue(char *buf, int); virtual char *ShowValue(char *buf, int);
virtual char *GetCharString(char *p); virtual char *GetCharString(char *p);
@@ -285,20 +277,10 @@ class DllExport DECVAL: public TYPVAL<PSZ> {
virtual int GetValPrec() {return Prec;} virtual int GetValPrec() {return Prec;}
// Methods // Methods
//virtual bool SetValue_pval(PVAL valp, bool chktype);
//virtual bool SetValue_char(char *p, int n);
//virtual void SetValue_psz(PSZ s);
//virtual void SetValue_pvblk(PVBLK blk, int n);
//virtual void SetBinValue(void *p);
virtual bool GetBinValue(void *buf, int buflen, bool go); virtual bool GetBinValue(void *buf, int buflen, bool go);
virtual char *ShowValue(char *buf, int); virtual char *ShowValue(char *buf, int);
//virtual char *GetCharString(char *p);
virtual bool IsEqual(PVAL vp, bool chktype); virtual bool IsEqual(PVAL vp, bool chktype);
#if defined(BLK_INDX)
virtual int CompareValue(PVAL vp); virtual int CompareValue(PVAL vp);
#endif // BLK_INDX
//virtual bool FormatValue(PVAL vp, char *fmt);
//virtual bool SetConstFormat(PGLOBAL, FORMAT&);
// Members // Members
}; // end of class DECVAL }; // end of class DECVAL
@@ -327,15 +309,12 @@ class DllExport DTVAL : public TYPVAL<int> {
bool SetFormat(PGLOBAL g, PSZ fmt, int len, int year = 0); bool SetFormat(PGLOBAL g, PSZ fmt, int len, int year = 0);
bool SetFormat(PGLOBAL g, PVAL valp); bool SetFormat(PGLOBAL g, PVAL valp);
bool IsFormatted(void) {return Pdtp != NULL;} bool IsFormatted(void) {return Pdtp != NULL;}
// bool GetTmMember(OPVAL op, int& mval);
// bool DateDiff(DTVAL *dtp, OPVAL op, int& tdif);
bool MakeTime(struct tm *ptm); bool MakeTime(struct tm *ptm);
static void SetTimeShift(void); static void SetTimeShift(void);
static int GetShift(void) {return Shift;} static int GetShift(void) {return Shift;}
// Methods // Methods
bool MakeDate(PGLOBAL g, int *val, int nval); bool MakeDate(PGLOBAL g, int *val, int nval);
// bool WeekNum(PGLOBAL g, int& nval);
struct tm *GetGmTime(struct tm *); struct tm *GetGmTime(struct tm *);

View File

@@ -1792,7 +1792,7 @@ int XINDEX::FastFind(int nv)
XINDXS::XINDXS(PTDBDOS tdbp, PIXDEF xdp, PXLOAD pxp, PCOL *cp, PXOB *xp) XINDXS::XINDXS(PTDBDOS tdbp, PIXDEF xdp, PXLOAD pxp, PCOL *cp, PXOB *xp)
: XINDEX(tdbp, xdp, pxp, cp, xp) : XINDEX(tdbp, xdp, pxp, cp, xp)
{ {
Srtd = To_Cols[0]->GetOpt() < 0; // ????? Srtd = To_Cols[0]->GetOpt() == 2;
} // end of XINDXS constructor } // end of XINDXS constructor
/***********************************************************************/ /***********************************************************************/
@@ -2797,7 +2797,7 @@ bool KXYCOL::Init(PGLOBAL g, PCOL colp, int n, bool sm, int kln)
// Store this information to avoid sorting when already done // Store this information to avoid sorting when already done
if (Asc) if (Asc)
IsSorted = colp->GetOpt() < 0; IsSorted = colp->GetOpt() == 2;
//SetNulls(colp->IsNullable()); for when null columns will be indexable //SetNulls(colp->IsNullable()); for when null columns will be indexable
return false; return false;

View File

@@ -98,12 +98,6 @@ class DllExport INDEXDEF : public BLOCK { /* Index description block */
void SetNParts(uint np) {Nparts = (signed)np;} void SetNParts(uint np) {Nparts = (signed)np;}
void SetMaxSame(int mxs) {MaxSame = mxs;} void SetMaxSame(int mxs) {MaxSame = mxs;}
void SetMxsame(PXINDEX x); void SetMxsame(PXINDEX x);
//int GetOffset(void) {return Offset;}
//void SetOffset(int off) {Offset = off;}
//int GetOffhigh(void) {return Offhigh;}
//void SetOffhigh(int hof) {Offhigh = hof;}
//int GetSize(void) {return Size;}
//void SetSize(int size) {Size = size;}
int GetMaxSame(void) {return MaxSame;} int GetMaxSame(void) {return MaxSame;}
bool Define(PGLOBAL g, void *memp, PTABDEF dfp, LPCSTR p); bool Define(PGLOBAL g, void *memp, PTABDEF dfp, LPCSTR p);
PIXDEF GetIndexOf(PCOL colp, bool hd = false); PIXDEF GetIndexOf(PCOL colp, bool hd = false);
@@ -123,9 +117,6 @@ class DllExport INDEXDEF : public BLOCK { /* Index description block */
bool AutoInc; /* true if unique key in auto increment */ bool AutoInc; /* true if unique key in auto increment */
int Nparts; /* Number of key parts */ int Nparts; /* Number of key parts */
int ID; /* Index ID number */ int ID; /* Index ID number */
//int Offset; /* Offset in index file */
//int Offhigh; /* Offset high in big index file */
//int Size; /* Size of index file */
int MaxSame; /* Max number of same values */ int MaxSame; /* Max number of same values */
}; // end of INDEXDEF }; // end of INDEXDEF
@@ -253,9 +244,6 @@ class DllExport XINDEX : public XXBASE {
virtual int GetCurPos(void) {return (Pex) ? Pex[Cur_K] : Cur_K;} virtual int GetCurPos(void) {return (Pex) ? Pex[Cur_K] : Cur_K;}
virtual void SetNval(int n) {Nval = n;} virtual void SetNval(int n) {Nval = n;}
int GetMaxSame(void) {return MaxSame;} int GetMaxSame(void) {return MaxSame;}
// int GetDefoff(void) {return Defoff;}
// int GetDefhigh(void) {return Defhigh;}
// int GetSize(void) {return Size;}
// Methods // Methods
virtual void Reset(void); virtual void Reset(void);
@@ -288,9 +276,6 @@ class DllExport XINDEX : public XXBASE {
int Nk; // The number of indexed columns int Nk; // The number of indexed columns
int Nval; // The number of used columns int Nval; // The number of used columns
int Incr; // Increment of record position int Incr; // Increment of record position
//int Defoff; // Offset of definition in index file
//int Defhigh; // High order of offset big value
//int Size; // Size of definition in index file
int MaxSame; // Max number of same values int MaxSame; // Max number of same values
}; // end of class XINDEX }; // end of class XINDEX

View File

@@ -1,7 +1,7 @@
/************ Xobject C++ Functions Source Code File (.CPP) ************/ /************ Xobject C++ Functions Source Code File (.CPP) ************/
/* Name: XOBJECT.CPP Version 2.2 */ /* Name: XOBJECT.CPP Version 2.3 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 1998-2012 */ /* (C) Copyright to the author Olivier BERTRAND 1998-2014 */
/* */ /* */
/* This file contains base XOBJECT class functions. */ /* This file contains base XOBJECT class functions. */
/* Also here is the implementation of the CONSTANT class. */ /* Also here is the implementation of the CONSTANT class. */
@@ -109,7 +109,6 @@ int CONSTANT::GetLengthEx(void)
return Value->GetValLen(); return Value->GetValLen();
} // end of GetLengthEx } // end of GetLengthEx
#if defined(BLK_INDX)
/***********************************************************************/ /***********************************************************************/
/* Convert a constant to the given type. */ /* Convert a constant to the given type. */
/***********************************************************************/ /***********************************************************************/
@@ -120,7 +119,6 @@ void CONSTANT::Convert(PGLOBAL g, int newtype)
longjmp(g->jumper[g->jump_level], TYPE_CONST); longjmp(g->jumper[g->jump_level], TYPE_CONST);
} // end of Convert } // end of Convert
#endif // BLK_INDX
/***********************************************************************/ /***********************************************************************/
/* Compare: returns true if this object is equivalent to xp. */ /* Compare: returns true if this object is equivalent to xp. */

View File

@@ -1,7 +1,7 @@
/*************** Xobject H Declares Source Code File (.H) **************/ /*************** Xobject H Declares Source Code File (.H) **************/
/* Name: XOBJECT.H Version 2.3 */ /* Name: XOBJECT.H Version 2.4 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 1998-2012 */ /* (C) Copyright to the author Olivier BERTRAND 1998-2014 */
/* */ /* */
/* This file contains the XOBJECT and derived classes declares. */ /* This file contains the XOBJECT and derived classes declares. */
/***********************************************************************/ /***********************************************************************/
@@ -60,17 +60,6 @@ class DllExport XOBJECT : public BLOCK {
virtual bool Init(PGLOBAL) {return false;} virtual bool Init(PGLOBAL) {return false;}
virtual bool Eval(PGLOBAL) {return false;} virtual bool Eval(PGLOBAL) {return false;}
virtual bool SetFormat(PGLOBAL, FORMAT&) = 0; virtual bool SetFormat(PGLOBAL, FORMAT&) = 0;
virtual int CheckColumn(PGLOBAL, PSQL, PXOB &, int &) {return 0;}
virtual int RefNum(PSQL) {return 0;}
virtual void AddTdb(PSQL, PTDB *, int&) {}
virtual PXOB SetSelect(PGLOBAL, PSQL, bool) {return this;}
virtual PXOB CheckSubQuery(PGLOBAL, PSQL) {return this;}
virtual bool CheckLocal(PTDB) {return true;}
virtual int CheckSpcCol(PTDB, int) {return 2;}
virtual bool CheckSort(PTDB) {return false;}
virtual bool VerifyColumn(PTDB txp) {return false;}
virtual bool VerifyTdb(PTDB& tdbp) {return false;}
virtual bool IsColInside(PCOL colp) {return false;}
protected: protected:
PVAL Value; // The current value of the object. PVAL Value; // The current value of the object.
@@ -97,7 +86,6 @@ class DllExport XVOID : public XOBJECT {
// Methods // Methods
virtual bool Compare(PXOB xp) {return xp->GetType() == TYPE_VOID;} virtual bool Compare(PXOB xp) {return xp->GetType() == TYPE_VOID;}
virtual bool SetFormat(PGLOBAL, FORMAT&) {return true;} virtual bool SetFormat(PGLOBAL, FORMAT&) {return true;}
virtual int CheckSpcCol(PTDB, int) {return 0;}
}; // end of class XVOID }; // end of class XVOID
@@ -122,14 +110,8 @@ class DllExport CONSTANT : public XOBJECT {
virtual bool Compare(PXOB xp); virtual bool Compare(PXOB xp);
virtual bool SetFormat(PGLOBAL g, FORMAT& fmt) virtual bool SetFormat(PGLOBAL g, FORMAT& fmt)
{return Value->SetConstFormat(g, fmt);} {return Value->SetConstFormat(g, fmt);}
virtual int CheckSpcCol(PTDB, int) {return 1;}
#if defined(BLK_INDX)
void Convert(PGLOBAL g, int newtype); void Convert(PGLOBAL g, int newtype);
#endif // BLK_INDX
// bool Rephrase(PGLOBAL g, PSZ work);
void SetValue(PVAL vp) {Value = vp;} void SetValue(PVAL vp) {Value = vp;}
virtual bool VerifyColumn(PTDB txp) {return true;}
virtual bool VerifyTdb(PTDB& tdbp) {return true;}
virtual void Print(PGLOBAL g, FILE *, uint); virtual void Print(PGLOBAL g, FILE *, uint);
virtual void Print(PGLOBAL g, char *, uint); virtual void Print(PGLOBAL g, char *, uint);
}; // end of class CONSTANT }; // end of class CONSTANT

View File

@@ -62,10 +62,8 @@ class DllExport TDB: public BLOCK { // Table Descriptor Block.
inline PCOL GetColumns(void) {return Columns;} inline PCOL GetColumns(void) {return Columns;}
inline int GetDegree(void) {return Degree;} inline int GetDegree(void) {return Degree;}
inline MODE GetMode(void) {return Mode;} inline MODE GetMode(void) {return Mode;}
#if defined(BLK_INDX)
inline PFIL GetFilter(void) {return To_Filter;} inline PFIL GetFilter(void) {return To_Filter;}
inline void SetFilter(PFIL fp) {To_Filter = fp;} inline void SetFilter(PFIL fp) {To_Filter = fp;}
#endif // BLK_INDX
inline void SetOrig(PTDB txp) {To_Orig = txp;} inline void SetOrig(PTDB txp) {To_Orig = txp;}
inline void SetUse(TUSE n) {Use = n;} inline void SetUse(TUSE n) {Use = n;}
inline void SetCondFil(PCFIL cfp) {To_CondFil = cfp;} inline void SetCondFil(PCFIL cfp) {To_CondFil = cfp;}
@@ -112,17 +110,11 @@ class DllExport TDB: public BLOCK { // Table Descriptor Block.
virtual void CloseDB(PGLOBAL) = 0; virtual void CloseDB(PGLOBAL) = 0;
virtual int CheckWrite(PGLOBAL g) {return 0;} virtual int CheckWrite(PGLOBAL g) {return 0;}
// Database routines
bool OpenTable(PGLOBAL g, PSQL sqlp, MODE mode);
void CloseTable(PGLOBAL g);
protected: protected:
// Members // Members
PTDB To_Orig; // Pointer to original if it is a copy PTDB To_Orig; // Pointer to original if it is a copy
TUSE Use; TUSE Use;
#if defined(BLK_INDX)
PFIL To_Filter; PFIL To_Filter;
#endif // BLK_INDX
PCFIL To_CondFil; // To condition filter structure PCFIL To_CondFil; // To condition filter structure
static int Tnum; // Used to generate Tdb_no's static int Tnum; // Used to generate Tdb_no's
const int Tdb_No; // GetTdb_No() is always 0 for OPJOIN const int Tdb_No; // GetTdb_No() is always 0 for OPJOIN