Commit 089938cd authored by Alexander Barkov's avatar Alexander Barkov

Merge 10.0->10.0-connect

parents 82ce2a25 4d0587c3
...@@ -7,123 +7,120 @@ ...@@ -7,123 +7,120 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#define MYSQL_DTRACE_DISABLED false
#else
#define MYSQL_DTRACE_DISABLED 0
#endif #endif
#define MYSQL_CONNECTION_START(arg0, arg1, arg2) #define MYSQL_CONNECTION_START(arg0, arg1, arg2)
#define MYSQL_CONNECTION_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_CONNECTION_START_ENABLED() (0)
#define MYSQL_CONNECTION_DONE(arg0, arg1) #define MYSQL_CONNECTION_DONE(arg0, arg1)
#define MYSQL_CONNECTION_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_CONNECTION_DONE_ENABLED() (0)
#define MYSQL_COMMAND_START(arg0, arg1, arg2, arg3) #define MYSQL_COMMAND_START(arg0, arg1, arg2, arg3)
#define MYSQL_COMMAND_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_COMMAND_START_ENABLED() (0)
#define MYSQL_COMMAND_DONE(arg0) #define MYSQL_COMMAND_DONE(arg0)
#define MYSQL_COMMAND_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_COMMAND_DONE_ENABLED() (0)
#define MYSQL_QUERY_START(arg0, arg1, arg2, arg3, arg4) #define MYSQL_QUERY_START(arg0, arg1, arg2, arg3, arg4)
#define MYSQL_QUERY_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_QUERY_START_ENABLED() (0)
#define MYSQL_QUERY_DONE(arg0) #define MYSQL_QUERY_DONE(arg0)
#define MYSQL_QUERY_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_QUERY_DONE_ENABLED() (0)
#define MYSQL_QUERY_PARSE_START(arg0) #define MYSQL_QUERY_PARSE_START(arg0)
#define MYSQL_QUERY_PARSE_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_QUERY_PARSE_START_ENABLED() (0)
#define MYSQL_QUERY_PARSE_DONE(arg0) #define MYSQL_QUERY_PARSE_DONE(arg0)
#define MYSQL_QUERY_PARSE_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_QUERY_PARSE_DONE_ENABLED() (0)
#define MYSQL_QUERY_CACHE_HIT(arg0, arg1) #define MYSQL_QUERY_CACHE_HIT(arg0, arg1)
#define MYSQL_QUERY_CACHE_HIT_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_QUERY_CACHE_HIT_ENABLED() (0)
#define MYSQL_QUERY_CACHE_MISS(arg0) #define MYSQL_QUERY_CACHE_MISS(arg0)
#define MYSQL_QUERY_CACHE_MISS_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_QUERY_CACHE_MISS_ENABLED() (0)
#define MYSQL_QUERY_EXEC_START(arg0, arg1, arg2, arg3, arg4, arg5) #define MYSQL_QUERY_EXEC_START(arg0, arg1, arg2, arg3, arg4, arg5)
#define MYSQL_QUERY_EXEC_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_QUERY_EXEC_START_ENABLED() (0)
#define MYSQL_QUERY_EXEC_DONE(arg0) #define MYSQL_QUERY_EXEC_DONE(arg0)
#define MYSQL_QUERY_EXEC_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_QUERY_EXEC_DONE_ENABLED() (0)
#define MYSQL_INSERT_ROW_START(arg0, arg1) #define MYSQL_INSERT_ROW_START(arg0, arg1)
#define MYSQL_INSERT_ROW_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_INSERT_ROW_START_ENABLED() (0)
#define MYSQL_INSERT_ROW_DONE(arg0) #define MYSQL_INSERT_ROW_DONE(arg0)
#define MYSQL_INSERT_ROW_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_INSERT_ROW_DONE_ENABLED() (0)
#define MYSQL_UPDATE_ROW_START(arg0, arg1) #define MYSQL_UPDATE_ROW_START(arg0, arg1)
#define MYSQL_UPDATE_ROW_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_UPDATE_ROW_START_ENABLED() (0)
#define MYSQL_UPDATE_ROW_DONE(arg0) #define MYSQL_UPDATE_ROW_DONE(arg0)
#define MYSQL_UPDATE_ROW_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_UPDATE_ROW_DONE_ENABLED() (0)
#define MYSQL_DELETE_ROW_START(arg0, arg1) #define MYSQL_DELETE_ROW_START(arg0, arg1)
#define MYSQL_DELETE_ROW_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_DELETE_ROW_START_ENABLED() (0)
#define MYSQL_DELETE_ROW_DONE(arg0) #define MYSQL_DELETE_ROW_DONE(arg0)
#define MYSQL_DELETE_ROW_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_DELETE_ROW_DONE_ENABLED() (0)
#define MYSQL_READ_ROW_START(arg0, arg1, arg2) #define MYSQL_READ_ROW_START(arg0, arg1, arg2)
#define MYSQL_READ_ROW_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_READ_ROW_START_ENABLED() (0)
#define MYSQL_READ_ROW_DONE(arg0) #define MYSQL_READ_ROW_DONE(arg0)
#define MYSQL_READ_ROW_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_READ_ROW_DONE_ENABLED() (0)
#define MYSQL_INDEX_READ_ROW_START(arg0, arg1) #define MYSQL_INDEX_READ_ROW_START(arg0, arg1)
#define MYSQL_INDEX_READ_ROW_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_INDEX_READ_ROW_START_ENABLED() (0)
#define MYSQL_INDEX_READ_ROW_DONE(arg0) #define MYSQL_INDEX_READ_ROW_DONE(arg0)
#define MYSQL_INDEX_READ_ROW_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_INDEX_READ_ROW_DONE_ENABLED() (0)
#define MYSQL_HANDLER_RDLOCK_START(arg0, arg1) #define MYSQL_HANDLER_RDLOCK_START(arg0, arg1)
#define MYSQL_HANDLER_RDLOCK_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_HANDLER_RDLOCK_START_ENABLED() (0)
#define MYSQL_HANDLER_WRLOCK_START(arg0, arg1) #define MYSQL_HANDLER_WRLOCK_START(arg0, arg1)
#define MYSQL_HANDLER_WRLOCK_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_HANDLER_WRLOCK_START_ENABLED() (0)
#define MYSQL_HANDLER_UNLOCK_START(arg0, arg1) #define MYSQL_HANDLER_UNLOCK_START(arg0, arg1)
#define MYSQL_HANDLER_UNLOCK_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_HANDLER_UNLOCK_START_ENABLED() (0)
#define MYSQL_HANDLER_RDLOCK_DONE(arg0) #define MYSQL_HANDLER_RDLOCK_DONE(arg0)
#define MYSQL_HANDLER_RDLOCK_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_HANDLER_RDLOCK_DONE_ENABLED() (0)
#define MYSQL_HANDLER_WRLOCK_DONE(arg0) #define MYSQL_HANDLER_WRLOCK_DONE(arg0)
#define MYSQL_HANDLER_WRLOCK_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_HANDLER_WRLOCK_DONE_ENABLED() (0)
#define MYSQL_HANDLER_UNLOCK_DONE(arg0) #define MYSQL_HANDLER_UNLOCK_DONE(arg0)
#define MYSQL_HANDLER_UNLOCK_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_HANDLER_UNLOCK_DONE_ENABLED() (0)
#define MYSQL_FILESORT_START(arg0, arg1) #define MYSQL_FILESORT_START(arg0, arg1)
#define MYSQL_FILESORT_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_FILESORT_START_ENABLED() (0)
#define MYSQL_FILESORT_DONE(arg0, arg1) #define MYSQL_FILESORT_DONE(arg0, arg1)
#define MYSQL_FILESORT_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_FILESORT_DONE_ENABLED() (0)
#define MYSQL_SELECT_START(arg0) #define MYSQL_SELECT_START(arg0)
#define MYSQL_SELECT_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_SELECT_START_ENABLED() (0)
#define MYSQL_SELECT_DONE(arg0, arg1) #define MYSQL_SELECT_DONE(arg0, arg1)
#define MYSQL_SELECT_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_SELECT_DONE_ENABLED() (0)
#define MYSQL_INSERT_START(arg0) #define MYSQL_INSERT_START(arg0)
#define MYSQL_INSERT_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_INSERT_START_ENABLED() (0)
#define MYSQL_INSERT_DONE(arg0, arg1) #define MYSQL_INSERT_DONE(arg0, arg1)
#define MYSQL_INSERT_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_INSERT_DONE_ENABLED() (0)
#define MYSQL_INSERT_SELECT_START(arg0) #define MYSQL_INSERT_SELECT_START(arg0)
#define MYSQL_INSERT_SELECT_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_INSERT_SELECT_START_ENABLED() (0)
#define MYSQL_INSERT_SELECT_DONE(arg0, arg1) #define MYSQL_INSERT_SELECT_DONE(arg0, arg1)
#define MYSQL_INSERT_SELECT_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_INSERT_SELECT_DONE_ENABLED() (0)
#define MYSQL_UPDATE_START(arg0) #define MYSQL_UPDATE_START(arg0)
#define MYSQL_UPDATE_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_UPDATE_START_ENABLED() (0)
#define MYSQL_UPDATE_DONE(arg0, arg1, arg2) #define MYSQL_UPDATE_DONE(arg0, arg1, arg2)
#define MYSQL_UPDATE_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_UPDATE_DONE_ENABLED() (0)
#define MYSQL_MULTI_UPDATE_START(arg0) #define MYSQL_MULTI_UPDATE_START(arg0)
#define MYSQL_MULTI_UPDATE_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_MULTI_UPDATE_START_ENABLED() (0)
#define MYSQL_MULTI_UPDATE_DONE(arg0, arg1, arg2) #define MYSQL_MULTI_UPDATE_DONE(arg0, arg1, arg2)
#define MYSQL_MULTI_UPDATE_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_MULTI_UPDATE_DONE_ENABLED() (0)
#define MYSQL_DELETE_START(arg0) #define MYSQL_DELETE_START(arg0)
#define MYSQL_DELETE_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_DELETE_START_ENABLED() (0)
#define MYSQL_DELETE_DONE(arg0, arg1) #define MYSQL_DELETE_DONE(arg0, arg1)
#define MYSQL_DELETE_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_DELETE_DONE_ENABLED() (0)
#define MYSQL_MULTI_DELETE_START(arg0) #define MYSQL_MULTI_DELETE_START(arg0)
#define MYSQL_MULTI_DELETE_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_MULTI_DELETE_START_ENABLED() (0)
#define MYSQL_MULTI_DELETE_DONE(arg0, arg1) #define MYSQL_MULTI_DELETE_DONE(arg0, arg1)
#define MYSQL_MULTI_DELETE_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_MULTI_DELETE_DONE_ENABLED() (0)
#define MYSQL_NET_READ_START() #define MYSQL_NET_READ_START()
#define MYSQL_NET_READ_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_NET_READ_START_ENABLED() (0)
#define MYSQL_NET_READ_DONE(arg0, arg1) #define MYSQL_NET_READ_DONE(arg0, arg1)
#define MYSQL_NET_READ_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_NET_READ_DONE_ENABLED() (0)
#define MYSQL_NET_WRITE_START(arg0) #define MYSQL_NET_WRITE_START(arg0)
#define MYSQL_NET_WRITE_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_NET_WRITE_START_ENABLED() (0)
#define MYSQL_NET_WRITE_DONE(arg0) #define MYSQL_NET_WRITE_DONE(arg0)
#define MYSQL_NET_WRITE_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_NET_WRITE_DONE_ENABLED() (0)
#define MYSQL_KEYCACHE_READ_START(arg0, arg1, arg2, arg3) #define MYSQL_KEYCACHE_READ_START(arg0, arg1, arg2, arg3)
#define MYSQL_KEYCACHE_READ_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_KEYCACHE_READ_START_ENABLED() (0)
#define MYSQL_KEYCACHE_READ_BLOCK(arg0) #define MYSQL_KEYCACHE_READ_BLOCK(arg0)
#define MYSQL_KEYCACHE_READ_BLOCK_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_KEYCACHE_READ_BLOCK_ENABLED() (0)
#define MYSQL_KEYCACHE_READ_HIT() #define MYSQL_KEYCACHE_READ_HIT()
#define MYSQL_KEYCACHE_READ_HIT_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_KEYCACHE_READ_HIT_ENABLED() (0)
#define MYSQL_KEYCACHE_READ_MISS() #define MYSQL_KEYCACHE_READ_MISS()
#define MYSQL_KEYCACHE_READ_MISS_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_KEYCACHE_READ_MISS_ENABLED() (0)
#define MYSQL_KEYCACHE_READ_DONE(arg0, arg1) #define MYSQL_KEYCACHE_READ_DONE(arg0, arg1)
#define MYSQL_KEYCACHE_READ_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_KEYCACHE_READ_DONE_ENABLED() (0)
#define MYSQL_KEYCACHE_WRITE_START(arg0, arg1, arg2, arg3) #define MYSQL_KEYCACHE_WRITE_START(arg0, arg1, arg2, arg3)
#define MYSQL_KEYCACHE_WRITE_START_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_KEYCACHE_WRITE_START_ENABLED() (0)
#define MYSQL_KEYCACHE_WRITE_BLOCK(arg0) #define MYSQL_KEYCACHE_WRITE_BLOCK(arg0)
#define MYSQL_KEYCACHE_WRITE_BLOCK_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_KEYCACHE_WRITE_BLOCK_ENABLED() (0)
#define MYSQL_KEYCACHE_WRITE_DONE(arg0, arg1) #define MYSQL_KEYCACHE_WRITE_DONE(arg0, arg1)
#define MYSQL_KEYCACHE_WRITE_DONE_ENABLED() MYSQL_DTRACE_DISABLED #define MYSQL_KEYCACHE_WRITE_DONE_ENABLED() (0)
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -3195,13 +3195,26 @@ uint32 get_partition_id_cols_list_for_endpoint(partition_info *part_info, ...@@ -3195,13 +3195,26 @@ uint32 get_partition_id_cols_list_for_endpoint(partition_info *part_info,
(list_index - 1)*num_columns, (list_index - 1)*num_columns,
nparts, left_endpoint, nparts, left_endpoint,
include_endpoint))); include_endpoint)));
#if 0
if (!left_endpoint) if (!left_endpoint)
{ {
/* Set the end after this list tuple if not already after the last. */ /* Set the end after this list tuple if not already after the last. */
if (list_index < part_info->num_parts) if (list_index < part_info->num_parts)
list_index++; list_index++;
} }
#else
if (!left_endpoint && list_index < part_info->num_list_values)
{
/*
Set the end after this list tuple if it is not already after the last
and it matches.
*/
int cmp = cmp_rec_and_tuple_prune(list_col_array + list_index*num_columns,
nparts, left_endpoint, include_endpoint);
if (cmp >= 0)
list_index++;
}
#endif
DBUG_RETURN(list_index); DBUG_RETURN(list_index);
} }
......
...@@ -19,20 +19,20 @@ SET(CONNECT_PLUGIN_DYNAMIC "connect") ...@@ -19,20 +19,20 @@ SET(CONNECT_PLUGIN_DYNAMIC "connect")
SET(CONNECT_SOURCES SET(CONNECT_SOURCES
ha_connect.cc connect.cc user_connect.cc mycat.cc ha_connect.cc connect.cc user_connect.cc mycat.cc
fmdlex.c osutil.c plugutil.c rcmsg.c rcmsg.h fmdlex.c osutil.c plugutil.c rcmsg.c rcmsg.h
csort.cpp maputil.cpp plgdbutl.cpp array.cpp blkfil.cpp colblk.cpp csort.cpp
colblk.cpp reldef.cpp tabcol.cpp table.cpp filamap.cpp filamdbf.cpp filamfix.cpp filamtxt.cpp filamvct.cpp filamzip.cpp
filamap.cpp filamdbf.cpp filamfix.cpp filamtxt.cpp filamvct.cpp filter.cpp maputil.cpp myutil.cpp plgdbutl.cpp reldef.cpp tabcol.cpp
tabdos.cpp tabfix.cpp tabfmt.cpp tabmul.cpp tabsys.cpp tabvct.cpp tabdos.cpp tabfix.cpp tabfmt.cpp table.cpp tabmul.cpp taboccur.cpp
tabpivot.cpp tabsys.cpp tabtbl.cpp tabutil.cpp tabvct.cpp tabxcl.cpp
valblk.cpp value.cpp xindex.cpp xobject.cpp valblk.cpp value.cpp xindex.cpp xobject.cpp
filamzip.cpp tabtbl.cpp myutil.cpp
tabutil.cpp tabxcl.cpp taboccur.cpp tabpivot.cpp array.h blkfil.h block.h catalog.h checklvl.h colblk.h connect.h csort.h
block.h catalog.h checklvl.h colblk.h connect.h csort.h engmsg.h engmsg.h filamap.h filamdbf.h filamfix.h filamtxt.h filamvct.h filamzip.h
filamap.h filamdbf.h filamfix.h filamtxt.h filamvct.h filamzip.h filter.h global.h ha_connect.h inihandl.h maputil.h msgid.h mycat.h myutil.h
global.h ha_connect.h inihandl.h maputil.h msgid.h mycat.h myutil.h os.h os.h osutil.h plgcnx.h plgdbsem.h preparse.h reldef.h resource.h tabcol.h
osutil.h plgcnx.h plgdbsem.h preparse.h reldef.h resource.h tabcol.h tabdos.h tabfix.h tabfmt.h tabmul.h taboccur.h tabpivot.h tabsys.h
tabdos.h tabfix.h tabfmt.h tabmul.h tabsys.h tabtbl.h tabvct.h tabtbl.h tabutil.h tabvct.h tabxcl.h user_connect.h valblk.h value.h
user_connect.h valblk.h value.h xindex.h xobject.h xtable.h xindex.h xobject.h xtable.h)
tabutil.h tabxcl.h taboccur.h tabpivot.h)
# #
# Definitions that are shared for all OSes # Definitions that are shared for all OSes
......
This diff is collapsed.
/**************** Array H Declares Source Code File (.H) ***************/
/* Name: ARRAY.H Version 3.1 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */
/* */
/* This file contains the ARRAY and VALBASE derived classes declares. */
/***********************************************************************/
/***********************************************************************/
/* Include required application header files */
/***********************************************************************/
#include "xobject.h"
#include "valblk.h"
#include "csort.h"
typedef class ARRAY *PARRAY;
/***********************************************************************/
/* Definition of class ARRAY with all its method functions. */
/* Note: This is not a general array class that could be defined as */
/* a template class, but rather a specific object containing a list */
/* of values to be processed by the filter IN operator. */
/* In addition it must act as a metaclass by being able to give back */
/* the type of values it contains. */
/* It must also be able to convert itself from some type to another. */
/***********************************************************************/
class DllExport ARRAY : public XOBJECT, public CSORT { // Array descblock
friend class MULAR;
//friend class VALLST;
//friend class SFROW;
public:
// Constructors
ARRAY(PGLOBAL g, int type, int size, int len = 1, int prec = 0);
//ARRAY(PGLOBAL g, PQUERY qryp);
//ARRAY(PGLOBAL g, PARRAY par, int k);
// Implementation
virtual int GetType(void) {return TYPE_ARRAY;}
virtual int GetResultType(void) {return Type;}
virtual int GetLength(void) {return Len;}
virtual int GetLengthEx(void) {return Len;}
virtual int GetScale() {return 0;}
int GetNval(void) {return Nval;}
int GetSize(void) {return Size;}
// PVAL GetValp(void) {return Valp;}
void SetType(int atype) {Type = atype;}
// void SetCorrel(bool b) {Correlated = b;}
// Methods
virtual void Reset(void) {Bot = -1;}
virtual int Qcompare(int *, int *);
virtual bool Compare(PXOB) {assert(FALSE); return FALSE;}
virtual bool SetFormat(PGLOBAL, FORMAT&) {assert(FALSE); return FALSE;}
//virtual int CheckSpcCol(PTDB, int) {return 0;}
virtual void Print(PGLOBAL g, FILE *f, uint n);
virtual void Print(PGLOBAL g, char *ps, uint z);
// void Empty(void);
void SetPrecision(PGLOBAL g, int p);
bool AddValue(PGLOBAL g, PSZ sp);
bool AddValue(PGLOBAL g, short n);
bool AddValue(PGLOBAL g, int n);
bool AddValue(PGLOBAL g, double f);
bool AddValue(PGLOBAL g, PXOB xp);
bool AddValue(PGLOBAL g, PVAL vp);
void GetNthValue(PVAL valp, int n);
char *GetStringValue(int n);
BYTE Vcompare(PVAL vp, int n);
void Save(int);
void Restore(int);
void Move(int, int);
bool Sort(PGLOBAL g);
bool Find(PVAL valp);
bool FilTest(PGLOBAL g, PVAL valp, OPVAL opc, int opm);
int Convert(PGLOBAL g, int k, PVAL vp = NULL);
int BlockTest(PGLOBAL g, int opc, int opm,
void *minp, void *maxp, bool s);
PSZ MakeArrayList(PGLOBAL g);
bool CanBeShort(void);
bool GetSubValue(PGLOBAL g, PVAL valp, int *kp);
protected:
// Members
PMBV Valblk; // To the MBVALS class
PVBLK Vblp; // To Valblock of the data array
//PVAL Valp; // The value used for Save and Restore is Value
int Size; // Size of value array
int Nval; // Total number of items in array
int Ndif; // Total number of distinct items in array
int Xsize; // Size of Index (used for correlated arrays)
int Type; // Type of individual values in the array
int Len; // Length of character string
int Bot; // Bottom of research index
int Top; // Top of research index
int X, Inf, Sup; // Used for block optimization
//bool Correlated; // -----------> Temporary
}; // end of class ARRAY
/***********************************************************************/
/* Definition of class MULAR with all its method functions. */
/* This class is used when constructing the arrays of constants used */
/* for indexing. Its only purpose is to provide a way to sort, reduce */
/* and reorder the arrays of multicolumn indexes as one block. Indeed */
/* sorting the arrays independantly would break the correspondance of */
/* column values. */
/***********************************************************************/
class MULAR : public CSORT, public BLOCK { // No need to be an XOBJECT
public:
// Constructor
MULAR(PGLOBAL g, int n);
// Implementation
void SetPars(PARRAY par, int i) {Pars[i] = par;}
// Methods
virtual int Qcompare(int *i1, int *i2); // Sort compare routine
bool Sort(PGLOBAL g);
protected:
// Members
int Narray; // The number of sub-arrays
PARRAY *Pars; // To the block of real arrays
}; // end of class ARRAY
This diff is collapsed.
This diff is collapsed.
...@@ -43,6 +43,8 @@ typedef struct _colinfo { ...@@ -43,6 +43,8 @@ typedef struct _colinfo {
int Key; int Key;
int Precision; int Precision;
int Scale; int Scale;
int Opt;
int Freq;
char *Remark; char *Remark;
char *Datefmt; char *Datefmt;
char *Fieldfmt; char *Fieldfmt;
...@@ -82,7 +84,7 @@ class DllExport CATALOG { ...@@ -82,7 +84,7 @@ class DllExport CATALOG {
virtual bool TestCond(PGLOBAL g, const char *name, const char *type) virtual bool TestCond(PGLOBAL g, const char *name, const char *type)
{return true;} {return true;}
virtual bool DropTable(PGLOBAL g, PSZ name, bool erase) {return true;} virtual bool DropTable(PGLOBAL g, PSZ name, bool erase) {return true;}
virtual PTDB GetTable(PGLOBAL g, PTABLE tablep, virtual PTDB GetTable(PGLOBAL g, PTABLE tablep,
MODE mode = MODE_READ, LPCSTR type = NULL) MODE mode = MODE_READ, LPCSTR type = NULL)
{return NULL;} {return NULL;}
virtual void TableNames(PGLOBAL g, char *buffer, int maxbuf, int info[]) {} virtual void TableNames(PGLOBAL g, char *buffer, int maxbuf, int info[]) {}
......
This diff is collapsed.
...@@ -36,10 +36,13 @@ class DllExport COLBLK : public XOBJECT { ...@@ -36,10 +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;}
virtual int GetClustered(void) {return 0;}
virtual int IsClustered(void) {return FALSE;}
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;}
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);}
...@@ -48,17 +51,18 @@ class DllExport COLBLK : public XOBJECT { ...@@ -48,17 +51,18 @@ 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;}
PXCOL GetKcol(void) {return To_Kcol;}
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;}
PSZ GetDesc(void) {return (Cdp) ? Cdp->Desc : NULL;} PSZ GetDesc(void) {return (Cdp) ? Cdp->Desc : NULL;}
PSZ GetFmt(void) {return (Cdp) ? Cdp->Fmt : NULL;} PSZ GetFmt(void) {return (Cdp) ? Cdp->Fmt : NULL;}
bool IsUnsigned(void) {return Unsigned;} bool IsUnsigned(void) {return Unsigned;}
bool IsNullable(void) {return Nullable;}
bool IsVirtual(void) {return Cdp->IsVirtual();} bool IsVirtual(void) {return Cdp->IsVirtual();}
bool IsNullable(void) {return Nullable;}
void SetNullable(bool b) {Nullable = b;} void SetNullable(bool b) {Nullable = b;}
// Methods // Methods
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&);
...@@ -70,6 +74,7 @@ class DllExport COLBLK : public XOBJECT { ...@@ -70,6 +74,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);
virtual bool VarSize(void) {return false;}
bool InitValue(PGLOBAL g); bool InitValue(PGLOBAL g);
protected: protected:
...@@ -82,9 +87,11 @@ class DllExport COLBLK : public XOBJECT { ...@@ -82,9 +87,11 @@ class DllExport COLBLK : public XOBJECT {
bool Nullable; // True if nullable bool Nullable; // True if nullable
bool Unsigned; // True if unsigned bool Unsigned; // True if unsigned
int Index; // Column number in table int Index; // Column number in table
int Opt; // Cluster/sort information
int Buf_Type; // Data type int Buf_Type; // Data type
int Long; // Internal length in table int Long; // Internal length in table
int Precision; // Column length (as for ODBC) int Precision; // Column length (as for ODBC)
int Freq; // Evaluated ceiling of distinct values
FORMAT Format; // Output format FORMAT Format; // Output format
ushort ColUse; // Column usage ushort ColUse; // Column usage
ushort Status; // Column read status ushort Status; // Column read status
...@@ -100,7 +107,7 @@ class DllExport SPCBLK : public COLBLK { ...@@ -100,7 +107,7 @@ class DllExport SPCBLK : public COLBLK {
// Implementation // Implementation
virtual int GetAmType(void) = 0; virtual int GetAmType(void) = 0;
virtual bool GetRnm(void) {return false;} virtual bool GetRnm(void) {return false;}
// Methods // Methods
virtual bool IsSpecial(void) {return true;} virtual bool IsSpecial(void) {return true;}
...@@ -122,7 +129,7 @@ class DllExport RIDBLK : public SPCBLK { ...@@ -122,7 +129,7 @@ class DllExport RIDBLK : public SPCBLK {
// Implementation // Implementation
virtual int GetAmType(void) {return TYPE_AM_ROWID;} virtual int GetAmType(void) {return TYPE_AM_ROWID;}
virtual bool GetRnm(void) {return Rnm;} virtual bool GetRnm(void) {return Rnm;}
// Methods // Methods
virtual void ReadColumn(PGLOBAL g); virtual void ReadColumn(PGLOBAL g);
...@@ -137,7 +144,7 @@ class DllExport RIDBLK : public SPCBLK { ...@@ -137,7 +144,7 @@ class DllExport RIDBLK : public SPCBLK {
class DllExport FIDBLK : public SPCBLK { class DllExport FIDBLK : public SPCBLK {
public: public:
// Constructor // Constructor
FIDBLK(PCOLUMN cp); FIDBLK(PCOLUMN cp, OPVAL op);
// Implementation // Implementation
virtual int GetAmType(void) {return TYPE_AM_FILID;} virtual int GetAmType(void) {return TYPE_AM_FILID;}
...@@ -147,7 +154,8 @@ class DllExport FIDBLK : public SPCBLK { ...@@ -147,7 +154,8 @@ class DllExport FIDBLK : public SPCBLK {
virtual void ReadColumn(PGLOBAL g); virtual void ReadColumn(PGLOBAL g);
protected: protected:
PSZ Fn; // The current To_File of the table PSZ Fn; // The current To_File of the table
OPVAL Op; // The file part operator
}; // end of class FIDBLK }; // end of class FIDBLK
/***********************************************************************/ /***********************************************************************/
...@@ -173,6 +181,29 @@ class DllExport TIDBLK : public SPCBLK { ...@@ -173,6 +181,29 @@ class DllExport TIDBLK : public SPCBLK {
PSZ Tname; // The current table name PSZ Tname; // The current table name
}; // end of class TIDBLK }; // end of class TIDBLK
/***********************************************************************/
/* Class PRTBLK: PARTID special column descriptor. */
/***********************************************************************/
class DllExport PRTBLK : public SPCBLK {
public:
// Constructor
PRTBLK(PCOLUMN cp);
// Implementation
virtual int GetAmType(void) {return TYPE_AM_PRTID;}
// Methods
virtual void Reset(void) {} // This is a pseudo constant column
virtual void ReadColumn(PGLOBAL g);
protected:
// Default constructor not to be used
PRTBLK(void) {}
// Members
PSZ Pname; // The current partition name
}; // end of class PRTBLK
/***********************************************************************/ /***********************************************************************/
/* Class SIDBLK: SERVID special column descriptor. */ /* Class SIDBLK: SERVID special column descriptor. */
/***********************************************************************/ /***********************************************************************/
......
This diff is collapsed.
...@@ -33,10 +33,10 @@ bool CntCheckDB(PGLOBAL g, PHC handler, const char *pathname); ...@@ -33,10 +33,10 @@ bool CntCheckDB(PGLOBAL g, PHC handler, const char *pathname);
PTDB CntGetTDB(PGLOBAL g, const char *name, MODE xmod, PHC); PTDB CntGetTDB(PGLOBAL g, const char *name, MODE xmod, PHC);
bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE, char *, char *, bool, PHC); bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE, char *, char *, bool, PHC);
bool CntRewindTable(PGLOBAL g, PTDB tdbp); bool CntRewindTable(PGLOBAL g, PTDB tdbp);
int CntCloseTable(PGLOBAL g, PTDB tdbp); int CntCloseTable(PGLOBAL g, PTDB tdbp, bool nox, bool abort);
int CntIndexInit(PGLOBAL g, PTDB tdbp, int id); int CntIndexInit(PGLOBAL g, PTDB tdbp, int id);
RCODE CntReadNext(PGLOBAL g, PTDB tdbp); RCODE CntReadNext(PGLOBAL g, PTDB tdbp);
RCODE CntIndexRead(PGLOBAL g, PTDB, OPVAL op, const void *k, int n); RCODE CntIndexRead(PGLOBAL g, PTDB, OPVAL op, const void *k, int n, bool mrr);
RCODE CntWriteRow(PGLOBAL g, PTDB tdbp); RCODE CntWriteRow(PGLOBAL g, PTDB tdbp);
RCODE CntUpdateRow(PGLOBAL g, PTDB tdbp); RCODE CntUpdateRow(PGLOBAL g, PTDB tdbp);
RCODE CntDeleteRow(PGLOBAL g, PTDB tdbp, bool all); RCODE CntDeleteRow(PGLOBAL g, PTDB tdbp, bool all);
...@@ -58,9 +58,9 @@ class DOXDEF: public DOSDEF { ...@@ -58,9 +58,9 @@ class DOXDEF: public DOSDEF {
/***********************************************************************/ /***********************************************************************/
class TDBDOX: public TDBDOS { class TDBDOX: public TDBDOS {
friend int MakeIndex(PGLOBAL, PTDB, PIXDEF); friend int MakeIndex(PGLOBAL, PTDB, PIXDEF);
friend int CntCloseTable(PGLOBAL, PTDB); friend int CntCloseTable(PGLOBAL, PTDB, bool, bool);
friend int CntIndexInit(PGLOBAL, PTDB, int); friend int CntIndexInit(PGLOBAL, PTDB, int);
friend RCODE CntIndexRead(PGLOBAL, PTDB, OPVAL, const void*, int); friend RCODE CntIndexRead(PGLOBAL, PTDB, OPVAL, const void*, int, bool);
friend RCODE CntDeleteRow(PGLOBAL, PTDB, bool); friend RCODE CntDeleteRow(PGLOBAL, PTDB, bool);
friend int CntIndexRange(PGLOBAL, PTDB, const uchar**, uint*, friend int CntIndexRange(PGLOBAL, PTDB, const uchar**, uint*,
bool*, key_part_map*); bool*, key_part_map*);
......
/*********** File AM Map C++ Program Source Code File (.CPP) ***********/ /*********** File AM Map C++ Program Source Code File (.CPP) ***********/
/* PROGRAM NAME: FILAMAP */ /* PROGRAM NAME: FILAMAP */
/* ------------- */ /* ------------- */
/* 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: */
/* ----------------------- */ /* ----------------------- */
...@@ -129,9 +129,9 @@ bool MAPFAM::OpenTableFile(PGLOBAL g) ...@@ -129,9 +129,9 @@ bool MAPFAM::OpenTableFile(PGLOBAL g)
&& fp->Count && fp->Mode == mode) && fp->Count && fp->Mode == mode)
break; break;
if (trace) #ifdef DEBTRACE
htrc("Mapping file, fp=%p\n", fp); htrc("Mapping file, fp=%p\n", fp);
#endif
} else } else
fp = NULL; fp = NULL;
...@@ -322,8 +322,26 @@ int MAPFAM::ReadBuffer(PGLOBAL g) ...@@ -322,8 +322,26 @@ int MAPFAM::ReadBuffer(PGLOBAL g)
/*******************************************************************/ /*******************************************************************/
/* Record file position in case of UPDATE or DELETE. */ /* Record file position in case of UPDATE or DELETE. */
/*******************************************************************/ /*******************************************************************/
Fpos = Mempos; int rc;
CurBlk = (int)Rows++;
next:
Fpos = Mempos;
CurBlk = (int)Rows++;
/*******************************************************************/
/* 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
} else } else
Placed = false; Placed = false;
...@@ -382,7 +400,7 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc) ...@@ -382,7 +400,7 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc)
if (Tpos == Spos) if (Tpos == Spos)
/*******************************************************************/ /*******************************************************************/
/* First line to delete. Move of eventual preceding lines is */ /* First line to delete. Move of eventual preceeding lines is */
/* not required here, just setting of future Spos and Tpos. */ /* not required here, just setting of future Spos and Tpos. */
/*******************************************************************/ /*******************************************************************/
Tpos = Fpos; // Spos is set below Tpos = Fpos; // Spos is set below
...@@ -458,10 +476,10 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc) ...@@ -458,10 +476,10 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc)
/***********************************************************************/ /***********************************************************************/
/* Table file close routine for MAP access method. */ /* Table file close routine for MAP access method. */
/***********************************************************************/ /***********************************************************************/
void MAPFAM::CloseTableFile(PGLOBAL g) void MAPFAM::CloseTableFile(PGLOBAL g, bool abort)
{ {
PlugCloseFile(g, To_Fb); PlugCloseFile(g, To_Fb);
To_Fb = NULL; // To get correct file size in Cardinality To_Fb = NULL; // To get correct file size in Cardinality
if (trace) if (trace)
htrc("MAP Close: closing %s count=%d\n", htrc("MAP Close: closing %s count=%d\n",
...@@ -488,7 +506,7 @@ MBKFAM::MBKFAM(PDOSDEF tdp) : MAPFAM(tdp) ...@@ -488,7 +506,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();
BlkPos = NULL; BlkPos = tdp->GetTo_Pos();
CurNum = Nrec; CurNum = Nrec;
} // end of MBKFAM standard constructor } // end of MBKFAM standard constructor
...@@ -508,9 +526,7 @@ void MBKFAM::Reset(void) ...@@ -508,9 +526,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
/***********************************************************************/ /***********************************************************************/
...@@ -534,8 +550,49 @@ int MBKFAM::GetRowID(void) ...@@ -534,8 +550,49 @@ int MBKFAM::GetRowID(void)
/***********************************************************************/ /***********************************************************************/
int MBKFAM::ReadBuffer(PGLOBAL g) int MBKFAM::ReadBuffer(PGLOBAL g)
{ {
strcpy(g->Message, "This AM cannot be used in this version"); int len;
return RC_FX;
/*********************************************************************/
/* Sequential block reading when Placed is not true. */
/*********************************************************************/
if (Placed) {
Placed = false;
} else if (Mempos >= Top) { // Are we at the end of the memory
return RC_EF;
} else if (++CurNum < Nrec) {
Fpos = Mempos;
} else {
/*******************************************************************/
/* New block. */
/*******************************************************************/
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
// Immediately calculate next position (Used by DeleteDB)
while (*Mempos++ != '\n') ; // What about Unix ???
// Set caller line buffer
len = (Mempos - Fpos) - Ending;
memcpy(Tdbp->GetLine(), Fpos, len);
Tdbp->GetLine()[len] = '\0';
return RC_OK;
} // end of ReadBuffer } // end of ReadBuffer
/***********************************************************************/ /***********************************************************************/
...@@ -618,17 +675,29 @@ int MPXFAM::ReadBuffer(PGLOBAL g) ...@@ -618,17 +675,29 @@ int MPXFAM::ReadBuffer(PGLOBAL g)
Placed = false; Placed = false;
} else if (Mempos >= Top) { // Are we at the end of the memory } else if (Mempos >= Top) { // Are we at the end of the memory
return RC_EF; return RC_EF;
} else if (++CurNum < Nrec) { } else if (++CurNum < Nrec) {
Fpos = Mempos; Fpos = Mempos;
} else { } else {
/*******************************************************************/ /*******************************************************************/
/* New block. */ /* New block. */
/*******************************************************************/ /*******************************************************************/
CurNum = 0; 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
if (++CurBlk >= Block)
return RC_EF;
Fpos = Mempos = Headlen + Memory + CurBlk * Blksize; Fpos = Mempos = Headlen + Memory + CurBlk * Blksize;
} // endif's } // endif's
......
/*************** FilAMap H Declares Source Code File (.H) **************/ /*************** FilAMap H Declares Source Code File (.H) **************/
/* Name: FILAMAP.H Version 1.2 */ /* Name: FILAMAP.H Version 1.2 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 2005-2012 */ /* (C) Copyright to the author Olivier BERTRAND 2005-2012 */
/* */ /* */
/* This file contains the MAP file access method classes declares. */ /* This file contains the MAP file access method classes declares. */
/***********************************************************************/ /***********************************************************************/
#ifndef __FILAMAP_H #ifndef __FILAMAP_H
#define __FILAMAP_H #define __FILAMAP_H
#include "block.h" #include "block.h"
#include "filamtxt.h" #include "filamtxt.h"
typedef class MAPFAM *PMAPFAM; typedef class MAPFAM *PMAPFAM;
/***********************************************************************/ /***********************************************************************/
/* This is the variable file access method using file mapping. */ /* This is the variable file access method using file mapping. */
/***********************************************************************/ /***********************************************************************/
class DllExport MAPFAM : public TXTFAM { class DllExport MAPFAM : public TXTFAM {
public: public:
// Constructor // Constructor
MAPFAM(PDOSDEF tdp); MAPFAM(PDOSDEF tdp);
MAPFAM(PMAPFAM tmfp); MAPFAM(PMAPFAM tmfp);
// Implementation // Implementation
virtual AMT GetAmType(void) {return TYPE_AM_MAP;} virtual AMT GetAmType(void) {return TYPE_AM_MAP;}
virtual int GetPos(void); virtual int GetPos(void);
virtual int GetNextPos(void); virtual int GetNextPos(void);
virtual PTXF Duplicate(PGLOBAL g) virtual PTXF Duplicate(PGLOBAL g)
{return (PTXF)new(g) MAPFAM(this);} {return (PTXF)new(g) MAPFAM(this);}
// Methods // Methods
virtual void Reset(void); virtual void Reset(void);
virtual int GetFileLength(PGLOBAL g); virtual int GetFileLength(PGLOBAL g);
virtual int Cardinality(PGLOBAL g) {return (g) ? -1 : 0;} virtual int Cardinality(PGLOBAL g) {return (g) ? -1 : 0;}
virtual int GetRowID(void); virtual int MaxBlkSize(PGLOBAL g, int s) {return s;}
virtual bool RecordPos(PGLOBAL g); virtual int GetRowID(void);
virtual bool SetPos(PGLOBAL g, int recpos); virtual bool RecordPos(PGLOBAL g);
virtual int SkipRecord(PGLOBAL g, bool header); virtual bool SetPos(PGLOBAL g, int recpos);
virtual bool OpenTableFile(PGLOBAL g); virtual int SkipRecord(PGLOBAL g, bool header);
virtual bool DeferReading(void) {return false;} virtual bool OpenTableFile(PGLOBAL g);
virtual int ReadBuffer(PGLOBAL g); virtual bool DeferReading(void) {return false;}
virtual int WriteBuffer(PGLOBAL g); virtual int ReadBuffer(PGLOBAL g);
virtual int DeleteRecords(PGLOBAL g, int irc); virtual int WriteBuffer(PGLOBAL g);
virtual void CloseTableFile(PGLOBAL g); virtual int DeleteRecords(PGLOBAL g, int irc);
virtual void Rewind(void); virtual void CloseTableFile(PGLOBAL g, bool abort);
virtual void Rewind(void);
protected:
// Members protected:
char *Memory; // Pointer on file mapping view. // Members
char *Mempos; // Position of next data to read char *Memory; // Pointer on file mapping view.
char *Fpos; // Position of last read record char *Mempos; // Position of next data to read
char *Tpos; // Target Position for delete move char *Fpos; // Position of last read record
char *Spos; // Start position for delete move char *Tpos; // Target Position for delete move
char *Top; // Mark end of file mapping view char *Spos; // Start position for delete move
}; // end of class MAPFAM char *Top; // Mark end of file mapping view
}; // end of class MAPFAM
/***********************************************************************/
/* This is the blocked file access method using file mapping. */ /***********************************************************************/
/***********************************************************************/ /* This is the blocked file access method using file mapping. */
class DllExport MBKFAM : public MAPFAM { /***********************************************************************/
public: class DllExport MBKFAM : public MAPFAM {
// Constructor public:
MBKFAM(PDOSDEF tdp); // Constructor
MBKFAM(PMAPFAM tmfp) : MAPFAM(tmfp) {} MBKFAM(PDOSDEF tdp);
MBKFAM(PMAPFAM tmfp) : MAPFAM(tmfp) {}
// Implementation
virtual PTXF Duplicate(PGLOBAL g) // Implementation
{return (PTXF)new(g) MBKFAM(this);} virtual PTXF Duplicate(PGLOBAL g)
{return (PTXF)new(g) MBKFAM(this);}
// Methods
virtual void Reset(void); // Methods
virtual int Cardinality(PGLOBAL g); virtual void Reset(void);
virtual int GetRowID(void); virtual int Cardinality(PGLOBAL g);
virtual int SkipRecord(PGLOBAL g, bool header); virtual int MaxBlkSize(PGLOBAL g, int s)
virtual int ReadBuffer(PGLOBAL g); {return TXTFAM::MaxBlkSize(g, s);}
virtual void Rewind(void); virtual int GetRowID(void);
virtual int SkipRecord(PGLOBAL g, bool header);
protected: virtual int ReadBuffer(PGLOBAL g);
// No additional members virtual void Rewind(void);
}; // end of class MBKFAM
protected:
/***********************************************************************/ // No additional members
/* This is the fixed file access method using file mapping. */ }; // end of class MBKFAM
/***********************************************************************/
class DllExport MPXFAM : public MBKFAM { /***********************************************************************/
public: /* This is the fixed file access method using file mapping. */
// Constructor /***********************************************************************/
MPXFAM(PDOSDEF tdp); class DllExport MPXFAM : public MBKFAM {
MPXFAM(PMAPFAM tmfp) : MBKFAM(tmfp) {} public:
// Constructor
// Implementation MPXFAM(PDOSDEF tdp);
virtual int GetPos(void); MPXFAM(PMAPFAM tmfp) : MBKFAM(tmfp) {}
virtual PTXF Duplicate(PGLOBAL g)
{return (PTXF)new(g) MPXFAM(this);} // Implementation
virtual int GetPos(void);
// Methods virtual PTXF Duplicate(PGLOBAL g)
virtual int Cardinality(PGLOBAL g) {return TXTFAM::Cardinality(g);} {return (PTXF)new(g) MPXFAM(this);}
virtual bool SetPos(PGLOBAL g, int recpos);
virtual bool DeferReading(void) {return false;} // Methods
virtual int ReadBuffer(PGLOBAL g); virtual int Cardinality(PGLOBAL g) {return TXTFAM::Cardinality(g);}
virtual int WriteBuffer(PGLOBAL g); virtual int MaxBlkSize(PGLOBAL g, int s)
{return TXTFAM::MaxBlkSize(g, s);}
protected: virtual bool SetPos(PGLOBAL g, int recpos);
// No additional members virtual bool DeferReading(void) {return false;}
}; // end of class MPXFAM virtual int ReadBuffer(PGLOBAL g);
virtual int WriteBuffer(PGLOBAL g);
#endif // __FILAMAP_H
protected:
// No additional members
}; // end of class MPXFAM
#endif // __FILAMAP_H
...@@ -791,7 +791,7 @@ void DBFFAM::Rewind(void) ...@@ -791,7 +791,7 @@ void DBFFAM::Rewind(void)
/***********************************************************************/ /***********************************************************************/
/* Table file close routine for DBF access method. */ /* Table file close routine for DBF access method. */
/***********************************************************************/ /***********************************************************************/
void DBFFAM::CloseTableFile(PGLOBAL g) void DBFFAM::CloseTableFile(PGLOBAL g, bool abort)
{ {
int rc = RC_OK, wrc = RC_OK; int rc = RC_OK, wrc = RC_OK;
MODE mode = Tdbp->GetMode(); MODE mode = Tdbp->GetMode();
...@@ -810,17 +810,17 @@ void DBFFAM::CloseTableFile(PGLOBAL g) ...@@ -810,17 +810,17 @@ void DBFFAM::CloseTableFile(PGLOBAL g)
} // endif Modif } // endif Modif
if (UseTemp && T_Stream && wrc == RC_OK) { if (UseTemp && T_Stream && wrc == RC_OK) {
// Copy any remaining lines if (!abort) {
bool b; // Copy any remaining lines
bool b;
Fpos = Tdbp->Cardinality(g);
Fpos = Tdbp->Cardinality(g);
if ((rc = MoveIntermediateLines(g, &b)) == RC_OK) { abort = MoveIntermediateLines(g, &b) != RC_OK;
// Delete the old file and rename the new temp file. } // endif abort
RenameTempFile(g);
goto fin;
} // endif rc
// Delete the old file and rename the new temp file.
RenameTempFile(g, abort);
goto fin;
} // endif UseTemp } // endif UseTemp
} // endif's mode } // endif's mode
......
...@@ -67,7 +67,7 @@ class DllExport DBFFAM : public FIXFAM, public DBFBASE { ...@@ -67,7 +67,7 @@ class DllExport DBFFAM : public FIXFAM, public DBFBASE {
virtual void ResetBuffer(PGLOBAL g); virtual void ResetBuffer(PGLOBAL g);
virtual int ReadBuffer(PGLOBAL g); virtual int ReadBuffer(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, bool abort);
virtual void Rewind(void); virtual void Rewind(void);
protected: protected:
......
...@@ -169,9 +169,20 @@ int FIXFAM::ReadBuffer(PGLOBAL g) ...@@ -169,9 +169,20 @@ int FIXFAM::ReadBuffer(PGLOBAL g)
CurNum = 0; CurNum = 0;
Tdbp->SetLine(To_Buf); Tdbp->SetLine(To_Buf);
next:
if (++CurBlk >= Block) if (++CurBlk >= Block)
return RC_EF; return RC_EF;
/*****************************************************************/
/* Before reading a new block, check whether block indexing */
/* 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's } // endif's
if (OldBlk == CurBlk) { if (OldBlk == CurBlk) {
...@@ -304,8 +315,7 @@ int FIXFAM::WriteBuffer(PGLOBAL g) ...@@ -304,8 +315,7 @@ int FIXFAM::WriteBuffer(PGLOBAL g)
} else { // Mode == MODE_UPDATE } else { // Mode == MODE_UPDATE
// T_Stream is the temporary stream or the table file stream itself // T_Stream is the temporary stream or the table file stream itself
if (!T_Stream) if (!T_Stream) {
{
if (UseTemp /*&& Tdbp->GetMode() == MODE_UPDATE*/) { if (UseTemp /*&& Tdbp->GetMode() == MODE_UPDATE*/) {
if (OpenTempFile(g)) if (OpenTempFile(g))
return RC_FX; return RC_FX;
...@@ -315,7 +325,9 @@ int FIXFAM::WriteBuffer(PGLOBAL g) ...@@ -315,7 +325,9 @@ int FIXFAM::WriteBuffer(PGLOBAL g)
} else } else
T_Stream = Stream; T_Stream = Stream;
}
} // endif T_Stream
Modif++; // Modified line in Update mode Modif++; // Modified line in Update mode
} // endif Mode } // endif Mode
...@@ -409,7 +421,7 @@ int FIXFAM::DeleteRecords(PGLOBAL g, int irc) ...@@ -409,7 +421,7 @@ int FIXFAM::DeleteRecords(PGLOBAL g, int irc)
/*****************************************************************/ /*****************************************************************/
/* Ok, now delete old file and rename new temp file. */ /* Ok, now delete old file and rename new temp file. */
/*****************************************************************/ /*****************************************************************/
if (RenameTempFile(g)) if (RenameTempFile(g, false))
return RC_FX; return RC_FX;
} else { } else {
...@@ -516,7 +528,7 @@ bool FIXFAM::MoveIntermediateLines(PGLOBAL g, bool *b) ...@@ -516,7 +528,7 @@ bool FIXFAM::MoveIntermediateLines(PGLOBAL g, bool *b)
/***********************************************************************/ /***********************************************************************/
/* Table file close routine for FIX access method. */ /* Table file close routine for FIX access method. */
/***********************************************************************/ /***********************************************************************/
void FIXFAM::CloseTableFile(PGLOBAL g) void FIXFAM::CloseTableFile(PGLOBAL g, bool abort)
{ {
int rc = RC_OK, wrc = RC_OK; int rc = RC_OK, wrc = RC_OK;
MODE mode = Tdbp->GetMode(); MODE mode = Tdbp->GetMode();
...@@ -535,17 +547,17 @@ void FIXFAM::CloseTableFile(PGLOBAL g) ...@@ -535,17 +547,17 @@ void FIXFAM::CloseTableFile(PGLOBAL g)
} // endif Modif } // endif Modif
if (UseTemp && T_Stream && wrc == RC_OK) { if (UseTemp && T_Stream && wrc == RC_OK) {
// Copy any remaining lines if (!abort) {
bool b; // Copy any remaining lines
bool b;
Fpos = Tdbp->Cardinality(g);
Fpos = Tdbp->Cardinality(g);
if ((rc = MoveIntermediateLines(g, &b)) == RC_OK) { abort = MoveIntermediateLines(g, &b) != RC_OK;
// Delete the old file and rename the new temp file. } // endif // abort
RenameTempFile(g);
goto fin; // Delete the old file and rename the new temp file.
} // endif rc RenameTempFile(g, abort);
goto fin;
} // endif UseTemp } // endif UseTemp
} // endif's mode } // endif's mode
...@@ -1013,9 +1025,21 @@ int BGXFAM::ReadBuffer(PGLOBAL g) ...@@ -1013,9 +1025,21 @@ int BGXFAM::ReadBuffer(PGLOBAL g)
CurNum = 0; CurNum = 0;
Tdbp->SetLine(To_Buf); Tdbp->SetLine(To_Buf);
next:
if (++CurBlk >= Block) if (++CurBlk >= Block)
return RC_EF; 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
} // endif's } // endif's
if (OldBlk == CurBlk) { if (OldBlk == CurBlk) {
...@@ -1222,7 +1246,7 @@ int BGXFAM::DeleteRecords(PGLOBAL g, int irc) ...@@ -1222,7 +1246,7 @@ int BGXFAM::DeleteRecords(PGLOBAL g, int irc)
/*****************************************************************/ /*****************************************************************/
/* Ok, now delete old file and rename new temp file. */ /* Ok, now delete old file and rename new temp file. */
/*****************************************************************/ /*****************************************************************/
if (RenameTempFile(g)) if (RenameTempFile(g, false))
return RC_FX; return RC_FX;
} else { } else {
...@@ -1352,7 +1376,7 @@ bool BGXFAM::MoveIntermediateLines(PGLOBAL g, bool *b) ...@@ -1352,7 +1376,7 @@ bool BGXFAM::MoveIntermediateLines(PGLOBAL g, bool *b)
/***********************************************************************/ /***********************************************************************/
/* Data Base close routine for BIGFIX access method. */ /* Data Base close routine for BIGFIX access method. */
/***********************************************************************/ /***********************************************************************/
void BGXFAM::CloseTableFile(PGLOBAL g) void BGXFAM::CloseTableFile(PGLOBAL g, bool abort)
{ {
int rc = RC_OK, wrc = RC_OK; int rc = RC_OK, wrc = RC_OK;
MODE mode = Tdbp->GetMode(); MODE mode = Tdbp->GetMode();
...@@ -1370,17 +1394,17 @@ void BGXFAM::CloseTableFile(PGLOBAL g) ...@@ -1370,17 +1394,17 @@ void BGXFAM::CloseTableFile(PGLOBAL g)
} // endif Modif } // endif Modif
if (UseTemp && Tfile && wrc == RC_OK) { if (UseTemp && Tfile && wrc == RC_OK) {
// Copy any remaining lines if (!abort) {
bool b; // Copy any remaining lines
bool b;
Fpos = Tdbp->Cardinality(g);
Fpos = Tdbp->Cardinality(g);
if ((rc = MoveIntermediateLines(g, &b)) == RC_OK) { abort = MoveIntermediateLines(g, &b) != RC_OK;
// Delete the old file and rename the new temp file. } // endif abort
RenameTempFile(g);
goto fin; // Delete the old file and rename the new temp file.
} // endif rc RenameTempFile(g, abort);
goto fin;
} // endif UseTemp } // endif UseTemp
} // endif's mode } // endif's mode
......
/************** 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. */
/***********************************************************************/ /***********************************************************************/
#ifndef __FILAMFIX_H #ifndef __FILAMFIX_H
#define __FILAMFIX_H #define __FILAMFIX_H
#include "filamtxt.h" #include "filamtxt.h"
typedef class FIXFAM *PFIXFAM; typedef class FIXFAM *PFIXFAM;
typedef class BGXFAM *PBGXFAM; typedef class BGXFAM *PBGXFAM;
/***********************************************************************/ /***********************************************************************/
/* This is the DOS/UNIX Access Method class declaration for standard */ /* This is the DOS/UNIX Access Method class declaration for standard */
/* files with fixed record format (FIX, BIN) */ /* files with fixed record format (FIX, BIN) */
/***********************************************************************/ /***********************************************************************/
class DllExport FIXFAM : public BLKFAM { class DllExport FIXFAM : public BLKFAM {
public: public:
// Constructor // Constructor
FIXFAM(PDOSDEF tdp); FIXFAM(PDOSDEF tdp);
FIXFAM(PFIXFAM txfp); FIXFAM(PFIXFAM txfp);
// Implementation // Implementation
virtual AMT GetAmType(void) {return TYPE_AM_FIX;} virtual AMT GetAmType(void) {return TYPE_AM_FIX;}
virtual PTXF Duplicate(PGLOBAL g) virtual PTXF Duplicate(PGLOBAL g)
{return (PTXF)new(g) FIXFAM(this);} {return (PTXF)new(g) FIXFAM(this);}
// Methods // Methods
virtual int Cardinality(PGLOBAL g) {return TXTFAM::Cardinality(g);} virtual int Cardinality(PGLOBAL g) {return TXTFAM::Cardinality(g);}
virtual bool AllocateBuffer(PGLOBAL g); virtual int MaxBlkSize(PGLOBAL g, int s)
virtual void ResetBuffer(PGLOBAL g); {return TXTFAM::MaxBlkSize(g, s);}
virtual int ReadBuffer(PGLOBAL g); virtual bool AllocateBuffer(PGLOBAL g);
virtual int WriteBuffer(PGLOBAL g); virtual void ResetBuffer(PGLOBAL g);
virtual int DeleteRecords(PGLOBAL g, int irc); virtual int ReadBuffer(PGLOBAL g);
virtual void CloseTableFile(PGLOBAL g); virtual int WriteBuffer(PGLOBAL g);
virtual int DeleteRecords(PGLOBAL g, int irc);
protected: virtual void CloseTableFile(PGLOBAL g, bool abort);
virtual bool CopyHeader(PGLOBAL g) {return false;}
virtual bool MoveIntermediateLines(PGLOBAL g, bool *b); protected:
virtual bool CopyHeader(PGLOBAL g) {return false;}
// No additional members virtual bool MoveIntermediateLines(PGLOBAL g, bool *b);
}; // end of class FIXFAM
// No additional members
}; // end of class FIXFAM
/***********************************************************************/
/* This is the DOS/UNIX Access Method class declaration for files */
/* that are standard files with columns starting at fixed offset */ /***********************************************************************/
/* This class is for fixed formatted files of more than 2 gigabytes. */ /* This is the DOS/UNIX Access Method class declaration for files */
/***********************************************************************/ /* that are standard files with columns starting at fixed offset */
class BGXFAM : public FIXFAM { /* This class is for fixed formatted files of more than 2 gigabytes. */
public: /***********************************************************************/
// Constructor class BGXFAM : public FIXFAM {
BGXFAM(PDOSDEF tdp); public:
BGXFAM(PBGXFAM txfp); // Constructor
BGXFAM(PDOSDEF tdp);
// Implementation BGXFAM(PBGXFAM txfp);
virtual PTXF Duplicate(PGLOBAL g)
{return (PTXF)new(g) BGXFAM(this);} // Implementation
virtual PTXF Duplicate(PGLOBAL g)
// Methods {return (PTXF)new(g) BGXFAM(this);}
virtual int Cardinality(PGLOBAL g);
virtual bool OpenTableFile(PGLOBAL g); // Methods
virtual int ReadBuffer(PGLOBAL g); virtual int Cardinality(PGLOBAL g);
virtual int WriteBuffer(PGLOBAL g); virtual bool OpenTableFile(PGLOBAL g);
virtual int DeleteRecords(PGLOBAL g, int irc); virtual int ReadBuffer(PGLOBAL g);
virtual void CloseTableFile(PGLOBAL g); virtual int WriteBuffer(PGLOBAL g);
virtual void Rewind(void); virtual int DeleteRecords(PGLOBAL g, int irc);
virtual void CloseTableFile(PGLOBAL g, bool abort);
protected: virtual void Rewind(void);
bool BigSeek(PGLOBAL g, HANDLE h, BIGINT pos
, int org = FILE_BEGIN); protected:
int BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req); bool BigSeek(PGLOBAL g, HANDLE h, BIGINT pos
bool BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req); , int org = FILE_BEGIN);
virtual bool OpenTempFile(PGLOBAL g); int BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req);
virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL); bool BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req);
virtual bool OpenTempFile(PGLOBAL g);
// Members virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL);
HANDLE Hfile; // Handle(descriptor) to big file
HANDLE Tfile; // Handle(descriptor) to big temp file // Members
}; // end of class BGXFAM HANDLE Hfile; // Handle(descriptor) to big file
HANDLE Tfile; // Handle(descriptor) to big temp file
#endif // __FILAMFIX_H }; // end of class BGXFAM
#endif // __FILAMFIX_H
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/***********************************************************************/ /***********************************************************************/
/* GLOBAL.H: Declaration file used by all CONNECT implementations. */ /* GLOBAL.H: Declaration file used by all CONNECT implementations. */
/* (C) Copyright Olivier Bertrand 1993-2012 */ /* (C) Copyright Olivier Bertrand 1993-2014 */
/***********************************************************************/ /***********************************************************************/
/***********************************************************************/ /***********************************************************************/
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
#define XML_SUPPORT 1 #define XML_SUPPORT 1
#endif #endif
#if defined(XMSG) #if defined(XMSG)
// Definition used to read messages from message file. // Definition used to read messages from message file.
#include "msgid.h" #include "msgid.h"
#define MSG(I) PlugReadMessage(NULL, MSG_##I, #I) #define MSG(I) PlugReadMessage(NULL, MSG_##I, #I)
#define STEP(I) PlugReadMessage(g, MSG_##I, #I) #define STEP(I) PlugReadMessage(g, MSG_##I, #I)
#elif defined(NEWMSG) #elif defined(NEWMSG)
// Definition used to get messages from resource. // Definition used to get messages from resource.
#include "msgid.h" #include "msgid.h"
#define MSG(I) PlugGetMessage(NULL, MSG_##I) #define MSG(I) PlugGetMessage(NULL, MSG_##I)
...@@ -223,6 +223,7 @@ typedef struct _global { /* Global structure */ ...@@ -223,6 +223,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 */
short Mrr; /* True when doing mrr */
short Trace; short Trace;
int jump_level; int jump_level;
jmp_buf jumper[MAX_JUMP + 2]; jmp_buf jumper[MAX_JUMP + 2];
......
This diff is collapsed.
This diff is collapsed.
...@@ -571,6 +571,7 @@ PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode, LPCSTR type) ...@@ -571,6 +571,7 @@ PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode, LPCSTR type)
tdbp->GetAmType()); tdbp->GetAmType());
tablep->SetTo_Tdb(tdbp); tablep->SetTo_Tdb(tdbp);
tdbp->SetTable(tablep); tdbp->SetTable(tablep);
tdbp->SetMode(mode);
} // endif tdbp } // endif tdbp
return (tdbp); return (tdbp);
......
This diff is collapsed.
...@@ -64,6 +64,7 @@ class DllItem MYSQLC { ...@@ -64,6 +64,7 @@ class DllItem MYSQLC {
// Methods // Methods
int GetResultSize(PGLOBAL g, PSZ sql); int GetResultSize(PGLOBAL g, PSZ sql);
int GetTableSize(PGLOBAL g, PSZ query);
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);
......
...@@ -21,8 +21,8 @@ DROP INDEX xd ON t1; ...@@ -21,8 +21,8 @@ DROP INDEX xd ON t1;
ALTER TABLE t1 ADD INDEX xc (c), ADD INDEX xd (d); ALTER TABLE t1 ADD INDEX xc (c), ADD INDEX xd (d);
SHOW INDEX FROM t1; SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 xc 1 c A NULL NULL NULL XPLUG t1 1 xc 1 c A NULL NULL NULL XINDEX
t1 1 xd 1 d A NULL NULL NULL XPLUG t1 1 xd 1 d A NULL NULL NULL XINDEX
ALTER TABLE t1 DROP INDEX xc, DROP INDEX xd; ALTER TABLE t1 DROP INDEX xc, DROP INDEX xd;
SHOW INDEX FROM t1; SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
...@@ -111,8 +111,8 @@ t1 CREATE TABLE `t1` ( ...@@ -111,8 +111,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF
SHOW INDEX FROM t1; SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 xc 1 c A NULL NULL NULL XPLUG t1 1 xc 1 c A NULL NULL NULL XINDEX
t1 1 xd 1 d A NULL NULL NULL XPLUG t1 1 xd 1 d A NULL NULL NULL XINDEX
SELECT * FROM t1; SELECT * FROM t1;
c d c d
1 One 1 One
...@@ -143,8 +143,8 @@ line ...@@ -143,8 +143,8 @@ line
ALTER TABLE t1 ADD INDEX xc (c), ADD INDEX xd (d); ALTER TABLE t1 ADD INDEX xc (c), ADD INDEX xd (d);
SHOW INDEX FROM t1; SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 xc 1 c A NULL NULL NULL XPLUG t1 1 xc 1 c A NULL NULL NULL XINDEX
t1 1 xd 1 d A NULL NULL NULL XPLUG t1 1 xd 1 d A NULL NULL NULL XINDEX
SELECT d FROM t1 WHERE c = 2; SELECT d FROM t1 WHERE c = 2;
d d
Two Two
...@@ -249,7 +249,7 @@ line ...@@ -249,7 +249,7 @@ line
# Sure enough, the data file was not deleted. # Sure enough, the data file was not deleted.
# #
ALTER TABLE t1 ENGINE=CONNECT; ALTER TABLE t1 ENGINE=CONNECT;
ERROR HY000: Operation denied. Table data would be lost. ERROR HY000: Operation denied. Table data would be modified.
# #
# But changing back to CONNECT succeed # But changing back to CONNECT succeed
# if the data file does not exist. # if the data file does not exist.
......
...@@ -35,7 +35,7 @@ Warning 1105 No table_type. Will be set to DOS ...@@ -35,7 +35,7 @@ Warning 1105 No table_type. Will be set to DOS
SELECT * FROM t2; SELECT * FROM t2;
line line
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Created by CONNECT Version 1.02.0002 March 16, 2014 --> <!-- Created by the MariaDB CONNECT Storage Engine-->
<t1> <t1>
<row> <row>
<TH>c</TH> <TH>c</TH>
...@@ -71,7 +71,7 @@ t1 CREATE TABLE `t1` ( ...@@ -71,7 +71,7 @@ t1 CREATE TABLE `t1` (
SELECT * FROM t2; SELECT * FROM t2;
line line
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Created by CONNECT Version 1.02.0002 March 16, 2014 --> <!-- Created by the MariaDB CONNECT Storage Engine-->
<t1> <t1>
<row d="One"> <row d="One">
<c>1</c> <c>1</c>
......
...@@ -193,8 +193,6 @@ Kevin 8 ...@@ -193,8 +193,6 @@ Kevin 8
Lisbeth 2 Lisbeth 2
Mary 2 Mary 2
ALTER TABLE xpet MODIFY number INT NOT NULL; ALTER TABLE xpet MODIFY number INT NOT NULL;
Warnings:
Warning 1105 This is an outward table, table data were not modified.
SELECT * FROM xpet; SELECT * FROM xpet;
name race number name race number
John dog 2 John dog 2
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*************** Tabxml H Declares Source Code File (.H) ***************/ /*************** Tabxml H Declares Source Code File (.H) ***************/
/* Name: TABXML.H Version 1.6 */ /* Name: TABXML.H Version 1.6 */
/* */ /* */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment