Get rid of GCC warnings about unused parameters

modified:   storage/connect/array.cpp
  modified:   storage/connect/blkfil.cpp
  modified:   storage/connect/block.h
  modified:   storage/connect/catalog.h
  modified:   storage/connect/colblk.cpp
  modified:   storage/connect/colblk.h
  modified:   storage/connect/connect.cc
  modified:   storage/connect/filamap.cpp
  modified:   storage/connect/filamdbf.cpp
  modified:   storage/connect/filamfix.cpp
  modified:   storage/connect/filamtxt.cpp
  modified:   storage/connect/filamtxt.h
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filter.h
  modified:   storage/connect/ha_connect.c
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/mycat.h
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/reldef.h
  modified:   storage/connect/tabcol.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabfmt.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  modified:   storage/connect/table.cpp
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmysql.cpp
  modified:   storage/connect/tabmysql.h
  modified:   storage/connect/taboccur.cpp
  modified:   storage/connect/tabpivot.cpp
  modified:   storage/connect/tabsys.cpp
  modified:   storage/connect/tabtbl.cpp
  modified:   storage/connect/tabtbl.h
  modified:   storage/connect/tabutil.cpp
  modified:   storage/connect/tabutil.h
  modified:   storage/connect/tabvct.cpp
  modified:   storage/connect/tabvir.cpp
  modified:   storage/connect/tabvir.h
  modified:   storage/connect/tabxcl.cpp
  modified:   storage/connect/tabxcl.h
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/tabxml.h
  modified:   storage/connect/valblk.cpp
  modified:   storage/connect/valblk.h
  modified:   storage/connect/value.cpp
  modified:   storage/connect/value.h
  modified:   storage/connect/xindex.cpp
  modified:   storage/connect/xindex.h
  modified:   storage/connect/xobject.h
  modified:   storage/connect/xtable.h
This commit is contained in:
Olivier Bertrand 2015-05-10 11:58:23 +02:00
parent 1db5b849ab
commit 9dee994d99
60 changed files with 818 additions and 867 deletions

View file

@ -1,7 +1,7 @@
/************* Array C++ Functions Source Code File (.CPP) *************/
/* Name: ARRAY.CPP Version 2.3 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */
/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */
/* */
/* This file contains the XOBJECT derived class ARRAY functions. */
/* ARRAY is used for elaborate type of processing, such as sorting */
@ -186,7 +186,7 @@ ARRAY::ARRAY(PGLOBAL g, int type, int size, int length, int prec)
// The error message was built by PlgDBalloc
Type = TYPE_ERROR;
else if (type != TYPE_PCHAR)
Value = AllocateValue(g, type, Len, prec, NULL);
Value = AllocateValue(g, type, Len, prec);
Constant = TRUE;
} // end of ARRAY constructor
@ -610,7 +610,7 @@ int ARRAY::Convert(PGLOBAL g, int k, PVAL vp)
// The error message was built by PlgDBalloc
return TYPE_ERROR;
else
Value = AllocateValue(g, Type, Len, prec, NULL);
Value = AllocateValue(g, Type, Len, prec);
/*********************************************************************/
/* Converting STRING to DATE can be done according to date format. */
@ -848,7 +848,7 @@ void *ARRAY::GetSortIndex(PGLOBAL g)
/* the indication of whether the Find will be always true, always not */
/* true or other. */
/***********************************************************************/
int ARRAY::BlockTest(PGLOBAL g, int opc, int opm,
int ARRAY::BlockTest(PGLOBAL, int opc, int opm,
void *minp, void *maxp, bool s)
{
bool bin, bax, pin, pax, veq, all = (opm == 2);
@ -1038,7 +1038,7 @@ void ARRAY::Print(PGLOBAL g, FILE *f, uint n)
/***********************************************************************/
/* Make string output of ARRAY contents. */
/***********************************************************************/
void ARRAY::Print(PGLOBAL g, char *ps, uint z)
void ARRAY::Print(PGLOBAL, char *ps, uint z)
{
if (z < 16)
return;

View file

@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2004-2014 */
/* (C) Copyright to the author Olivier BERTRAND 2004-2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -56,7 +56,7 @@ BLOCKFILTER::BLOCKFILTER(PTDBDOS tdbp, int op)
/***********************************************************************/
/* Make file output of BLOCKFILTER contents. */
/***********************************************************************/
void BLOCKFILTER::Print(PGLOBAL g, FILE *f, uint n)
void BLOCKFILTER::Print(PGLOBAL, FILE *f, uint n)
{
char m[64];
@ -70,7 +70,7 @@ void BLOCKFILTER::Print(PGLOBAL g, FILE *f, uint n)
/***********************************************************************/
/* Make string output of BLOCKFILTER contents. */
/***********************************************************************/
void BLOCKFILTER::Print(PGLOBAL g, char *ps, uint z)
void BLOCKFILTER::Print(PGLOBAL, char *ps, uint z)
{
strncat(ps, "BlockFilter(s)", z);
} // end of Print
@ -186,7 +186,7 @@ void BLKFILARI::Reset(PGLOBAL g)
/***********************************************************************/
/* Evaluate block filter for arithmetic operators. */
/***********************************************************************/
int BLKFILARI::BlockEval(PGLOBAL g)
int BLKFILARI::BlockEval(PGLOBAL)
{
int mincmp, maxcmp, n;
@ -306,7 +306,7 @@ void BLKFILAR2::MakeValueBitmap(void)
/***********************************************************************/
/* Evaluate XDB2 block filter for arithmetic operators. */
/***********************************************************************/
int BLKFILAR2::BlockEval(PGLOBAL g)
int BLKFILAR2::BlockEval(PGLOBAL)
{
#if defined(_DEBUG)
assert (Colp->IsClustered());
@ -428,7 +428,7 @@ void BLKFILMR2::MakeValueBitmap(void)
/***********************************************************************/
/* Evaluate XDB2 block filter for arithmetic operators. */
/***********************************************************************/
int BLKFILMR2::BlockEval(PGLOBAL g)
int BLKFILMR2::BlockEval(PGLOBAL)
{
#if defined(_DEBUG)
assert (Colp->IsClustered());
@ -514,7 +514,7 @@ void BLKSPCARI::Reset(PGLOBAL g)
/***********************************************************************/
/* Evaluate block filter for arithmetic operators (ROWID) */
/***********************************************************************/
int BLKSPCARI::BlockEval(PGLOBAL g)
int BLKSPCARI::BlockEval(PGLOBAL)
{
int mincmp, maxcmp, n, m;
@ -605,7 +605,7 @@ BLKFILIN::BLKFILIN(PGLOBAL g, PTDBDOS tdbp, int op, int opm, PXOB *xp)
/***********************************************************************/
/* Reset: have the sorted array reset its Bot value to -1 (bottom). */
/***********************************************************************/
void BLKFILIN::Reset(PGLOBAL g)
void BLKFILIN::Reset(PGLOBAL)
{
Arap->Reset();
// MakeValueBitmap(); // Does nothing for class BLKFILIN
@ -736,7 +736,7 @@ void BLKFILIN2::MakeValueBitmap(void)
/* ended string in case of string argument. This is because the ARRAY */
/* can have a different width than the char column. */
/***********************************************************************/
int BLKFILIN2::BlockEval(PGLOBAL g)
int BLKFILIN2::BlockEval(PGLOBAL)
{
if (N < 0)
return Result; // Was set in MakeValueBitmap
@ -909,7 +909,7 @@ int BLKFILIN2::BlockEval(PGLOBAL g)
/***********************************************************************/
/* BLKSPCIN constructor. */
/***********************************************************************/
BLKSPCIN::BLKSPCIN(PGLOBAL g, PTDBDOS tdbp, int op, int opm,
BLKSPCIN::BLKSPCIN(PGLOBAL, PTDBDOS tdbp, int op, int opm,
PXOB *xp, int bsize)
: BLOCKFILTER(tdbp, op)
{
@ -930,7 +930,7 @@ BLKSPCIN::BLKSPCIN(PGLOBAL g, PTDBDOS tdbp, int op, int opm,
/***********************************************************************/
/* Reset: have the sorted array reset its Bot value to -1 (bottom). */
/***********************************************************************/
void BLKSPCIN::Reset(PGLOBAL g)
void BLKSPCIN::Reset(PGLOBAL)
{
Arap->Reset();
} // end of Reset

View file

@ -50,7 +50,7 @@ class DllExport BLOCK {
#if !defined(__BORLANDC__)
// Avoid warning C4291 by defining a matching dummy delete operator
void operator delete(void *, PGLOBAL, void *) {}
void operator delete(void *ptr,size_t size) {}
void operator delete(void *, size_t) {}
#endif
virtual ~BLOCK() {}

View file

@ -1,7 +1,7 @@
/*************** Catalog H Declares Source Code File (.H) **************/
/* Name: CATALOG.H Version 3.3 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2000-2014 */
/* (C) Copyright to the author Olivier BERTRAND 2000-2015 */
/* */
/* This file contains the CATALOG PlugDB classes definitions. */
/***********************************************************************/
@ -73,33 +73,29 @@ class DllExport CATALOG {
// Methods
virtual void Reset(void) {}
//virtual void SetDataPath(PGLOBAL g, const char *path) {}
virtual bool CheckName(PGLOBAL g, char *name) {return true;}
virtual bool ClearName(PGLOBAL g, PSZ name) {return true;}
virtual PRELDEF MakeOneTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am) {return NULL;}
virtual PRELDEF GetTableDescEx(PGLOBAL g, PTABLE tablep) {return NULL;}
virtual PRELDEF GetTableDesc(PGLOBAL g, LPCSTR name, LPCSTR type,
PRELDEF *prp = NULL) {return NULL;}
virtual PRELDEF GetFirstTable(PGLOBAL g) {return NULL;}
virtual PRELDEF GetNextTable(PGLOBAL g) {return NULL;}
virtual bool TestCond(PGLOBAL g, const char *name, const char *type)
{return true;}
virtual bool DropTable(PGLOBAL g, PSZ name, bool erase) {return true;}
virtual PTDB GetTable(PGLOBAL g, PTABLE tablep,
MODE mode = MODE_READ, LPCSTR type = NULL)
{return NULL;}
virtual void TableNames(PGLOBAL g, char *buffer, int maxbuf, int info[]) {}
virtual void ColumnNames(PGLOBAL g, char *tabname, char *buffer,
int maxbuf, int info[]) {}
virtual void ColumnDefs(PGLOBAL g, char *tabname, char *buffer,
int maxbuf, int info[]) {}
virtual void *DecodeValues(PGLOBAL g, char *tabname, char *colname,
char *buffer, int maxbuf, int info[]) {return NULL;}
virtual int ColumnType(PGLOBAL g, char *tabname, char *colname) {return 0;}
virtual void ClearDB(PGLOBAL g) {}
virtual bool CheckName(PGLOBAL, char*) {return true;}
virtual bool ClearName(PGLOBAL, PSZ) {return true;}
virtual PRELDEF MakeOneTableDesc(PGLOBAL, LPCSTR, LPCSTR) {return NULL;}
virtual PRELDEF GetTableDescEx(PGLOBAL, PTABLE) {return NULL;}
virtual PRELDEF GetTableDesc(PGLOBAL, LPCSTR, LPCSTR,
PRELDEF* = NULL) {return NULL;}
virtual PRELDEF GetFirstTable(PGLOBAL) {return NULL;}
virtual PRELDEF GetNextTable(PGLOBAL) {return NULL;}
virtual bool TestCond(PGLOBAL, const char*, const char*) {return true;}
virtual bool DropTable(PGLOBAL, PSZ, bool) {return true;}
virtual PTDB GetTable(PGLOBAL, PTABLE,
MODE = MODE_READ, LPCSTR = NULL) {return NULL;}
virtual void TableNames(PGLOBAL, char*, int, int[]) {}
virtual void ColumnNames(PGLOBAL, char*, char*, int, int[]) {}
virtual void ColumnDefs(PGLOBAL, char*, char*, int, int[]) {}
virtual void *DecodeValues(PGLOBAL, char*, char*, char*,
int, int[]) {return NULL;}
virtual int ColumnType(PGLOBAL, char*, char*) {return 0;}
virtual void ClearDB(PGLOBAL) {}
protected:
virtual bool ClearSection(PGLOBAL g, const char *key, const char *section) {return true;}
virtual PRELDEF MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am) {return NULL;}
virtual bool ClearSection(PGLOBAL, const char*, const char*) {return true;}
virtual PRELDEF MakeTableDesc(PGLOBAL, LPCSTR, LPCSTR) {return NULL;}
// Members
char *Cbuf; /* Buffer used for col section */

View file

@ -1,417 +1,417 @@
/************* Colblk C++ Functions Source Code File (.CPP) ************/
/* Name: COLBLK.CPP Version 2.1 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */
/* */
/* This file contains the COLBLK class functions. */
/***********************************************************************/
/***********************************************************************/
/* Include relevant MariaDB header file. */
/***********************************************************************/
#include "my_global.h"
/***********************************************************************/
/* Include required application header files */
/* global.h is header containing all global Plug declarations. */
/* plgdbsem.h is header containing the DB applic. declarations. */
/***********************************************************************/
#include "global.h"
#include "plgdbsem.h"
#include "tabcol.h"
#include "colblk.h"
#include "xindex.h"
#include "xtable.h"
/***********************************************************************/
/* COLBLK protected constructor. */
/***********************************************************************/
COLBLK::COLBLK(PCOLDEF cdp, PTDB tdbp, int i)
{
Next = NULL;
Index = i;
//Number = 0;
ColUse = 0;
if ((Cdp = cdp)) {
Name = cdp->Name;
Format = cdp->F;
Opt = cdp->Opt;
Long = cdp->Long;
Precision = cdp->Precision;
Freq = cdp->Freq;
Buf_Type = cdp->Buf_Type;
ColUse |= cdp->Flags; // Used by CONNECT
Nullable = !!(cdp->Flags & U_NULLS);
Unsigned = !!(cdp->Flags & U_UNSIGNED);
} else {
Name = NULL;
memset(&Format, 0, sizeof(FORMAT));
Opt = 0;
Long = 0;
Precision = 0;
Freq = 0;
Buf_Type = TYPE_ERROR;
Nullable = false;
Unsigned = false;
} // endif cdp
To_Tdb = tdbp;
Status = BUF_NO;
//Value = NULL; done in XOBJECT constructor
To_Kcol = NULL;
} // end of COLBLK constructor
/***********************************************************************/
/* COLBLK constructor used for copying columns. */
/* tdbp is the pointer to the new table descriptor. */
/***********************************************************************/
COLBLK::COLBLK(PCOL col1, PTDB tdbp)
{
PCOL colp;
// Copy the old column block to the new one
*this = *col1;
Next = NULL;
//To_Orig = col1;
To_Tdb = tdbp;
if (trace > 1)
htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this);
if (tdbp)
// Attach the new column to the table block
if (!tdbp->GetColumns())
tdbp->SetColumns(this);
else {
for (colp = tdbp->GetColumns(); colp->Next; colp = colp->Next) ;
colp->Next = this;
} // endelse
} // end of COLBLK copy constructor
/***********************************************************************/
/* Reset the column descriptor to non evaluated yet. */
/***********************************************************************/
void COLBLK::Reset(void)
{
Status &= ~BUF_READ;
} // end of Reset
/***********************************************************************/
/* Compare: compares itself to an (expression) object and returns */
/* true if it is equivalent. */
/***********************************************************************/
bool COLBLK::Compare(PXOB xp)
{
return (this == xp);
} // end of Compare
/***********************************************************************/
/* SetFormat: function used to set SELECT output format. */
/***********************************************************************/
bool COLBLK::SetFormat(PGLOBAL g, FORMAT& fmt)
{
fmt = Format;
if (trace > 1)
htrc("COLBLK: %p format=%c(%d,%d)\n",
this, *fmt.Type, fmt.Length, fmt.Prec);
return false;
} // end of SetFormat
/***********************************************************************/
/* Eval: get the column value from the last read record or from a */
/* matching Index column if there is one. */
/***********************************************************************/
bool COLBLK::Eval(PGLOBAL g)
{
if (trace > 1)
htrc("Col Eval: %s status=%.4X\n", Name, Status);
if (!GetStatus(BUF_READ)) {
// if (To_Tdb->IsNull())
// Value->Reset();
if (To_Kcol)
To_Kcol->FillValue(Value);
else
ReadColumn(g);
AddStatus(BUF_READ);
} // endif
return false;
} // end of Eval
/***********************************************************************/
/* InitValue: prepare a column block for read operation. */
/* Now we use Format.Length for the len parameter to avoid strings */
/* to be truncated when converting from string to coded string. */
/* Added in version 1.5 is the arguments GetScale() and Domain */
/* in calling AllocateValue. Domain is used for TYPE_DATE only. */
/***********************************************************************/
bool COLBLK::InitValue(PGLOBAL g)
{
if (Value)
return false; // Already done
// Allocate a Value object
if (!(Value = AllocateValue(g, Buf_Type, Precision,
GetScale(), Unsigned, GetDomain())))
return true;
AddStatus(BUF_READY);
Value->SetNullable(Nullable);
if (trace > 1)
htrc(" colp=%p type=%d value=%p coluse=%.4X status=%.4X\n",
this, Buf_Type, Value, ColUse, Status);
return false;
} // end of InitValue
/***********************************************************************/
/* SetBuffer: prepare a column block for write operation. */
/***********************************************************************/
bool COLBLK::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
{
sprintf(g->Message, MSG(UNDEFINED_AM), "SetBuffer");
return true;
} // end of SetBuffer
/***********************************************************************/
/* GetLength: returns an evaluation of the column string length. */
/***********************************************************************/
int COLBLK::GetLengthEx(void)
{
return Long;
} // end of GetLengthEx
/***********************************************************************/
/* ReadColumn: what this routine does is to access the last line */
/* read from the corresponding table, extract from it the field */
/* corresponding to this column and convert it to buffer type. */
/***********************************************************************/
void COLBLK::ReadColumn(PGLOBAL g)
{
sprintf(g->Message, MSG(UNDEFINED_AM), "ReadColumn");
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
} // end of ReadColumn
/***********************************************************************/
/* WriteColumn: what this routine does is to access the last line */
/* read from the corresponding table, and rewrite the field */
/* corresponding to this column from the column buffer and type. */
/***********************************************************************/
void COLBLK::WriteColumn(PGLOBAL g)
{
sprintf(g->Message, MSG(UNDEFINED_AM), "WriteColumn");
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
} // end of WriteColumn
/***********************************************************************/
/* Make file output of a column descriptor block. */
/***********************************************************************/
void COLBLK::Print(PGLOBAL g, FILE *f, uint n)
{
char m[64];
int i;
PCOL colp;
memset(m, ' ', n); // Make margin string
m[n] = '\0';
for (colp = To_Tdb->GetColumns(), i = 1; colp; colp = colp->Next, i++)
if (colp == this)
break;
fprintf(f, "%sR%dC%d type=%d F=%.2s(%d,%d)", m, To_Tdb->GetTdb_No(),
i, GetAmType(), Format.Type, Format.Length, Format.Prec);
fprintf(f,
" coluse=%04X status=%04X buftyp=%d value=%p name=%s\n",
ColUse, Status, Buf_Type, Value, Name);
} // end of Print
/***********************************************************************/
/* Make string output of a column descriptor block. */
/***********************************************************************/
void COLBLK::Print(PGLOBAL g, char *ps, uint z)
{
sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name);
} // end of Print
/***********************************************************************/
/* SPCBLK constructor. */
/***********************************************************************/
SPCBLK::SPCBLK(PCOLUMN cp)
: COLBLK((PCOLDEF)NULL, cp->GetTo_Table()->GetTo_Tdb(), 0)
{
Name = (char*)cp->GetName();
Precision = Long = 0;
Buf_Type = TYPE_ERROR;
} // end of SPCBLK constructor
/***********************************************************************/
/* WriteColumn: what this routine does is to access the last line */
/* read from the corresponding table, and rewrite the field */
/* corresponding to this column from the column buffer and type. */
/***********************************************************************/
void SPCBLK::WriteColumn(PGLOBAL g)
{
sprintf(g->Message, MSG(SPCOL_READONLY), Name);
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
} // end of WriteColumn
/***********************************************************************/
/* RIDBLK constructor for the ROWID special column. */
/***********************************************************************/
RIDBLK::RIDBLK(PCOLUMN cp, bool rnm) : SPCBLK(cp)
{
Precision = Long = 10;
Buf_Type = TYPE_INT;
Rnm = rnm;
*Format.Type = 'N';
Format.Length = 10;
} // end of RIDBLK constructor
/***********************************************************************/
/* ReadColumn: what this routine does is to return the ordinal */
/* number of the current row in the table (if Rnm is true) or in the */
/* current file (if Rnm is false) the same except for multiple tables.*/
/***********************************************************************/
void RIDBLK::ReadColumn(PGLOBAL g)
{
Value->SetValue(To_Tdb->RowNumber(g, Rnm));
} // end of ReadColumn
/***********************************************************************/
/* FIDBLK constructor for the FILEID special column. */
/***********************************************************************/
FIDBLK::FIDBLK(PCOLUMN cp, OPVAL op) : SPCBLK(cp), Op(op)
{
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
Precision = Long = _MAX_PATH;
Buf_Type = TYPE_STRING;
*Format.Type = 'C';
Format.Length = Long;
#if defined(WIN32)
Format.Prec = 1; // Case insensitive
#endif // WIN32
Constant = (!((PTDBASE)To_Tdb)->GetDef()->GetMultiple() &&
To_Tdb->GetAmType() != TYPE_AM_PLG &&
To_Tdb->GetAmType() != TYPE_AM_PLM);
Fn = NULL;
} // end of FIDBLK constructor
/***********************************************************************/
/* ReadColumn: what this routine does is to return the current */
/* file ID of the table (can change for Multiple tables). */
/***********************************************************************/
void FIDBLK::ReadColumn(PGLOBAL g)
{
if (Fn != ((PTDBASE)To_Tdb)->GetFile(g)) {
char filename[_MAX_PATH];
Fn = ((PTDBASE)To_Tdb)->GetFile(g);
PlugSetPath(filename, Fn, ((PTDBASE)To_Tdb)->GetPath());
if (Op != OP_XX) {
char buff[_MAX_PATH];
Value->SetValue_psz(ExtractFromPath(g, buff, filename, Op));
} else
Value->SetValue_psz(filename);
} // endif Fn
} // end of ReadColumn
/***********************************************************************/
/* TIDBLK constructor for the TABID special column. */
/***********************************************************************/
TIDBLK::TIDBLK(PCOLUMN cp) : SPCBLK(cp)
{
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
Precision = Long = 64;
Buf_Type = TYPE_STRING;
*Format.Type = 'C';
Format.Length = Long;
Format.Prec = 1; // Case insensitive
Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL);
Tname = NULL;
} // end of TIDBLK constructor
/***********************************************************************/
/* ReadColumn: what this routine does is to return the table ID. */
/***********************************************************************/
void TIDBLK::ReadColumn(PGLOBAL g)
{
if (Tname == NULL) {
Tname = (char*)To_Tdb->GetName();
Value->SetValue_psz(Tname);
} // endif Tname
} // end of ReadColumn
/***********************************************************************/
/* PRTBLK constructor for the PARTID special column. */
/***********************************************************************/
PRTBLK::PRTBLK(PCOLUMN cp) : SPCBLK(cp)
{
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
Precision = Long = 64;
Buf_Type = TYPE_STRING;
*Format.Type = 'C';
Format.Length = Long;
Format.Prec = 1; // Case insensitive
Constant = true; // TODO: check whether this is true indeed
Pname = NULL;
} // end of PRTBLK constructor
/***********************************************************************/
/* ReadColumn: what this routine does is to return the partition ID. */
/***********************************************************************/
void PRTBLK::ReadColumn(PGLOBAL g)
{
if (Pname == NULL) {
char *p;
PTDBASE tdbp = (PTDBASE)To_Tdb;
Pname = tdbp->GetDef()->GetStringCatInfo(g, "partname", "?");
p = strrchr(Pname, '#');
Value->SetValue_psz((p) ? p + 1 : Pname);
} // endif Pname
} // end of ReadColumn
/***********************************************************************/
/* SIDBLK constructor for the SERVID special column. */
/***********************************************************************/
SIDBLK::SIDBLK(PCOLUMN cp) : SPCBLK(cp)
{
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
Precision = Long = 64;
Buf_Type = TYPE_STRING;
*Format.Type = 'C';
Format.Length = Long;
Format.Prec = 1; // Case insensitive
Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL);
Sname = NULL;
} // end of TIDBLK constructor
/***********************************************************************/
/* ReadColumn: what this routine does is to return the server ID. */
/***********************************************************************/
void SIDBLK::ReadColumn(PGLOBAL g)
{
//if (Sname == NULL) {
Sname = (char*)To_Tdb->GetServer();
Value->SetValue_psz(Sname);
// } // endif Sname
} // end of ReadColumn
/************* Colblk C++ Functions Source Code File (.CPP) ************/
/* Name: COLBLK.CPP Version 2.1 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 1998-2015 */
/* */
/* This file contains the COLBLK class functions. */
/***********************************************************************/
/***********************************************************************/
/* Include relevant MariaDB header file. */
/***********************************************************************/
#include "my_global.h"
/***********************************************************************/
/* Include required application header files */
/* global.h is header containing all global Plug declarations. */
/* plgdbsem.h is header containing the DB applic. declarations. */
/***********************************************************************/
#include "global.h"
#include "plgdbsem.h"
#include "tabcol.h"
#include "colblk.h"
#include "xindex.h"
#include "xtable.h"
/***********************************************************************/
/* COLBLK protected constructor. */
/***********************************************************************/
COLBLK::COLBLK(PCOLDEF cdp, PTDB tdbp, int i)
{
Next = NULL;
Index = i;
//Number = 0;
ColUse = 0;
if ((Cdp = cdp)) {
Name = cdp->Name;
Format = cdp->F;
Opt = cdp->Opt;
Long = cdp->Long;
Precision = cdp->Precision;
Freq = cdp->Freq;
Buf_Type = cdp->Buf_Type;
ColUse |= cdp->Flags; // Used by CONNECT
Nullable = !!(cdp->Flags & U_NULLS);
Unsigned = !!(cdp->Flags & U_UNSIGNED);
} else {
Name = NULL;
memset(&Format, 0, sizeof(FORMAT));
Opt = 0;
Long = 0;
Precision = 0;
Freq = 0;
Buf_Type = TYPE_ERROR;
Nullable = false;
Unsigned = false;
} // endif cdp
To_Tdb = tdbp;
Status = BUF_NO;
//Value = NULL; done in XOBJECT constructor
To_Kcol = NULL;
} // end of COLBLK constructor
/***********************************************************************/
/* COLBLK constructor used for copying columns. */
/* tdbp is the pointer to the new table descriptor. */
/***********************************************************************/
COLBLK::COLBLK(PCOL col1, PTDB tdbp)
{
PCOL colp;
// Copy the old column block to the new one
*this = *col1;
Next = NULL;
//To_Orig = col1;
To_Tdb = tdbp;
if (trace > 1)
htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this);
if (tdbp)
// Attach the new column to the table block
if (!tdbp->GetColumns())
tdbp->SetColumns(this);
else {
for (colp = tdbp->GetColumns(); colp->Next; colp = colp->Next) ;
colp->Next = this;
} // endelse
} // end of COLBLK copy constructor
/***********************************************************************/
/* Reset the column descriptor to non evaluated yet. */
/***********************************************************************/
void COLBLK::Reset(void)
{
Status &= ~BUF_READ;
} // end of Reset
/***********************************************************************/
/* Compare: compares itself to an (expression) object and returns */
/* true if it is equivalent. */
/***********************************************************************/
bool COLBLK::Compare(PXOB xp)
{
return (this == xp);
} // end of Compare
/***********************************************************************/
/* SetFormat: function used to set SELECT output format. */
/***********************************************************************/
bool COLBLK::SetFormat(PGLOBAL, FORMAT& fmt)
{
fmt = Format;
if (trace > 1)
htrc("COLBLK: %p format=%c(%d,%d)\n",
this, *fmt.Type, fmt.Length, fmt.Prec);
return false;
} // end of SetFormat
/***********************************************************************/
/* Eval: get the column value from the last read record or from a */
/* matching Index column if there is one. */
/***********************************************************************/
bool COLBLK::Eval(PGLOBAL g)
{
if (trace > 1)
htrc("Col Eval: %s status=%.4X\n", Name, Status);
if (!GetStatus(BUF_READ)) {
// if (To_Tdb->IsNull())
// Value->Reset();
if (To_Kcol)
To_Kcol->FillValue(Value);
else
ReadColumn(g);
AddStatus(BUF_READ);
} // endif
return false;
} // end of Eval
/***********************************************************************/
/* InitValue: prepare a column block for read operation. */
/* Now we use Format.Length for the len parameter to avoid strings */
/* to be truncated when converting from string to coded string. */
/* Added in version 1.5 is the arguments GetScale() and Domain */
/* in calling AllocateValue. Domain is used for TYPE_DATE only. */
/***********************************************************************/
bool COLBLK::InitValue(PGLOBAL g)
{
if (Value)
return false; // Already done
// Allocate a Value object
if (!(Value = AllocateValue(g, Buf_Type, Precision,
GetScale(), Unsigned, GetDomain())))
return true;
AddStatus(BUF_READY);
Value->SetNullable(Nullable);
if (trace > 1)
htrc(" colp=%p type=%d value=%p coluse=%.4X status=%.4X\n",
this, Buf_Type, Value, ColUse, Status);
return false;
} // end of InitValue
/***********************************************************************/
/* SetBuffer: prepare a column block for write operation. */
/***********************************************************************/
bool COLBLK::SetBuffer(PGLOBAL g, PVAL, bool, bool)
{
sprintf(g->Message, MSG(UNDEFINED_AM), "SetBuffer");
return true;
} // end of SetBuffer
/***********************************************************************/
/* GetLength: returns an evaluation of the column string length. */
/***********************************************************************/
int COLBLK::GetLengthEx(void)
{
return Long;
} // end of GetLengthEx
/***********************************************************************/
/* ReadColumn: what this routine does is to access the last line */
/* read from the corresponding table, extract from it the field */
/* corresponding to this column and convert it to buffer type. */
/***********************************************************************/
void COLBLK::ReadColumn(PGLOBAL g)
{
sprintf(g->Message, MSG(UNDEFINED_AM), "ReadColumn");
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
} // end of ReadColumn
/***********************************************************************/
/* WriteColumn: what this routine does is to access the last line */
/* read from the corresponding table, and rewrite the field */
/* corresponding to this column from the column buffer and type. */
/***********************************************************************/
void COLBLK::WriteColumn(PGLOBAL g)
{
sprintf(g->Message, MSG(UNDEFINED_AM), "WriteColumn");
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
} // end of WriteColumn
/***********************************************************************/
/* Make file output of a column descriptor block. */
/***********************************************************************/
void COLBLK::Print(PGLOBAL, FILE *f, uint n)
{
char m[64];
int i;
PCOL colp;
memset(m, ' ', n); // Make margin string
m[n] = '\0';
for (colp = To_Tdb->GetColumns(), i = 1; colp; colp = colp->Next, i++)
if (colp == this)
break;
fprintf(f, "%sR%dC%d type=%d F=%.2s(%d,%d)", m, To_Tdb->GetTdb_No(),
i, GetAmType(), Format.Type, Format.Length, Format.Prec);
fprintf(f,
" coluse=%04X status=%04X buftyp=%d value=%p name=%s\n",
ColUse, Status, Buf_Type, Value, Name);
} // end of Print
/***********************************************************************/
/* Make string output of a column descriptor block. */
/***********************************************************************/
void COLBLK::Print(PGLOBAL, char *ps, uint)
{
sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name);
} // end of Print
/***********************************************************************/
/* SPCBLK constructor. */
/***********************************************************************/
SPCBLK::SPCBLK(PCOLUMN cp)
: COLBLK((PCOLDEF)NULL, cp->GetTo_Table()->GetTo_Tdb(), 0)
{
Name = (char*)cp->GetName();
Precision = Long = 0;
Buf_Type = TYPE_ERROR;
} // end of SPCBLK constructor
/***********************************************************************/
/* WriteColumn: what this routine does is to access the last line */
/* read from the corresponding table, and rewrite the field */
/* corresponding to this column from the column buffer and type. */
/***********************************************************************/
void SPCBLK::WriteColumn(PGLOBAL g)
{
sprintf(g->Message, MSG(SPCOL_READONLY), Name);
longjmp(g->jumper[g->jump_level], TYPE_COLBLK);
} // end of WriteColumn
/***********************************************************************/
/* RIDBLK constructor for the ROWID special column. */
/***********************************************************************/
RIDBLK::RIDBLK(PCOLUMN cp, bool rnm) : SPCBLK(cp)
{
Precision = Long = 10;
Buf_Type = TYPE_INT;
Rnm = rnm;
*Format.Type = 'N';
Format.Length = 10;
} // end of RIDBLK constructor
/***********************************************************************/
/* ReadColumn: what this routine does is to return the ordinal */
/* number of the current row in the table (if Rnm is true) or in the */
/* current file (if Rnm is false) the same except for multiple tables.*/
/***********************************************************************/
void RIDBLK::ReadColumn(PGLOBAL g)
{
Value->SetValue(To_Tdb->RowNumber(g, Rnm));
} // end of ReadColumn
/***********************************************************************/
/* FIDBLK constructor for the FILEID special column. */
/***********************************************************************/
FIDBLK::FIDBLK(PCOLUMN cp, OPVAL op) : SPCBLK(cp), Op(op)
{
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
Precision = Long = _MAX_PATH;
Buf_Type = TYPE_STRING;
*Format.Type = 'C';
Format.Length = Long;
#if defined(WIN32)
Format.Prec = 1; // Case insensitive
#endif // WIN32
Constant = (!((PTDBASE)To_Tdb)->GetDef()->GetMultiple() &&
To_Tdb->GetAmType() != TYPE_AM_PLG &&
To_Tdb->GetAmType() != TYPE_AM_PLM);
Fn = NULL;
} // end of FIDBLK constructor
/***********************************************************************/
/* ReadColumn: what this routine does is to return the current */
/* file ID of the table (can change for Multiple tables). */
/***********************************************************************/
void FIDBLK::ReadColumn(PGLOBAL g)
{
if (Fn != ((PTDBASE)To_Tdb)->GetFile(g)) {
char filename[_MAX_PATH];
Fn = ((PTDBASE)To_Tdb)->GetFile(g);
PlugSetPath(filename, Fn, ((PTDBASE)To_Tdb)->GetPath());
if (Op != OP_XX) {
char buff[_MAX_PATH];
Value->SetValue_psz(ExtractFromPath(g, buff, filename, Op));
} else
Value->SetValue_psz(filename);
} // endif Fn
} // end of ReadColumn
/***********************************************************************/
/* TIDBLK constructor for the TABID special column. */
/***********************************************************************/
TIDBLK::TIDBLK(PCOLUMN cp) : SPCBLK(cp)
{
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
Precision = Long = 64;
Buf_Type = TYPE_STRING;
*Format.Type = 'C';
Format.Length = Long;
Format.Prec = 1; // Case insensitive
Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL);
Tname = NULL;
} // end of TIDBLK constructor
/***********************************************************************/
/* ReadColumn: what this routine does is to return the table ID. */
/***********************************************************************/
void TIDBLK::ReadColumn(PGLOBAL)
{
if (Tname == NULL) {
Tname = (char*)To_Tdb->GetName();
Value->SetValue_psz(Tname);
} // endif Tname
} // end of ReadColumn
/***********************************************************************/
/* PRTBLK constructor for the PARTID special column. */
/***********************************************************************/
PRTBLK::PRTBLK(PCOLUMN cp) : SPCBLK(cp)
{
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
Precision = Long = 64;
Buf_Type = TYPE_STRING;
*Format.Type = 'C';
Format.Length = Long;
Format.Prec = 1; // Case insensitive
Constant = true; // TODO: check whether this is true indeed
Pname = NULL;
} // end of PRTBLK constructor
/***********************************************************************/
/* ReadColumn: what this routine does is to return the partition ID. */
/***********************************************************************/
void PRTBLK::ReadColumn(PGLOBAL g)
{
if (Pname == NULL) {
char *p;
PTDBASE tdbp = (PTDBASE)To_Tdb;
Pname = tdbp->GetDef()->GetStringCatInfo(g, "partname", "?");
p = strrchr(Pname, '#');
Value->SetValue_psz((p) ? p + 1 : Pname);
} // endif Pname
} // end of ReadColumn
/***********************************************************************/
/* SIDBLK constructor for the SERVID special column. */
/***********************************************************************/
SIDBLK::SIDBLK(PCOLUMN cp) : SPCBLK(cp)
{
//Is_Key = 2; for when the MUL table indexed reading will be implemented.
Precision = Long = 64;
Buf_Type = TYPE_STRING;
*Format.Type = 'C';
Format.Length = Long;
Format.Prec = 1; // Case insensitive
Constant = (To_Tdb->GetAmType() != TYPE_AM_TBL);
Sname = NULL;
} // end of TIDBLK constructor
/***********************************************************************/
/* ReadColumn: what this routine does is to return the server ID. */
/***********************************************************************/
void SIDBLK::ReadColumn(PGLOBAL)
{
//if (Sname == NULL) {
Sname = (char*)To_Tdb->GetServer();
Value->SetValue_psz(Sname);
// } // endif Sname
} // end of ReadColumn

View file

@ -1,7 +1,7 @@
/*************** Colblk H Declares Source Code File (.H) ***************/
/* Name: COLBLK.H Version 1.7 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */
/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */
/* */
/* This file contains the COLBLK and derived classes declares. */
/***********************************************************************/
@ -23,7 +23,7 @@ class DllExport COLBLK : public XOBJECT {
// Default constructors used by derived classes
COLBLK(PCOLDEF cdp = NULL, PTDB tdbp = NULL, int i = 0);
COLBLK(PCOL colp, PTDB tdbp = NULL); // Used in copy process
COLBLK(int n) {} // Used when changing a column class in TDBXML
COLBLK(int) {} // Used when changing a column class in TDBXML
public:
// Implementation
@ -69,7 +69,7 @@ class DllExport COLBLK : public XOBJECT {
virtual bool IsSpecial(void) {return false;}
virtual bool Eval(PGLOBAL g);
virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check);
virtual void SetTo_Val(PVAL valp) {}
virtual void SetTo_Val(PVAL) {}
virtual void ReadColumn(PGLOBAL g);
virtual void WriteColumn(PGLOBAL g);
virtual void Print(PGLOBAL g, FILE *, uint);

View file

@ -1,4 +1,4 @@
/* Copyright (C) Olivier Bertrand 2004 - 2012
/* Copyright (C) Olivier Bertrand 2004 - 2015
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
@ -237,7 +237,7 @@ PTDB CntGetTDB(PGLOBAL g, LPCSTR name, MODE mode, PHC h)
/* OPENTAB: Open a Table. */
/***********************************************************************/
bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2,
bool del, PHC h)
bool del, PHC)
{
char *p;
int i, n, rc;

View file

@ -276,7 +276,7 @@ bool MAPFAM::SetPos(PGLOBAL g, int pos)
/***********************************************************************/
/* Record file position in case of UPDATE or DELETE. */
/***********************************************************************/
bool MAPFAM::RecordPos(PGLOBAL g)
bool MAPFAM::RecordPos(PGLOBAL)
{
Fpos = Mempos;
return false;
@ -285,7 +285,7 @@ bool MAPFAM::RecordPos(PGLOBAL g)
/***********************************************************************/
/* Initialize Fpos and Mempos for indexed DELETE. */
/***********************************************************************/
int MAPFAM::InitDelete(PGLOBAL g, int fpos, int spos)
int MAPFAM::InitDelete(PGLOBAL, int fpos, int spos)
{
Fpos = Memory + (ptrdiff_t)fpos;
Mempos = Memory + (ptrdiff_t)spos;
@ -371,7 +371,7 @@ int MAPFAM::ReadBuffer(PGLOBAL g)
/***********************************************************************/
/* WriteBuffer: File write routine for MAP access method. */
/***********************************************************************/
int MAPFAM::WriteBuffer(PGLOBAL g)
int MAPFAM::WriteBuffer(PGLOBAL g __attribute__((unused)))
{
#if defined(_DEBUG)
// Insert mode is no more handled using file mapping
@ -495,7 +495,7 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc)
/***********************************************************************/
/* Table file close routine for MAP access method. */
/***********************************************************************/
void MAPFAM::CloseTableFile(PGLOBAL g, bool abort)
void MAPFAM::CloseTableFile(PGLOBAL g, bool)
{
PlugCloseFile(g, To_Fb);
To_Fb = NULL; // To get correct file size in Cardinality
@ -551,7 +551,7 @@ int MBKFAM::Cardinality(PGLOBAL g)
/***********************************************************************/
/* Skip one record in file. */
/***********************************************************************/
int MBKFAM::SkipRecord(PGLOBAL g, bool header)
int MBKFAM::SkipRecord(PGLOBAL, bool)
{
return RC_OK;
} // end of SkipRecord
@ -685,7 +685,7 @@ bool MPXFAM::SetPos(PGLOBAL g, int pos)
/***********************************************************************/
/* Initialize CurBlk, CurNum, Mempos and Fpos for indexed DELETE. */
/***********************************************************************/
int MPXFAM::InitDelete(PGLOBAL g, int fpos, int spos)
int MPXFAM::InitDelete(PGLOBAL, int fpos, int)
{
Fpos = Memory + Headlen + (ptrdiff_t)fpos * Lrecl;
Mempos = Fpos + Lrecl;
@ -740,7 +740,7 @@ int MPXFAM::ReadBuffer(PGLOBAL g)
/***********************************************************************/
/* WriteBuffer: File write routine for MAP access method. */
/***********************************************************************/
int MPXFAM::WriteBuffer(PGLOBAL g)
int MPXFAM::WriteBuffer(PGLOBAL g __attribute__((unused)))
{
#if defined(_DEBUG)
// Insert mode is no more handled using file mapping

View file

@ -1,11 +1,11 @@
/*********** File AM Dbf C++ Program Source Code File (.CPP) ****************/
/* PROGRAM NAME: FILAMDBF */
/* ------------- */
/* Version 1.7 */
/* Version 1.8 */
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */
/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -115,6 +115,7 @@ typedef struct _descriptor {
/* Side effects: */
/* Moves file pointer to byte 32; fills buffer at buf with */
/* first 32 bytes of file. */
/* Converts numeric values to platform byte ordering (LE in file) */
/****************************************************************************/
static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf)
{
@ -142,6 +143,11 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf)
} else
strcpy(g->Message, MSG(DBASE_FILE));
// Convert numeric fields to have them in platform byte ordering
buf->Records = uint4korr(&buf->Records);
buf->Headlen = uint2korr(&buf->Headlen);
buf->Reclen = uint2korr(&buf->Reclen);
// Check last byte(s) of header
if (fseek(file, buf->Headlen - dbc, SEEK_SET) != 0) {
sprintf(g->Message, MSG(BAD_HEADER), fn);
@ -565,8 +571,8 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g)
header->Filedate[0] = datm->tm_year - 100;
header->Filedate[1] = datm->tm_mon + 1;
header->Filedate[2] = datm->tm_mday;
header->Headlen = (ushort)hlen;
header->Reclen = (ushort)reclen;
int2store(&header->Headlen, hlen);
int2store(&header->Reclen, reclen);
descp = (DESCRIPTOR*)header;
// Currently only standard Xbase types are supported
@ -729,7 +735,7 @@ bool DBFFAM::CopyHeader(PGLOBAL g)
if (Headlen) {
void *hdr = PlugSubAlloc(g, NULL, Headlen);
size_t n, hlen = (size_t)Headlen;
int pos = ftell(Stream);
int pos = ftell(Stream);
if (fseek(Stream, 0, SEEK_SET))
strcpy(g->Message, "Seek error in CopyHeader");
@ -863,13 +869,14 @@ void DBFFAM::CloseTableFile(PGLOBAL g, bool abort)
if (n > Records) {
// Update the number of rows in the file header
char filename[_MAX_PATH];
char filename[_MAX_PATH], nRecords[4];
int4store(&nRecords, n);
PlugSetPath(filename, To_File, Tdbp->GetPath());
if ((Stream= global_fopen(g, MSGID_OPEN_MODE_STRERROR, filename, "r+b")))
{
fseek(Stream, 4, SEEK_SET); // Get header.Records position
fwrite(&n, sizeof(int), 1, Stream);
fwrite(nRecords, sizeof(nRecords), 1, Stream);
fclose(Stream);
Stream= NULL;
Records= n; // Update Records value
@ -944,13 +951,13 @@ bool DBMFAM::AllocateBuffer(PGLOBAL g)
/************************************************************************/
DBFHEADER *hp = (DBFHEADER*)Memory;
if (Lrecl != (int)hp->Reclen) {
sprintf(g->Message, MSG(BAD_LRECL), Lrecl, hp->Reclen);
if (Lrecl != (int)uint2korr(&hp->Reclen)) {
sprintf(g->Message, MSG(BAD_LRECL), Lrecl, uint2korr(&hp->Reclen));
return true;
} // endif Lrecl
Records = (int)hp->Records;
Headlen = (int)hp->Headlen;
Records = (int)uint4korr(&hp->Records);
Headlen = (int)uint2korr(&hp->Headlen);
} // endif Headlen
/**************************************************************************/
@ -1004,7 +1011,7 @@ int DBMFAM::ReadBuffer(PGLOBAL g)
/* Data Base delete line routine for DBF access methods. */
/* Deleted lines are just flagged in the first buffer character. */
/****************************************************************************/
int DBMFAM::DeleteRecords(PGLOBAL g, int irc)
int DBMFAM::DeleteRecords(PGLOBAL, int irc)
{
if (irc == RC_OK)
*Fpos = '*';

View file

@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */
/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -102,7 +102,7 @@ bool FIXFAM::SetPos(PGLOBAL g, int pos)
/***********************************************************************/
/* Initialize CurBlk and CurNum for indexed DELETE. */
/***********************************************************************/
int FIXFAM::InitDelete(PGLOBAL g, int fpos, int spos)
int FIXFAM::InitDelete(PGLOBAL, int fpos, int)
{
CurBlk = fpos / Nrec;
CurNum = fpos % Nrec;
@ -690,7 +690,8 @@ bool BGXFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, int org)
/***********************************************************************/
/* Read from a big file. */
/***********************************************************************/
int BGXFAM::BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req)
int BGXFAM::BigRead(PGLOBAL g __attribute__((unused)),
HANDLE h, void *inbuf, int req)
{
int rc;

View file

@ -436,7 +436,7 @@ err:
/* The purpose of this function is to deal with access methods that */
/* are not coherent regarding the use of SetPos and GetPos. */
/***********************************************************************/
int TXTFAM::InitDelete(PGLOBAL g, int fpos, int spos)
int TXTFAM::InitDelete(PGLOBAL g, int, int)
{
strcpy(g->Message, "InitDelete should not be used by this table type");
return RC_FX;
@ -519,7 +519,7 @@ int DOSFAM::Cardinality(PGLOBAL g)
/* Use BlockTest to reduce the table estimated size. */
/* Note: This function is not really implemented yet. */
/***********************************************************************/
int DOSFAM::MaxBlkSize(PGLOBAL g, int s)
int DOSFAM::MaxBlkSize(PGLOBAL, int s)
{
return s;
} // end of MaxBlkSize
@ -1272,7 +1272,7 @@ int BLKFAM::Cardinality(PGLOBAL g)
/***********************************************************************/
/* Use BlockTest to reduce the table estimated size. */
/***********************************************************************/
int BLKFAM::MaxBlkSize(PGLOBAL g, int s)
int BLKFAM::MaxBlkSize(PGLOBAL g, int)
{
int rc = RC_OK, savcur = CurBlk;
int size;
@ -1343,7 +1343,7 @@ int BLKFAM::GetNextPos(void)
/***********************************************************************/
/* SetPos: Replace the table at the specified position. */
/***********************************************************************/
bool BLKFAM::SetPos(PGLOBAL g, int pos)
bool BLKFAM::SetPos(PGLOBAL g, int)
{
strcpy(g->Message, "Blocked variable tables cannot be used indexed");
return true;
@ -1353,7 +1353,7 @@ bool BLKFAM::SetPos(PGLOBAL g, int pos)
/* Record file position in case of UPDATE or DELETE. */
/* Not used yet for blocked tables. */
/***********************************************************************/
bool BLKFAM::RecordPos(PGLOBAL g)
bool BLKFAM::RecordPos(PGLOBAL)
{
Fpos = (CurNum + Nrec * CurBlk); // Computed file index
return false;
@ -1362,7 +1362,7 @@ bool BLKFAM::RecordPos(PGLOBAL g)
/***********************************************************************/
/* Skip one record in file. */
/***********************************************************************/
int BLKFAM::SkipRecord(PGLOBAL g, bool header)
int BLKFAM::SkipRecord(PGLOBAL, bool header)
{
if (header) {
// For Delete

View file

@ -57,8 +57,8 @@ class DllExport TXTFAM : public BLOCK {
virtual int GetFileLength(PGLOBAL g);
virtual int Cardinality(PGLOBAL g);
virtual int MaxBlkSize(PGLOBAL g, int s);
virtual bool AllocateBuffer(PGLOBAL g) {return false;}
virtual void ResetBuffer(PGLOBAL g) {}
virtual bool AllocateBuffer(PGLOBAL) {return false;}
virtual void ResetBuffer(PGLOBAL) {}
virtual int GetNerr(void) {return 0;}
virtual int GetRowID(void) = 0;
virtual bool RecordPos(PGLOBAL g) = 0;

View file

@ -279,7 +279,7 @@ bool VCTFAM::SetBlockInfo(PGLOBAL g)
/***********************************************************************/
/* Use BlockTest to reduce the table estimated size. */
/***********************************************************************/
int VCTFAM::MaxBlkSize(PGLOBAL g, int s)
int VCTFAM::MaxBlkSize(PGLOBAL g, int)
{
int rc = RC_OK, savcur = CurBlk;
int size;
@ -1716,7 +1716,7 @@ int VCMFAM::DeleteRecords(PGLOBAL g, int irc)
/***********************************************************************/
/* Move intermediate deleted or updated lines. */
/***********************************************************************/
bool VCMFAM::MoveIntermediateLines(PGLOBAL g, bool *b)
bool VCMFAM::MoveIntermediateLines(PGLOBAL, bool *)
{
int i, m, n;
@ -1765,7 +1765,7 @@ bool VCMFAM::MoveIntermediateLines(PGLOBAL g, bool *b)
/***********************************************************************/
/* Data Base close routine for VMP access method. */
/***********************************************************************/
void VCMFAM::CloseTableFile(PGLOBAL g, bool abort)
void VCMFAM::CloseTableFile(PGLOBAL g, bool)
{
int wrc = RC_OK;
MODE mode = Tdbp->GetMode();
@ -1800,7 +1800,7 @@ void VCMFAM::CloseTableFile(PGLOBAL g, bool abort)
/***********************************************************************/
/* ReadBlock: Read column values from current block. */
/***********************************************************************/
bool VCMFAM::ReadBlock(PGLOBAL g, PVCTCOL colp)
bool VCMFAM::ReadBlock(PGLOBAL, PVCTCOL colp)
{
char *mempos;
int i = colp->Index - 1;
@ -1830,7 +1830,7 @@ bool VCMFAM::ReadBlock(PGLOBAL g, PVCTCOL colp)
/* the mapped file, except when checking for Update but in this case */
/* we do not want to write back the modifications either. */
/***********************************************************************/
bool VCMFAM::WriteBlock(PGLOBAL g, PVCTCOL colp)
bool VCMFAM::WriteBlock(PGLOBAL, PVCTCOL colp __attribute__((unused)))
{
#if defined(_DEBUG)
char *mempos;
@ -2124,7 +2124,7 @@ bool VECFAM::AllocateBuffer(PGLOBAL g)
/***********************************************************************/
/* Do initial action when inserting. */
/***********************************************************************/
bool VECFAM::InitInsert(PGLOBAL g)
bool VECFAM::InitInsert(PGLOBAL)
{
// We come here in MODE_INSERT only
CurBlk = 0;
@ -2365,7 +2365,7 @@ bool VECFAM::MoveLines(PGLOBAL g)
/***********************************************************************/
/* Move intermediate deleted or updated lines. */
/***********************************************************************/
bool VECFAM::MoveIntermediateLines(PGLOBAL g, bool *bn)
bool VECFAM::MoveIntermediateLines(PGLOBAL g, bool *)
{
int i, n;
bool b = false;
@ -3009,7 +3009,7 @@ int VMPFAM::DeleteRecords(PGLOBAL g, int irc)
/***********************************************************************/
/* Data Base close routine for VMP access method. */
/***********************************************************************/
void VMPFAM::CloseTableFile(PGLOBAL g, bool abort)
void VMPFAM::CloseTableFile(PGLOBAL g, bool)
{
if (Tdbp->GetMode() == MODE_DELETE) {
// Set Block and Nrec values for TDBVCT::MakeBlockValues

View file

@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */
/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -247,7 +247,7 @@ int ZIPFAM::GetNextPos(void)
/***********************************************************************/
/* SetPos: Replace the table at the specified position. */
/***********************************************************************/
bool ZIPFAM::SetPos(PGLOBAL g, int pos)
bool ZIPFAM::SetPos(PGLOBAL g, int pos __attribute__((unused)))
{
sprintf(g->Message, MSG(NO_SETPOS_YET), "ZIP");
return true;
@ -267,7 +267,7 @@ bool ZIPFAM::SetPos(PGLOBAL g, int pos)
/***********************************************************************/
/* Record file position in case of UPDATE or DELETE. */
/***********************************************************************/
bool ZIPFAM::RecordPos(PGLOBAL g)
bool ZIPFAM::RecordPos(PGLOBAL)
{
Zpos = gztell(Zfile);
return false;
@ -376,7 +376,7 @@ int ZIPFAM::WriteBuffer(PGLOBAL g)
/***********************************************************************/
/* Data Base delete line routine for ZDOS access method. (NIY) */
/***********************************************************************/
int ZIPFAM::DeleteRecords(PGLOBAL g, int irc)
int ZIPFAM::DeleteRecords(PGLOBAL g, int)
{
strcpy(g->Message, MSG(NO_ZIP_DELETE));
return RC_FX;
@ -385,7 +385,7 @@ int ZIPFAM::DeleteRecords(PGLOBAL g, int irc)
/***********************************************************************/
/* Data Base close routine for DOS access method. */
/***********************************************************************/
void ZIPFAM::CloseTableFile(PGLOBAL g, bool abort)
void ZIPFAM::CloseTableFile(PGLOBAL, bool)
{
int rc = gzclose(Zfile);
@ -431,7 +431,7 @@ ZBKFAM::ZBKFAM(PZBKFAM txfp) : ZIPFAM(txfp)
/***********************************************************************/
/* Use BlockTest to reduce the table estimated size. */
/***********************************************************************/
int ZBKFAM::MaxBlkSize(PGLOBAL g, int s)
int ZBKFAM::MaxBlkSize(PGLOBAL g, int)
{
int rc = RC_OK, savcur = CurBlk;
int size;
@ -503,7 +503,7 @@ int ZBKFAM::GetPos(void)
/* Record file position in case of UPDATE or DELETE. */
/* Not used yet for fixed tables. */
/***********************************************************************/
bool ZBKFAM::RecordPos(PGLOBAL g)
bool ZBKFAM::RecordPos(PGLOBAL /*g*/)
{
//strcpy(g->Message, "RecordPos not implemented for zip blocked tables");
//return true;
@ -513,7 +513,7 @@ bool ZBKFAM::RecordPos(PGLOBAL g)
/***********************************************************************/
/* Skip one record in file. */
/***********************************************************************/
int ZBKFAM::SkipRecord(PGLOBAL g, bool header)
int ZBKFAM::SkipRecord(PGLOBAL /*g*/, bool)
{
//strcpy(g->Message, "SkipRecord not implemented for zip blocked tables");
//return RC_FX;
@ -668,7 +668,7 @@ int ZBKFAM::DeleteRecords(PGLOBAL g, int irc)
/***********************************************************************/
/* Data Base close routine for ZBK access method. */
/***********************************************************************/
void ZBKFAM::CloseTableFile(PGLOBAL g, bool abort)
void ZBKFAM::CloseTableFile(PGLOBAL g, bool)
{
int rc = RC_OK;
@ -1060,7 +1060,7 @@ int ZLBFAM::GetNextPos(void)
/***********************************************************************/
/* SetPos: Replace the table at the specified position. */
/***********************************************************************/
bool ZLBFAM::SetPos(PGLOBAL g, int pos)
bool ZLBFAM::SetPos(PGLOBAL g, int pos __attribute__((unused)))
{
sprintf(g->Message, MSG(NO_SETPOS_YET), "ZIP");
return true;
@ -1350,7 +1350,7 @@ bool ZLBFAM::WriteCompressedBuffer(PGLOBAL g)
/***********************************************************************/
/* Table file close routine for DOS access method. */
/***********************************************************************/
void ZLBFAM::CloseTableFile(PGLOBAL g, bool abort)
void ZLBFAM::CloseTableFile(PGLOBAL g, bool)
{
int rc = RC_OK;

View file

@ -1,7 +1,7 @@
/*************** Filter H Declares Source Code File (.H) ***************/
/* Name: FILTER.H Version 1.2 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2010-2012 */
/* (C) Copyright to the author Olivier BERTRAND 2010-2015 */
/* */
/* This file contains the FILTER and derived classes declares. */
/***********************************************************************/
@ -105,7 +105,7 @@ class FILTERX : public FILTER {
virtual bool Eval(PGLOBAL) = 0; // just to prevent direct FILTERX use
// Fake operator new used to change a filter into a derived filter
void * operator new(size_t size, PFIL filp) {return filp;}
void * operator new(size_t, PFIL filp) {return filp;}
#if defined(WIN32)
// Avoid warning C4291 by defining a matching dummy delete operator
void operator delete(void *, PFIL) {}

View file

@ -193,7 +193,7 @@ extern "C" {
/* Utility functions. */
/***********************************************************************/
PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info);
PQRYRES VirColumns(PGLOBAL g, char *tab, char *db, bool info);
PQRYRES VirColumns(PGLOBAL g, bool info);
PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn,
int pretty, int lvl, int mxr, bool info);
PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info);
@ -349,7 +349,7 @@ int GetConvSize(void) {return THDVAR(current_thd, conv_size);}
TYPCONV GetTypeConv(void) {return (TYPCONV)THDVAR(current_thd, type_conv);}
uint GetJsonGrpSize(void) {return THDVAR(current_thd, json_grp_size);}
uint GetWorkSize(void) {return THDVAR(current_thd, work_size);}
void SetWorkSize(uint n)
void SetWorkSize(uint)
{
// Changing the session variable value seems to be impossible here
// and should be done in a check function
@ -664,7 +664,7 @@ static int connect_init_func(void *p)
@brief
Plugin clean up
*/
static int connect_done_func(void *p)
static int connect_done_func(void *)
{
int error= 0;
PCONNECT pc, pn;
@ -822,8 +822,6 @@ ha_connect::~ha_connect(void)
/****************************************************************************/
static PCONNECT GetUser(THD *thd, PCONNECT xp)
{
const char *dbn= NULL;
if (!thd)
return NULL;
@ -835,7 +833,7 @@ static PCONNECT GetUser(THD *thd, PCONNECT xp)
break;
if (!xp) {
xp= new user_connect(thd, dbn);
xp= new user_connect(thd);
if (xp->user_init()) {
delete xp;
@ -908,7 +906,8 @@ const char *ha_connect::index_type(uint inx)
If all_parts is set, MySQL wants to know the flags for the combined
index, up to and including 'part'.
*/
ulong ha_connect::index_flags(uint inx, uint part, bool all_parts) const
//ong ha_connect::index_flags(uint inx, uint part, bool all_parts) const
ulong ha_connect::index_flags(uint, uint, bool) const
{
ulong flags= HA_READ_NEXT | HA_READ_RANGE |
HA_KEYREAD_ONLY | HA_KEY_SCAN_NOT_ROR;
@ -2008,7 +2007,7 @@ int ha_connect::MakeRecord(char *buf)
/***********************************************************************/
/* Set row values from a MySQL pseudo record. Specific to MySQL. */
/***********************************************************************/
int ha_connect::ScanRecord(PGLOBAL g, uchar *buf)
int ha_connect::ScanRecord(PGLOBAL g, uchar *)
{
char attr_buffer[1024];
char data_buffer[1024];
@ -2150,7 +2149,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *buf)
/* Check change in index column. Specific to MySQL. */
/* Should be elaborated to check for real changes. */
/***********************************************************************/
int ha_connect::CheckRecord(PGLOBAL g, const uchar *oldbuf, uchar *newbuf)
int ha_connect::CheckRecord(PGLOBAL g, const uchar *, uchar *newbuf)
{
return ScanRecord(g, newbuf);
} // end of dummy CheckRecord
@ -2923,7 +2922,7 @@ bool ha_connect::get_error_message(int error, String* buf)
&dummy_errors);
if (trace)
htrc("GEM(%u): %s\n", len, g->Message);
htrc("GEM(%d): len=%u %s\n", error, len, g->Message);
msg[len]= '\0';
buf->copy(msg, (uint)strlen(msg), system_charset_info);
@ -3019,7 +3018,7 @@ int ha_connect::open(const char *name, int mode, uint test_if_locked)
@brief
Make the indexes for this table
*/
int ha_connect::optimize(THD* thd, HA_CHECK_OPT* check_opt)
int ha_connect::optimize(THD* thd, HA_CHECK_OPT*)
{
int rc= 0;
PGLOBAL& g= xp->g;
@ -3223,7 +3222,7 @@ int ha_connect::update_row(const uchar *old_data, uchar *new_data)
@see
sql_acl.cc, sql_udf.cc, sql_delete.cc, sql_insert.cc and sql_select.cc
*/
int ha_connect::delete_row(const uchar *buf)
int ha_connect::delete_row(const uchar *)
{
int rc= 0;
DBUG_ENTER("ha_connect::delete_row");
@ -3503,7 +3502,8 @@ int ha_connect::index_last(uchar *buf)
/****************************************************************************/
/* This is called to get more rows having the same index value. */
/****************************************************************************/
int ha_connect::index_next_same(uchar *buf, const uchar *key, uint keylen)
//t ha_connect::index_next_same(uchar *buf, const uchar *key, uint keylen)
int ha_connect::index_next_same(uchar *buf, const uchar *, uint)
{
int rc;
DBUG_ENTER("ha_connect::index_next_same");
@ -3693,7 +3693,7 @@ int ha_connect::rnd_next(uchar *buf)
@see
filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc
*/
void ha_connect::position(const uchar *record)
void ha_connect::position(const uchar *)
{
DBUG_ENTER("ha_connect::position");
//if (((PTDBASE)tdbp)->GetDef()->Indexable())
@ -3876,7 +3876,7 @@ int ha_connect::info(uint flag)
@see
ha_innodb.cc
*/
int ha_connect::extra(enum ha_extra_function operation)
int ha_connect::extra(enum ha_extra_function /*operation*/)
{
DBUG_ENTER("ha_connect::extra");
DBUG_RETURN(0);
@ -4484,7 +4484,7 @@ int ha_connect::external_lock(THD *thd, int lock_type)
@see
get_lock_data() in lock.cc
*/
THR_LOCK_DATA **ha_connect::store_lock(THD *thd,
THR_LOCK_DATA **ha_connect::store_lock(THD *,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type)
{
@ -4901,7 +4901,7 @@ static int init_table_share(THD* thd,
oom|= sql->append(' ');
oom|= sql->append(opt->name);
oom|= sql->append('=');
oom|= sql->append(vull ? "ON" : "OFF");
oom|= sql->append(vull ? "YES" : "NO");
} // endif vull
break;
@ -4955,7 +4955,7 @@ static int init_table_share(THD* thd,
@note
this function is no more called in case of CREATE .. SELECT
*/
static int connect_assisted_discovery(handlerton *hton, THD* thd,
static int connect_assisted_discovery(handlerton *, THD* thd,
TABLE_SHARE *table_s,
HA_CREATE_INFO *create_info)
{
@ -4967,8 +4967,8 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
#if defined(WIN32)
char *nsp= NULL, *cls= NULL;
#endif // WIN32
int port= 0, hdr= 0, mxr __attribute__((unused))= 0, mxe= 0, rc= 0;
int cop __attribute__((unused))= 0, pty= 2, lrecl= 0, lvl= 0;
int port= 0, hdr= 0, mxr= 0, mxe= 0, rc= 0, lvl= 0;
int cop __attribute__((unused))= 0, pty= 2, lrecl= 0;
#if defined(ODBC_SUPPORT)
POPARM sop = NULL;
char *ucnc = NULL;
@ -5337,7 +5337,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
break;
#endif // PIVOT_SUPPORT
case TAB_VIR:
qrp= VirColumns(g, tab, (char*)db, fnc == FNC_COL);
qrp= VirColumns(g, fnc == FNC_COL);
break;
case TAB_JSON:
qrp= JSONColumns(g, (char*)db, fn, objn, pty, lrecl, lvl, fnc == FNC_COL);
@ -6464,8 +6464,7 @@ fin:
@note: This function is no more called by check_if_supported_inplace_alter
*/
bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes)
bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *, uint)
{
DBUG_ENTER("ha_connect::check_if_incompatible_data");
// TO DO: really implement and check it.

View file

@ -296,7 +296,7 @@ my_bool Json_Value_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
} // end of Json_Value_init
char *Json_Value(UDF_INIT *initid, UDF_ARGS *args, char *result,
unsigned long *res_length, char *is_null, char *error)
unsigned long *res_length, char *, char *)
{
char *str;
PJVAL jvp;
@ -329,7 +329,7 @@ my_bool Json_Array_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
} // end of Json_Array_init
char *Json_Array(UDF_INIT *initid, UDF_ARGS *args, char *result,
unsigned long *res_length, char *is_null, char *error)
unsigned long *res_length, char *, char *)
{
char *str;
uint i;
@ -376,7 +376,7 @@ my_bool Json_Array_Add_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
} // end of Json_Array_Add_init
char *Json_Array_Add(UDF_INIT *initid, UDF_ARGS *args, char *result,
unsigned long *res_length, char *is_null, char *error)
unsigned long *res_length, char *, char *)
{
char *str;
PJVAL jvp;
@ -429,7 +429,7 @@ my_bool Json_Array_Delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
} // end of Json_Array_Delete_init
char *Json_Array_Delete(UDF_INIT *initid, UDF_ARGS *args, char *result,
unsigned long *res_length, char *is_null, char *error)
unsigned long *res_length, char *, char *)
{
char *str;
int n;
@ -482,7 +482,7 @@ my_bool Json_Object_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
} // end of Json_Object_init
char *Json_Object(UDF_INIT *initid, UDF_ARGS *args, char *result,
unsigned long *res_length, char *is_null, char *error)
unsigned long *res_length, char *, char *)
{
char *str;
uint i;
@ -520,7 +520,7 @@ my_bool Json_Object_Nonull_init(UDF_INIT *initid, UDF_ARGS *args,
} // end of Json_Object_Nonull_init
char *Json_Object_Nonull(UDF_INIT *initid, UDF_ARGS *args, char *result,
unsigned long *res_length, char *is_null, char *error)
unsigned long *res_length, char *, char *)
{
char *str;
uint i;
@ -574,8 +574,7 @@ my_bool Json_Array_Grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
return false;
} // end of Json_Array_Grp_init
void Json_Array_Grp_add(UDF_INIT *initid, UDF_ARGS *args,
char *is_null, char *error)
void Json_Array_Grp_add(UDF_INIT *initid, UDF_ARGS *args, char*, char*)
{
PGLOBAL g = (PGLOBAL)initid->ptr;
PJAR arp = (PJAR)g->Activityp;
@ -585,8 +584,8 @@ void Json_Array_Grp_add(UDF_INIT *initid, UDF_ARGS *args,
} // end of Json_Array_Grp_add
char *Json_Array_Grp(UDF_INIT *initid, UDF_ARGS *args, char *result,
unsigned long *res_length, char *is_null, char *error)
char *Json_Array_Grp(UDF_INIT *initid, UDF_ARGS *, char *result,
unsigned long *res_length, char *, char *)
{
char *str;
PGLOBAL g = (PGLOBAL)initid->ptr;
@ -605,7 +604,7 @@ char *Json_Array_Grp(UDF_INIT *initid, UDF_ARGS *args, char *result,
return str;
} // end of Json_Array_Grp
void Json_Array_Grp_clear(UDF_INIT *initid, char *is_null, char *error)
void Json_Array_Grp_clear(UDF_INIT *initid, char*, char*)
{
PGLOBAL g = (PGLOBAL)initid->ptr;
@ -646,8 +645,7 @@ my_bool Json_Object_Grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
return false;
} // end of Json_Object_Grp_init
void Json_Object_Grp_add(UDF_INIT *initid, UDF_ARGS *args,
char *is_null, char *error)
void Json_Object_Grp_add(UDF_INIT *initid, UDF_ARGS *args, char*, char*)
{
PGLOBAL g = (PGLOBAL)initid->ptr;
PJOB objp = (PJOB)g->Activityp;
@ -657,8 +655,8 @@ void Json_Object_Grp_add(UDF_INIT *initid, UDF_ARGS *args,
} // end of Json_Object_Grp_add
char *Json_Object_Grp(UDF_INIT *initid, UDF_ARGS *args, char *result,
unsigned long *res_length, char *is_null, char *error)
char *Json_Object_Grp(UDF_INIT *initid, UDF_ARGS *, char *result,
unsigned long *res_length, char *, char *)
{
char *str;
PGLOBAL g = (PGLOBAL)initid->ptr;
@ -675,7 +673,7 @@ char *Json_Object_Grp(UDF_INIT *initid, UDF_ARGS *args, char *result,
return str;
} // end of Json_Object_Grp
void Json_Object_Grp_clear(UDF_INIT *initid, char *is_null, char *error)
void Json_Object_Grp_clear(UDF_INIT *initid, char*, char*)
{
PGLOBAL g = (PGLOBAL)initid->ptr;

View file

@ -1,4 +1,4 @@
/* Copyright (C) Olivier Bertrand 2004 - 2014
/* Copyright (C) Olivier Bertrand 2004 - 2015
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
@ -18,7 +18,7 @@
/* ------------- */
/* Version 1.4 */
/* */
/* Author: Olivier Bertrand 2012 - 2014 */
/* Author: Olivier Bertrand 2012 - 2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -478,7 +478,7 @@ void MYCAT::SetPath(PGLOBAL g, LPCSTR *datapath, const char *path)
/* Look for a table descriptor matching the name and type. */
/***********************************************************************/
PRELDEF MYCAT::GetTableDesc(PGLOBAL g, LPCSTR name,
LPCSTR type, PRELDEF *prp)
LPCSTR type, PRELDEF *)
{
if (trace)
printf("GetTableDesc: name=%s am=%s\n", name, SVP(type));
@ -589,7 +589,7 @@ PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode, LPCSTR type)
/***********************************************************************/
/* ClearDB: Terminates Database usage. */
/***********************************************************************/
void MYCAT::ClearDB(PGLOBAL g)
void MYCAT::ClearDB(PGLOBAL)
{
} // end of ClearDB

View file

@ -1,4 +1,4 @@
/* Copyright (C) Olivier Bertrand 2004 - 2013
/* Copyright (C) Olivier Bertrand 2004 - 2015
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
@ -98,7 +98,7 @@ class MYCAT : public CATALOG {
void Reset(void);
//void SetDataPath(PGLOBAL g, const char *path)
// {SetPath(g, &DataPath, path);}
bool StoreIndex(PGLOBAL g, PTABDEF defp) {return false;} // Temporary
bool StoreIndex(PGLOBAL, PTABDEF) {return false;} // Temporary
PRELDEF GetTableDesc(PGLOBAL g, LPCSTR name,
LPCSTR type, PRELDEF *prp = NULL);
PTDB GetTable(PGLOBAL g, PTABLE tablep,

View file

@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2007-2014 */
/* (C) Copyright to the author Olivier BERTRAND 2007-2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -720,7 +720,7 @@ int MYSQLC::ExecSQL(PGLOBAL g, const char *query, int *w)
/***********************************************************************/
/* Get table size by executing "select count(*) from table_name". */
/***********************************************************************/
int MYSQLC::GetTableSize(PGLOBAL g, PSZ query)
int MYSQLC::GetTableSize(PGLOBAL g __attribute__((unused)), PSZ query)
{
if (mysql_real_query(m_DB, query, strlen(query))) {
#if defined(_DEBUG)

View file

@ -1,5 +1,5 @@
Warnings:
Warning 1105 No file name. Table will use t1.xml
Warning 1105 No file name. Table will use t1.xml
SET NAMES utf8;
#
# Testing HTML like XML file
@ -11,9 +11,9 @@ CREATE TABLE beers (
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml'
TABNAME='table' OPTION_LIST='xmlsup=libxml2,rownode=tr,colnode=td';
SELECT * FROM beers;
Name Origin Description
Huntsman Bath, UK Wonderful hop, light alcohol
Tuborg Danmark In small bottles
Name Origin Description
Huntsman Bath, UK Wonderful hop, light alcohol
Tuborg Danmark In small bottles
DROP TABLE beers;
#
# Testing HTML file
@ -26,7 +26,7 @@ CREATE TABLE coffee (
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='coffee.htm'
TABNAME='TABLE' HEADER=1 OPTION_LIST='xmlsup=libxml2,Coltype=HTML';
SELECT * FROM coffee;
Name Cups Type Sugar
T. Sexton 10 Espresso No
J. Dinnen 5 Decaf Yes
Name Cups Type Sugar
T. Sexton 10 Espresso No
J. Dinnen 5 Decaf Yes
DROP TABLE coffee;

View file

@ -888,7 +888,7 @@ FILE *PlugReopenFile(PGLOBAL g, PFBLOCK fp, LPCSTR md)
/* Close file routine: the purpose of this routine is to avoid */
/* double closing that freeze the system on some Unix platforms. */
/***********************************************************************/
int PlugCloseFile(PGLOBAL g, PFBLOCK fp, bool all)
int PlugCloseFile(PGLOBAL g __attribute__((unused)), PFBLOCK fp, bool all)
{
int rc = 0;

View file

@ -548,7 +548,7 @@ bool OEMDEF::DeleteTableFile(PGLOBAL g)
/***********************************************************************/
/* Define: initialize the table definition block from XDB file. */
/***********************************************************************/
bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR, int)
{
Module = GetStringCatInfo(g, "Module", "");
Subtype = GetStringCatInfo(g, "Subtype", Module);
@ -715,7 +715,7 @@ COLDEF::COLDEF(void) : COLCRT()
/***********************************************************************/
/* Define: initialize a column definition from a COLINFO structure. */
/***********************************************************************/
int COLDEF::Define(PGLOBAL g, void *memp, PCOLINFO cfp, int poff)
int COLDEF::Define(PGLOBAL g, void *, PCOLINFO cfp, int poff)
{
Name = (PSZ)PlugDup(g, cfp->Name);

View file

@ -1,7 +1,7 @@
/*************** RelDef H Declares Source Code File (.H) ***************/
/* Name: RELDEF.H Version 1.5 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2004-2014 */
/* (C) Copyright to the author Olivier BERTRAND 2004-2015 */
/* */
/* This file contains the DEF classes definitions. */
/***********************************************************************/
@ -89,7 +89,7 @@ class DllExport TABDEF : public RELDEF { /* Logical table descriptor */
bool IsReadOnly(void) {return Read_Only;}
virtual AMT GetDefType(void) {return TYPE_AM_TAB;}
virtual PIXDEF GetIndx(void) {return NULL;}
virtual void SetIndx(PIXDEF xp) {}
virtual void SetIndx(PIXDEF) {}
virtual bool IsHuge(void) {return false;}
const CHARSET_INFO *data_charset() {return m_data_charset;}

View file

@ -1,7 +1,7 @@
/************* TabCol C++ Functions Source Code File (.CPP) ************/
/* Name: TABCOL.CPP Version 2.7 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 1998-2013 */
/* (C) Copyright to the author Olivier BERTRAND 1998-2015 */
/* */
/* This file contains the PlugDB++ XTAB, COLUMN and XORDER methods. */
/***********************************************************************/
@ -91,7 +91,7 @@ void XTAB::Print(PGLOBAL g, FILE *f, uint n)
/***********************************************************************/
/* Make string output of XTAB contents. */
/***********************************************************************/
void XTAB::Print(PGLOBAL g, char *ps, uint z)
void XTAB::Print(PGLOBAL, char *ps, uint z)
{
char buf[128];
int i, n = (int)z - 1;
@ -125,7 +125,7 @@ COLUMN::COLUMN(LPCSTR name) : Name(name)
/***********************************************************************/
/* COLUMN SetFormat: should never be called. */
/***********************************************************************/
bool COLUMN::SetFormat(PGLOBAL g, FORMAT& fmt)
bool COLUMN::SetFormat(PGLOBAL g, FORMAT&)
{
strcpy(g->Message, MSG(NO_FORMAT_COL));
return true;
@ -154,7 +154,7 @@ void COLUMN::Print(PGLOBAL g, FILE *f, uint n)
/***********************************************************************/
/* Make string output of COLUMN contents. */
/***********************************************************************/
void COLUMN::Print(PGLOBAL g, char *ps, uint z)
void COLUMN::Print(PGLOBAL, char *ps, uint z)
{
char buf[80];

View file

@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */
/* (C) Copyright to the author Olivier BERTRAND 1998-2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -117,7 +117,7 @@ DOSDEF::DOSDEF(void)
/***********************************************************************/
/* DefineAM: define specific AM block values from XDB file. */
/***********************************************************************/
bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int)
{
char buf[8];
bool map = (am && (*am == 'M' || *am == 'm'));
@ -303,7 +303,7 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf)
/***********************************************************************/
/* InvalidateIndex: mark all indexes as invalid. */
/***********************************************************************/
bool DOSDEF::InvalidateIndex(PGLOBAL g)
bool DOSDEF::InvalidateIndex(PGLOBAL)
{
if (To_Indx)
for (PIXDEF xp = To_Indx; xp; xp = xp->Next)
@ -1736,15 +1736,16 @@ err:
/***********************************************************************/
/* Make a dynamic index. */
/***********************************************************************/
bool TDBDOS::InitialyzeIndex(PGLOBAL g, PIXDEF xdp, bool sorted)
bool TDBDOS::InitialyzeIndex(PGLOBAL g, volatile PIXDEF xdp, bool sorted)
{
int k, rc;
bool brc, dynamic;
volatile bool dynamic;
bool brc;
PCOL colp;
PCOLDEF cdp;
PVAL valp;
PXLOAD pxp;
PKXBASE kxp;
volatile PKXBASE kxp;
PKPDEF kdp;
if (!xdp && !(xdp = To_Xdp)) {
@ -1864,7 +1865,7 @@ int TDBDOS::GetProgCur(void)
/***********************************************************************/
/* RowNumber: return the ordinal number of the current row. */
/***********************************************************************/
int TDBDOS::RowNumber(PGLOBAL g, bool b)
int TDBDOS::RowNumber(PGLOBAL g, bool)
{
if (To_Kindex) {
/*******************************************************************/
@ -1944,7 +1945,7 @@ int TDBDOS::Cardinality(PGLOBAL g)
rec = ((PDOSDEF)To_Def)->Ending;
if (AvgLen <= 0) // No given average estimate
rec += EstimatedLength(g);
rec += EstimatedLength();
else // An estimate was given for the average record length
rec += AvgLen;
@ -1988,7 +1989,7 @@ int TDBDOS::GetMaxSize(PGLOBAL g)
/* Estimate the number of lines in the table (if not known) by */
/* dividing the file length by minimum record length. */
/*****************************************************************/
rec = EstimatedLength(g) + ((PDOSDEF)To_Def)->Ending;
rec = EstimatedLength() + ((PDOSDEF)To_Def)->Ending;
MaxSize = (len + rec - 1) / rec;
if (trace)
@ -2005,7 +2006,7 @@ int TDBDOS::GetMaxSize(PGLOBAL g)
/***********************************************************************/
/* DOS EstimatedLength. Returns an estimated minimum line length. */
/***********************************************************************/
int TDBDOS::EstimatedLength(PGLOBAL g)
int TDBDOS::EstimatedLength(void)
{
int dep = 0;
PCOLDEF cdp = To_Def->GetCols();
@ -2023,7 +2024,7 @@ int TDBDOS::EstimatedLength(PGLOBAL g)
/***********************************************************************/
/* DOS tables favor the use temporary files for Update. */
/***********************************************************************/
bool TDBDOS::IsUsingTemp(PGLOBAL g)
bool TDBDOS::IsUsingTemp(PGLOBAL)
{
USETEMP utp = UseTemp();
@ -2183,7 +2184,7 @@ int TDBDOS::ReadDB(PGLOBAL g)
/***********************************************************************/
/* PrepareWriting: Prepare the line to write. */
/***********************************************************************/
bool TDBDOS::PrepareWriting(PGLOBAL g)
bool TDBDOS::PrepareWriting(PGLOBAL)
{
if (!Ftype && (Mode == MODE_INSERT || Txfp->GetUseTemp())) {
char *p;

View file

@ -1,7 +1,7 @@
/*************** TabDos H Declares Source Code File (.H) ***************/
/* Name: TABDOS.H Version 3.3 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 1999-2014 */
/* (C) Copyright to the author Olivier BERTRAND 1999-2015 */
/* */
/* This file contains the DOS classes declares. */
/***********************************************************************/
@ -123,11 +123,11 @@ class DllExport TDBDOS : public TDBASE {
// Implementation
virtual AMT GetAmType(void) {return Txfp->GetAmType();}
virtual PSZ GetFile(PGLOBAL g) {return Txfp->To_File;}
virtual void SetFile(PGLOBAL g, PSZ fn) {Txfp->To_File = fn;}
virtual PSZ GetFile(PGLOBAL) {return Txfp->To_File;}
virtual void SetFile(PGLOBAL, PSZ fn) {Txfp->To_File = fn;}
virtual void SetAbort(bool b) {Abort = b;}
virtual RECFM GetFtype(void) {return Ftype;}
virtual bool SkipHeader(PGLOBAL g) {return false;}
virtual bool SkipHeader(PGLOBAL) {return false;}
virtual void RestoreNrec(void) {Txfp->SetNrec(1);}
virtual PTDB Duplicate(PGLOBAL g)
{return (PTDB)new(g) TDBDOS(g, this);}
@ -149,7 +149,7 @@ class DllExport TDBDOS : public TDBASE {
// Database routines
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
virtual char *GetOpenMode(PGLOBAL g, char *opmode) {return NULL;}
virtual char *GetOpenMode(PGLOBAL, char*) {return NULL;}
virtual int GetFileLength(PGLOBAL g) {return Txfp->GetFileLength(g);}
virtual int GetProgMax(PGLOBAL g);
virtual int GetProgCur(void);
@ -168,7 +168,7 @@ class DllExport TDBDOS : public TDBASE {
virtual int ReadBuffer(PGLOBAL g) {return Txfp->ReadBuffer(g);}
// Specific routine
virtual int EstimatedLength(PGLOBAL g);
virtual int EstimatedLength(void);
// Optimization routines
virtual int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add);

View file

@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */
/* (C) Copyright to the author Olivier BERTRAND 1998-2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -271,7 +271,7 @@ int TDBFIX::RowNumber(PGLOBAL g, bool b)
/***********************************************************************/
/* FIX tables don't use temporary files except if specified as do it. */
/***********************************************************************/
bool TDBFIX::IsUsingTemp(PGLOBAL g)
bool TDBFIX::IsUsingTemp(PGLOBAL)
{
// Not ready yet to handle using a temporary file with mapping
// or while deleting from DBF files.

View file

@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2001 - 2014 */
/* (C) Copyright to the author Olivier BERTRAND 2001 - 2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -625,7 +625,7 @@ bool TDBCSV::CheckErr(void)
/***********************************************************************/
/* CSV EstimatedLength. Returns an estimated minimum line length. */
/***********************************************************************/
int TDBCSV::EstimatedLength(PGLOBAL g)
int TDBCSV::EstimatedLength(void)
{
int n = 0;
PCOLDEF cdp;
@ -1118,7 +1118,7 @@ PCOL TDBFMT::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
/* FMT EstimatedLength. Returns an estimated minimum line length. */
/* The big problem here is how can we astimated that minimum ? */
/***********************************************************************/
int TDBFMT::EstimatedLength(PGLOBAL g)
int TDBFMT::EstimatedLength(void)
{
// This is rather stupid !!!
return ((PDOSDEF)To_Def)->GetEnding() + (int)((Lrecl / 10) + 1);

View file

@ -75,7 +75,7 @@ class TDBCSV : public TDBDOS {
virtual int ReadBuffer(PGLOBAL g); // Physical file read
// Specific routines
virtual int EstimatedLength(PGLOBAL g);
virtual int EstimatedLength(void);
virtual bool SkipHeader(PGLOBAL g);
virtual bool CheckErr(void);
@ -157,7 +157,7 @@ class TDBFMT : public TDBCSV {
virtual int ReadBuffer(PGLOBAL g); // Physical file read
// Specific routines
virtual int EstimatedLength(PGLOBAL g);
virtual int EstimatedLength(void);
protected:
virtual bool PrepareWriting(PGLOBAL g)

View file

@ -78,11 +78,13 @@ PQRYRES JSONColumns(PGLOBAL g, char *dp, const char *fn, char *objn,
PJVAL jvp;
PJOB row;
PJDEF tdp;
TDBJSN *tjnp;
PJTDB tjsp;
TDBJSN *tjnp = NULL;
PJTDB tjsp = NULL;
PQRYRES qrp;
PCOLRES crp;
jcol.Name = jcol.Fmt = NULL;
if (info) {
length[0] = 128;
length[7] = 256;
@ -362,7 +364,7 @@ JSONDEF::JSONDEF(void)
/***********************************************************************/
/* DefineAM: define specific AM block values. */
/***********************************************************************/
bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR, int poff)
{
Jmode = (JMODE)GetIntCatInfo("Jmode", MODE_OBJECT);
Objname = GetStringCatInfo(g, "Object", NULL);
@ -506,7 +508,7 @@ PCOL TDBJSN::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
/***********************************************************************/
/* InsertSpecialColumn: Put a special column ahead of the column list.*/
/***********************************************************************/
PCOL TDBJSN::InsertSpecialColumn(PGLOBAL g, PCOL colp)
PCOL TDBJSN::InsertSpecialColumn(PCOL colp)
{
if (!colp->IsSpecial())
return NULL;
@ -1486,7 +1488,7 @@ int TDBJSON::MakeNewDoc(PGLOBAL g)
/***********************************************************************/
int TDBJSON::MakeDocument(PGLOBAL g)
{
char *p, *memory, *objpath, *key;
char *p, *memory, *objpath, *key = NULL;
int len, i = 0;
MODE mode = Mode;
PJSON jsp;
@ -1646,7 +1648,7 @@ void TDBJSON::ResetSize(void)
/***********************************************************************/
/* TDBJSON is not indexable. */
/***********************************************************************/
int TDBJSON::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add)
int TDBJSON::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool)
{
if (pxdf) {
strcpy(g->Message, "JSON not indexable when pretty = 2");
@ -1677,7 +1679,7 @@ int TDBJSON::GetRecpos(void)
/***********************************************************************/
/* Set the position in the table. */
/***********************************************************************/
bool TDBJSON::SetRecpos(PGLOBAL g, int recpos)
bool TDBJSON::SetRecpos(PGLOBAL, int recpos)
{
#if 0
union {
@ -1739,7 +1741,7 @@ bool TDBJSON::OpenDB(PGLOBAL g)
/***********************************************************************/
/* ReadDB: Data Base read routine for JSON access method. */
/***********************************************************************/
int TDBJSON::ReadDB(PGLOBAL g)
int TDBJSON::ReadDB(PGLOBAL)
{
int rc;

View file

@ -82,7 +82,7 @@ class TDBJSN : public TDBDOS {
// Methods
virtual PTDB CopyOne(PTABS t);
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL colp);
virtual PCOL InsertSpecialColumn(PCOL colp);
virtual int RowNumber(PGLOBAL g, bool b = FALSE)
{return (b) ? N : Fpos + 1;}

View file

@ -1,7 +1,7 @@
/************** Table C++ Functions Source Code File (.CPP) ************/
/* Name: TABLE.CPP Version 2.7 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 1999-2014 */
/* (C) Copyright to the author Olivier BERTRAND 1999-2015 */
/* */
/* This file contains the TBX, TDB and OPJOIN classes functions. */
/***********************************************************************/
@ -74,7 +74,7 @@ TDB::TDB(PTDB tdbp) : Tdb_No(++Tnum)
/***********************************************************************/
/* RowNumber: returns the current row ordinal number. */
/***********************************************************************/
int TDB::RowNumber(PGLOBAL g, bool b)
int TDB::RowNumber(PGLOBAL g, bool)
{
sprintf(g->Message, MSG(ROWID_NOT_IMPL), GetAmName(g, GetAmType()));
return 0;
@ -122,7 +122,7 @@ void TDB::Print(PGLOBAL g, FILE *f, uint n)
} // end of Print
void TDB::Print(PGLOBAL g, char *ps, uint z)
void TDB::Print(PGLOBAL, char *ps, uint)
{
sprintf(ps, "R%d.%s", Tdb_No, Name);
} // end of Print
@ -263,7 +263,7 @@ PCOL TDBASE::ColDB(PGLOBAL g, PSZ name, int num)
/***********************************************************************/
/* InsertSpecialColumn: Put a special column ahead of the column list.*/
/***********************************************************************/
PCOL TDBASE::InsertSpecialColumn(PGLOBAL g, PCOL colp)
PCOL TDBASE::InsertSpecialColumn(PCOL colp)
{
if (!colp->IsSpecial())
return NULL;
@ -327,7 +327,7 @@ PCOL TDBASE::InsertSpcBlk(PGLOBAL g, PCOLDEF cdp)
return NULL;
} // endif's name
if (!(colp = InsertSpecialColumn(g, colp))) {
if (!(colp = InsertSpecialColumn(colp))) {
sprintf(g->Message, MSG(BAD_SPECIAL_COL), name);
return NULL;
} // endif Insert
@ -338,7 +338,7 @@ PCOL TDBASE::InsertSpcBlk(PGLOBAL g, PCOLDEF cdp)
/***********************************************************************/
/* ResetTableOpt: Wrong for this table type. */
/***********************************************************************/
int TDBASE::ResetTableOpt(PGLOBAL g, bool dop, bool dox)
int TDBASE::ResetTableOpt(PGLOBAL g, bool, bool)
{
strcpy(g->Message, "This table is not indexable");
return RC_INFO;
@ -365,7 +365,7 @@ void TDBASE::ResetKindex(PGLOBAL g, PKXBASE kxp)
/***********************************************************************/
/* SetRecpos: Replace the table at the specified position. */
/***********************************************************************/
bool TDBASE::SetRecpos(PGLOBAL g, int recpos)
bool TDBASE::SetRecpos(PGLOBAL g, int)
{
strcpy(g->Message, MSG(SETRECPOS_NIY));
return true;
@ -386,7 +386,7 @@ void TDBASE::PrintAM(FILE *f, char *m)
/* Two questions here: exact meaning of U_J_INT ? */
/* Why is the eventual reference to To_Key_Col not marked U_J_EXT ? */
/***********************************************************************/
void TDBASE::MarkDB(PGLOBAL g, PTDB tdb2)
void TDBASE::MarkDB(PGLOBAL, PTDB tdb2)
{
if (trace)
htrc("DOS MarkDB: tdbp=%p tdb2=%p\n", this, tdb2);
@ -453,7 +453,7 @@ bool TDBCAT::Initialize(PGLOBAL g)
/***********************************************************************/
/* CAT: Get the number of properties. */
/***********************************************************************/
int TDBCAT::GetMaxSize(PGLOBAL g)
int TDBCAT::GetMaxSize(PGLOBAL g __attribute__((unused)))
{
if (MaxSize < 0) {
// if (Initialize(g))
@ -528,7 +528,7 @@ bool TDBCAT::InitCol(PGLOBAL g)
/***********************************************************************/
/* SetRecpos: Replace the table at the specified position. */
/***********************************************************************/
bool TDBCAT::SetRecpos(PGLOBAL g, int recpos)
bool TDBCAT::SetRecpos(PGLOBAL, int recpos)
{
N = recpos - 1;
return false;
@ -537,7 +537,7 @@ bool TDBCAT::SetRecpos(PGLOBAL g, int recpos)
/***********************************************************************/
/* Data Base read routine for CAT access method. */
/***********************************************************************/
int TDBCAT::ReadDB(PGLOBAL g)
int TDBCAT::ReadDB(PGLOBAL)
{
return (++N < Qrp->Nblin) ? RC_OK : RC_EF;
} // end of ReadDB
@ -554,7 +554,7 @@ int TDBCAT::WriteDB(PGLOBAL g)
/***********************************************************************/
/* Data Base delete line routine for CAT access methods. */
/***********************************************************************/
int TDBCAT::DeleteDB(PGLOBAL g, int irc)
int TDBCAT::DeleteDB(PGLOBAL g, int)
{
strcpy(g->Message, "Delete not enabled for CAT tables");
return RC_FX;
@ -563,7 +563,7 @@ int TDBCAT::DeleteDB(PGLOBAL g, int irc)
/***********************************************************************/
/* Data Base close routine for WMI access method. */
/***********************************************************************/
void TDBCAT::CloseDB(PGLOBAL g)
void TDBCAT::CloseDB(PGLOBAL)
{
// Nothing to do
} // end of CloseDB
@ -584,7 +584,7 @@ CATCOL::CATCOL(PCOLDEF cdp, PTDB tdbp, int n)
/***********************************************************************/
/* Read the next Data Source elements. */
/***********************************************************************/
void CATCOL::ReadColumn(PGLOBAL g)
void CATCOL::ReadColumn(PGLOBAL)
{
// Get the value of the Name or Description property
if (Crp->Kdata)

View file

@ -561,7 +561,7 @@ int TDBMUL::WriteDB(PGLOBAL g)
/***********************************************************************/
/* Data Base delete line routine for MUL access method. */
/***********************************************************************/
int TDBMUL::DeleteDB(PGLOBAL g, int irc)
int TDBMUL::DeleteDB(PGLOBAL g, int)
{
// When implementing DELETE_MODE InitFileNames must be updated to
// eliminate CRLF under Windows if the file is read in binary.
@ -586,7 +586,7 @@ void TDBMUL::CloseDB(PGLOBAL g)
/***********************************************************************/
/* DefineAM: define specific AM block values from XDB file. */
/***********************************************************************/
bool DIRDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
bool DIRDEF::DefineAM(PGLOBAL g, LPCSTR, int)
{
Desc = Fn = GetStringCatInfo(g, "Filename", NULL);
Incl = (GetIntCatInfo("Subdir", 0) != 0);
@ -597,7 +597,7 @@ bool DIRDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
/***********************************************************************/
/* GetTable: makes a new Table Description Block. */
/***********************************************************************/
PTDB DIRDEF::GetTable(PGLOBAL g, MODE m)
PTDB DIRDEF::GetTable(PGLOBAL g, MODE)
{
#if 0
if (Huge)
@ -865,7 +865,7 @@ int TDBDIR::WriteDB(PGLOBAL g)
/***********************************************************************/
/* Data Base delete line routine for DIR access method. */
/***********************************************************************/
int TDBDIR::DeleteDB(PGLOBAL g, int irc)
int TDBDIR::DeleteDB(PGLOBAL g, int)
{
strcpy(g->Message, MSG(TABDIR_READONLY));
return RC_FX; // NIY
@ -874,7 +874,7 @@ int TDBDIR::DeleteDB(PGLOBAL g, int irc)
/***********************************************************************/
/* Data Base close routine for MUL access method. */
/***********************************************************************/
void TDBDIR::CloseDB(PGLOBAL g)
void TDBDIR::CloseDB(PGLOBAL)
{
#if defined(WIN32)
// Close the search handle.
@ -895,7 +895,7 @@ void TDBDIR::CloseDB(PGLOBAL g)
/***********************************************************************/
/* DIRCOL public constructor. */
/***********************************************************************/
DIRCOL::DIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
DIRCOL::DIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ)
: COLBLK(cdp, tdbp, i)
{
if (cprec) {

View file

@ -5,7 +5,7 @@
/* */
/* AUTHOR: */
/* ------- */
/* Olivier BERTRAND 2007-2014 */
/* Olivier BERTRAND 2007-2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -307,7 +307,7 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b)
/***********************************************************************/
/* DefineAM: define specific AM block values from XCV file. */
/***********************************************************************/
bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int)
{
char *url;
@ -380,7 +380,7 @@ bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
/***********************************************************************/
/* GetTable: makes a new TDB of the proper type. */
/***********************************************************************/
PTDB MYSQLDEF::GetTable(PGLOBAL g, MODE m)
PTDB MYSQLDEF::GetTable(PGLOBAL g, MODE)
{
if (Xsrc)
return new(g) TDBMYEXC(this);
@ -438,7 +438,7 @@ TDBMYSQL::TDBMYSQL(PMYDEF tdp) : TDBASE(tdp)
Nparm = 0;
} // end of TDBMYSQL constructor
TDBMYSQL::TDBMYSQL(PGLOBAL g, PTDBMY tdbp) : TDBASE(tdbp)
TDBMYSQL::TDBMYSQL(PTDBMY tdbp) : TDBASE(tdbp)
{
Host = tdbp->Host;
Database = tdbp->Database;
@ -468,7 +468,7 @@ PTDB TDBMYSQL::CopyOne(PTABS t)
PCOL cp1, cp2;
PGLOBAL g = t->G;
tp = new(g) TDBMYSQL(g, this);
tp = new(g) TDBMYSQL(this);
for (cp1 = Columns; cp1; cp1 = cp1->GetNext()) {
cp2 = new(g) MYSQLCOL((PMYCOL)cp1, tp);
@ -816,7 +816,7 @@ int TDBMYSQL::GetMaxSize(PGLOBAL g)
/***********************************************************************/
/* This a fake routine as ROWID does not exist in MySQL. */
/***********************************************************************/
int TDBMYSQL::RowNumber(PGLOBAL g, bool b)
int TDBMYSQL::RowNumber(PGLOBAL, bool)
{
return N + 1;
} // end of RowNumber
@ -832,7 +832,7 @@ int TDBMYSQL::GetProgMax(PGLOBAL g)
/***********************************************************************/
/* MySQL Bind Parameter function. */
/***********************************************************************/
int TDBMYSQL::BindColumns(PGLOBAL g)
int TDBMYSQL::BindColumns(PGLOBAL g __attribute__((unused)))
{
#if defined(MYSQL_PREPARED_STATEMENTS)
if (Prep) {
@ -1425,7 +1425,7 @@ void MYSQLCOL::ReadColumn(PGLOBAL g)
/***********************************************************************/
/* WriteColumn: make sure the bind buffer is updated. */
/***********************************************************************/
void MYSQLCOL::WriteColumn(PGLOBAL g)
void MYSQLCOL::WriteColumn(PGLOBAL)
{
/*********************************************************************/
/* Do convert the column value if necessary. */
@ -1463,7 +1463,7 @@ TDBMYEXC::TDBMYEXC(PMYDEF tdp) : TDBMYSQL(tdp)
Nerr = 0;
} // end of TDBMYEXC constructor
TDBMYEXC::TDBMYEXC(PGLOBAL g, PTDBMYX tdbp) : TDBMYSQL(g, tdbp)
TDBMYEXC::TDBMYEXC(PTDBMYX tdbp) : TDBMYSQL(tdbp)
{
Cmdlist = tdbp->Cmdlist;
Cmdcol = tdbp->Cmdcol;
@ -1481,7 +1481,7 @@ PTDB TDBMYEXC::CopyOne(PTABS t)
PCOL cp1, cp2;
PGLOBAL g = t->G;
tp = new(g) TDBMYEXC(g, this);
tp = new(g) TDBMYEXC(this);
for (cp1 = Columns; cp1; cp1 = cp1->GetNext()) {
cp2 = new(g) MYXCOL((PMYXCOL)cp1, tp);
@ -1534,7 +1534,7 @@ PCMD TDBMYEXC::MakeCMD(PGLOBAL g)
/***********************************************************************/
/* EXC GetMaxSize: returns the maximum number of rows in the table. */
/***********************************************************************/
int TDBMYEXC::GetMaxSize(PGLOBAL g)
int TDBMYEXC::GetMaxSize(PGLOBAL)
{
if (MaxSize < 0) {
MaxSize = 10; // a guess
@ -1711,7 +1711,7 @@ void MYXCOL::ReadColumn(PGLOBAL g)
/***********************************************************************/
/* WriteColumn: should never be called. */
/***********************************************************************/
void MYXCOL::WriteColumn(PGLOBAL g)
void MYXCOL::WriteColumn(PGLOBAL)
{
assert(false);
} // end of WriteColumn

View file

@ -73,11 +73,11 @@ class TDBMYSQL : public TDBASE {
public:
// Constructor
TDBMYSQL(PMYDEF tdp);
TDBMYSQL(PGLOBAL g, PTDBMY tdbp);
TDBMYSQL(PTDBMY tdbp);
// Implementation
virtual AMT GetAmType(void) {return TYPE_AM_MYSQL;}
virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMYSQL(g, this);}
virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMYSQL(this);}
// Methods
virtual PTDB CopyOne(PTABS t);
@ -180,11 +180,11 @@ class TDBMYEXC : public TDBMYSQL {
public:
// Constructors
TDBMYEXC(PMYDEF tdp);
TDBMYEXC(PGLOBAL g, PTDBMYX tdbp);
TDBMYEXC(PTDBMYX tdbp);
// Implementation
virtual AMT GetAmType(void) {return TYPE_AM_MYX;}
virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMYEXC(g, this);}
virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMYEXC(this);}
// Methods
virtual PTDB CopyOne(PTABS t);

View file

@ -266,7 +266,7 @@ bool OCCURDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
/***********************************************************************/
/* GetTable: makes a new TDB of the proper type. */
/***********************************************************************/
PTDB OCCURDEF::GetTable(PGLOBAL g, MODE m)
PTDB OCCURDEF::GetTable(PGLOBAL g, MODE)
{
if (Catfunc != FNC_COL)
return new(g) TDBOCCUR(this);
@ -432,7 +432,7 @@ int TDBOCCUR::GetMaxSize(PGLOBAL g)
/* In this sample, ROWID will be the (virtual) row number, */
/* while ROWNUM will be the occurence rank in the multiple column. */
/***********************************************************************/
int TDBOCCUR::RowNumber(PGLOBAL g, bool b)
int TDBOCCUR::RowNumber(PGLOBAL, bool b)
{
return (b) ? M : N;
} // end of RowNumber
@ -567,7 +567,7 @@ void OCCURCOL::ReadColumn(PGLOBAL g)
/* ReadColumn: what this routine does is to access the Mth columns of */
/* list, extract its name and set to it the rank column value. */
/***********************************************************************/
void RANKCOL::ReadColumn(PGLOBAL g)
void RANKCOL::ReadColumn(PGLOBAL)
{
PTDBOCCUR tdbp = (PTDBOCCUR)To_Tdb;
PCOL *col = tdbp->Col;

View file

@ -376,7 +376,7 @@ bool PIVOTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
/***********************************************************************/
/* GetTable: makes a new TDB of the proper type. */
/***********************************************************************/
PTDB PIVOTDEF::GetTable(PGLOBAL g, MODE m)
PTDB PIVOTDEF::GetTable(PGLOBAL g, MODE)
{
return new(g) TDBPIVOT(this);
} // end of GetTable
@ -634,7 +634,7 @@ bool TDBPIVOT::MakeViewColumns(PGLOBAL g)
/***********************************************************************/
/* PIVOT GetMaxSize: returns the maximum number of rows in the table. */
/***********************************************************************/
int TDBPIVOT::GetMaxSize(PGLOBAL g)
int TDBPIVOT::GetMaxSize(PGLOBAL g __attribute__((unused)))
{
#if 0
if (MaxSize < 0)
@ -649,7 +649,7 @@ int TDBPIVOT::GetMaxSize(PGLOBAL g)
/* In this sample, ROWID will be the (virtual) row number, */
/* while ROWNUM will be the occurence rank in the multiple column. */
/***********************************************************************/
int TDBPIVOT::RowNumber(PGLOBAL g, bool b)
int TDBPIVOT::RowNumber(PGLOBAL, bool b)
{
return (b) ? M : N;
} // end of RowNumber
@ -806,7 +806,7 @@ int TDBPIVOT::WriteDB(PGLOBAL g)
/***********************************************************************/
/* Data Base delete line routine for PIVOT access methods. */
/***********************************************************************/
int TDBPIVOT::DeleteDB(PGLOBAL g, int irc)
int TDBPIVOT::DeleteDB(PGLOBAL g, int)
{
sprintf(g->Message, MSG(NO_TABLE_DEL), "PIVOT");
return RC_FX;

View file

@ -3,7 +3,7 @@
/* ------------- */
/* Version 2.3 */
/* */
/* Author Olivier BERTRAND 2004-2014 */
/* Author Olivier BERTRAND 2004-2015 */
/* */
/* This program are the INI/CFG tables classes. */
/***********************************************************************/
@ -70,7 +70,7 @@ INIDEF::INIDEF(void)
/***********************************************************************/
/* DefineAM: define specific AM block values from XDB file. */
/***********************************************************************/
bool INIDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
bool INIDEF::DefineAM(PGLOBAL g, LPCSTR, int)
{
char buf[8];
@ -96,7 +96,7 @@ bool INIDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
/***********************************************************************/
/* GetTable: makes a new TDB of the proper type. */
/***********************************************************************/
PTDB INIDEF::GetTable(PGLOBAL g, MODE m)
PTDB INIDEF::GetTable(PGLOBAL g, MODE)
{
PTDBASE tdbp;
@ -277,49 +277,27 @@ bool TDBINI::OpenDB(PGLOBAL g)
/***********************************************************************/
/* Data Base read routine for INI access method. */
/***********************************************************************/
int TDBINI::ReadDB(PGLOBAL g)
int TDBINI::ReadDB(PGLOBAL)
{
/*********************************************************************/
/* Now start the pseudo reading process. */
/*********************************************************************/
#if 0 // INI tables are not indexable
if (To_Kindex) {
/*******************************************************************/
/* Reading is by an index table. */
/*******************************************************************/
int recpos = To_Kindex->Fetch(g);
if (!Section)
Section = Seclist;
else
Section += (strlen(Section) + 1);
switch (recpos) {
case -1: // End of file reached
return RC_EF;
case -2: // No match for join
return RC_NF;
case -3: // Same record as last non null one
return RC_OK;
default:
Section = (char*)recpos; // No good on 64 bit machines
} // endswitch recpos
} else {
#endif // 0
if (!Section)
Section = Seclist;
else
Section += (strlen(Section) + 1);
if (trace > 1)
htrc("INI ReadDB: section=%s N=%d\n", Section, N);
N++;
//} // endif To_Kindex
if (trace > 1)
htrc("INI ReadDB: section=%s N=%d\n", Section, N);
N++;
return (*Section) ? RC_OK : RC_EF;
} // end of ReadDB
/***********************************************************************/
/* WriteDB: Data Base write routine for INI access methods. */
/***********************************************************************/
int TDBINI::WriteDB(PGLOBAL g)
int TDBINI::WriteDB(PGLOBAL)
{
// This is to check that section name was given when inserting
if (Mode == MODE_INSERT)
@ -365,7 +343,7 @@ int TDBINI::DeleteDB(PGLOBAL g, int irc)
/***********************************************************************/
/* Data Base close routine for INI access methods. */
/***********************************************************************/
void TDBINI::CloseDB(PGLOBAL g)
void TDBINI::CloseDB(PGLOBAL)
{
#if !defined(WIN32)
PROFILE_Close(Ifile);
@ -377,7 +355,7 @@ void TDBINI::CloseDB(PGLOBAL g)
/***********************************************************************/
/* INICOL public constructor. */
/***********************************************************************/
INICOL::INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
INICOL::INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ)
: COLBLK(cdp, tdbp, i)
{
if (cprec) {
@ -471,7 +449,7 @@ bool INICOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
/* from the corresponding section, extract from it the key value */
/* corresponding to this column name and convert it to buffer type. */
/***********************************************************************/
void INICOL::ReadColumn(PGLOBAL g)
void INICOL::ReadColumn(PGLOBAL)
{
PTDBINI tdbp = (PTDBINI)To_Tdb;
@ -747,7 +725,7 @@ int TDBXIN::ReadDB(PGLOBAL g)
/***********************************************************************/
/* WriteDB: Data Base write routine for XIN access methods. */
/***********************************************************************/
int TDBXIN::WriteDB(PGLOBAL g)
int TDBXIN::WriteDB(PGLOBAL)
{
// To check that section and key names were given when inserting
if (Mode == MODE_INSERT) {
@ -809,7 +787,7 @@ XINCOL::XINCOL(XINCOL *col1, PTDB tdbp) : INICOL(col1, tdbp)
/* from the corresponding section, extract from it the key value */
/* corresponding to this column name and convert it to buffer type. */
/***********************************************************************/
void XINCOL::ReadColumn(PGLOBAL g)
void XINCOL::ReadColumn(PGLOBAL)
{
PTDBXIN tdbp = (PTDBXIN)To_Tdb;

View file

@ -101,7 +101,7 @@ TBLDEF::TBLDEF(void)
/**************************************************************************/
/* DefineAM: define specific AM block values from XDB file. */
/**************************************************************************/
bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR, int)
{
char *tablist, *dbname, *def = NULL;
@ -161,7 +161,7 @@ bool TBLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
/***********************************************************************/
/* GetTable: makes a new Table Description Block. */
/***********************************************************************/
PTDB TBLDEF::GetTable(PGLOBAL g, MODE m)
PTDB TBLDEF::GetTable(PGLOBAL g, MODE)
{
if (Catfunc == FNC_COL)
return new(g) TDBTBC(this);
@ -202,7 +202,7 @@ PCOL TDBTBL::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
/***********************************************************************/
/* InsertSpecialColumn: Put a special column ahead of the column list.*/
/***********************************************************************/
PCOL TDBTBL::InsertSpecialColumn(PGLOBAL g, PCOL scp)
PCOL TDBTBL::InsertSpecialColumn(PCOL scp)
{
PCOL colp;
@ -548,7 +548,7 @@ int TDBTBL::ReadDB(PGLOBAL g)
/***********************************************************************/
/* ReadColumn: */
/***********************************************************************/
void TBTBLK::ReadColumn(PGLOBAL g)
void TBTBLK::ReadColumn(PGLOBAL)
{
if (trace)
htrc("TBT ReadColumn: name=%s\n", Name);

View file

@ -81,7 +81,7 @@ class DllExport TDBTBL : public TDBPRX {
virtual int Cardinality(PGLOBAL g);
virtual int GetMaxSize(PGLOBAL g);
virtual int RowNumber(PGLOBAL g, bool b = FALSE);
virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL scp);
virtual PCOL InsertSpecialColumn(PCOL scp);
virtual bool OpenDB(PGLOBAL g);
virtual int ReadDB(PGLOBAL g);

View file

@ -292,7 +292,7 @@ PRXDEF::PRXDEF(void)
/***********************************************************************/
/* DefineAM: define specific AM block values from XCOL file. */
/***********************************************************************/
bool PRXDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
bool PRXDEF::DefineAM(PGLOBAL g, LPCSTR, int)
{
char *pn, *db, *tab, *def = NULL;
@ -322,7 +322,7 @@ bool PRXDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
/***********************************************************************/
/* GetTable: makes a new TDB of the proper type. */
/***********************************************************************/
PTDB PRXDEF::GetTable(PGLOBAL g, MODE mode)
PTDB PRXDEF::GetTable(PGLOBAL g, MODE)
{
if (Catfunc == FNC_COL)
return new(g) TDBTBC(this);
@ -341,7 +341,7 @@ TDBPRX::TDBPRX(PPRXDEF tdp) : TDBASE(tdp)
Tdbp = NULL; // The object table
} // end of TDBPRX constructor
TDBPRX::TDBPRX(PGLOBAL g, PTDBPRX tdbp) : TDBASE(tdbp)
TDBPRX::TDBPRX(PTDBPRX tdbp) : TDBASE(tdbp)
{
Tdbp = tdbp->Tdbp;
} // end of TDBPRX copy constructor
@ -353,7 +353,7 @@ PTDB TDBPRX::CopyOne(PTABS t)
PPRXCOL cp1, cp2;
PGLOBAL g = t->G;
tp = new(g) TDBPRX(g, this);
tp = new(g) TDBPRX(this);
for (cp1 = (PPRXCOL)Columns; cp1; cp1 = (PPRXCOL)cp1->GetNext()) {
cp2 = new(g) PRXCOL(cp1, tp); // Make a copy

View file

@ -59,12 +59,12 @@ class DllExport TDBPRX : public TDBASE {
public:
// Constructors
TDBPRX(PPRXDEF tdp);
TDBPRX(PGLOBAL g, PTDBPRX tdbp);
TDBPRX(PTDBPRX tdbp);
// Implementation
virtual AMT GetAmType(void) {return TYPE_AM_PRX;}
virtual PTDB Duplicate(PGLOBAL g)
{return (PTDB)new(g) TDBPRX(g, this);}
{return (PTDB)new(g) TDBPRX(this);}
// Methods
virtual PTDB CopyOne(PTABS t);

View file

@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 1999-2014 */
/* (C) Copyright to the author Olivier BERTRAND 1999-2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@ -94,7 +94,7 @@ PVBLK AllocValBlock(PGLOBAL, void *, int, int, int, int,
/***********************************************************************/
/* DefineAM: define specific AM block values from XDB file. */
/***********************************************************************/
bool VCTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
bool VCTDEF::DefineAM(PGLOBAL g, LPCSTR, int poff)
{
DOSDEF::DefineAM(g, "BIN", poff);
@ -290,7 +290,7 @@ PCOL TDBVCT::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
/***********************************************************************/
/* VEC tables are not ready yet to use temporary files. */
/***********************************************************************/
bool TDBVCT::IsUsingTemp(PGLOBAL g)
bool TDBVCT::IsUsingTemp(PGLOBAL)
{
// For developpers
return (UseTemp() == TMP_TEST);
@ -570,7 +570,7 @@ void VCTCOL::ReadColumn(PGLOBAL g)
/* On each change of block the buffer is written back to file and */
/* in mode Insert the buffer is filled with the block to update. */
/***********************************************************************/
void VCTCOL::WriteColumn(PGLOBAL g)
void VCTCOL::WriteColumn(PGLOBAL)
{
PTXF txfp = ((PTDBVCT)To_Tdb)->Txfp;;

View file

@ -29,7 +29,7 @@
/***********************************************************************/
/* Return the unique column definition to MariaDB. */
/***********************************************************************/
PQRYRES VirColumns(PGLOBAL g, char *tab, char *db, bool info)
PQRYRES VirColumns(PGLOBAL g, bool info)
{
int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
TYPE_INT, TYPE_STRING, TYPE_STRING};
@ -95,7 +95,7 @@ PQRYRES VirColumns(PGLOBAL g, char *tab, char *db, bool info)
/***********************************************************************/
/* GetTable: makes a new Table Description Block. */
/***********************************************************************/
PTDB VIRDEF::GetTable(PGLOBAL g, MODE m)
PTDB VIRDEF::GetTable(PGLOBAL g, MODE)
{
// Column blocks will be allocated only when needed.
if (Catfunc == FNC_COL)
@ -241,7 +241,7 @@ bool TDBVIR::OpenDB(PGLOBAL g)
/***********************************************************************/
/* Data Base read routine for the VIR access method. */
/***********************************************************************/
int TDBVIR::ReadDB(PGLOBAL g)
int TDBVIR::ReadDB(PGLOBAL)
{
return (++N >= Size) ? RC_EF : RC_OK;
} // end of ReadDB
@ -258,7 +258,7 @@ int TDBVIR::WriteDB(PGLOBAL g)
/***********************************************************************/
/* Data Base delete line routine for the VIR access methods. */
/***********************************************************************/
int TDBVIR::DeleteDB(PGLOBAL g, int irc)
int TDBVIR::DeleteDB(PGLOBAL g, int)
{
sprintf(g->Message, MSG(VIR_NO_DELETE), To_Def->GetType());
return RC_FX;
@ -269,7 +269,7 @@ int TDBVIR::DeleteDB(PGLOBAL g, int irc)
/***********************************************************************/
/* VIRCOL public constructor. */
/***********************************************************************/
VIRCOL::VIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
VIRCOL::VIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ)
: COLBLK(cdp, tdbp, i)
{
if (cprec) {
@ -299,7 +299,7 @@ void VIRCOL::ReadColumn(PGLOBAL g)
/***********************************************************************/
PQRYRES TDBVICL::GetResult(PGLOBAL g)
{
return VirColumns(g, NULL, NULL, false);
return VirColumns(g, false);
} // end of GetResult
/* ------------------------- End of Virtual -------------------------- */

View file

@ -11,7 +11,7 @@ typedef class TDBVIR *PTDBVIR;
/***********************************************************************/
/* Return the unique column definition to MariaDB. */
/***********************************************************************/
PQRYRES VirColumns(PGLOBAL g, char *tab, char *db, bool info);
PQRYRES VirColumns(PGLOBAL g, bool info);
/* --------------------------- VIR classes --------------------------- */

View file

@ -83,7 +83,7 @@ bool XCLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
/***********************************************************************/
/* GetTable: makes a new TDB of the proper type. */
/***********************************************************************/
PTDB XCLDEF::GetTable(PGLOBAL g, MODE mode)
PTDB XCLDEF::GetTable(PGLOBAL g, MODE)
{
if (Catfunc == FNC_COL)
return new(g) TDBTBC(this);
@ -117,7 +117,7 @@ PCOL TDBXCL::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
PCOL colp;
if (!stricmp(cdp->GetName(), Xcolumn)) {
Xcolp = new(g) XCLCOL(g, cdp, this, cprec, n);
Xcolp = new(g) XCLCOL(cdp, this, cprec, n);
colp = Xcolp;
} else
colp = new(g) PRXCOL(cdp, this, cprec, n);
@ -144,7 +144,7 @@ int TDBXCL::GetMaxSize(PGLOBAL g)
/* For this table type, ROWID is the (virtual) row number, */
/* while ROWNUM is be the occurence rank in the multiple column. */
/***********************************************************************/
int TDBXCL::RowNumber(PGLOBAL g, bool b)
int TDBXCL::RowNumber(PGLOBAL, bool b)
{
return (b) ? M : N;
} // end of RowNumber
@ -232,7 +232,7 @@ int TDBXCL::ReadDB(PGLOBAL g)
/***********************************************************************/
/* XCLCOL public constructor. */
/***********************************************************************/
XCLCOL::XCLCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i)
XCLCOL::XCLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i)
: PRXCOL(cdp, tdbp, cprec, i, "XCL")
{
// Set additional XXL access method information for column.

View file

@ -85,7 +85,7 @@ class XCLCOL : public PRXCOL {
friend class TDBXCL;
public:
// Constructors
XCLCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i);
XCLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i);
// Methods
using PRXCOL::Init;

View file

@ -118,7 +118,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
FLD_LENGTH, FLD_SCALE, FLD_NULL, FLD_FORMAT};
static unsigned int length[] = {0, 6, 8, 10, 10, 6, 6, 0};
char *op, colname[65], fmt[129], buf[512];
int i, j, lvl, rc, n = 0;
int i, j, lvl, n = 0;
int ncol = sizeof(buftyp) / sizeof(int);
bool ok = true;
PXCL xcol, xcp, fxcp = NULL, pxcp = NULL;
@ -164,7 +164,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
txmp = new(g) TDBXML(tdp);
if (txmp->Initialize(g))
return NULL;
goto err;
xcol = new(g) XMCOL;
colname[64] = 0;
@ -224,8 +224,16 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
if (vp->atp) {
strncpy(colname, vp->atp->GetName(g), sizeof(colname));
strncat(xcol->Name, colname, 64);
rc = vp->atp->GetText(g, buf, sizeof(buf));
strncat(fmt, "@", sizeof(fmt));
switch (vp->atp->GetText(g, buf, sizeof(buf))) {
case RC_INFO:
PushWarning(g, txmp);
case RC_OK:
strncat(fmt, "@", sizeof(fmt));
break;
default:
goto err;
} // enswitch rc
if (j)
strncat(fmt, colname, sizeof(fmt));
@ -273,7 +281,15 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
} else
ok = true;
rc = node->GetContent(g, buf, sizeof(buf));
switch (node->GetContent(g, buf, sizeof(buf))) {
case RC_INFO:
PushWarning(g, txmp);
case RC_OK:
break;
default:
goto err;
} // enswitch rc
} // endif atp;
xcol->Len = strlen(buf);
@ -313,10 +329,6 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
pxcp = xcp;
// for (j = lvl - 1; j >= 0; j--)
// if (jrp[j] && (jrp[j] = jrp[j]->GetNext()))
// goto more;
if (vp->atp)
vp->atp = vp->atp->GetNext(g);
@ -421,8 +433,6 @@ XMLDEF::XMLDEF(void)
bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{
char *defrow, *defcol, buf[10];
//void *memp = Cat->GetDescp();
//PSZ dbfile = Cat->GetDescFile();
Fn = GetStringCatInfo(g, "Filename", NULL);
Encoding = GetStringCatInfo(g, "Encoding", "UTF-8");
@ -479,12 +489,6 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
Header = GetIntCatInfo("Header", 0);
GetCharCatInfo("Xmlsup", "*", buf, sizeof(buf));
//if (*buf == '*') // Try the old (deprecated) option
// GetCharCatInfo("Method", "*", buf, sizeof(buf));
//if (*buf == '*') // Is there a default for the database?
// GetCharCatInfo("Defxml", XMLSUP, buf, sizeof(buf));
// Note that if no support is specified, the default is MS-DOM
// on Windows and libxml2 otherwise
if (*buf == '*')
@ -499,7 +503,6 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
// Get eventual table node attribute
Attrib = GetStringCatInfo(g, "Attribute", "");
Hdattr = GetStringCatInfo(g, "HeadAttr", "");
return false;
} // end of DefineAM
@ -519,30 +522,6 @@ PTDB XMLDEF::GetTable(PGLOBAL g, MODE m)
return tdbp;
} // end of GetTable
#if 0
/***********************************************************************/
/* DeleteTableFile: Delete XML table files using platform API. */
/***********************************************************************/
bool XMLDEF::DeleteTableFile(PGLOBAL g)
{
char filename[_MAX_PATH];
bool rc;
// Delete the XML table file if not protected
if (!IsReadOnly()) {
PlugSetPath(filename, Fn, GetPath());
#if defined(WIN32)
rc = !DeleteFile(filename);
#else // UNIX
rc = remove(filename);
#endif // UNIX
} else
rc =true;
return rc; // Return true if error
} // end of DeleteTableFile
#endif // 0
/* ------------------------- TDBXML Class ---------------------------- */
/***********************************************************************/
@ -667,7 +646,7 @@ PCOL TDBXML::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
/***********************************************************************/
/* InsertSpecialColumn: Put a special column ahead of the column list.*/
/***********************************************************************/
PCOL TDBXML::InsertSpecialColumn(PGLOBAL g, PCOL colp)
PCOL TDBXML::InsertSpecialColumn(PCOL colp)
{
if (!colp->IsSpecial())
return NULL;
@ -854,7 +833,6 @@ bool TDBXML::Initialize(PGLOBAL g)
To_Xb = Docp->LinkXblock(g, Mode, rc, filename);
// Add a CONNECT comment node
// sprintf(buf, " Created by CONNECT %s ", version);
strcpy(buf, " Created by the MariaDB CONNECT Storage Engine");
Docp->AddComment(g, buf);
@ -1279,7 +1257,6 @@ void TDBXML::CloseDB(PGLOBAL g)
if (Docp) {
if (Changed) {
char filename[_MAX_PATH];
// PDBUSER dup = (PDBUSER)g->Activityp->Aptr;
// We used the file name relative to recorded datapath
PlugSetPath(filename, Xfile, GetPath());
@ -1321,7 +1298,6 @@ void TDBXML::CloseDB(PGLOBAL g)
NewRow = false;
Hasnod = false;
Write = false;
// Bufdone = false;
Nodedone = false;
Void = false;
Nrow = -1;
@ -1413,8 +1389,6 @@ bool XMLCOL::AllocBuf(PGLOBAL g, bool mode)
if (Valbuf)
return false; // Already done
//Valbuf = (char*)PlugSubAlloc(g, NULL, Long + 1);
//Valbuf[Long] = '\0';
return ParseXpath(g, mode);
} // end of AllocBuf
@ -1506,8 +1480,6 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode)
// HTML like table, columns are retrieved by position
new(this) XPOSCOL(Value); // Change the class of this column
Inod = -1;
// Tdbp->Hasnod = true;
// return false;
} else if (Type == 0 && !mode) {
strcat(strcat(pbuf, "@"), Name);
} else { // Type == 1
@ -1657,7 +1629,6 @@ void XMLCOL::WriteColumn(PGLOBAL g)
int done = 0;
int i, n, k = 0;
PXNODE TopNode = NULL;
//PXATTR AttNode = NULL;
if (trace > 1)
htrc("XML WriteColumn: col %s R%d coluse=%.4X status=%.4X\n",
@ -1892,7 +1863,6 @@ void XMULCOL::WriteColumn(PGLOBAL g)
int done = 0;
int i, n, len, k = 0;
PXNODE TopNode = NULL;
//PXATTR AttNode = NULL;
if (trace)
htrc("XML WriteColumn: col %s R%d coluse=%.4X status=%.4X\n",

View file

@ -84,7 +84,7 @@ class DllExport TDBXML : public TDBASE {
// Database routines
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL colp);
virtual PCOL InsertSpecialColumn(PCOL colp);
//virtual int GetMaxSame(PGLOBAL g) {return (Xpand) ? Limit : 1;}
virtual int Cardinality(PGLOBAL g);
virtual int GetMaxSize(PGLOBAL g);

View file

@ -1,4 +1,4 @@
/* Copyright (C) Olivier Bertrand 2004 - 2014
/* Copyright (C) Olivier Bertrand 2004 - 2015
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
@ -28,7 +28,7 @@
*/
/****************************************************************************/
/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2014 */
/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2015 */
/****************************************************************************/
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
@ -63,7 +63,7 @@ void SetWorkSize(uint);
/****************************************************************************/
/* Constructor. */
/****************************************************************************/
user_connect::user_connect(THD *thd, const char *dbn)
user_connect::user_connect(THD *thd)
{
thdp= thd;
next= NULL;

View file

@ -45,7 +45,7 @@ class user_connect
friend int connect_done_func(void *);
public:
// Constructor
user_connect(THD *thd, const char *dbn);
user_connect(THD *thd);
// Destructor
virtual ~user_connect();

View file

@ -132,7 +132,7 @@ VALBLK::VALBLK(void *mp, int type, int nval, bool un)
/***********************************************************************/
/* Raise error for numeric types. */
/***********************************************************************/
PSZ VALBLK::GetCharValue(int n)
PSZ VALBLK::GetCharValue(int)
{
PGLOBAL& g = Global;
@ -145,7 +145,7 @@ PSZ VALBLK::GetCharValue(int n)
/***********************************************************************/
/* Set format so formatted dates can be converted on input. */
/***********************************************************************/
bool VALBLK::SetFormat(PGLOBAL g, PSZ fmt, int len, int year)
bool VALBLK::SetFormat(PGLOBAL g, PSZ, int, int)
{
sprintf(g->Message, MSG(NO_DATE_FMT), Type);
return true;
@ -752,7 +752,7 @@ double CHRBLK::GetFloatValue(int n)
/***********************************************************************/
/* STRING GetCharString: get string representation of a char value. */
/***********************************************************************/
char *CHRBLK::GetCharString(char *p, int n)
char *CHRBLK::GetCharString(char *, int n)
{
return (char *)GetValPtrEx(n);
} // end of GetCharString

View file

@ -95,17 +95,17 @@ class VALBLK : public BLOCK {
virtual bool IsCi(void) {return false;}
// Methods
virtual void SetValue(short sval, int n) {assert(false);}
virtual void SetValue(ushort sval, int n) {assert(false);}
virtual void SetValue(int lval, int n) {assert(false);}
virtual void SetValue(uint lval, int n) {assert(false);}
virtual void SetValue(longlong lval, int n) {assert(false);}
virtual void SetValue(ulonglong lval, int n) {assert(false);}
virtual void SetValue(double fval, int n) {assert(false);}
virtual void SetValue(char cval, int n) {assert(false);}
virtual void SetValue(uchar cval, int n) {assert(false);}
virtual void SetValue(PSZ sp, int n) {assert(false);}
virtual void SetValue(char *sp, uint len, int n) {assert(false);}
virtual void SetValue(short, int) {assert(false);}
virtual void SetValue(ushort, int) {assert(false);}
virtual void SetValue(int, int) {assert(false);}
virtual void SetValue(uint, int) {assert(false);}
virtual void SetValue(longlong, int) {assert(false);}
virtual void SetValue(ulonglong, int) {assert(false);}
virtual void SetValue(double, int) {assert(false);}
virtual void SetValue(char, int) {assert(false);}
virtual void SetValue(uchar, int) {assert(false);}
virtual void SetValue(PSZ, int) {assert(false);}
virtual void SetValue(char *, uint, int) {assert(false);}
virtual void SetValue(PVAL valp, int n) = 0;
virtual void SetValue(PVBLK pv, int n1, int n2) = 0;
virtual void SetMin(PVAL valp, int n) = 0;
@ -271,7 +271,7 @@ class STRBLK : public VALBLK {
// Implementation
virtual void SetNull(int n, bool b) {if (b) {Strp[n] = NULL;}}
virtual bool IsNull(int n) {return Strp[n] == NULL;}
virtual void SetNullable(bool b) {} // Always nullable
virtual void SetNullable(bool) {} // Always nullable
virtual bool Init(PGLOBAL g, bool check);
virtual int GetVlen(void) {return sizeof(PSZ);}
virtual PSZ GetCharValue(int n) {return Strp[n];}
@ -284,7 +284,7 @@ class STRBLK : public VALBLK {
virtual longlong GetBigintValue(int n);
virtual ulonglong GetUBigintValue(int n);
virtual double GetFloatValue(int n) {return atof(Strp[n]);}
virtual char *GetCharString(char *p, int n) {return Strp[n];}
virtual char *GetCharString(char *, int n) {return Strp[n];}
virtual void Reset(int n) {Strp[n] = NULL;}
// Methods

View file

@ -475,7 +475,7 @@ PVAL AllocateValue(PGLOBAL g, PVAL valp, int newtype, int uns)
break;
case TYPE_DATE:
vp = new(g) DTVAL(g, valp->GetIntValue());
vp = new(g) DTVAL(valp->GetIntValue());
break;
case TYPE_DOUBLE:
vp = new(g) TYPVAL<double>(valp->GetFloatValue(), TYPE_DOUBLE,
@ -551,7 +551,7 @@ BYTE VALUE::TestValue(PVAL vp)
/***********************************************************************/
/* Compute a function on a string. */
/***********************************************************************/
bool VALUE::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
bool VALUE::Compute(PGLOBAL g, PVAL *, int, OPVAL)
{
strcpy(g->Message, "Compute not implemented for this value type");
return true;
@ -976,7 +976,7 @@ ulonglong TYPVAL<ulonglong>::MinMaxVal(bool b)
{return (b) ? 0xFFFFFFFFFFFFFFFFLL : 0;}
template <>
double TYPVAL<double>::MinMaxVal(bool b)
double TYPVAL<double>::MinMaxVal(bool)
{assert(false); return 0.0;}
template <>
@ -1566,7 +1566,7 @@ bool TYPVAL<PSZ>::GetBinValue(void *buf, int buflen, bool go)
/***********************************************************************/
/* STRING ShowValue: get string representation of a char value. */
/***********************************************************************/
char *TYPVAL<PSZ>::ShowValue(char *buf, int len)
char *TYPVAL<PSZ>::ShowValue(char *, int)
{
return Strp;
} // end of ShowValue
@ -1574,7 +1574,7 @@ char *TYPVAL<PSZ>::ShowValue(char *buf, int len)
/***********************************************************************/
/* STRING GetCharString: get string representation of a char value. */
/***********************************************************************/
char *TYPVAL<PSZ>::GetCharString(char *p)
char *TYPVAL<PSZ>::GetCharString(char *)
{
return Strp;
} // end of GetCharString
@ -1681,7 +1681,7 @@ bool TYPVAL<PSZ>::FormatValue(PVAL vp, char *fmt)
/***********************************************************************/
/* STRING SetFormat function (used to set SELECT output format). */
/***********************************************************************/
bool TYPVAL<PSZ>::SetConstFormat(PGLOBAL g, FORMAT& fmt)
bool TYPVAL<PSZ>::SetConstFormat(PGLOBAL, FORMAT& fmt)
{
fmt.Type[0] = 'C';
fmt.Length = Len;
@ -2300,7 +2300,7 @@ char *BINVAL::ShowValue(char *buf, int len)
/***********************************************************************/
/* BINVAL GetCharString: get string representation of a binary value. */
/***********************************************************************/
char *BINVAL::GetCharString(char *p)
char *BINVAL::GetCharString(char *)
{
if (!Chrp)
Chrp = (char*)PlugSubAlloc(Global, NULL, Clen * 2 + 1);
@ -2349,7 +2349,7 @@ bool BINVAL::FormatValue(PVAL vp, char *fmt)
/***********************************************************************/
/* BINVAL SetFormat function (used to set SELECT output format). */
/***********************************************************************/
bool BINVAL::SetConstFormat(PGLOBAL g, FORMAT& fmt)
bool BINVAL::SetConstFormat(PGLOBAL, FORMAT& fmt)
{
fmt.Type[0] = 'B';
fmt.Length = Clen;
@ -2379,7 +2379,7 @@ DTVAL::DTVAL(PGLOBAL g, int n, int prec, PSZ fmt)
/***********************************************************************/
/* DTVAL public constructor from int. */
/***********************************************************************/
DTVAL::DTVAL(PGLOBAL g, int n) : TYPVAL<int>(n, TYPE_DATE)
DTVAL::DTVAL(int n) : TYPVAL<int>(n, TYPE_DATE)
{
Pdtp = NULL;
Len = 19;

View file

@ -94,18 +94,18 @@ class DllExport VALUE : public BLOCK {
virtual bool SetValue_pval(PVAL valp, bool chktype = false) = 0;
virtual bool SetValue_char(char *p, int n) = 0;
virtual void SetValue_psz(PSZ s) = 0;
virtual void SetValue_bool(bool b) {assert(FALSE);}
virtual void SetValue_bool(bool) {assert(FALSE);}
virtual int CompareValue(PVAL vp) = 0;
virtual BYTE TestValue(PVAL vp);
virtual void SetValue(char c) {assert(false);}
virtual void SetValue(uchar c) {assert(false);}
virtual void SetValue(short i) {assert(false);}
virtual void SetValue(ushort i) {assert(false);}
virtual void SetValue(int n) {assert(false);}
virtual void SetValue(uint n) {assert(false);}
virtual void SetValue(longlong n) {assert(false);}
virtual void SetValue(ulonglong n) {assert(false);}
virtual void SetValue(double f) {assert(false);}
virtual void SetValue(char) {assert(false);}
virtual void SetValue(uchar) {assert(false);}
virtual void SetValue(short) {assert(false);}
virtual void SetValue(ushort) {assert(false);}
virtual void SetValue(int) {assert(false);}
virtual void SetValue(uint) {assert(false);}
virtual void SetValue(longlong) {assert(false);}
virtual void SetValue(ulonglong) {assert(false);}
virtual void SetValue(double) {assert(false);}
virtual void SetValue_pvblk(PVBLK blk, int n) = 0;
virtual void SetBinValue(void *p) = 0;
virtual bool GetBinValue(void *buf, int buflen, bool go) = 0;
@ -338,7 +338,7 @@ class DllExport BINVAL: public VALUE {
virtual void SetValue(double f);
virtual void SetBinValue(void *p);
virtual bool GetBinValue(void *buf, int buflen, bool go);
virtual int CompareValue(PVAL vp) {assert(false); return 0;}
virtual int CompareValue(PVAL) {assert(false); return 0;}
virtual char *ShowValue(char *buf, int);
virtual char *GetCharString(char *p);
virtual bool IsEqual(PVAL vp, bool chktype);
@ -359,11 +359,11 @@ class DllExport DTVAL : public TYPVAL<int> {
public:
// Constructors
DTVAL(PGLOBAL g, int n, int p, PSZ fmt);
DTVAL(PGLOBAL g, PSZ s, int n);
DTVAL(PGLOBAL g, short i);
DTVAL(PGLOBAL g, int n);
DTVAL(PGLOBAL g, longlong n);
DTVAL(PGLOBAL g, double f);
//DTVAL(PGLOBAL g, PSZ s, int n);
//DTVAL(PGLOBAL g, short i);
DTVAL(int n);
//DTVAL(PGLOBAL g, longlong n);
//DTVAL(PGLOBAL g, double f);
// Implementation
virtual bool IsZero(void) {return Null;}

View file

@ -1,7 +1,7 @@
/***************** Xindex C++ Class Xindex Code (.CPP) *****************/
/* Name: XINDEX.CPP Version 2.9 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2004-2014 */
/* (C) Copyright to the author Olivier BERTRAND 2004-2015 */
/* */
/* This file contains the class XINDEX implementation code. */
/***********************************************************************/
@ -179,7 +179,7 @@ XXBASE::XXBASE(PTDBDOS tbxp, bool b) : CSORT(b),
/***********************************************************************/
/* Make file output of XINDEX contents. */
/***********************************************************************/
void XXBASE::Print(PGLOBAL g, FILE *f, uint n)
void XXBASE::Print(PGLOBAL, FILE *f, uint n)
{
char m[64];
@ -191,7 +191,7 @@ void XXBASE::Print(PGLOBAL g, FILE *f, uint n)
/***********************************************************************/
/* Make string output of XINDEX contents. */
/***********************************************************************/
void XXBASE::Print(PGLOBAL g, char *ps, uint z)
void XXBASE::Print(PGLOBAL, char *ps, uint z)
{
*ps = '\0';
strncat(ps, "Xindex", z);
@ -287,7 +287,7 @@ int XINDEX::Qcompare(int *i1, int *i2)
/* Sure enough, it is done while records are read and permit to avoid */
/* reading the table while doing the join (Dynamic index only) */
/***********************************************************************/
bool XINDEX::AddColumns(PIXDEF xdp)
bool XINDEX::AddColumns(void)
{
if (!Dynamic)
return false; // Not applying to static index
@ -377,7 +377,7 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp)
To_LastCol = prev;
if (AddColumns(sxp)) {
if (AddColumns()) {
PCOL kolp = To_Cols[0]; // Temporary while imposing Nk = 1
i = 0;
@ -733,7 +733,7 @@ int XINDEX::ColMaxSame(PXCOL kp)
/* Reorder: use the sort index to reorder the data in storage so */
/* it will be physically sorted and sort index can be removed. */
/***********************************************************************/
bool XINDEX::Reorder(PGLOBAL g)
bool XINDEX::Reorder(PGLOBAL g __attribute__((unused)))
{
register int i, j, k, n;
bool sorted = true;
@ -1585,7 +1585,7 @@ int XINDEX::Range(PGLOBAL g, int limit, bool incl)
if (++i == Nval) break;
} // endfor kp
if ((k = FastFind(Nval)) < Num_K)
if ((k = FastFind()) < Num_K)
n = k;
// if (limit)
// n = (Mul) ? k : kp->Val_K;
@ -1826,7 +1826,7 @@ int XINDEX::Fetch(PGLOBAL g)
if (trace > 1)
htrc("Fetch: Looking for new value\n");
Cur_K = FastFind(Nval);
Cur_K = FastFind();
if (Cur_K >= Num_K)
/*************************************************************/
@ -1857,12 +1857,12 @@ int XINDEX::Fetch(PGLOBAL g)
/* FastFind: Returns the index of matching record in a join using an */
/* optimized algorithm based on dichotomie and optimized comparing. */
/***********************************************************************/
int XINDEX::FastFind(int nv)
int XINDEX::FastFind(void)
{
register int curk, sup, inf, i= 0, k, n = 2;
register PXCOL kp, kcp;
assert((int)nv == Nval);
//assert((int)nv == Nval);
if (Nblk && Op == OP_EQ) {
// Look in block values to find in which block to search
@ -2018,7 +2018,7 @@ int XINDXS::Range(PGLOBAL g, int limit, bool incl)
/*********************************************************************/
if (xp->GetType() == TYPE_CONST) {
kp->Valp->SetValue_pval(xp->GetValue(), !kp->Prefix);
k = FastFind(Nval);
k = FastFind();
if (k < Num_K || Op != OP_EQ)
if (limit)
@ -2162,7 +2162,7 @@ int XINDXS::Fetch(PGLOBAL g)
if (trace > 1)
htrc("Fetch: Looking for new value\n");
Cur_K = FastFind(1);
Cur_K = FastFind();
if (Cur_K >= Num_K)
// Rank not whithin index table, signal record not found
@ -2190,7 +2190,7 @@ int XINDXS::Fetch(PGLOBAL g)
/* FastFind: Returns the index of matching indexed record using an */
/* optimized algorithm based on dichotomie and optimized comparing. */
/***********************************************************************/
int XINDXS::FastFind(int nk)
int XINDXS::FastFind(void)
{
register int sup, inf, i= 0, n = 2;
register PXCOL kcp = To_KeyCol;
@ -2360,7 +2360,8 @@ bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode)
/***********************************************************************/
/* Move into an index file. */
/***********************************************************************/
bool XFILE::Seek(PGLOBAL g, int low, int high, int origin)
bool XFILE::Seek(PGLOBAL g, int low, int high __attribute__((unused)),
int origin)
{
#if defined(_DEBUG)
assert(high == 0);
@ -2371,7 +2372,6 @@ bool XFILE::Seek(PGLOBAL g, int low, int high, int origin)
return true;
} // endif
//ftell(Xfile);
return false;
} // end of Seek
@ -2819,7 +2819,7 @@ void XHUGE::Close(char *fn, int id)
/***********************************************************************/
/* Don't know whether this is possible for huge files. */
/***********************************************************************/
void *XHUGE::FileView(PGLOBAL g, char *fn)
void *XHUGE::FileView(PGLOBAL g, char *)
{
strcpy(g->Message, MSG(NO_PART_MAP));
return NULL;
@ -2879,7 +2879,7 @@ bool XXROW::Init(PGLOBAL g)
/***********************************************************************/
/* RANGE: Tell how many record exist in a given value range. */
/***********************************************************************/
int XXROW::Range(PGLOBAL g, int limit, bool incl)
int XXROW::Range(PGLOBAL, int limit, bool incl)
{
int n = Valp->GetIntValue();
@ -2895,7 +2895,7 @@ int XXROW::Range(PGLOBAL g, int limit, bool incl)
/***********************************************************************/
/* XXROW: Fetch a physical or logical record. */
/***********************************************************************/
int XXROW::Fetch(PGLOBAL g)
int XXROW::Fetch(PGLOBAL)
{
if (Num_K == 0)
return -1; // means end of file
@ -2904,7 +2904,7 @@ int XXROW::Fetch(PGLOBAL g)
/* Look for a key equal to the link column of previous table, */
/* and return its rank whithin the index table. */
/*********************************************************************/
Cur_K = FastFind(1);
Cur_K = FastFind();
if (Cur_K >= Num_K)
/*******************************************************************/
@ -2926,7 +2926,7 @@ int XXROW::Fetch(PGLOBAL g)
/***********************************************************************/
/* FastFind: Returns the index of matching record in a join. */
/***********************************************************************/
int XXROW::FastFind(int nk)
int XXROW::FastFind(void)
{
int n = Valp->GetIntValue();

View file

@ -1,7 +1,7 @@
/*************** Xindex H Declares Source Code File (.H) ***************/
/* Name: XINDEX.H Version 3.5 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2004 - 2013 */
/* (C) Copyright to the author Olivier BERTRAND 2004 - 2015 */
/* */
/* This file contains the XINDEX class declares. */
/***********************************************************************/
@ -205,12 +205,11 @@ class DllExport XXBASE : public CSORT, public BLOCK {
#endif // XMAP
virtual int MaxRange(void) {return 1;}
virtual int Fetch(PGLOBAL g) = 0;
virtual bool NextVal(bool eq) {return true;}
virtual bool NextVal(bool) {return true;}
virtual bool PrevVal(void) {return true;}
virtual int FastFind(int nk) = 0;
virtual bool Reorder(PGLOBAL g) {return true;}
virtual int Range(PGLOBAL g, int limit = 0, bool incl = true)
{return -1;} // Means error
virtual int FastFind(void) = 0;
virtual bool Reorder(PGLOBAL) {return true;}
virtual int Range(PGLOBAL, int = 0, bool = true) {return -1;} // Means error
virtual int Qcompare(int *, int *) = 0;
virtual int GroupSize(void) {return 1;}
virtual void Close(void) = 0;
@ -266,7 +265,7 @@ class DllExport XINDEX : public XXBASE {
#endif // XMAP
virtual int Qcompare(int *, int *);
virtual int Fetch(PGLOBAL g);
virtual int FastFind(int nk);
virtual int FastFind(void);
virtual int GroupSize(void);
virtual int Range(PGLOBAL g, int limit = 0, bool incl = true);
virtual int MaxRange(void) {return MaxSame;}
@ -280,7 +279,7 @@ class DllExport XINDEX : public XXBASE {
bool GetAllSizes(PGLOBAL g,/* int &ndif,*/ int &numk);
protected:
bool AddColumns(PIXDEF xdp);
bool AddColumns(void);
bool NextValDif(void);
// Members
@ -312,7 +311,7 @@ class DllExport XINDXS : public XINDEX {
// Methods
virtual int Qcompare(int *, int *);
virtual int Fetch(PGLOBAL g);
virtual int FastFind(int nk);
virtual int FastFind(void);
virtual bool NextVal(bool eq);
virtual bool PrevVal(void);
virtual int Range(PGLOBAL g, int limit = 0, bool incl = true);
@ -421,14 +420,14 @@ class DllExport XXROW : public XXBASE {
// Methods
virtual bool Init(PGLOBAL g);
#if defined(XMAP)
virtual bool MapInit(PGLOBAL g) {return true;}
virtual bool MapInit(PGLOBAL) {return true;}
#endif // XMAP
virtual int Fetch(PGLOBAL g);
virtual int FastFind(int nk);
virtual int FastFind(void);
virtual int MaxRange(void) {return 1;}
virtual int Range(PGLOBAL g, int limit = 0, bool incl = true);
virtual int Qcompare(int *, int *) {assert(false); return 0;}
virtual bool Make(PGLOBAL g, PIXDEF sxp) {return false;}
virtual bool Make(PGLOBAL, PIXDEF) {return false;}
virtual void Close(void) {}
protected:

View file

@ -42,9 +42,9 @@ class DllExport XOBJECT : public BLOCK {
virtual int GetResultType(void) {return TYPE_VOID;}
virtual int GetKey(void) {return 0;}
#if defined(_DEBUG)
virtual void SetKey(int k) {assert(false);}
virtual void SetKey(int) {assert(false);}
#else // !_DEBUG
virtual void SetKey(int k) {} // Only defined for COLBLK
virtual void SetKey(int) {} // Only defined for COLBLK
#endif // !_DEBUG
virtual int GetLength(void) = 0;
virtual int GetLengthEx(void) = 0;

View file

@ -77,21 +77,21 @@ class DllExport TDB: public BLOCK { // Table Descriptor Block.
virtual int GetTdb_No(void) {return Tdb_No;}
virtual PTDB GetNext(void) {return Next;}
virtual PCATLG GetCat(void) {return NULL;}
virtual void SetAbort(bool b) {;}
virtual void SetAbort(bool) {;}
// Methods
virtual bool IsSame(PTDB tp) {return tp == this;}
virtual bool IsSpecial(PSZ name) = 0;
virtual bool GetBlockValues(PGLOBAL g) {return false;}
virtual int Cardinality(PGLOBAL g) {return 0;}
virtual bool GetBlockValues(PGLOBAL) {return false;}
virtual int Cardinality(PGLOBAL) {return 0;}
virtual int GetMaxSize(PGLOBAL) = 0;
virtual int GetProgMax(PGLOBAL) = 0;
virtual int GetProgCur(void) = 0;
virtual int RowNumber(PGLOBAL g, bool b = false);
virtual bool IsReadOnly(void) {return true;}
virtual const CHARSET_INFO *data_charset() {return NULL;}
virtual PTDB Duplicate(PGLOBAL g) {return NULL;}
virtual PTDB CopyOne(PTABS t) {return this;}
virtual PTDB Duplicate(PGLOBAL) {return NULL;}
virtual PTDB CopyOne(PTABS) {return this;}
virtual PTDB Copy(PTABS t);
virtual void PrintAM(FILE *f, char *m)
{fprintf(f, "%s AM(%d)\n", m, GetAmType());}
@ -108,7 +108,7 @@ class DllExport TDB: public BLOCK { // Table Descriptor Block.
virtual int WriteDB(PGLOBAL) = 0;
virtual int DeleteDB(PGLOBAL, int) = 0;
virtual void CloseDB(PGLOBAL) = 0;
virtual int CheckWrite(PGLOBAL g) {return 0;}
virtual int CheckWrite(PGLOBAL) {return 0;}
virtual bool ReadKey(PGLOBAL, OPVAL, const void *, int) = 0;
protected:
@ -155,7 +155,7 @@ class DllExport TDBASE : public TDB {
PCOL Key(int i) {return (To_Key_Col) ? To_Key_Col[i] : NULL;}
// Methods
virtual bool IsUsingTemp(PGLOBAL g) {return false;}
virtual bool IsUsingTemp(PGLOBAL) {return false;}
virtual bool IsIndexed(void) {return false;}
virtual bool IsSpecial(PSZ name);
virtual PCATLG GetCat(void);
@ -170,9 +170,9 @@ class DllExport TDBASE : public TDB {
virtual CHARSET_INFO *data_charset(void);
virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);}
virtual int GetProgCur(void) {return GetRecpos();}
virtual PSZ GetFile(PGLOBAL g) {return "Not a file";}
virtual PSZ GetFile(PGLOBAL) {return "Not a file";}
virtual int GetRemote(void) {return 0;}
virtual void SetFile(PGLOBAL g, PSZ fn) {}
virtual void SetFile(PGLOBAL, PSZ) {}
virtual void ResetDB(void) {}
virtual void ResetSize(void) {MaxSize = -1;}
virtual void RestoreNrec(void) {}
@ -183,12 +183,12 @@ class DllExport TDBASE : public TDB {
virtual PCOL ColDB(PGLOBAL g, PSZ name, int num);
virtual PCOL MakeCol(PGLOBAL, PCOLDEF, PCOL, int)
{assert(false); return NULL;}
virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL colp);
virtual PCOL InsertSpecialColumn(PCOL colp);
virtual PCOL InsertSpcBlk(PGLOBAL g, PCOLDEF cdp);
virtual void MarkDB(PGLOBAL g, PTDB tdb2);
virtual int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add)
virtual int MakeIndex(PGLOBAL g, PIXDEF, bool)
{strcpy(g->Message, "Remote index"); return RC_INFO;}
virtual bool ReadKey(PGLOBAL g, OPVAL op, const void *key, int len)
virtual bool ReadKey(PGLOBAL, OPVAL, const void *, int)
{assert(false); return true;}
protected:
@ -225,7 +225,7 @@ class DllExport TDBCAT : public TDBASE {
// Methods
virtual int GetRecpos(void) {return N;}
virtual int GetProgCur(void) {return N;}
virtual int RowNumber(PGLOBAL g, bool b = false) {return N + 1;}
virtual int RowNumber(PGLOBAL, bool = false) {return N + 1;}
virtual bool SetRecpos(PGLOBAL g, int recpos);
// Database routines