Skip to content

Commit

Permalink
Prevent wrong update of expanded columns when pretty is not 2.
Browse files Browse the repository at this point in the history
  modified:   storage/connect/tabjson.cpp
  • Loading branch information
Buggynours committed Aug 11, 2015
1 parent 5f53303 commit 335ec7a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions storage/connect/tabjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ int TDBJSN::MakeTopTree(PGLOBAL g, PJSON jsp)
} else
strcpy(To_Line, s);

Row->Clear();
// Row->Clear();
return false;
} else
return true;
Expand Down Expand Up @@ -979,7 +979,8 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
if (!stricmp(Name, colp->GetName())) {
Nod = colp->Nod;
Nodes = colp->Nodes;
goto fin;
Xpd = colp->Xpd;
goto fin;
} // endif Name

sprintf(g->Message, "Cannot parse updated column %s", Name);
Expand Down Expand Up @@ -1347,7 +1348,12 @@ PJSON JSONCOL::GetRow(PGLOBAL g)
/***********************************************************************/
void JSONCOL::WriteColumn(PGLOBAL g)
{
/*********************************************************************/
if (Xpd && Tjp->Pretty < 2) {
strcpy(g->Message, "Cannot write expanded column when Pretty is not 2");
longjmp(g->jumper[g->jump_level], 666);
} // endif Xpd

/*********************************************************************/
/* Check whether this node must be written. */
/*********************************************************************/
if (Value != To_Val)
Expand Down

0 comments on commit 335ec7a

Please sign in to comment.