summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2015-02-25 11:59:00 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2015-02-25 11:59:00 +0100
commitaa107ef3ab47c9bfbd177672e64d2af56ce1b1b5 (patch)
treeedc0901c1d2e61b13c747f7251af9b4f67132b4f
parente027f5e8d5d966f11d7f38825a8e316ff9d4dd79 (diff)
downloadmariadb-git-aa107ef3ab47c9bfbd177672e64d2af56ce1b1b5.tar.gz
- FIX assert failure when sorting JSON tables
modified: storage/connect/tabjson.cpp storage/connect/tabjson.h
-rw-r--r--storage/connect/tabjson.cpp8
-rw-r--r--storage/connect/tabjson.h5
2 files changed, 8 insertions, 5 deletions
diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp
index 827828c06ee..41a6e72a76a 100644
--- a/storage/connect/tabjson.cpp
+++ b/storage/connect/tabjson.cpp
@@ -117,7 +117,8 @@ TDBJSN::TDBJSN(PJDEF tdp, PTXF txfp) : TDBDOS(tdp, txfp)
Jmode = tdp->Jmode;
Xcol = tdp->Xcol;
Fpos = -1;
- Spos = N = 0;
+//Spos = 0;
+ N = 0;
Limit = tdp->Limit;
NextSame = 0;
SameRow = 0;
@@ -134,7 +135,7 @@ TDBJSN::TDBJSN(TDBJSN *tdbp) : TDBDOS(NULL, tdbp)
Jmode = tdbp->Jmode;
Xcol = tdbp->Xcol;
Fpos = tdbp->Fpos;
- Spos = tdbp->Spos;
+//Spos = tdbp->Spos;
N = tdbp->N;
Limit = tdbp->Limit;
NextSame = tdbp->NextSame;
@@ -222,7 +223,7 @@ bool TDBJSN::OpenDB(PGLOBAL g)
/* Table already open replace it at its beginning. */
/*******************************************************************/
Fpos= -1;
- Spos = 0;
+// Spos = 0;
NextSame = 0;
SameRow = 0;
} else {
@@ -1299,7 +1300,6 @@ bool TDBJSON::OpenDB(PGLOBAL g)
/* Table already open replace it at its beginning. */
/*******************************************************************/
Fpos= -1;
- Spos = 0;
NextSame = false;
SameRow = 0;
return false;
diff --git a/storage/connect/tabjson.h b/storage/connect/tabjson.h
index f46a59c5498..eb9d078012b 100644
--- a/storage/connect/tabjson.h
+++ b/storage/connect/tabjson.h
@@ -94,7 +94,7 @@ class TDBJSN : public TDBDOS {
JMODE Jmode; // MODE_OBJECT by default
char *Xcol; // Name of expandable column
int Fpos; // The current row index
- int Spos; // DELETE start index
+//int Spos; // DELETE start index
int N; // The current Rownum
int Limit; // Limit of multiple values
int Pretty; // Depends on file structure
@@ -175,6 +175,9 @@ class TDBJSON : public TDBJSN {
virtual int GetMaxSize(PGLOBAL g);
virtual void ResetSize(void);
virtual int GetRecpos(void) {return Fpos;}
+ virtual int GetProgCur(void) {return N;}
+ virtual bool SetRecpos(PGLOBAL g, int recpos)
+ {Fpos = recpos - 1; return false;}
virtual bool OpenDB(PGLOBAL g);
virtual int ReadDB(PGLOBAL g);
virtual bool PrepareWriting(PGLOBAL g) {return false;}