mariadb/storage/connect/tabvct.h
Olivier Bertrand 0219ac1e98 This is a major update that fixes most of the issues and bugs that
have been created by the last addition of new CONNECT features.
The version previous to this one is a preliminary test version and
should not be distributed.

- Handle indexed UPDATE/DELETE. Previously this was just tested and
  an error message send when it could not be done. Now CONNECT can
  do it in all the cases. It is done by a MRR like tchnique by making
  a list of all update or delete to do, sort them, then execute them.
modified:
  storage/connect/array.cpp
  storage/connect/array.h
  storage/connect/filamap.cpp
  storage/connect/filamap.h
  storage/connect/filamdbf.cpp
  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/global.h
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h

- Differenciate Cardinality that returns a true or estimated table size
  and GetMaxSize that return a value equal or greater than the table
  row number. This fixes the errors of non matching opt files.
modified:
  storage/connect/connect.cc
  storage/connect/tabdos.cpp
  storage/connect/tabdos.h
  storage/connect/tabfix.cpp
  storage/connect/table.cpp
  storage/connect/tabmac.h
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
  storage/connect/tabpivot.h
  storage/connect/tabtbl.cpp
  storage/connect/tabtbl.h
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
  storage/connect/tabwmi.h
  storage/connect/xtable.h

- Fix some errors and issues when making index and opt files.
  Erase opt and index files for void tables.
  Fix wrong calculation of Block and Last in MakeBlockValues.
  Invalidate indexes before making opt file.
  Fully handle blocked variable tables. Make opt file for blocked
  variable tables even when they have no optimised colums.
modified:
  storage/connect/tabdos.cpp
  storage/connect/xindex.h

- Fix some errors making index
  Return an error when the allocation is too small (should not
  really occur now that GetMaxSize is sure)
  Don't use XXROW index for DBF tables because of soft deleted lines.
modified:
  storage/connect/xindex.cpp

- Typo
modified:
  storage/connect/macutil.cpp
  storage/connect/tabdos.h
  storage/connect/tabsys.cpp
  storage/connect/tabsys.h
2014-08-07 17:59:21 +02:00

123 lines
4.3 KiB
C++

/*************** TabVct H Declares Source Code File (.H) ***************/
/* Name: TABVCT.H Version 3.4 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 1999-2011 */
/* */
/* This file contains the TDBVCT class declares. */
/***********************************************************************/
#ifndef __TABVCT__
#define __TABVCT__
#include "tabfix.h"
#if defined(UNIX)
//#include <string.h.SUNWCCh>
#endif
typedef class TDBVCT *PTDBVCT;
typedef class VCTCOL *PVCTCOL;
/***********************************************************************/
/* VCT table. */
/***********************************************************************/
class DllExport VCTDEF : public DOSDEF { /* Logical table description */
friend class TDBVCT;
friend class VCTFAM;
friend class VECFAM;
friend class VMPFAM;
public:
// Constructor
VCTDEF(void) {Split = false; Estimate = Header = 0;}
// Implementation
virtual const char *GetType(void) {return "VCT";}
int GetEstimate(void) {return Estimate;}
// Methods
virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
virtual PTDB GetTable(PGLOBAL g, MODE mode);
protected:
int MakeFnPattern(char *fpat);
// Members
bool Split; /* Columns in separate files */
int Estimate; /* Estimated maximum size of table */
int Header; /* 0: no, 1: separate, 2: in data file */
}; // end of VCTDEF
/***********************************************************************/
/* This is the DOS/UNIX Access Method class declaration for files */
/* in blocked vector format. In each block containing "Elements" */
/* records, values of each columns are consecutively stored (vector). */
/***********************************************************************/
class DllExport TDBVCT : public TDBFIX {
friend class VCTCOL;
friend class VCTFAM;
friend class VCMFAM;
friend class VECFAM;
friend class VMPFAM;
public:
// Constructors
TDBVCT(PVCTDEF tdp, PTXF txfp);
TDBVCT(PGLOBAL g, PTDBVCT tdbp);
// Implementation
virtual AMT GetAmType(void) {return TYPE_AM_VCT;}
virtual PTDB Duplicate(PGLOBAL g)
{return (PTDB)new(g) TDBVCT(g, this);}
bool IsSplit(void) {return ((VCTDEF*)To_Def)->Split;}
// Methods
virtual PTDB CopyOne(PTABS t);
// Database routines
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
virtual bool OpenDB(PGLOBAL g);
virtual int ReadDB(PGLOBAL g);
virtual void CloseDB(PGLOBAL g);
protected:
// Members
}; // end of class TDBVCT
/***********************************************************************/
/* Class VCTCOL: VCT access method column descriptor. */
/* This A.M. is used for file having column wise organization. */
/***********************************************************************/
class DllExport VCTCOL : public DOSCOL {
friend class TDBVCT;
friend class VCTFAM;
friend class VCMFAM;
friend class VECFAM;
friend class VMPFAM;
friend class BGVFAM;
public:
// Constructors
VCTCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i);
VCTCOL(VCTCOL *colp, PTDB tdbp); // Constructor used in copy process
// Implementation
virtual int GetAmType(void) {return TYPE_AM_VCT;}
// Methods
virtual void ReadColumn(PGLOBAL g);
virtual void WriteColumn(PGLOBAL g);
virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check);
virtual void SetOk(void);
protected:
virtual void ReadBlock(PGLOBAL g);
virtual void WriteBlock(PGLOBAL g);
VCTCOL(void) {} // Default constructor not to be used
// Members
PVBLK Blk; // Block buffer
int Clen; // Internal length in table
int ColBlk; // Block pointed by column
int ColPos; // Last position read
int Modif; // Number of modified lines in block
}; // end of class VCTCOL
#endif // __TABVCT__