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/filamap.cpp | |
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/filamap.cpp')
-rw-r--r-- | storage/connect/filamap.cpp | 69 |
1 files changed, 64 insertions, 5 deletions
diff --git a/storage/connect/filamap.cpp b/storage/connect/filamap.cpp index 5a67c5d2dd2..64e9ed15f40 100644 --- a/storage/connect/filamap.cpp +++ b/storage/connect/filamap.cpp @@ -1,11 +1,11 @@ /*********** File AM Map C++ Program Source Code File (.CPP) ***********/ /* PROGRAM NAME: FILAMAP */ /* ------------- */ -/* Version 1.4 */ +/* Version 1.5 */ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2005-2013 */ +/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -322,8 +322,30 @@ int MAPFAM::ReadBuffer(PGLOBAL g) /*******************************************************************/ /* Record file position in case of UPDATE or DELETE. */ /*******************************************************************/ - Fpos = Mempos; - CurBlk = (int)Rows++; +#if defined(BLK_INDX) + int rc; + + next: +#endif // BLK_INDX + Fpos = Mempos; + CurBlk = (int)Rows++; + +#if defined(BLK_INDX) + /*******************************************************************/ + /* Check whether optimization on ROWID */ + /* can be done, as well as for join as for local filtering. */ + /*******************************************************************/ + switch (Tdbp->TestBlock(g)) { + case RC_EF: + return RC_EF; + case RC_NF: + // Skip this record + if ((rc = SkipRecord(g, FALSE)) != RC_OK) + return rc; + + goto next; + } // endswitch rc +#endif // BLK_INDX } else Placed = false; @@ -491,7 +513,11 @@ MBKFAM::MBKFAM(PDOSDEF tdp) : MAPFAM(tdp) Block = tdp->GetBlock(); Last = tdp->GetLast(); Nrec = tdp->GetElemt(); +#if defined(BLK_INDX) BlkPos = tdp->GetTo_Pos(); +#else // !BLK_INDX + BlkPos = NULL; +#endif // !BLK_INDX CurNum = Nrec; } // end of MBKFAM standard constructor @@ -537,6 +563,7 @@ int MBKFAM::GetRowID(void) /***********************************************************************/ int MBKFAM::ReadBuffer(PGLOBAL g) { +#if defined(BLK_INDX) int len; /*********************************************************************/ @@ -554,9 +581,21 @@ int MBKFAM::ReadBuffer(PGLOBAL g) /*******************************************************************/ CurNum = 0; + next: if (++CurBlk >= Block) return RC_EF; + /*******************************************************************/ + /* Before reading a new block, check whether block optimization */ + /* can be done, as well as for join as for local filtering. */ + /*******************************************************************/ + switch (Tdbp->TestBlock(g)) { + case RC_EF: + return RC_EF; + case RC_NF: + goto next; + } // endswitch rc + Fpos = Mempos = Memory + BlkPos[CurBlk]; } // endif's @@ -568,6 +607,10 @@ int MBKFAM::ReadBuffer(PGLOBAL g) memcpy(Tdbp->GetLine(), Fpos, len); Tdbp->GetLine()[len] = '\0'; 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 /***********************************************************************/ @@ -657,10 +700,26 @@ int MPXFAM::ReadBuffer(PGLOBAL g) /* New block. */ /*******************************************************************/ CurNum = 0; - + +#if defined(BLK_INDX) + next: +#endif // BLK_INDX if (++CurBlk >= Block) return RC_EF; +#if defined(BLK_INDX) + /*******************************************************************/ + /* Before reading a new block, check whether block optimization */ + /* can be done, as well as for join as for local filtering. */ + /*******************************************************************/ + switch (Tdbp->TestBlock(g)) { + case RC_EF: + return RC_EF; + case RC_NF: + goto next; + } // endswitch rc +#endif // BLK_INDX + Fpos = Mempos = Headlen + Memory + CurBlk * Blksize; } // endif's |