summaryrefslogtreecommitdiffstats
path: root/storage/connect/catalog.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
commita175314c3e5827eb193872241446f2f8f5c9d33c (patch)
treecd3d60ca99ae00829c52a6ca79150a5b6e62528b /storage/connect/catalog.h
parentInitial commit. (diff)
downloadmariadb-10.5-9e4947182e0b875da38088fdd168e775f473b8ad.tar.xz
mariadb-10.5-9e4947182e0b875da38088fdd168e775f473b8ad.zip
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'storage/connect/catalog.h')
-rw-r--r--storage/connect/catalog.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/storage/connect/catalog.h b/storage/connect/catalog.h
new file mode 100644
index 00000000..48347d75
--- /dev/null
+++ b/storage/connect/catalog.h
@@ -0,0 +1,105 @@
+/*************** Catalog H Declares Source Code File (.H) **************/
+/* Name: CATALOG.H Version 3.3 */
+/* */
+/* (C) Copyright to the author Olivier BERTRAND 2000-2015 */
+/* */
+/* This file contains the CATALOG PlugDB classes definitions. */
+/***********************************************************************/
+#ifndef __CATALOG__H
+#define __CATALOG__H
+
+#include "block.h"
+
+/***********************************************************************/
+/* Defines the length of a buffer to contain entire table section. */
+/***********************************************************************/
+#define PLG_MAX_PATH 144 /* Must be the same across systems */
+#define PLG_BUFF_LEN 100 /* Number of lines in binary file buffer */
+
+
+//typedef class INDEXDEF *PIXDEF;
+
+/***********************************************************************/
+/* Defines the structure used to enumerate tables or views. */
+/***********************************************************************/
+typedef struct _curtab {
+ PRELDEF CurTdb;
+ char *Curp;
+ char *Tabpat;
+ bool Ispat;
+ bool NoView;
+ int Nt;
+ char *Type[16];
+ } CURTAB, *PCURTAB;
+
+/***********************************************************************/
+/* Defines the structure used to get column catalog info. */
+/***********************************************************************/
+typedef struct _colinfo {
+ PCSZ Name;
+ int Type;
+ int Offset;
+ int Length;
+ int Key;
+ int Precision;
+ int Scale;
+ int Opt;
+ int Freq;
+ PCSZ Remark;
+ PCSZ Datefmt;
+ PCSZ Fieldfmt;
+ ushort Flags; // Used by MariaDB CONNECT handlers
+ } COLINFO, *PCOLINFO;
+
+/***********************************************************************/
+/* CATALOG: base class for catalog classes. */
+/***********************************************************************/
+class DllExport CATALOG {
+ friend class RELDEF;
+ friend class TABDEF;
+ friend class DIRDEF;
+ friend class OEMDEF;
+ public:
+ CATALOG(void); // Constructor
+ virtual ~CATALOG() { } // Make -Wdelete-non-virtual-dtor happy
+
+ // Implementation
+ int GetCblen(void) {return Cblen;}
+ bool GetDefHuge(void) {return DefHuge;}
+ void SetDefHuge(bool b) {DefHuge = b;}
+ char *GetCbuf(void) {return Cbuf;}
+
+ // Methods
+ virtual void Reset(void) {}
+ 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, const char*, const char*) {return true;}
+ //virtual PRELDEF MakeTableDesc(PGLOBAL, LPCSTR, LPCSTR) {return NULL;}
+
+ // Members
+ char *Cbuf; /* Buffer used for col section */
+ int Cblen; /* Length of suballoc. buffer */
+ CURTAB Ctb; /* Used to enumerate tables */
+ bool DefHuge; /* true: tables default to huge */
+ }; // end of class CATALOG
+
+#endif // __CATALOG__H