mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- Fix Catalog JSON table crash when no Jpath
- Added JSON OBJECT specification for pretty != 2. - Fix NULL values not recognized for nullable JSON columns - Issue an error message when a JSON table is created without specifying LRECL if PRETTY != 2. - Make JSONColumns use a TDBJSON class. - Make JSON table using MAPFAM modified: filamap.h filamtxt.h ha_connect.cc json.result tabjson.cpp tabjson.h table.cpp - Implementing Discovery for the XML table type. modified: domdoc.cpp domdoc.h ha_connect.cc libdoc.cpp plgxml.cpp plgxml.h reldef.cpp reldef.h tabxml.cpp tabxml.h - Providing an error message when creating an ODBC table via discovery returns columns of more than one table. modified: ha_connect.cc - TableOptionStruct declaration moved from ha_connect.h to mycat.h To make it easier to use by other classes. modified: ha_connect.cc ha_connect.h mycat.cc mycat.h reldef.cpp tabmysql.cpp taboccur.cpp tabpivot.cpp tabtbl.cpp tabutil.cpp tabxcl.cpp
This commit is contained in:
@@ -35,6 +35,8 @@ class JSONDEF : public DOSDEF { /* Table description */
|
||||
friend class TDBJSON;
|
||||
friend class TDBJSN;
|
||||
friend class TDBJCL;
|
||||
friend PQRYRES JSONColumns(PGLOBAL, char *, const char *, char *,
|
||||
int, int, int, bool);
|
||||
public:
|
||||
// Constructor
|
||||
JSONDEF(void);
|
||||
@@ -71,29 +73,36 @@ class TDBJSN : public TDBDOS {
|
||||
TDBJSN(TDBJSN *tdbp);
|
||||
|
||||
// Implementation
|
||||
virtual AMT GetAmType(void) {return TYPE_AM_JSN;}
|
||||
virtual bool SkipHeader(PGLOBAL g);
|
||||
virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBJSN(this);}
|
||||
virtual AMT GetAmType(void) {return TYPE_AM_JSN;}
|
||||
virtual bool SkipHeader(PGLOBAL g);
|
||||
virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBJSN(this);}
|
||||
PJSON GetRow(void) {return Row;}
|
||||
|
||||
// Methods
|
||||
virtual PTDB CopyOne(PTABS t);
|
||||
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
|
||||
virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL colp);
|
||||
virtual int RowNumber(PGLOBAL g, bool b = FALSE)
|
||||
{return (b) ? N : Fpos + 1;}
|
||||
virtual PTDB CopyOne(PTABS t);
|
||||
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
|
||||
virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL colp);
|
||||
virtual int RowNumber(PGLOBAL g, bool b = FALSE)
|
||||
{return (b) ? N : Fpos + 1;}
|
||||
|
||||
// Database routines
|
||||
virtual int Cardinality(PGLOBAL g);
|
||||
virtual int GetMaxSize(PGLOBAL g);
|
||||
virtual bool OpenDB(PGLOBAL g);
|
||||
virtual bool PrepareWriting(PGLOBAL g);
|
||||
virtual int ReadDB(PGLOBAL g);
|
||||
virtual int Cardinality(PGLOBAL g);
|
||||
virtual int GetMaxSize(PGLOBAL g);
|
||||
virtual bool OpenDB(PGLOBAL g);
|
||||
virtual bool PrepareWriting(PGLOBAL g);
|
||||
virtual int ReadDB(PGLOBAL g);
|
||||
|
||||
protected:
|
||||
PJSON FindRow(PGLOBAL g);
|
||||
int MakeTopTree(PGLOBAL g, PJSON jsp);
|
||||
|
||||
// Members
|
||||
PJSON Top; // The top JSON tree
|
||||
PJSON Row; // The current row
|
||||
PJSON Val; // The value of the current row
|
||||
PJCOL Colp; // The multiple column
|
||||
JMODE Jmode; // MODE_OBJECT by default
|
||||
char *Objname; // The table object name
|
||||
char *Xcol; // Name of expandable column
|
||||
int Fpos; // The current row index
|
||||
//int Spos; // DELETE start index
|
||||
@@ -168,6 +177,7 @@ class TDBJSON : public TDBJSN {
|
||||
// Implementation
|
||||
virtual AMT GetAmType(void) {return TYPE_AM_JSON;}
|
||||
virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBJSON(this);}
|
||||
PJAR GetDoc(void) {return Doc;}
|
||||
|
||||
// Methods
|
||||
virtual PTDB CopyOne(PTABS t);
|
||||
@@ -185,18 +195,16 @@ class TDBJSON : public TDBJSN {
|
||||
virtual int WriteDB(PGLOBAL g);
|
||||
virtual int DeleteDB(PGLOBAL g, int irc);
|
||||
virtual void CloseDB(PGLOBAL g);
|
||||
int MakeDocument(PGLOBAL g);
|
||||
|
||||
// Optimization routines
|
||||
virtual int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add);
|
||||
|
||||
protected:
|
||||
int MakeNewDoc(PGLOBAL g);
|
||||
int MakeDocument(PGLOBAL g);
|
||||
|
||||
// Members
|
||||
PJSON Top; // The file JSON tree
|
||||
PJAR Doc; // The document array
|
||||
char *Objname; // The table object name
|
||||
int Multiple; // 0: No 1: DIR 2: Section 3: filelist
|
||||
bool Done; // True when document parsing is done
|
||||
bool Changed; // After Update, Insert or Delete
|
||||
|
Reference in New Issue
Block a user