Commit 99d95c8a authored by Olivier Bertrand's avatar Olivier Bertrand

- Added table type PIVOT

modified:
  storage/connect/filamdbf.cpp
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mycat.cc
  storage/connect/myconn.cpp
  storage/connect/odbconn.cpp
  storage/connect/plgcnx.h
  storage/connect/plgdbsem.h
  storage/connect/plgdbutl.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabpivot.cpp
  storage/connect/tabpivot.h
  storage/connect/tabutil.cpp
  storage/connect/tabwmi.cpp
  storage/connect/tabxcl.cpp
  storage/connect/value.cpp
  storage/connect/value.h
parent be268bed
...@@ -178,15 +178,13 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf) ...@@ -178,15 +178,13 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf)
/****************************************************************************/ /****************************************************************************/
PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info) PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
{ {
static int dbtype[] = {DB_CHAR, DB_SHORT, DB_CHAR,
DB_INT, DB_INT, DB_SHORT};
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
TYPE_INT, TYPE_INT, TYPE_SHORT}; TYPE_INT, TYPE_INT, TYPE_SHORT};
static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME,
FLD_PREC, FLD_LENGTH, FLD_SCALE}; FLD_PREC, FLD_LENGTH, FLD_SCALE};
static unsigned int length[] = {11, 6, 8, 10, 10, 6}; static unsigned int length[] = {11, 6, 8, 10, 10, 6};
char buf[2], filename[_MAX_PATH]; char buf[2], filename[_MAX_PATH];
int ncol = sizeof(dbtype) / sizeof(int); int ncol = sizeof(buftyp) / sizeof(int);
int rc, type, len, field, fields; int rc, type, len, field, fields;
BOOL bad; BOOL bad;
DBFHEADER mainhead; DBFHEADER mainhead;
...@@ -228,8 +226,7 @@ PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info) ...@@ -228,8 +226,7 @@ PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
fields = 0; fields = 0;
qrp = PlgAllocResult(g, ncol, fields, IDS_COLUMNS + 3, qrp = PlgAllocResult(g, ncol, fields, IDS_COLUMNS + 3,
dbtype, buftyp, fldtyp, length, true, false); buftyp, fldtyp, length, true, false);
//qrp->Info = info || (rc == RC_INFO);
if (info) if (info)
return qrp; return qrp;
......
...@@ -207,6 +207,8 @@ ha_create_table_option connect_table_option_list[]= ...@@ -207,6 +207,8 @@ ha_create_table_option connect_table_option_list[]=
HA_TOPTION_STRING("MODULE", module), HA_TOPTION_STRING("MODULE", module),
HA_TOPTION_STRING("SUBTYPE", subtype), HA_TOPTION_STRING("SUBTYPE", subtype),
HA_TOPTION_STRING("CATFUNC", catfunc), HA_TOPTION_STRING("CATFUNC", catfunc),
HA_TOPTION_STRING("SRCDEF", srcdef),
HA_TOPTION_STRING("COLIST", colist),
HA_TOPTION_STRING("OPTION_LIST", oplist), HA_TOPTION_STRING("OPTION_LIST", oplist),
HA_TOPTION_STRING("DATA_CHARSET", data_charset), HA_TOPTION_STRING("DATA_CHARSET", data_charset),
HA_TOPTION_NUMBER("LRECL", lrecl, 0, 0, INT_MAX32, 1), HA_TOPTION_NUMBER("LRECL", lrecl, 0, 0, INT_MAX32, 1),
...@@ -590,7 +592,7 @@ static char *GetListOption(PGLOBAL g, const char *opname, ...@@ -590,7 +592,7 @@ static char *GetListOption(PGLOBAL g, const char *opname,
} else { } else {
if (pn) { if (pn) {
n= pn - pk; n= min(pn - pk, 15);
memcpy(key, pk, n); memcpy(key, pk, n);
key[n]= 0; key[n]= 0;
} else } else
...@@ -655,6 +657,10 @@ char *ha_connect::GetStringOption(char *opname, char *sdef) ...@@ -655,6 +657,10 @@ char *ha_connect::GetStringOption(char *opname, char *sdef)
opval= (char*)options->subtype; opval= (char*)options->subtype;
else if (!stricmp(opname, "Catfunc")) else if (!stricmp(opname, "Catfunc"))
opval= (char*)options->catfunc; opval= (char*)options->catfunc;
else if (!stricmp(opname, "Srcdef"))
opval= (char*)options->srcdef;
else if (!stricmp(opname, "Colist"))
opval= (char*)options->colist;
else if (!stricmp(opname, "Data_charset")) else if (!stricmp(opname, "Data_charset"))
opval= (char*)options->data_charset; opval= (char*)options->data_charset;
...@@ -2667,7 +2673,6 @@ bool ha_connect::check_privileges(THD *thd, PTOS options) ...@@ -2667,7 +2673,6 @@ bool ha_connect::check_privileges(THD *thd, PTOS options)
case TAB_JCT: case TAB_JCT:
case TAB_DMY: case TAB_DMY:
case TAB_NIY: case TAB_NIY:
case TAB_PIVOT:
my_printf_error(ER_UNKNOWN_ERROR, my_printf_error(ER_UNKNOWN_ERROR,
"Unsupported table type %s", MYF(0), options->type); "Unsupported table type %s", MYF(0), options->type);
return true; return true;
...@@ -2706,6 +2711,7 @@ bool ha_connect::check_privileges(THD *thd, PTOS options) ...@@ -2706,6 +2711,7 @@ bool ha_connect::check_privileges(THD *thd, PTOS options)
case TAB_XCL: case TAB_XCL:
case TAB_PRX: case TAB_PRX:
case TAB_OCCUR: case TAB_OCCUR:
case TAB_PIVOT:
return false; return false;
} }
......
...@@ -83,6 +83,8 @@ struct ha_table_option_struct { ...@@ -83,6 +83,8 @@ struct ha_table_option_struct {
const char *module; const char *module;
const char *subtype; const char *subtype;
const char *catfunc; const char *catfunc;
const char *srcdef;
const char *colist;
const char *oplist; const char *oplist;
const char *data_charset; const char *data_charset;
ulonglong lrecl; ulonglong lrecl;
......
...@@ -132,6 +132,9 @@ TABTYPE GetTypeID(const char *type) ...@@ -132,6 +132,9 @@ TABTYPE GetTypeID(const char *type)
: (!stricmp(type, "OCCUR")) ? TAB_OCCUR : (!stricmp(type, "OCCUR")) ? TAB_OCCUR
: (!stricmp(type, "CATLG")) ? TAB_PRX // Legacy : (!stricmp(type, "CATLG")) ? TAB_PRX // Legacy
: (!stricmp(type, "PROXY")) ? TAB_PRX : (!stricmp(type, "PROXY")) ? TAB_PRX
#ifdef PIVOT_SUPPORT
: (!stricmp(type, "PIVOT")) ? TAB_PIVOT
#endif
: (!stricmp(type, "OEM")) ? TAB_OEM : TAB_NIY; : (!stricmp(type, "OEM")) ? TAB_OEM : TAB_NIY;
} // end of GetTypeID } // end of GetTypeID
...@@ -650,9 +653,9 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am) ...@@ -650,9 +653,9 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am)
#if defined(MYSQL_SUPPORT) #if defined(MYSQL_SUPPORT)
case TAB_MYSQL: tdp= new(g) MYSQLDEF; break; case TAB_MYSQL: tdp= new(g) MYSQLDEF; break;
#endif // MYSQL_SUPPORT #endif // MYSQL_SUPPORT
//#if defined(PIVOT_SUPPORT) #if defined(PIVOT_SUPPORT)
// case TAB_PIVOT: tdp= new(g) PIVOTDEF; break; case TAB_PIVOT: tdp= new(g) PIVOTDEF; break;
//#endif // PIVOT_SUPPORT #endif // PIVOT_SUPPORT
default: default:
sprintf(g->Message, MSG(BAD_TABLE_TYPE), am, name); sprintf(g->Message, MSG(BAD_TABLE_TYPE), am, name);
} // endswitch } // endswitch
......
...@@ -74,10 +74,7 @@ PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db, ...@@ -74,10 +74,7 @@ PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db,
const char *table, const char *colpat, const char *table, const char *colpat,
int port, bool key, bool info) int port, bool key, bool info)
{ {
static int dbtype[] = {DB_CHAR, DB_SHORT, DB_CHAR, DB_INT, static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_INT,
DB_CHAR, DB_SHORT, DB_SHORT, DB_SHORT,
DB_CHAR, DB_CHAR, DB_CHAR};
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_INT,
TYPE_STRING, TYPE_SHORT, TYPE_SHORT, TYPE_SHORT, TYPE_STRING, TYPE_SHORT, TYPE_SHORT, TYPE_SHORT,
TYPE_STRING, TYPE_STRING, TYPE_STRING}; TYPE_STRING, TYPE_STRING, TYPE_STRING};
static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, FLD_PREC, static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, FLD_PREC,
...@@ -85,7 +82,7 @@ PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db, ...@@ -85,7 +82,7 @@ PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db,
FLD_REM, FLD_NO, FLD_CHARSET}; FLD_REM, FLD_NO, FLD_CHARSET};
static unsigned int length[] = {0, 4, 16, 4, 4, 4, 4, 4, 256, 32, 32}; static unsigned int length[] = {0, 4, 16, 4, 4, 4, 4, 4, 256, 32, 32};
char *fld, *fmt, cmd[128]; char *fld, *fmt, cmd[128];
int i, n, nf, ncol = sizeof(dbtype) / sizeof(int); int i, n, nf, ncol = sizeof(buftyp) / sizeof(int);
int len, type, prec, rc, k = 0; int len, type, prec, rc, k = 0;
PQRYRES qrp; PQRYRES qrp;
PCOLRES crp; PCOLRES crp;
...@@ -134,7 +131,7 @@ PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db, ...@@ -134,7 +131,7 @@ PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db,
/* Allocate the structures used to refer to the result set. */ /* Allocate the structures used to refer to the result set. */
/**********************************************************************/ /**********************************************************************/
qrp = PlgAllocResult(g, ncol, n, IDS_COLUMNS + 3, qrp = PlgAllocResult(g, ncol, n, IDS_COLUMNS + 3,
dbtype, buftyp, fldtyp, length, true, true); buftyp, fldtyp, length, true, true);
// Some columns must be renamed // Some columns must be renamed
for (i = 0, crp = qrp->Colresp; crp; crp = crp->Next) for (i = 0, crp = qrp->Colresp; crp; crp = crp->Next)
...@@ -665,7 +662,6 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb) ...@@ -665,7 +662,6 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)
crp->Prec = fld->decimals; crp->Prec = fld->decimals;
crp->Length = fld->max_length; crp->Length = fld->max_length;
crp->Clen = GetTypeSize(crp->Type, crp->Length); crp->Clen = GetTypeSize(crp->Type, crp->Length);
crp->DBtype = GetDBType((int)crp->Type);
if (!(crp->Kdata = AllocValBlock(g, NULL, crp->Type, m_Rows, if (!(crp->Kdata = AllocValBlock(g, NULL, crp->Type, m_Rows,
crp->Clen, 0, FALSE, TRUE))) { crp->Clen, 0, FALSE, TRUE))) {
......
...@@ -230,11 +230,7 @@ void ResetNullValues(CATPARM *cap) ...@@ -230,11 +230,7 @@ void ResetNullValues(CATPARM *cap)
PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *table, PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *table,
char *colpat, bool info) char *colpat, bool info)
{ {
static int dbtype[] = {DB_CHAR, DB_CHAR, DB_CHAR, static int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING,
DB_CHAR, DB_SHORT, DB_CHAR,
DB_INT, DB_INT, DB_SHORT,
DB_SHORT, DB_SHORT, DB_CHAR};
static int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_STRING, TYPE_SHORT, TYPE_STRING,
TYPE_INT, TYPE_INT, TYPE_SHORT, TYPE_INT, TYPE_INT, TYPE_SHORT,
TYPE_SHORT, TYPE_SHORT, TYPE_STRING}; TYPE_SHORT, TYPE_SHORT, TYPE_STRING};
...@@ -285,7 +281,7 @@ PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *table, ...@@ -285,7 +281,7 @@ PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *table,
/* Allocate the structures used to refer to the result set. */ /* Allocate the structures used to refer to the result set. */
/************************************************************************/ /************************************************************************/
qrp = PlgAllocResult(g, ncol, maxres, IDS_COLUMNS, qrp = PlgAllocResult(g, ncol, maxres, IDS_COLUMNS,
dbtype, buftyp, fldtyp, length, true, true); buftyp, fldtyp, length, true, true);
if (info) // Info table if (info) // Info table
return qrp; return qrp;
...@@ -396,7 +392,6 @@ PQRYRES MyODBCCols(PGLOBAL g, char *dsn, char *tab, bool info) ...@@ -396,7 +392,6 @@ PQRYRES MyODBCCols(PGLOBAL g, char *dsn, char *tab, bool info)
/*************************************************************************/ /*************************************************************************/
PQRYRES ODBCDataSources(PGLOBAL g, bool info) PQRYRES ODBCDataSources(PGLOBAL g, bool info)
{ {
static int dbtype[] = {DB_CHAR, DB_CHAR};
static int buftyp[] = {TYPE_STRING, TYPE_STRING}; static int buftyp[] = {TYPE_STRING, TYPE_STRING};
static XFLD fldtyp[] = {FLD_NAME, FLD_REM}; static XFLD fldtyp[] = {FLD_NAME, FLD_REM};
static unsigned int length[] = {0, 256}; static unsigned int length[] = {0, 256};
...@@ -425,7 +420,7 @@ PQRYRES ODBCDataSources(PGLOBAL g, bool info) ...@@ -425,7 +420,7 @@ PQRYRES ODBCDataSources(PGLOBAL g, bool info)
/* Allocate the structures used to refer to the result set. */ /* Allocate the structures used to refer to the result set. */
/************************************************************************/ /************************************************************************/
qrp = PlgAllocResult(g, ncol, maxres, IDS_DSRC, qrp = PlgAllocResult(g, ncol, maxres, IDS_DSRC,
dbtype, buftyp, fldtyp, length, true, true); buftyp, fldtyp, length, true, true);
/************************************************************************/ /************************************************************************/
/* Now get the results into blocks. */ /* Now get the results into blocks. */
...@@ -446,7 +441,6 @@ PQRYRES ODBCDataSources(PGLOBAL g, bool info) ...@@ -446,7 +441,6 @@ PQRYRES ODBCDataSources(PGLOBAL g, bool info)
/*************************************************************************/ /*************************************************************************/
PQRYRES ODBCDrivers(PGLOBAL g, bool info) PQRYRES ODBCDrivers(PGLOBAL g, bool info)
{ {
static int dbtype[] = {DB_CHAR, DB_CHAR};
static int buftyp[] = {TYPE_STRING, TYPE_STRING}; static int buftyp[] = {TYPE_STRING, TYPE_STRING};
static XFLD fldtyp[] = {FLD_NAME, FLD_REM}; static XFLD fldtyp[] = {FLD_NAME, FLD_REM};
static unsigned int length[] = {128, 256}; static unsigned int length[] = {128, 256};
...@@ -471,7 +465,7 @@ PQRYRES ODBCDrivers(PGLOBAL g, bool info) ...@@ -471,7 +465,7 @@ PQRYRES ODBCDrivers(PGLOBAL g, bool info)
/* Allocate the structures used to refer to the result set. */ /* Allocate the structures used to refer to the result set. */
/************************************************************************/ /************************************************************************/
qrp = PlgAllocResult(g, ncol, maxres, IDS_DRIVER, qrp = PlgAllocResult(g, ncol, maxres, IDS_DRIVER,
dbtype, buftyp, fldtyp, length, true, true); buftyp, fldtyp, length, true, true);
/************************************************************************/ /************************************************************************/
/* Now get the results into blocks. */ /* Now get the results into blocks. */
...@@ -492,8 +486,7 @@ PQRYRES ODBCDrivers(PGLOBAL g, bool info) ...@@ -492,8 +486,7 @@ PQRYRES ODBCDrivers(PGLOBAL g, bool info)
/***********************************************************************/ /***********************************************************************/
PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info) PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info)
{ {
static int dbtype[] = {DB_CHAR, DB_CHAR, DB_CHAR, DB_CHAR, DB_CHAR}; static int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING,
static int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING}; TYPE_STRING, TYPE_STRING};
static XFLD fldtyp[] = {FLD_QUALIF, FLD_OWNER, FLD_NAME, static XFLD fldtyp[] = {FLD_QUALIF, FLD_OWNER, FLD_NAME,
FLD_TYPE, FLD_REM}; FLD_TYPE, FLD_REM};
...@@ -536,7 +529,7 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info) ...@@ -536,7 +529,7 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info)
/************************************************************************/ /************************************************************************/
/* Allocate the structures used to refer to the result set. */ /* Allocate the structures used to refer to the result set. */
/************************************************************************/ /************************************************************************/
qrp = PlgAllocResult(g, ncol, maxres, IDS_TABLES, dbtype, buftyp, qrp = PlgAllocResult(g, ncol, maxres, IDS_TABLES, buftyp,
fldtyp, length, true, true); fldtyp, length, true, true);
if (info) if (info)
...@@ -579,8 +572,6 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info) ...@@ -579,8 +572,6 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *tabpat, bool info)
/**************************************************************************/ /**************************************************************************/
PQRYRES ODBCPrimaryKeys(PGLOBAL g, ODBConn *op, char *dsn, char *table) PQRYRES ODBCPrimaryKeys(PGLOBAL g, ODBConn *op, char *dsn, char *table)
{ {
static int dbtype[] = {DB_CHAR, DB_CHAR, DB_CHAR,
DB_CHAR, DB_SHORT, DB_CHAR};
static int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, static int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_SHORT, TYPE_STRING}; TYPE_STRING, TYPE_SHORT, TYPE_STRING};
static unsigned int length[] = {0, 0, 0, 0, 6, 128}; static unsigned int length[] = {0, 0, 0, 0, 6, 128};
...@@ -623,7 +614,7 @@ PQRYRES ODBCPrimaryKeys(PGLOBAL g, ODBConn *op, char *dsn, char *table) ...@@ -623,7 +614,7 @@ PQRYRES ODBCPrimaryKeys(PGLOBAL g, ODBConn *op, char *dsn, char *table)
/* Allocate the structure used to refer to the result set. */ /* Allocate the structure used to refer to the result set. */
/************************************************************************/ /************************************************************************/
qrp = PlgAllocResult(g, ncol, maxres, IDS_PKEY, qrp = PlgAllocResult(g, ncol, maxres, IDS_PKEY,
dbtype, buftyp, NULL, length, true, true); buftyp, NULL, length, true, true);
if (trace) if (trace)
htrc("Getting pkey results ncol=%d\n", qrp->Nbcol); htrc("Getting pkey results ncol=%d\n", qrp->Nbcol);
...@@ -662,9 +653,6 @@ PQRYRES ODBCPrimaryKeys(PGLOBAL g, ODBConn *op, char *dsn, char *table) ...@@ -662,9 +653,6 @@ PQRYRES ODBCPrimaryKeys(PGLOBAL g, ODBConn *op, char *dsn, char *table)
PQRYRES ODBCStatistics(PGLOBAL g, ODBConn *op, char *dsn, char *pat, PQRYRES ODBCStatistics(PGLOBAL g, ODBConn *op, char *dsn, char *pat,
int un, int acc) int un, int acc)
{ {
static int dbtype[] = {DB_CHAR, DB_CHAR, DB_CHAR, DB_SHORT, DB_CHAR,
DB_CHAR, DB_SHORT, DB_SHORT, DB_CHAR, DB_CHAR,
DB_INT, DB_INT, DB_CHAR};
static int buftyp[] = {TYPE_STRING, static int buftyp[] = {TYPE_STRING,
TYPE_STRING, TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_SHORT, TYPE_STRING,
TYPE_STRING, TYPE_SHORT, TYPE_SHORT, TYPE_STRING, TYPE_STRING, TYPE_SHORT, TYPE_SHORT, TYPE_STRING,
...@@ -708,7 +696,7 @@ PQRYRES ODBCStatistics(PGLOBAL g, ODBConn *op, char *dsn, char *pat, ...@@ -708,7 +696,7 @@ PQRYRES ODBCStatistics(PGLOBAL g, ODBConn *op, char *dsn, char *pat,
/* Allocate the structure used to refer to the result set. */ /* Allocate the structure used to refer to the result set. */
/************************************************************************/ /************************************************************************/
qrp = PlgAllocResult(g, ncol, maxres, IDS_STAT, qrp = PlgAllocResult(g, ncol, maxres, IDS_STAT,
dbtype, buftyp, NULL, length, true, true); buftyp, NULL, length, true, true);
if (trace) if (trace)
htrc("Getting stat results ncol=%d\n", qrp->Nbcol); htrc("Getting stat results ncol=%d\n", qrp->Nbcol);
......
...@@ -49,17 +49,6 @@ enum RCODE {RC_OK = 0, /* No error return code */ ...@@ -49,17 +49,6 @@ enum RCODE {RC_OK = 0, /* No error return code */
RC_INFO = 4}; /* Success with info */ RC_INFO = 4}; /* Success with info */
#endif // !RC_OK_DEFINED #endif // !RC_OK_DEFINED
/**************************************************************************/
/* Data types. */
/**************************************************************************/
enum XDBTYPE {DB_ERROR = 0, /* Unknown or wrong type */
DB_STRING = 1, /* Null terminated string */
DB_CHAR = 2, /* Character array */
DB_SHORT = 3, /* Used by some catalog functions */
DB_INT = 4, /* Long integer array */
DB_DOUBLE = 5, /* Double float array */
DB_DATE = 6}; /* Datetime value array */
/**************************************************************************/ /**************************************************************************/
/* Index of info values within the info int integer array. */ /* Index of info values within the info int integer array. */
/**************************************************************************/ /**************************************************************************/
......
...@@ -513,7 +513,6 @@ typedef struct _colres { ...@@ -513,7 +513,6 @@ typedef struct _colres {
PVBLK Kdata; /* Column block of values */ PVBLK Kdata; /* Column block of values */
char *Nulls; /* Column null value array */ char *Nulls; /* Column null value array */
int Type; /* Internal type */ int Type; /* Internal type */
int DBtype; /* Data type */
int Datasize; /* Overall data size */ int Datasize; /* Overall data size */
int Ncol; /* Column number */ int Ncol; /* Column number */
int Clen; /* Data individual internal size */ int Clen; /* Data individual internal size */
...@@ -545,7 +544,7 @@ int ExtractDate(char *, PDTP, int, int val[6]); ...@@ -545,7 +544,7 @@ int ExtractDate(char *, PDTP, int, int val[6]);
/* Allocate the result structure that will contain result data. */ /* Allocate the result structure that will contain result data. */
/**************************************************************************/ /**************************************************************************/
PQRYRES PlgAllocResult(PGLOBAL g, int ncol, int maxres, int ids, PQRYRES PlgAllocResult(PGLOBAL g, int ncol, int maxres, int ids,
int *dbtype, int *buftyp, XFLD *fldtyp, int *buftyp, XFLD *fldtyp,
unsigned int *length, bool blank, bool nonull); unsigned int *length, bool blank, bool nonull);
/***********************************************************************/ /***********************************************************************/
......
...@@ -270,7 +270,7 @@ void ptrc(char const *fmt, ...) ...@@ -270,7 +270,7 @@ void ptrc(char const *fmt, ...)
/* Allocate the result structure that will contain result data. */ /* Allocate the result structure that will contain result data. */
/**************************************************************************/ /**************************************************************************/
PQRYRES PlgAllocResult(PGLOBAL g, int ncol, int maxres, int ids, PQRYRES PlgAllocResult(PGLOBAL g, int ncol, int maxres, int ids,
int *dbtype, int *buftyp, XFLD *fldtyp, int *buftyp, XFLD *fldtyp,
unsigned int *length, bool blank, bool nonull) unsigned int *length, bool blank, bool nonull)
{ {
char cname[NAM_LEN+1]; char cname[NAM_LEN+1];
...@@ -304,7 +304,6 @@ PQRYRES PlgAllocResult(PGLOBAL g, int ncol, int maxres, int ids, ...@@ -304,7 +304,6 @@ PQRYRES PlgAllocResult(PGLOBAL g, int ncol, int maxres, int ids,
crp->Length = length[i]; crp->Length = length[i];
crp->Clen = GetTypeSize(crp->Type, length[i]); crp->Clen = GetTypeSize(crp->Type, length[i]);
crp->Prec = 0; crp->Prec = 0;
crp->DBtype = dbtype[i];
if (ids > 0) { if (ids > 0) {
#if defined(XMSG) #if defined(XMSG)
......
...@@ -78,8 +78,6 @@ extern "C" int trace; ...@@ -78,8 +78,6 @@ extern "C" int trace;
PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q, PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q,
int hdr, int mxr, bool info) int hdr, int mxr, bool info)
{ {
static int dbtype[] = {DB_CHAR, DB_SHORT, DB_CHAR,
DB_INT, DB_INT, DB_SHORT};
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
TYPE_INT, TYPE_INT, TYPE_SHORT}; TYPE_INT, TYPE_INT, TYPE_SHORT};
static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME,
...@@ -87,7 +85,7 @@ PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q, ...@@ -87,7 +85,7 @@ PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q,
static unsigned int length[] = {6, 6, 8, 10, 10, 6}; static unsigned int length[] = {6, 6, 8, 10, 10, 6};
char *p, *colname[MAXCOL], dechar, filename[_MAX_PATH], buf[4096]; char *p, *colname[MAXCOL], dechar, filename[_MAX_PATH], buf[4096];
int i, imax, hmax, n, nerr, phase, blank, digit, dec, type; int i, imax, hmax, n, nerr, phase, blank, digit, dec, type;
int ncol = sizeof(dbtype) / sizeof(int); int ncol = sizeof(buftyp) / sizeof(int);
int num_read = 0, num_max = 10000000; // Statistics int num_read = 0, num_max = 10000000; // Statistics
int len[MAXCOL], typ[MAXCOL], prc[MAXCOL]; int len[MAXCOL], typ[MAXCOL], prc[MAXCOL];
FILE *infile; FILE *infile;
...@@ -341,7 +339,7 @@ PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q, ...@@ -341,7 +339,7 @@ PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q,
/* Allocate the structures used to refer to the result set. */ /* Allocate the structures used to refer to the result set. */
/*********************************************************************/ /*********************************************************************/
qrp = PlgAllocResult(g, ncol, imax, IDS_COLUMNS + 3, qrp = PlgAllocResult(g, ncol, imax, IDS_COLUMNS + 3,
dbtype, buftyp, fldtyp, length, true, false); buftyp, fldtyp, length, true, false);
qrp->Nblin = imax; qrp->Nblin = imax;
if (info) if (info)
......
This diff is collapsed.
...@@ -22,13 +22,12 @@ typedef class QRSCOL *PQRSCOL; ...@@ -22,13 +22,12 @@ typedef class QRSCOL *PQRSCOL;
/***********************************************************************/ /***********************************************************************/
/* PIVOT table. */ /* PIVOT table. */
/***********************************************************************/ /***********************************************************************/
//ass DllExport PIVOTDEF : public TABDEF {/* Logical table description */ //ass DllExport PIVOTDEF : public PRXDEF {/* Logical table description */
class PIVOTDEF : public TABDEF { /* Logical table description */ class PIVOTDEF : public PRXDEF { /* Logical table description */
friend class TDBPIVOT; friend class TDBPIVOT;
public: public:
// Constructor // Constructor
PIVOTDEF(void) {Pseudo = 3; PIVOTDEF(void);
Tabname = Tabsrc = Picol = Fncol = Function = NULL;}
// Implementation // Implementation
virtual const char *GetType(void) {return "PIVOT";} virtual const char *GetType(void) {return "PIVOT";}
...@@ -39,26 +38,27 @@ class PIVOTDEF : public TABDEF { /* Logical table description */ ...@@ -39,26 +38,27 @@ class PIVOTDEF : public TABDEF { /* Logical table description */
protected: protected:
// Members // Members
char *Host; /* Host machine to use */ char *Host; /* Host machine to use */
char *User; /* User logon info */ char *User; /* User logon info */
char *Pwd; /* Password logon info */ char *Pwd; /* Password logon info */
char *DB; /* Database to be used by server */ char *DB; /* Database to be used by server */
char *Tabname; /* Name of source table */ char *Tabname; /* Name of source table */
char *Tabsrc; /* The source table SQL description */ char *Tabsrc; /* The source table SQL description */
char *Picol; /* The pivot column */ char *Picol; /* The pivot column */
char *Fncol; /* The function column */ char *Fncol; /* The function column */
char *Function; /* The function applying to group by */ char *Function; /* The function applying to group by */
bool GBdone; /* True if tabname as group by format */ bool GBdone; /* True if tabname as group by format */
int Port; /* MySQL port number */ bool Accept; /* TRUE if no match is accepted */
int Port; /* MySQL port number */
}; // end of PIVOTDEF }; // end of PIVOTDEF
/***********************************************************************/ /***********************************************************************/
/* This is the class declaration for the PIVOT table. */ /* This is the class declaration for the PIVOT table. */
/***********************************************************************/ /***********************************************************************/
//ass DllExport TDBPIVOT : public TDBASE, public CSORT { //ass DllExport TDBPIVOT : public TDBASE, public CSORT {
class TDBPIVOT : public TDBASE, public CSORT { class TDBPIVOT : public TDBPRX {
friend class FNCCOL; friend class FNCCOL;
friend class SRCCOL; //friend class SRCCOL;
public: public:
// Constructor // Constructor
TDBPIVOT(PPIVOTDEF tdp); TDBPIVOT(PPIVOTDEF tdp);
...@@ -85,39 +85,41 @@ class TDBPIVOT : public TDBASE, public CSORT { ...@@ -85,39 +85,41 @@ class TDBPIVOT : public TDBASE, public CSORT {
virtual void CloseDB(PGLOBAL g); virtual void CloseDB(PGLOBAL g);
// The sorting function // The sorting function
virtual int Qcompare(int *, int *); //virtual int Qcompare(int *, int *);
protected: protected:
PQRYRES GetSourceTable(PGLOBAL g); bool GetSourceTable(PGLOBAL g);
int MakePivotColumns(PGLOBAL g); //int MakePivotColumns(PGLOBAL g);
bool UpdateTableFields(PGLOBAL g, int n); //bool UpdateTableFields(PGLOBAL g, int n);
// Members // Members
MYSQLC Myc; // MySQL connection class //MYSQLC Myc; // MySQL connection class
PTDBQRS Tqrp; // To the source table result //PTDBQRS Tqrp; // To the source table result
char *Host; // Host machine to use char *Host; // Host machine to use
char *User; // User logon info char *User; // User logon info
char *Pwd; // Password logon info char *Pwd; // Password logon info
char *Database; // Database to be used by server char *Database; // Database to be used by server
PQRYRES Qryp; // Points to Query result block //PQRYRES Qryp; // Points to Query result block
char *Tabname; // Name of source table char *Tabname; // Name of source table
char *Tabsrc; // SQL of source table char *Tabsrc; // SQL of source table
char *Picol; // Pivot column name char *Picol; // Pivot column name
char *Fncol; // Function column name char *Fncol; // Function column name
char *Function; // The function applying to group by char *Function; // The function applying to group by
PQRSCOL Fcolp; // To the function column in source PCOL Fcolp; // To the function column in source
PQRSCOL Xcolp; // To the pivot column in source PCOL Xcolp; // To the pivot column in source
PCOLRES Xresp; // To the pivot result column PCOL Dcolp; // To the dump column
//PCOLRES To_Sort; // Saved Qryp To_Sort pointer //PCOLRES Xresp; // To the pivot result column
PVBLK Rblkp; // The value block of the pivot column //PCOLRES To_Sort; // Saved Qryp To_Sort pointer
bool GBdone; // True when subtable is "Group by" //PVBLK Rblkp; // The value block of the pivot column
int Mult; // Multiplication factor bool GBdone; // True when subtable is "Group by"
int Ncol; // The number of generated columns bool Accept; // TRUE if no match is accepted
int N; // The current table index int Mult; // Multiplication factor
int M; // The occurence rank int Ncol; // The number of generated columns
int Port; // MySQL port number int N; // The current table index
BYTE FileStatus; // 0: First 1: Rows 2: End-of-File int M; // The occurence rank
BYTE RowFlag; // 0: Ok, 1: Same, 2: Skip int Port; // MySQL port number
BYTE FileStatus; // 0: First 1: Rows 2: End-of-File
BYTE RowFlag; // 0: Ok, 1: Same, 2: Skip
}; // end of class TDBPIVOT }; // end of class TDBPIVOT
/***********************************************************************/ /***********************************************************************/
...@@ -127,30 +129,30 @@ class FNCCOL : public COLBLK { ...@@ -127,30 +129,30 @@ class FNCCOL : public COLBLK {
friend class TDBPIVOT; friend class TDBPIVOT;
public: public:
// Constructor // Constructor
FNCCOL(PCOL colp, PTDBPIVOT tdbp); FNCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i);
// Implementation // Implementation
virtual int GetAmType(void) {return TYPE_AM_FNC;} virtual int GetAmType(void) {return TYPE_AM_FNC;}
// Methods // Methods
virtual void Reset(void) {} virtual void Reset(void) {}
bool InitColumn(PGLOBAL g, PVAL valp); bool InitColumn(PGLOBAL g);
bool CompareColumn(void);
protected: protected:
// Member // Member
PVAL Hval; // The original value used to generate the header PVAL Hval; // The value containing the header
PCOL Xcolp;
}; // end of class FNCCOL }; // end of class FNCCOL
/***********************************************************************/ /***********************************************************************/
/* Class SRCCOL: for other source columns. */ /* Class SRCCOL: for other source columns. */
/***********************************************************************/ /***********************************************************************/
class SRCCOL : public COLBLK { class SRCCOL : public PRXCOL {
friend class TDBPIVOT; friend class TDBPIVOT;
public: public:
// Constructors // Constructors
//SRCCOL(PCOLDEF cdp, PTDBPIVOT tdbp, int n); SRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int n);
SRCCOL(PCOL cp, PTDBPIVOT tdbp, int n);
//SRCCOL(SRCCOL *colp, PTDB tdbp); // Constructor used in copy process
// Implementation // Implementation
virtual int GetAmType(void) {return TYPE_AM_SRC;} virtual int GetAmType(void) {return TYPE_AM_SRC;}
...@@ -158,16 +160,15 @@ class SRCCOL : public COLBLK { ...@@ -158,16 +160,15 @@ class SRCCOL : public COLBLK {
// Methods // Methods
virtual void Reset(void) {} virtual void Reset(void) {}
void SetColumn(void); void SetColumn(void);
bool Init(PGLOBAL g, PTDBPIVOT tdbp); bool Init(PGLOBAL g);
bool CompareColumn(void); bool CompareLast(void);
protected: protected:
// Default constructor not to be used // Default constructor not to be used
SRCCOL(void) {} SRCCOL(void) {}
// Members // Members
PQRSCOL Colp; //PVAL Cnval;
PVAL Cnval;
}; // end of class SRCCOL }; // end of class SRCCOL
/***********************************************************************/ /***********************************************************************/
......
...@@ -121,10 +121,7 @@ TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db, ...@@ -121,10 +121,7 @@ TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db,
PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db, PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
const char *name, bool info) const char *name, bool info)
{ {
static int dbtype[] = {DB_CHAR, DB_SHORT, DB_CHAR, DB_INT, static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_INT,
DB_INT, DB_SHORT, DB_SHORT, DB_SHORT,
DB_CHAR, DB_CHAR, DB_CHAR};
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_INT,
TYPE_INT, TYPE_SHORT, TYPE_SHORT, TYPE_SHORT, TYPE_INT, TYPE_SHORT, TYPE_SHORT, TYPE_SHORT,
TYPE_STRING, TYPE_STRING, TYPE_STRING}; TYPE_STRING, TYPE_STRING, TYPE_STRING};
static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, FLD_PREC, static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, FLD_PREC,
...@@ -132,7 +129,7 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db, ...@@ -132,7 +129,7 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
FLD_REM, FLD_NO, FLD_CHARSET}; FLD_REM, FLD_NO, FLD_CHARSET};
static unsigned int length[] = {0, 4, 16, 4, 4, 4, 4, 4, 256, 32, 32}; static unsigned int length[] = {0, 4, 16, 4, 4, 4, 4, 4, 256, 32, 32};
char *fld, *fmt; char *fld, *fmt;
int i, n, ncol = sizeof(dbtype) / sizeof(int); int i, n, ncol = sizeof(buftyp) / sizeof(int);
int len, type, prec; int len, type, prec;
bool mysql; bool mysql;
TABLE_SHARE *s; TABLE_SHARE *s;
...@@ -156,7 +153,7 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db, ...@@ -156,7 +153,7 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
/* Allocate the structures used to refer to the result set. */ /* Allocate the structures used to refer to the result set. */
/**********************************************************************/ /**********************************************************************/
qrp = PlgAllocResult(g, ncol, n, IDS_COLUMNS + 3, qrp = PlgAllocResult(g, ncol, n, IDS_COLUMNS + 3,
dbtype, buftyp, fldtyp, length, true, true); buftyp, fldtyp, length, true, true);
// Some columns must be renamed // Some columns must be renamed
for (i = 0, crp = qrp->Colresp; crp; crp = crp->Next) for (i = 0, crp = qrp->Colresp; crp; crp = crp->Next)
......
...@@ -135,14 +135,12 @@ PWMIUT InitWMI(PGLOBAL g, char *nsp, char *classname) ...@@ -135,14 +135,12 @@ PWMIUT InitWMI(PGLOBAL g, char *nsp, char *classname)
/***********************************************************************/ /***********************************************************************/
PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *cls, bool info) PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *cls, bool info)
{ {
static int dbtype[] = {DB_CHAR, DB_SHORT, DB_CHAR,
DB_INT, DB_INT, DB_SHORT};
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
TYPE_INT, TYPE_INT, TYPE_SHORT}; TYPE_INT, TYPE_INT, TYPE_SHORT};
static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME,
FLD_PREC, FLD_LENGTH, FLD_SCALE}; FLD_PREC, FLD_LENGTH, FLD_SCALE};
static unsigned int len, length[] = {0, 6, 8, 10, 10, 6}; static unsigned int len, length[] = {0, 6, 8, 10, 10, 6};
int i = 0, n = 0, ncol = sizeof(dbtype) / sizeof(int); int i = 0, n = 0, ncol = sizeof(buftyp) / sizeof(int);
int lng, typ, prec; int lng, typ, prec;
LONG low, upp; LONG low, upp;
BSTR propname; BSTR propname;
...@@ -213,7 +211,7 @@ PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *cls, bool info) ...@@ -213,7 +211,7 @@ PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *cls, bool info)
/* Allocate the structures used to refer to the result set. */ /* Allocate the structures used to refer to the result set. */
/*********************************************************************/ /*********************************************************************/
qrp = PlgAllocResult(g, ncol, n, IDS_COLUMNS + 3, qrp = PlgAllocResult(g, ncol, n, IDS_COLUMNS + 3,
dbtype, buftyp, fldtyp, length, true, true); buftyp, fldtyp, length, true, true);
if (info) if (info)
return qrp; return qrp;
......
...@@ -66,7 +66,6 @@ extern "C" int trace; ...@@ -66,7 +66,6 @@ extern "C" int trace;
/***********************************************************************/ /***********************************************************************/
XCLDEF::XCLDEF(void) XCLDEF::XCLDEF(void)
{ {
Pseudo = 3;
Xcol = NULL; Xcol = NULL;
Sep = ','; Sep = ',';
Mult = 10; Mult = 10;
......
...@@ -154,46 +154,6 @@ int GetTypeSize(int type, int len) ...@@ -154,46 +154,6 @@ int GetTypeSize(int type, int len)
return len; return len;
} // end of GetTypeSize } // end of GetTypeSize
/***********************************************************************/
/* GetPLGType: returns the PlugDB type corresponding to a DB type. */
/***********************************************************************/
int GetPLGType(int type)
{
int tp;
switch (type) {
case DB_CHAR:
case DB_STRING: tp = TYPE_STRING; break;
case DB_SHORT: tp = TYPE_SHORT; break;
case DB_INT: tp = TYPE_INT; break;
case DB_DOUBLE: tp = TYPE_FLOAT; break;
case DB_DATE: tp = TYPE_DATE; break;
default: tp = TYPE_ERROR;
} // endswitch type
return tp;
} // end of GetPLGType
/***********************************************************************/
/* GetDBType: returns the DB type corresponding to a PlugDB type. */
/***********************************************************************/
int GetDBType(int type)
{
int tp;
switch (type) {
case TYPE_STRING: tp = DB_CHAR; break;
case TYPE_SHORT: tp = DB_SHORT; break;
case TYPE_INT: tp = DB_INT; break;
case TYPE_BIGINT:
case TYPE_FLOAT: tp = DB_DOUBLE; break;
case TYPE_DATE: tp = DB_DATE; break;
default: tp = DB_ERROR;
} // endswitch type
return tp;
} // end of GetPLGType
/***********************************************************************/ /***********************************************************************/
/* GetFormatType: returns the FORMAT character(s) according to type. */ /* GetFormatType: returns the FORMAT character(s) according to type. */
/***********************************************************************/ /***********************************************************************/
...@@ -1143,10 +1103,13 @@ bool TYPVAL<PSZ>::IsEqual(PVAL vp, bool chktype) ...@@ -1143,10 +1103,13 @@ bool TYPVAL<PSZ>::IsEqual(PVAL vp, bool chktype)
return false; return false;
else if (Null || vp->IsNull()) else if (Null || vp->IsNull())
return false; return false;
else if (Ci || vp->IsCi())
return !stricmp(Strp, vp->GetCharValue()); char buf[32];
if (Ci || vp->IsCi())
return !stricmp(Strp, vp->GetCharString(buf));
else // (!Ci) else // (!Ci)
return !strcmp(Strp, vp->GetCharValue()); return !strcmp(Strp, vp->GetCharString(buf));
} // end of IsEqual } // end of IsEqual
......
...@@ -38,7 +38,6 @@ typedef struct _datpar *PDTP; // For DTVAL ...@@ -38,7 +38,6 @@ typedef struct _datpar *PDTP; // For DTVAL
/***********************************************************************/ /***********************************************************************/
/* Utilities used to test types and to allocated values. */ /* Utilities used to test types and to allocated values. */
/***********************************************************************/ /***********************************************************************/
int GetPLGType(int);
PVAL AllocateValue(PGLOBAL, void *, short); PVAL AllocateValue(PGLOBAL, void *, short);
// Exported functions // Exported functions
...@@ -50,7 +49,6 @@ DllExport int TranslateSQLType(int stp, int prec, int& len); ...@@ -50,7 +49,6 @@ DllExport int TranslateSQLType(int stp, int prec, int& len);
#endif #endif
DllExport char *GetFormatType(int); DllExport char *GetFormatType(int);
DllExport int GetFormatType(char); DllExport int GetFormatType(char);
DllExport int GetDBType(int);
DllExport bool IsTypeChar(int type); DllExport bool IsTypeChar(int type);
DllExport bool IsTypeNum(int type); DllExport bool IsTypeNum(int type);
DllExport int ConvertType(int, int, CONV, bool match = false); DllExport int ConvertType(int, int, CONV, bool match = false);
...@@ -82,12 +80,12 @@ class DllExport VALUE : public BLOCK { ...@@ -82,12 +80,12 @@ class DllExport VALUE : public BLOCK {
virtual longlong GetBigintValue(void) = 0; virtual longlong GetBigintValue(void) = 0;
virtual double GetFloatValue(void) = 0; virtual double GetFloatValue(void) = 0;
virtual void *GetTo_Val(void) = 0; virtual void *GetTo_Val(void) = 0;
virtual void SetPrec(int prec) {Prec = prec;}
bool IsNull(void) {return Null;} bool IsNull(void) {return Null;}
void SetNull(bool b) {Null = b;} void SetNull(bool b) {Null = b;}
void SetNullable(bool b) {Nullable = b;} void SetNullable(bool b) {Nullable = b;}
int GetType(void) {return Type;} int GetType(void) {return Type;}
int GetClen(void) {return Clen;} int GetClen(void) {return Clen;}
void SetPrec(int prec) {Prec = prec;}
void SetGlobal(PGLOBAL g) {Global = g;} void SetGlobal(PGLOBAL g) {Global = g;}
// Methods // Methods
...@@ -217,6 +215,7 @@ class DllExport TYPVAL<PSZ>: public VALUE { ...@@ -217,6 +215,7 @@ class DllExport TYPVAL<PSZ>: public VALUE {
virtual longlong GetBigintValue(void) {return atoll(Strp);} virtual longlong GetBigintValue(void) {return atoll(Strp);}
virtual double GetFloatValue(void) {return atof(Strp);} virtual double GetFloatValue(void) {return atof(Strp);}
virtual void *GetTo_Val(void) {return Strp;} virtual void *GetTo_Val(void) {return Strp;}
virtual void SetPrec(int prec) {Ci = prec != 0;}
// Methods // Methods
virtual bool SetValue_pval(PVAL valp, bool chktype); virtual bool SetValue_pval(PVAL valp, bool chktype);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment