diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2014-03-10 12:21:17 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2014-03-10 12:21:17 +0100 |
commit | 85e8aee47d2e1cc58857148293f84ccd7e2ec620 (patch) | |
tree | 078efdcf3dfa65b84a05353645276dc1d3b07bc5 /storage/connect/tabdos.h | |
parent | 126bb34513f34eba97598d2357bfc1c2fbf594b4 (diff) | |
download | mariadb-git-85e8aee47d2e1cc58857148293f84ccd7e2ec620.tar.gz |
- Temporary
modified:
storage/connect/catalog.h
storage/connect/colblk.cpp
storage/connect/colblk.h
storage/connect/connect.cc
storage/connect/filamap.cpp
storage/connect/filamfix.cpp
storage/connect/filamfix.h
storage/connect/filamtxt.cpp
storage/connect/filamvct.cpp
storage/connect/filamzip.cpp
storage/connect/filamzip.h
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/plgdbsem.h
storage/connect/plgdbutl.cpp
storage/connect/reldef.cpp
storage/connect/reldef.h
storage/connect/tabdos.cpp
storage/connect/tabdos.h
storage/connect/tabfix.cpp
storage/connect/tabfix.h
storage/connect/tabfmt.cpp
storage/connect/tabfmt.h
storage/connect/table.cpp
storage/connect/tabmac.h
storage/connect/tabmul.h
storage/connect/tabmysql.cpp
storage/connect/tabodbc.cpp
storage/connect/tabsys.cpp
storage/connect/tabsys.h
storage/connect/tabtbl.cpp
storage/connect/tabtbl.h
storage/connect/tabvct.cpp
storage/connect/tabvct.h
storage/connect/tabwmi.cpp
storage/connect/tabwmi.h
storage/connect/tabxml.cpp
storage/connect/tabxml.h
storage/connect/valblk.cpp
storage/connect/valblk.h
storage/connect/value.cpp
storage/connect/value.h
storage/connect/xobject.cpp
storage/connect/xobject.h
storage/connect/xtable.h
Diffstat (limited to 'storage/connect/tabdos.h')
-rw-r--r-- | storage/connect/tabdos.h | 121 |
1 files changed, 80 insertions, 41 deletions
diff --git a/storage/connect/tabdos.h b/storage/connect/tabdos.h index 5f67ffad92f..52bb1450c29 100644 --- a/storage/connect/tabdos.h +++ b/storage/connect/tabdos.h @@ -1,7 +1,7 @@ /*************** TabDos H Declares Source Code File (.H) ***************/ -/* Name: TABDOS.H Version 3.2 */ +/* Name: TABDOS.H Version 3.3 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 1999-2012 */ +/* (C) Copyright to the author Olivier BERTRAND 1999-2014 */ /* */ /* This file contains the DOS classes declares. */ /***********************************************************************/ @@ -12,9 +12,16 @@ #include "xtable.h" // Table base class declares #include "colblk.h" // Column base class declares #include "xindex.h" +#if defined(BLK_INDX) +#include "filter.h" +#endif // BLK_INDX //pedef struct _tabdesc *PTABD; // For friend setting typedef class TXTFAM *PTXF; +#if defined(BLK_INDX) +typedef class BLOCKFILTER *PBF; +typedef class BLOCKINDEX *PBX; +#endif // BLK_INDX /***********************************************************************/ /* DOS table. */ @@ -34,6 +41,7 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */ virtual const char *GetType(void) {return "DOS";} virtual PIXDEF GetIndx(void) {return To_Indx;} virtual void SetIndx(PIXDEF xdp) {To_Indx = xdp;} + virtual bool IsHuge(void) {return Huge;} PSZ GetFn(void) {return Fn;} PSZ GetOfn(void) {return Ofn;} void SetBlock(int block) {Block = block;} @@ -46,19 +54,28 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */ bool GetEof(void) {return Eof;} int GetBlksize(void) {return Blksize;} int GetEnding(void) {return Ending;} +#if defined(BLK_INDX) + bool IsOptimized(void) {return (Optimized == 1);} + void SetOptimized(int opt) {Optimized = opt;} + void SetAllocBlks(int blks) {AllocBlks = blks;} + int GetAllocBlks(void) {return AllocBlks;} int *GetTo_Pos(void) {return To_Pos;} - virtual bool IsHuge(void) {return Huge;} +#endif // BLK_INDX // Methods - virtual bool DeleteTableFile(PGLOBAL g); +//virtual bool DeleteTableFile(PGLOBAL g); virtual bool Indexable(void) {return Compressed != 1;} virtual bool DeleteIndexFile(PGLOBAL g, PIXDEF pxdf); virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); virtual PTDB GetTable(PGLOBAL g, MODE mode); bool InvalidateIndex(PGLOBAL g); +#if defined(BLK_INDX) + bool GetOptFileName(PGLOBAL g, char *filename); + void RemoveOptValues(PGLOBAL g); +#endif // BLK_INDX protected: - virtual bool Erase(char *filename); +//virtual bool Erase(char *filename); // Members PSZ Fn; /* Path/Name of corresponding file */ @@ -70,7 +87,11 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */ bool Huge; /* true for files larger than 2GB */ bool Accept; /* true if wrong lines are accepted (DBF)*/ bool Eof; /* true if an EOF (0xA) character exists */ - int *To_Pos; /* To array of block starting positions */ +#if defined(BLK_INDX) + int *To_Pos; /* To array of block starting positions */ + int Optimized; /* 0: No, 1:Yes, 2:Redo optimization */ + int AllocBlks; /* Number of suballocated opt blocks */ +#endif // BLK_INDX int Compressed; /* 0: No, 1: gz, 2:zlib compressed file */ int Lrecl; /* Size of biggest record */ int AvgLen; /* Average size of records */ @@ -129,13 +150,15 @@ class DllExport TDBDOS : public TDBASE { virtual bool IsUsingTemp(PGLOBAL g); //virtual bool NeedIndexing(PGLOBAL g); virtual void ResetSize(void) {MaxSize = Cardinal = -1;} - virtual int ResetTableOpt(PGLOBAL g, bool dox); -//virtual int MakeBlockValues(PGLOBAL g); -//virtual bool SaveBlockValues(PGLOBAL g); -//virtual bool GetBlockValues(PGLOBAL g); -//virtual PBF InitBlockFilter(PGLOBAL g, PFIL filp); + virtual int ResetTableOpt(PGLOBAL g, bool dop, bool dox); +#if defined(BLK_INDX) + virtual int MakeBlockValues(PGLOBAL g); + virtual bool SaveBlockValues(PGLOBAL g); + virtual bool GetBlockValues(PGLOBAL g); + virtual PBF InitBlockFilter(PGLOBAL g, PFIL filp); //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); // Database routines @@ -162,25 +185,31 @@ class DllExport TDBDOS : public TDBASE { virtual int EstimatedLength(PGLOBAL g); // Optimization routines -// void ResetBlockFilter(PGLOBAL g); - int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add); -// bool GetDistinctColumnValues(PGLOBAL g, int nrec); + int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add); +#if defined(BLK_INDX) + void ResetBlockFilter(PGLOBAL g); + bool GetDistinctColumnValues(PGLOBAL g, int nrec); 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 PTXF Txfp; // To the File access method class +#if defined(BLK_INDX) //PBX To_BlkIdx; // To index test block -//PBF To_BlkFil; // To evaluation block filter -//PFIL SavFil; // Saved hidden filter + PBF To_BlkFil; // To evaluation block filter + PFIL SavFil; // Saved hidden filter +#endif // BLK_INDX char *To_Line; // Points to current processed line int Cardinal; // Table Cardinality RECFM Ftype; // File type: 0-var 1-fixed 2-binary (VCT) int Lrecl; // Logical Record Length int AvgLen; // Logical Record Average Length +#if defined(BLK_INDX) //int Xeval; // BlockTest return value -//int Beval; // BlockEval return value + int Beval; // BlockEval return value +#endif // BLK_INDX }; // end of class TDBDOS /***********************************************************************/ @@ -198,50 +227,60 @@ class DllExport DOSCOL : public COLBLK { // Implementation virtual int GetAmType(void) {return TYPE_AM_DOS;} -//virtual int GetClustered(void) {return Clustered;} -//virtual int IsClustered(void) {return (Clustered && -// ((PDOSDEF)(((PTDBDOS)To_Tdb)->To_Def))->IsOptimized());} -//virtual int IsSorted(void) {return Sorted;} virtual void SetTo_Val(PVAL valp) {To_Val = valp;} -//virtual PVBLK GetMin(void) {return Min;} -//virtual PVBLK GetMax(void) {return Max;} -//virtual int GetNdv(void) {return Ndv;} -//virtual int GetNbm(void) {return Nbm;} -//virtual PVBLK GetBmap(void) {return Bmap;} -//virtual PVBLK GetDval(void) {return Dval;} +#if defined(BLK_INDX) + virtual int GetClustered(void) {return Clustered;} + virtual int IsClustered(void) {return (Clustered && + ((PDOSDEF)(((PTDBDOS)To_Tdb)->To_Def))->IsOptimized());} + virtual int IsSorted(void) {return Sorted;} + virtual PVBLK GetMin(void) {return Min;} + virtual PVBLK GetMax(void) {return Max;} + virtual int GetNdv(void) {return Ndv;} + virtual int GetNbm(void) {return Nbm;} + virtual PVBLK GetBmap(void) {return Bmap;} + virtual PVBLK GetDval(void) {return Dval;} +#endif // BLK_INDX // Methods +#if defined(BLK_INDX) virtual bool VarSize(void); +#endif // BLK_INDX virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); virtual void ReadColumn(PGLOBAL g); virtual void WriteColumn(PGLOBAL g); virtual void Print(PGLOBAL g, FILE *, uint); protected: -//virtual bool SetMinMax(PGLOBAL g); -//virtual bool SetBitMap(PGLOBAL g); -// bool CheckSorted(PGLOBAL g); -// bool AddDistinctValue(PGLOBAL g); +#if defined(BLK_INDX) + virtual bool SetMinMax(PGLOBAL g); + virtual bool SetBitMap(PGLOBAL g); + bool CheckSorted(PGLOBAL g); + bool AddDistinctValue(PGLOBAL g); +#endif // BLK_INDX // Default constructor not to be used DOSCOL(void) {} // Members -//PVBLK Min; // Array of block min values -//PVBLK Max; // Array of block max values -//PVBLK Bmap; // Array of block bitmap values -//PVBLK Dval; // Array of column distinct values +#if defined(BLK_INDX) + PVBLK Min; // Array of block min values + PVBLK Max; // Array of block max values + PVBLK Bmap; // Array of block bitmap values + PVBLK Dval; // Array of column distinct values +#endif // BLK_INDX PVAL To_Val; // To value used for Update/Insert PVAL OldVal; // The previous value of the object. char *Buf; // Buffer used in write operations bool Ldz; // True if field contains leading zeros bool Nod; // True if no decimal point int Dcm; // Last Dcm digits are decimals -//int Clustered; // 0:No 1:Yes -//int Sorted; // 0:No 1:Asc (2:Desc - NIY) int Deplac; // Offset in dos_buf -//int Ndv; // Number of distinct values -//int Nbm; // Number of uint in bitmap +#if defined(BLK_INDX) + int Clustered; // 0:No 1:Yes + int Sorted; // 0:No 1:Asc (2:Desc - NIY) + int Ndv; // Number of distinct values + int Nbm; // Number of uint in bitmap +#endif // BLK_INDX }; // end of class DOSCOL #endif // __TABDOS_H |