From b344a49f7e54f93f7b4815441d0b51b5838b84af Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Thu, 29 Aug 2013 12:01:27 +0200 Subject: - Fix a bug causing a crash when an XCOL table was the source of a PROXY or PROXY based table. modified: storage/connect/colblk.cpp storage/connect/tabutil.cpp storage/connect/tabutil.h storage/connect/tabxcl.cpp storage/connect/tabxcl.h --- storage/connect/colblk.cpp | 2 +- storage/connect/tabutil.cpp | 13 ++++++++++++- storage/connect/tabutil.h | 1 + storage/connect/tabxcl.cpp | 6 ++++-- storage/connect/tabxcl.h | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/storage/connect/colblk.cpp b/storage/connect/colblk.cpp index a3206243cc1..64cccfced7f 100644 --- a/storage/connect/colblk.cpp +++ b/storage/connect/colblk.cpp @@ -178,7 +178,7 @@ bool COLBLK::InitValue(PGLOBAL g) (To_Tdb) ? To_Tdb->GetCat() : NULL))) return true; - Status = BUF_READY; + AddStatus(BUF_READY); Value->SetNullable(Nullable); #ifdef DEBTRACE diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp index 110c53c33b2..674a8acf45a 100644 --- a/storage/connect/tabutil.cpp +++ b/storage/connect/tabutil.cpp @@ -591,6 +591,17 @@ bool PRXCOL::Init(PGLOBAL g) return FALSE; } // end of Init +/***********************************************************************/ +/* Reset the column descriptor to non evaluated yet. */ +/***********************************************************************/ +void PRXCOL::Reset(void) + { + if (Colp) + Colp->Reset(); + + Status &= ~BUF_READ; + } // end of Reset + /***********************************************************************/ /* ReadColumn: */ /***********************************************************************/ @@ -600,7 +611,7 @@ void PRXCOL::ReadColumn(PGLOBAL g) htrc("PRX ReadColumn: name=%s\n", Name); if (Colp) { - Colp->ReadColumn(g); + Colp->Eval(g); Value->SetValue_pval(To_Val); // Set null when applicable diff --git a/storage/connect/tabutil.h b/storage/connect/tabutil.h index 15078ca3dee..a6202950390 100644 --- a/storage/connect/tabutil.h +++ b/storage/connect/tabutil.h @@ -105,6 +105,7 @@ class DllExport PRXCOL : public COLBLK { virtual int GetAmType(void) {return TYPE_AM_PRX;} // Methods + virtual void Reset(void); virtual bool IsSpecial(void) {return Pseudo;} virtual void ReadColumn(PGLOBAL g); bool Init(PGLOBAL g); diff --git a/storage/connect/tabxcl.cpp b/storage/connect/tabxcl.cpp index eb9e9c0e4dc..33ec8984219 100644 --- a/storage/connect/tabxcl.cpp +++ b/storage/connect/tabxcl.cpp @@ -253,7 +253,7 @@ XCLCOL::XCLCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i) void XCLCOL::ReadColumn(PGLOBAL g) { if (((PTDBXCL)To_Tdb)->New) { - Colp->ReadColumn(g); + Colp->Eval(g); strcpy(Cbuf, To_Val->GetCharValue()); Cp = Cbuf; } // endif New @@ -272,9 +272,11 @@ void XCLCOL::ReadColumn(PGLOBAL g) } else if (Nullable) { Value->Reset(); Value->SetNull(true); - } else + } else { // Skip that row ((PTDBXCL)To_Tdb)->RowFlag = 2; + Colp->Reset(); + } // endif Cp if (Cp && *Cp) // More to come from the same row diff --git a/storage/connect/tabxcl.h b/storage/connect/tabxcl.h index 28fbf85d509..0189775cd8d 100644 --- a/storage/connect/tabxcl.h +++ b/storage/connect/tabxcl.h @@ -90,7 +90,7 @@ class XCLCOL : public PRXCOL { XCLCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i); // Methods - virtual void Reset(void) {} // Evaluated only by TDBXCL + virtual void Reset(void) {Colp->Reset();} // Evaluated only by TDBXCL virtual void ReadColumn(PGLOBAL g); protected: -- cgit v1.2.1