mariadb/storage/connect/tabcol.h
Olivier Bertrand 3e36eb230b Fix gcc compiler warnings reported by Sergei
modified:   storage/connect/array.cpp
  modified:   storage/connect/array.h
  modified:   storage/connect/blkfil.cpp
  modified:   storage/connect/blkfil.h
  modified:   storage/connect/block.h
  modified:   storage/connect/colblk.cpp
  modified:   storage/connect/colblk.h
  modified:   storage/connect/csort.h
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/filter.cpp
  modified:   storage/connect/filter.h
  modified:   storage/connect/global.h
  modified:   storage/connect/json.h
  modified:   storage/connect/plgdbsem.h
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/tabcol.cpp
  modified:   storage/connect/tabcol.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/table.cpp
  modified:   storage/connect/tabodbc.cpp
  modified:   storage/connect/tabodbc.h
  modified:   storage/connect/tabsys.h
  modified:   storage/connect/tabxml.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.cpp
  modified:   storage/connect/xobject.h
  modified:   storage/connect/xtable.h

Set values as nullable when retrieving catalog info
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/mysql-test/connect/r/odbc_oracle.result
  modified:   storage/connect/odbconn.cpp

Change format of Jpath
  modified:   storage/connect/json.cpp
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/mysql-test/connect/r/json.result
  modified:   storage/connect/mysql-test/connect/r/json_udf.result
  modified:   storage/connect/mysql-test/connect/r/json_udf_bin.result
  modified:   storage/connect/mysql-test/connect/r/zip.result
  modified:   storage/connect/mysql-test/connect/t/json.test
  modified:   storage/connect/mysql-test/connect/t/json_udf.test
  modified:   storage/connect/mysql-test/connect/t/json_udf_bin.test
  modified:   storage/connect/mysql-test/connect/t/zip.test
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  modified:   storage/connect/tabmgo.cpp

Change null representation from ??? to <null>
  modified:   storage/connect/json.cpp

Change the name of UDF that are equal to a native JSON function name
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
  modified:   storage/connect/mysql-test/connect/t/json_udf.inc
  modified:   storage/connect/mysql-test/connect/t/json_udf2.inc

Fix bug in making JSON project info
  modified:   storage/connect/mongofam.cpp

Fix COMPUTE when one argument is null
  modified:   storage/connect/value.cpp

Value is null only when nullable
  modified:   storage/connect/value.h
2017-05-23 19:35:50 +02:00

109 lines
4.7 KiB
C++

/*************** TabCol H Declares Source Code File (.H) ***************/
/* Name: TABCOL.H Version 2.8 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 1998-2013 */
/* */
/* This file contains the XTAB, COLUMN and XORDER class definitions. */
/***********************************************************************/
/***********************************************************************/
/* Include required application header files */
/* block.h is header containing Block global declarations. */
/***********************************************************************/
#include "xobject.h"
/***********************************************************************/
/* Definition of class XTAB with all its method functions. */
/***********************************************************************/
class DllExport XTAB: public BLOCK { // Table Name-Schema-Srcdef block.
friend class TDBPRX;
friend class TDBTBM;
public:
// Constructors
XTAB(LPCSTR name, LPCSTR srcdef = NULL);
XTAB(PTABLE tp);
// Implementation
PTABLE GetNext(void) {return Next;}
PTDB GetTo_Tdb(void) {return To_Tdb;}
LPCSTR GetName(void) {return Name;}
LPCSTR GetSrc(void) {return Srcdef;}
LPCSTR GetSchema(void) {return Schema;}
LPCSTR GetQualifier(void) {return Qualifier;}
void SetTo_Tdb(PTDB tdbp) {To_Tdb = tdbp;}
void SetName(LPCSTR name) {Name = name;}
void SetSrc(LPCSTR srcdef) {Srcdef = srcdef;}
void SetSchema(LPCSTR schname) {Schema = schname;}
void SetQualifier(LPCSTR qname) {Qualifier = qname;}
// Methods
PTABLE Link(PTABLE);
void Printf(PGLOBAL g, FILE *f, uint n);
void Prints(PGLOBAL g, char *ps, uint z);
protected:
// Members
PTABLE Next; // Points to next table in chain
PTDB To_Tdb; // Points to Table description Block
LPCSTR Name; // Table name
LPCSTR Srcdef; // Table Source definition
LPCSTR Schema; // Schema name
LPCSTR Qualifier; // Qualifier name
}; // end of class XTAB
/***********************************************************************/
/* Definition of class COLUMN with all its method functions. */
/* Note: because of LNA routines, the constantness of Name was */
/* removed and constructing a COLUMN with null name was allowed. */
/* Perhaps this should be replaced by the use of a specific class. */
/***********************************************************************/
class DllExport COLUMN: public XOBJECT { // Column Name/Qualifier block.
public:
// Constructor
COLUMN(LPCSTR name);
// Implementation
virtual int GetType(void) {return TYPE_COLUMN;}
virtual int GetResultType(void) {assert(false); return TYPE_VOID;}
virtual int GetLength(void) {assert(false); return 0;}
virtual int GetLengthEx(void) {assert(false); return 0;}
virtual int GetScale() {assert(false); return 0;};
LPCSTR GetName(void) {return Name;}
LPCSTR GetQualifier(void) {return Qualifier;}
PTABLE GetTo_Table(void) {return To_Table;}
PCOL GetTo_Col(void) {return To_Col;}
void SetQualifier(LPCSTR qualif) {Qualifier = qualif;}
void SetTo_Table(PTABLE tablep) {To_Table = tablep;}
void SetTo_Col(PCOL colp) {To_Col = colp;}
// Methods
virtual void Printf(PGLOBAL g, FILE *f, uint n);
virtual void Prints(PGLOBAL g, char *ps, uint z);
// All methods below should never be used for COLUMN's
virtual void Reset(void) {assert(false);}
virtual bool Compare(PXOB) {assert(false); return false;}
virtual bool SetFormat(PGLOBAL, FORMAT&);
virtual bool Eval(PGLOBAL) {assert(false); return true;}
private:
// Members
PTABLE To_Table; // Point to Table Name Block
PCOL To_Col; // Points to Column Description Block
LPCSTR const Name; // Column name
LPCSTR Qualifier; // Qualifier name
}; // end of class COLUMN
/***********************************************************************/
/* Definition of class SPCCOL with all its method functions. */
/* Note: Currently the special columns are ROWID, ROWNUM, FILEID, */
/* SERVID, TABID, PARTID, and CONID. */
/***********************************************************************/
class SPCCOL: public COLUMN { // Special Column Name/Qualifier block.
public:
// Constructor
SPCCOL(LPCSTR name) : COLUMN(name) {}
private:
// Members
}; // end of class SPCCOL