mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
Export TDBJSN class so it can be used by EOM tables
modified: storage/connect/filamtxt.cpp modified: storage/connect/tabdos.cpp modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h
This commit is contained in:
parent
8bd1f06c5a
commit
332c617690
4 changed files with 27 additions and 14 deletions
|
@ -71,8 +71,23 @@ TXTFAM::TXTFAM(PDOSDEF tdp)
|
|||
{
|
||||
Tdbp = NULL;
|
||||
To_Fb = NULL;
|
||||
To_File = tdp->Fn;
|
||||
Lrecl = tdp->Lrecl;
|
||||
|
||||
if (tdp) {
|
||||
To_File = tdp->Fn;
|
||||
Lrecl = tdp->Lrecl;
|
||||
Eof = tdp->Eof;
|
||||
Ending = tdp->Ending;
|
||||
} else {
|
||||
To_File = NULL;
|
||||
Lrecl = 0;
|
||||
Eof = false;
|
||||
#if defined(__WIN__)
|
||||
Ending = 2;
|
||||
#else
|
||||
Ending = 1;
|
||||
#endif
|
||||
} // endif tdp
|
||||
|
||||
Placed = false;
|
||||
IsRead = true;
|
||||
Blocked = false;
|
||||
|
@ -103,8 +118,6 @@ TXTFAM::TXTFAM(PDOSDEF tdp)
|
|||
Blksize = 0;
|
||||
Fpos = Spos = Tpos = 0;
|
||||
Padded = false;
|
||||
Eof = tdp->Eof;
|
||||
Ending = tdp->Ending;
|
||||
Abort = false;
|
||||
CrLf = (char*)(Ending == 1 ? "\n" : "\r\n");
|
||||
} // end of TXTFAM standard constructor
|
||||
|
|
|
@ -2358,7 +2358,7 @@ DOSCOL::DOSCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am)
|
|||
Dval = NULL;
|
||||
Buf = NULL;
|
||||
|
||||
if (txfp->Blocked && Opt && (cdp->GetMin() || cdp->GetDval())) {
|
||||
if (txfp && txfp->Blocked && Opt && (cdp->GetMin() || cdp->GetDval())) {
|
||||
int nblk = txfp->GetBlock();
|
||||
|
||||
Clustered = (cdp->GetXdb2()) ? 2 : 1;
|
||||
|
|
|
@ -441,7 +441,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m)
|
|||
|
||||
if (Zipped) {
|
||||
#if defined(ZIP_SUPPORT)
|
||||
if (m == MODE_READ || m == MODE_UPDATE) {
|
||||
if (m == MODE_READ || m == MODE_READX) {
|
||||
txfp = new(g) UNZFAM(this);
|
||||
} else if (m == MODE_INSERT) {
|
||||
txfp = new(g) ZIPFAM(this);
|
||||
|
@ -486,7 +486,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m)
|
|||
} else {
|
||||
if (Zipped) {
|
||||
#if defined(ZIP_SUPPORT)
|
||||
if (m == MODE_READ || m == MODE_UPDATE) {
|
||||
if (m == MODE_READ || m == MODE_READX) {
|
||||
txfp = new(g) UNZFAM(this);
|
||||
} else if (m == MODE_INSERT) {
|
||||
strcpy(g->Message, "INSERT supported only for zipped JSON when pretty=0");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*************** tabjson H Declares Source Code File (.H) **************/
|
||||
/* Name: tabjson.h Version 1.1 */
|
||||
/* Name: tabjson.h Version 1.2 */
|
||||
/* */
|
||||
/* (C) Copyright to the author Olivier BERTRAND 2014 - 2015 */
|
||||
/* (C) Copyright to the author Olivier BERTRAND 2014 - 2017 */
|
||||
/* */
|
||||
/* This file contains the JSON classes declares. */
|
||||
/***********************************************************************/
|
||||
|
@ -32,7 +32,7 @@ typedef struct _jnode {
|
|||
/***********************************************************************/
|
||||
/* JSON table. */
|
||||
/***********************************************************************/
|
||||
class JSONDEF : public DOSDEF { /* Table description */
|
||||
class DllExport JSONDEF : public DOSDEF { /* Table description */
|
||||
friend class TDBJSON;
|
||||
friend class TDBJSN;
|
||||
friend class TDBJCL;
|
||||
|
@ -66,7 +66,7 @@ class JSONDEF : public DOSDEF { /* Table description */
|
|||
/* This is the JSN Access Method class declaration. */
|
||||
/* The table is a DOS file, each record being a JSON object. */
|
||||
/***********************************************************************/
|
||||
class TDBJSN : public TDBDOS {
|
||||
class DllExport TDBJSN : public TDBDOS {
|
||||
friend class JSONCOL;
|
||||
friend class JSONDEF;
|
||||
public:
|
||||
|
@ -127,7 +127,7 @@ public:
|
|||
/***********************************************************************/
|
||||
/* Class JSONCOL: JSON access method column descriptor. */
|
||||
/***********************************************************************/
|
||||
class JSONCOL : public DOSCOL {
|
||||
class DllExport JSONCOL : public DOSCOL {
|
||||
friend class TDBJSN;
|
||||
friend class TDBJSON;
|
||||
public:
|
||||
|
@ -174,7 +174,7 @@ class JSONCOL : public DOSCOL {
|
|||
/***********************************************************************/
|
||||
/* This is the JSON Access Method class declaration. */
|
||||
/***********************************************************************/
|
||||
class TDBJSON : public TDBJSN {
|
||||
class DllExport TDBJSON : public TDBJSN {
|
||||
friend class JSONDEF;
|
||||
friend class JSONCOL;
|
||||
public:
|
||||
|
@ -221,7 +221,7 @@ class TDBJSON : public TDBJSN {
|
|||
/***********************************************************************/
|
||||
/* This is the class declaration for the JSON catalog table. */
|
||||
/***********************************************************************/
|
||||
class TDBJCL : public TDBCAT {
|
||||
class DllExport TDBJCL : public TDBCAT {
|
||||
public:
|
||||
// Constructor
|
||||
TDBJCL(PJDEF tdp);
|
||||
|
|
Loading…
Reference in a new issue