Skip to content

Commit aa107ef

Browse files
committed
- FIX assert failure when sorting JSON tables
modified: storage/connect/tabjson.cpp storage/connect/tabjson.h
1 parent e027f5e commit aa107ef

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

storage/connect/tabjson.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ TDBJSN::TDBJSN(PJDEF tdp, PTXF txfp) : TDBDOS(tdp, txfp)
117117
Jmode = tdp->Jmode;
118118
Xcol = tdp->Xcol;
119119
Fpos = -1;
120-
Spos = N = 0;
120+
//Spos = 0;
121+
N = 0;
121122
Limit = tdp->Limit;
122123
NextSame = 0;
123124
SameRow = 0;
@@ -134,7 +135,7 @@ TDBJSN::TDBJSN(TDBJSN *tdbp) : TDBDOS(NULL, tdbp)
134135
Jmode = tdbp->Jmode;
135136
Xcol = tdbp->Xcol;
136137
Fpos = tdbp->Fpos;
137-
Spos = tdbp->Spos;
138+
//Spos = tdbp->Spos;
138139
N = tdbp->N;
139140
Limit = tdbp->Limit;
140141
NextSame = tdbp->NextSame;
@@ -222,7 +223,7 @@ bool TDBJSN::OpenDB(PGLOBAL g)
222223
/* Table already open replace it at its beginning. */
223224
/*******************************************************************/
224225
Fpos= -1;
225-
Spos = 0;
226+
// Spos = 0;
226227
NextSame = 0;
227228
SameRow = 0;
228229
} else {
@@ -1299,7 +1300,6 @@ bool TDBJSON::OpenDB(PGLOBAL g)
12991300
/* Table already open replace it at its beginning. */
13001301
/*******************************************************************/
13011302
Fpos= -1;
1302-
Spos = 0;
13031303
NextSame = false;
13041304
SameRow = 0;
13051305
return false;

storage/connect/tabjson.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class TDBJSN : public TDBDOS {
9494
JMODE Jmode; // MODE_OBJECT by default
9595
char *Xcol; // Name of expandable column
9696
int Fpos; // The current row index
97-
int Spos; // DELETE start index
97+
//int Spos; // DELETE start index
9898
int N; // The current Rownum
9999
int Limit; // Limit of multiple values
100100
int Pretty; // Depends on file structure
@@ -175,6 +175,9 @@ class TDBJSON : public TDBJSN {
175175
virtual int GetMaxSize(PGLOBAL g);
176176
virtual void ResetSize(void);
177177
virtual int GetRecpos(void) {return Fpos;}
178+
virtual int GetProgCur(void) {return N;}
179+
virtual bool SetRecpos(PGLOBAL g, int recpos)
180+
{Fpos = recpos - 1; return false;}
178181
virtual bool OpenDB(PGLOBAL g);
179182
virtual int ReadDB(PGLOBAL g);
180183
virtual bool PrepareWriting(PGLOBAL g) {return false;}

0 commit comments

Comments
 (0)