mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
3e36eb230b
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
200 lines
6.4 KiB
C++
200 lines
6.4 KiB
C++
/************** filamzip H Declares Source Code File (.H) **************/
|
|
/* Name: filamzip.h Version 1.2 */
|
|
/* */
|
|
/* (C) Copyright to the author Olivier BERTRAND 2016-2017 */
|
|
/* */
|
|
/* This file contains the ZIP file access method classes declares. */
|
|
/***********************************************************************/
|
|
#ifndef __FILAMZIP_H
|
|
#define __FILAMZIP_H
|
|
|
|
#include "block.h"
|
|
#include "filamap.h"
|
|
#include "filamfix.h"
|
|
#include "zip.h"
|
|
#include "unzip.h"
|
|
|
|
#define DLLEXPORT extern "C"
|
|
|
|
typedef class UNZFAM *PUNZFAM;
|
|
typedef class UZXFAM *PUZXFAM;
|
|
typedef class ZIPFAM *PZIPFAM;
|
|
typedef class ZPXFAM *PZPXFAM;
|
|
|
|
/***********************************************************************/
|
|
/* This is the ZIP utility fonctions class. */
|
|
/***********************************************************************/
|
|
class DllExport ZIPUTIL : public BLOCK {
|
|
public:
|
|
// Constructor
|
|
ZIPUTIL(PCSZ tgt);
|
|
//ZIPUTIL(ZIPUTIL *zutp);
|
|
|
|
// Methods
|
|
bool OpenTable(PGLOBAL g, MODE mode, PCSZ fn, bool append);
|
|
bool open(PGLOBAL g, PCSZ fn, bool append);
|
|
bool addEntry(PGLOBAL g, PCSZ entry);
|
|
void close(void);
|
|
void closeEntry(void);
|
|
int writeEntry(PGLOBAL g, char *buf, int len);
|
|
void getTime(tm_zip& tmZip);
|
|
|
|
// Members
|
|
zipFile zipfile; // The ZIP container file
|
|
PCSZ target; // The target file name
|
|
PCSZ pwd; // The ZIP file password
|
|
PFBLOCK fp;
|
|
bool entryopen; // True when open current entry
|
|
}; // end of ZIPUTIL
|
|
|
|
/***********************************************************************/
|
|
/* This is the unZIP utility fonctions class. */
|
|
/***********************************************************************/
|
|
class DllExport UNZIPUTL : public BLOCK {
|
|
public:
|
|
// Constructor
|
|
UNZIPUTL(PCSZ tgt, bool mul);
|
|
UNZIPUTL(PDOSDEF tdp);
|
|
|
|
// Implementation
|
|
//PTXF Duplicate(PGLOBAL g) { return (PTXF) new(g)UNZFAM(this); }
|
|
|
|
// Methods
|
|
bool OpenTable(PGLOBAL g, MODE mode, PCSZ fn);
|
|
bool open(PGLOBAL g, PCSZ fn);
|
|
bool openEntry(PGLOBAL g);
|
|
void close(void);
|
|
void closeEntry(void);
|
|
bool WildMatch(PCSZ pat, PCSZ str);
|
|
int findEntry(PGLOBAL g, bool next);
|
|
int nextEntry(PGLOBAL g);
|
|
bool IsInsertOk(PGLOBAL g, PCSZ fn);
|
|
|
|
// Members
|
|
unzFile zipfile; // The ZIP container file
|
|
PCSZ target; // The target file name
|
|
PCSZ pwd; // The ZIP file password
|
|
unz_file_info finfo; // The current file info
|
|
PFBLOCK fp;
|
|
char *memory;
|
|
uint size;
|
|
int multiple; // Multiple targets
|
|
bool entryopen; // True when open current entry
|
|
char fn[FILENAME_MAX]; // The current entry file name
|
|
char mapCaseTable[256];
|
|
}; // end of UNZIPUTL
|
|
|
|
/***********************************************************************/
|
|
/* This is the unzip file access method. */
|
|
/***********************************************************************/
|
|
class DllExport UNZFAM : public MAPFAM {
|
|
//friend class UZXFAM;
|
|
public:
|
|
// Constructors
|
|
UNZFAM(PDOSDEF tdp);
|
|
UNZFAM(PUNZFAM txfp);
|
|
|
|
// Implementation
|
|
virtual AMT GetAmType(void) {return TYPE_AM_ZIP;}
|
|
virtual PTXF Duplicate(PGLOBAL g) {return (PTXF) new(g) UNZFAM(this);}
|
|
|
|
// Methods
|
|
virtual int Cardinality(PGLOBAL g);
|
|
virtual int GetFileLength(PGLOBAL g);
|
|
//virtual int MaxBlkSize(PGLOBAL g, int s) {return s;}
|
|
virtual bool OpenTableFile(PGLOBAL g);
|
|
virtual bool DeferReading(void) { return false; }
|
|
virtual int GetNext(PGLOBAL g);
|
|
//virtual int ReadBuffer(PGLOBAL g);
|
|
//virtual int WriteBuffer(PGLOBAL g);
|
|
//virtual int DeleteRecords(PGLOBAL g, int irc);
|
|
//virtual void CloseTableFile(PGLOBAL g, bool abort);
|
|
|
|
protected:
|
|
// Members
|
|
UNZIPUTL *zutp;
|
|
PDOSDEF tdfp;
|
|
}; // end of UNZFAM
|
|
|
|
/***********************************************************************/
|
|
/* This is the fixed unzip file access method. */
|
|
/***********************************************************************/
|
|
class DllExport UZXFAM : public MPXFAM {
|
|
//friend class UNZFAM;
|
|
public:
|
|
// Constructors
|
|
UZXFAM(PDOSDEF tdp);
|
|
UZXFAM(PUZXFAM txfp);
|
|
|
|
// Implementation
|
|
virtual AMT GetAmType(void) { return TYPE_AM_ZIP; }
|
|
virtual PTXF Duplicate(PGLOBAL g) { return (PTXF) new(g)UZXFAM(this); }
|
|
|
|
// Methods
|
|
virtual int GetFileLength(PGLOBAL g);
|
|
virtual int Cardinality(PGLOBAL g);
|
|
virtual bool OpenTableFile(PGLOBAL g);
|
|
virtual int GetNext(PGLOBAL g);
|
|
//virtual int ReadBuffer(PGLOBAL g);
|
|
|
|
protected:
|
|
// Members
|
|
UNZIPUTL *zutp;
|
|
PDOSDEF tdfp;
|
|
}; // end of UZXFAM
|
|
|
|
/***********************************************************************/
|
|
/* This is the zip file access method. */
|
|
/***********************************************************************/
|
|
class DllExport ZIPFAM : public DOSFAM {
|
|
public:
|
|
// Constructors
|
|
ZIPFAM(PDOSDEF tdp);
|
|
|
|
// Implementation
|
|
virtual AMT GetAmType(void) {return TYPE_AM_ZIP;}
|
|
|
|
// Methods
|
|
virtual int Cardinality(PGLOBAL g) {return 0;}
|
|
virtual int GetFileLength(PGLOBAL g) {return g ? 0 : 1;}
|
|
//virtual int MaxBlkSize(PGLOBAL g, int s) {return s;}
|
|
virtual bool OpenTableFile(PGLOBAL g);
|
|
virtual int ReadBuffer(PGLOBAL g);
|
|
virtual int WriteBuffer(PGLOBAL g);
|
|
//virtual int DeleteRecords(PGLOBAL g, int irc);
|
|
virtual void CloseTableFile(PGLOBAL g, bool abort);
|
|
|
|
protected:
|
|
// Members
|
|
ZIPUTIL *zutp;
|
|
PCSZ target;
|
|
bool append;
|
|
//bool replace;
|
|
}; // end of ZIPFAM
|
|
|
|
/***********************************************************************/
|
|
/* This is the fixed zip file access method. */
|
|
/***********************************************************************/
|
|
class DllExport ZPXFAM : public FIXFAM {
|
|
public:
|
|
// Constructors
|
|
ZPXFAM(PDOSDEF tdp);
|
|
|
|
// Implementation
|
|
virtual AMT GetAmType(void) {return TYPE_AM_ZIP;}
|
|
|
|
// Methods
|
|
virtual int Cardinality(PGLOBAL g) {return 0;}
|
|
virtual int GetFileLength(PGLOBAL g) {return g ? 0 : 1;}
|
|
virtual bool OpenTableFile(PGLOBAL g);
|
|
virtual int WriteBuffer(PGLOBAL g);
|
|
virtual void CloseTableFile(PGLOBAL g, bool abort);
|
|
|
|
protected:
|
|
// Members
|
|
ZIPUTIL *zutp;
|
|
PCSZ target;
|
|
bool append;
|
|
}; // end of ZPXFAM
|
|
|
|
#endif // __FILAMZIP_H
|