mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
1c88b9a8d3
When null and the column is NOT NULL the value was not reset. modified: storage/connect/tabjson.cpp Fix converting bstr_t string to set error message modified: storage/connect/domdoc.cpp Fix MDEV-12768: -Wformat-overflow compile warnings modified: storage/connect/global.h modified: storage/connect/jsonudf.cpp modified: storage/connect/plugutil.cpp modified: storage/connect/tabvct.cpp Typo (in external_lock) modified: storage/connect/ha_connect.cc Remove some warnings modified: storage/connect/odbconn.cpp modified: storage/connect/tabmysql.cpp Add MEM_RESERVE flag to virtualAlloc modified: storage/connect/plgdbutl.cpp Fix MDEV-12573: Accept=1 may show incorrect value for NULL column in CONNECT TBL modified: storage/connect/tabutil.cpp Fix wrong setting of key size when greater than 2G modified: storage/connect/xindex.cpp Fixing MDEV-12149: compile errors on Windows with /Zc:strictStrings Introduce typedef PCSZ and replace PSZ by it where it matters All done on CONNECT but compile still fails because of an included system file modified: storage/connect/array.cpp modified: storage/connect/catalog.h modified: storage/connect/colblk.cpp modified: storage/connect/colblk.h modified: storage/connect/connect.cc modified: storage/connect/domdoc.cpp modified: storage/connect/domdoc.h modified: storage/connect/filamdbf.cpp modified: storage/connect/filamdbf.h modified: storage/connect/filamfix.cpp modified: storage/connect/filamgz.cpp modified: storage/connect/filamtxt.h modified: storage/connect/filamvct.cpp modified: storage/connect/filamvct.h modified: storage/connect/filamzip.cpp modified: storage/connect/filamzip.h modified: storage/connect/ha_connect.cc modified: storage/connect/ha_connect.h modified: storage/connect/jdbccat.h modified: storage/connect/jdbconn.cpp modified: storage/connect/jdbconn.h modified: storage/connect/json.cpp modified: storage/connect/json.h modified: storage/connect/jsonudf.cpp modified: storage/connect/jsonudf.h modified: storage/connect/libdoc.cpp modified: storage/connect/macutil.cpp modified: storage/connect/myconn.cpp modified: storage/connect/myutil.cpp modified: storage/connect/myutil.h modified: storage/connect/odbccat.h modified: storage/connect/odbconn.cpp modified: storage/connect/odbconn.h modified: storage/connect/os.h modified: storage/connect/plgdbsem.h modified: storage/connect/plgdbutl.cpp modified: storage/connect/plgxml.cpp modified: storage/connect/plgxml.h modified: storage/connect/plugutil.cpp modified: storage/connect/preparse.h modified: storage/connect/reldef.cpp modified: storage/connect/reldef.h modified: storage/connect/tabdos.cpp modified: storage/connect/tabdos.h modified: storage/connect/tabext.cpp modified: storage/connect/tabext.h modified: storage/connect/tabfix.cpp modified: storage/connect/tabfix.h modified: storage/connect/tabfmt.cpp modified: storage/connect/tabfmt.h modified: storage/connect/tabjdbc.cpp modified: storage/connect/tabjdbc.h modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h modified: storage/connect/table.cpp modified: storage/connect/tabmac.cpp modified: storage/connect/tabmul.cpp modified: storage/connect/tabmul.h modified: storage/connect/tabmysql.cpp modified: storage/connect/tabmysql.h modified: storage/connect/tabodbc.cpp modified: storage/connect/tabodbc.h modified: storage/connect/tabpivot.cpp modified: storage/connect/tabpivot.h modified: storage/connect/tabsys.cpp modified: storage/connect/tabsys.h modified: storage/connect/tabutil.cpp modified: storage/connect/tabutil.h modified: storage/connect/tabvir.cpp modified: storage/connect/tabvir.h modified: storage/connect/tabwmi.cpp modified: storage/connect/tabwmi.h modified: storage/connect/tabxml.cpp modified: storage/connect/tabxml.h modified: storage/connect/tabzip.cpp modified: storage/connect/tabzip.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/xobject.cpp modified: storage/connect/xobject.h modified: storage/connect/xtable.h Fix MDEV-12603 Insert replaces values in ZIP file modified: storage/connect/filamzip.cpp modified: storage/connect/filamzip.h Fix MDEV-12686 Handle null in json Fix MDEV-12688 Insert does not handle type TINYINT modified: storage/connect/json.cpp modified: storage/connect/tabjson.cpp Fix MDEV-12653 Cannot add index for ZIP CONNECT table modified: storage/connect/filamzip.cpp modified: storage/connect/ha_connect.cc modified: storage/connect/tabdos.cpp modified: storage/connect/tabfmt.cpp modified: storage/connect/tabjson.cpp modified: storage/connect/xindex.cpp
248 lines
8.7 KiB
C++
248 lines
8.7 KiB
C++
/*************** Tabmul H Declares Source Code File (.H) ***************/
|
|
/* Name: TABMUL.H Version 1.5 */
|
|
/* */
|
|
/* (C) Copyright to PlugDB Software Development 2003-2017 */
|
|
/* Author: Olivier BERTRAND */
|
|
/* */
|
|
/* This file contains the TDBMUL and TDBDIR classes declares. */
|
|
/***********************************************************************/
|
|
#if defined(__WIN__)
|
|
#include <io.h>
|
|
#else // !__WIN__
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
#include <sys/stat.h>
|
|
#include <dirent.h>
|
|
#endif // !__WIN__
|
|
//#include "osutil.h"
|
|
#include "block.h"
|
|
|
|
typedef class TDBMUL *PTDBMUL;
|
|
typedef class TDBSDR *PTDBSDR;
|
|
|
|
/***********************************************************************/
|
|
/* This is the MUL Access Method class declaration for files that are */
|
|
/* physically split in multiple files having the same format. */
|
|
/***********************************************************************/
|
|
class DllExport TDBMUL : public TDBASE {
|
|
//friend class MULCOL;
|
|
public:
|
|
// Constructor
|
|
TDBMUL(PTDB tdbp);
|
|
TDBMUL(PTDBMUL tdbp);
|
|
|
|
// Implementation
|
|
virtual AMT GetAmType(void) {return Tdbp->GetAmType();}
|
|
virtual PTDB Duplicate(PGLOBAL g);
|
|
|
|
// Methods
|
|
virtual void ResetDB(void);
|
|
virtual PTDB Clone(PTABS t);
|
|
virtual bool IsSame(PTDB tp) {return tp == (PTDB)Tdbp;}
|
|
virtual PCSZ GetFile(PGLOBAL g) {return Tdbp->GetFile(g);}
|
|
virtual int GetRecpos(void) {return 0;}
|
|
virtual PCOL ColDB(PGLOBAL g, PSZ name, int num);
|
|
bool InitFileNames(PGLOBAL g);
|
|
|
|
// Database routines
|
|
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
|
|
{strcpy(g->Message, MSG(MUL_MAKECOL_ERR)); return NULL;}
|
|
virtual int Cardinality(PGLOBAL g);
|
|
virtual int GetMaxSize(PGLOBAL g);
|
|
virtual int GetProgMax(PGLOBAL g);
|
|
virtual int GetProgCur(void);
|
|
virtual int RowNumber(PGLOBAL g, bool b = false);
|
|
virtual bool OpenDB(PGLOBAL g);
|
|
virtual int ReadDB(PGLOBAL g);
|
|
virtual int WriteDB(PGLOBAL g);
|
|
virtual int DeleteDB(PGLOBAL g, int irc);
|
|
virtual void CloseDB(PGLOBAL g);
|
|
|
|
protected:
|
|
|
|
// Members
|
|
PTDB Tdbp; // Points to a (file) table class
|
|
char* *Filenames; // Points to file names
|
|
int Rows; // Total rows of already read files
|
|
int Mul; // Type of multiple file list
|
|
int NumFiles; // Number of physical files
|
|
int iFile; // Index of currently processed file
|
|
}; // end of class TDBMUL
|
|
|
|
#if 0
|
|
/***********************************************************************/
|
|
/* This is the MSD Access Method class declaration for files that are */
|
|
/* physically split in multiple files having the same format. */
|
|
/* This sub-class also include files of the sub-directories. */
|
|
/***********************************************************************/
|
|
class DllExport TDBMSD : public TDBMUL {
|
|
//friend class MULCOL;
|
|
public:
|
|
// Constructor
|
|
TDBMSD(PTDB tdbp) : TDBMUL(tdbp) {}
|
|
TDBMSD(PTDBMSD tdbp) : TDBMUL(tdbp) {}
|
|
|
|
// Implementation
|
|
virtual PTDB Duplicate(PGLOBAL g);
|
|
|
|
// Methods
|
|
virtual PTDB Clone(PTABS t);
|
|
bool InitFileNames(PGLOBAL g);
|
|
|
|
// Database routines
|
|
|
|
protected:
|
|
|
|
// Members
|
|
}; // end of class TDBMSD
|
|
#endif
|
|
|
|
/***********************************************************************/
|
|
/* Directory listing table. */
|
|
/***********************************************************************/
|
|
class DllExport DIRDEF : public TABDEF { /* Directory listing table */
|
|
friend class CATALOG;
|
|
friend class TDBDIR;
|
|
public:
|
|
// Constructor
|
|
DIRDEF(void) {Fn = NULL; Incl = false; Huge = false;}
|
|
|
|
// Implementation
|
|
virtual const char *GetType(void) {return "DIR";}
|
|
|
|
// Methods
|
|
virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
|
|
virtual PTDB GetTable(PGLOBAL g, MODE m);
|
|
|
|
protected:
|
|
// Members
|
|
PSZ Fn; /* Path/Name of file search */
|
|
bool Incl; /* true to include sub-directories */
|
|
bool Huge; /* true if files can be larger than 2GB */
|
|
bool Nodir; /* true to exclude directories */
|
|
}; // end of DIRDEF
|
|
|
|
/***********************************************************************/
|
|
/* This is the DIR Access Method class declaration for tables that */
|
|
/* represent a directory listing. The pathname is given at the create */
|
|
/* time and can contain wildcard characters in the file name, and the */
|
|
/* (virtual) table is populated when it is in use. */
|
|
/***********************************************************************/
|
|
class TDBDIR : public TDBASE {
|
|
friend class DIRCOL;
|
|
friend class TDBMUL;
|
|
public:
|
|
// Constructor
|
|
TDBDIR(PDIRDEF tdp);
|
|
TDBDIR(PSZ fpat);
|
|
|
|
// Implementation
|
|
virtual AMT GetAmType(void) {return TYPE_AM_DIR;}
|
|
|
|
// Methods
|
|
virtual int GetRecpos(void) {return iFile;}
|
|
|
|
// Database routines
|
|
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
|
|
virtual int GetMaxSize(PGLOBAL g);
|
|
virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);}
|
|
virtual int GetProgCur(void) {return iFile;}
|
|
virtual bool OpenDB(PGLOBAL g);
|
|
virtual int ReadDB(PGLOBAL g);
|
|
virtual int WriteDB(PGLOBAL g);
|
|
virtual int DeleteDB(PGLOBAL g, int irc);
|
|
virtual void CloseDB(PGLOBAL g);
|
|
|
|
protected:
|
|
void Init(void);
|
|
char *Path(PGLOBAL g);
|
|
|
|
// Members
|
|
PSZ To_File; // Points to file search pathname
|
|
int iFile; // Index of currently retrieved file
|
|
#if defined(__WIN__)
|
|
PVAL Dvalp; // Used to retrieve file date values
|
|
WIN32_FIND_DATA FileData; // Find data structure
|
|
HANDLE hSearch; // Search handle
|
|
char Drive[_MAX_DRIVE]; // Drive name
|
|
#else // !__WIN__
|
|
struct stat Fileinfo; // File info structure
|
|
struct dirent *Entry; // Point to directory entry structure
|
|
DIR *Dir; // To searched directory structure
|
|
bool Done; // true when _splipath is done
|
|
char Pattern[_MAX_FNAME+_MAX_EXT];
|
|
#endif // !__WIN__
|
|
char Fpath[_MAX_PATH]; // Absolute file search pattern
|
|
char Direc[_MAX_DIR]; // Search path
|
|
char Fname[_MAX_FNAME]; // File name
|
|
char Ftype[_MAX_EXT]; // File extention
|
|
bool Nodir; // Exclude directories from file list
|
|
}; // end of class TDBDIR
|
|
|
|
/***********************************************************************/
|
|
/* This is the DIR Access Method class declaration for tables that */
|
|
/* represent a directory listing. The pathname is given at the create */
|
|
/* time and can contain wildcard characters in the file name, and the */
|
|
/* (virtual) table is populated when it is in use. In addition, this */
|
|
/* class also includes files of included sub-directories. */
|
|
/***********************************************************************/
|
|
class TDBSDR : public TDBDIR {
|
|
friend class DIRCOL;
|
|
friend class TDBMUL;
|
|
public:
|
|
// Constructors
|
|
TDBSDR(PDIRDEF tdp) : TDBDIR(tdp) {Sub = NULL;}
|
|
TDBSDR(PSZ fpat) : TDBDIR(fpat) {Sub = NULL;}
|
|
|
|
// Database routines
|
|
virtual int GetMaxSize(PGLOBAL g);
|
|
virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);}
|
|
virtual bool OpenDB(PGLOBAL g);
|
|
virtual int ReadDB(PGLOBAL g);
|
|
//virtual void CloseDB(PGLOBAL g);
|
|
|
|
protected:
|
|
int FindInDir(PGLOBAL g);
|
|
|
|
typedef struct _Sub_Dir {
|
|
struct _Sub_Dir *Next;
|
|
struct _Sub_Dir *Prev;
|
|
#if defined(__WIN__)
|
|
HANDLE H; // Search handle
|
|
#else // !__WIN__
|
|
DIR *D;
|
|
#endif // !__WIN__
|
|
size_t Len; // Initial directory name length
|
|
} SUBDIR, *PSUBDIR;
|
|
|
|
// Members
|
|
PSUBDIR Sub; // To current Subdir block
|
|
}; // end of class TDBSDR
|
|
|
|
/***********************************************************************/
|
|
/* Class DIRCOL: DIR access method column descriptor. */
|
|
/* This A.M. is used for tables populated by DIR file name list. */
|
|
/***********************************************************************/
|
|
class DIRCOL : public COLBLK {
|
|
public:
|
|
// Constructors
|
|
DIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "DIR");
|
|
DIRCOL(DIRCOL *colp, PTDB tdbp); // Constructor used in copy process
|
|
|
|
// Implementation
|
|
virtual int GetAmType(void) {return TYPE_AM_DIR;}
|
|
|
|
// Methods
|
|
virtual void ReadColumn(PGLOBAL g);
|
|
|
|
protected:
|
|
// Default constructor not to be used
|
|
DIRCOL(void) {}
|
|
#if defined(__WIN__)
|
|
void SetTimeValue(PGLOBAL g, FILETIME& ftime);
|
|
#endif // __WIN__
|
|
|
|
// Members
|
|
PTDBDIR Tdbp; // To DIR table
|
|
int N; // Column number
|
|
}; // end of class DIRCOL
|