Commit 4d0587c3 authored by Olivier Bertrand's avatar Olivier Bertrand

- Fix an error pointed out by Valgrind due to uninitialised Correlated

  variable. This variable is not to be used by CONNECT.
modified:
  storage/connect/array.cpp
  storage/connect/array.h
parent de3ee460
...@@ -254,7 +254,6 @@ ARRAY::ARRAY(PGLOBAL g, PARRAY par, int k) : CSORT(FALSE) ...@@ -254,7 +254,6 @@ ARRAY::ARRAY(PGLOBAL g, PARRAY par, int k) : CSORT(FALSE)
Value = AllocateValue(g, Type, Len, prec, NULL); Value = AllocateValue(g, Type, Len, prec, NULL);
Constant = TRUE; Constant = TRUE;
} // end of ARRAY constructor } // end of ARRAY constructor
#endif // 0
/***********************************************************************/ /***********************************************************************/
/* Empty: reset the array for a new use (correlated queries). */ /* Empty: reset the array for a new use (correlated queries). */
...@@ -267,6 +266,7 @@ void ARRAY::Empty(void) ...@@ -267,6 +266,7 @@ void ARRAY::Empty(void)
Nval = Ndif = 0; Nval = Ndif = 0;
Bot = Top = X = Inf = Sup = 0; Bot = Top = X = Inf = Sup = 0;
} // end of Empty } // end of Empty
#endif // 0
/***********************************************************************/ /***********************************************************************/
/* Add a string element to an array. */ /* Add a string element to an array. */
...@@ -741,7 +741,7 @@ bool ARRAY::Sort(PGLOBAL g) ...@@ -741,7 +741,7 @@ bool ARRAY::Sort(PGLOBAL g)
Nval = Ndif; Nval = Ndif;
} // endif ndif } // endif ndif
if (!Correlated) { //if (!Correlated) {
if (Size > Nval) { if (Size > Nval) {
Size = Nval; Size = Nval;
Valblk->ReAllocate(g, Size); Valblk->ReAllocate(g, Size);
...@@ -751,7 +751,7 @@ bool ARRAY::Sort(PGLOBAL g) ...@@ -751,7 +751,7 @@ bool ARRAY::Sort(PGLOBAL g)
PlgDBfree(Index); PlgDBfree(Index);
PlgDBfree(Offset); PlgDBfree(Offset);
Xsize = -1; Xsize = -1;
} // endif Correlated // } // endif Correlated
Bot = -1; // For non optimized search Bot = -1; // For non optimized search
Top = Ndif; // Find searches the whole array. Top = Ndif; // Find searches the whole array.
......
...@@ -44,7 +44,7 @@ class DllExport ARRAY : public XOBJECT, public CSORT { // Array descblock ...@@ -44,7 +44,7 @@ class DllExport ARRAY : public XOBJECT, public CSORT { // Array descblock
int GetSize(void) {return Size;} int GetSize(void) {return Size;}
// PVAL GetValp(void) {return Valp;} // PVAL GetValp(void) {return Valp;}
void SetType(int atype) {Type = atype;} void SetType(int atype) {Type = atype;}
void SetCorrel(bool b) {Correlated = b;} // void SetCorrel(bool b) {Correlated = b;}
// Methods // Methods
virtual void Reset(void) {Bot = -1;} virtual void Reset(void) {Bot = -1;}
...@@ -54,7 +54,7 @@ class DllExport ARRAY : public XOBJECT, public CSORT { // Array descblock ...@@ -54,7 +54,7 @@ class DllExport ARRAY : public XOBJECT, public CSORT { // Array descblock
//virtual int CheckSpcCol(PTDB, int) {return 0;} //virtual int CheckSpcCol(PTDB, int) {return 0;}
virtual void Print(PGLOBAL g, FILE *f, uint n); virtual void Print(PGLOBAL g, FILE *f, uint n);
virtual void Print(PGLOBAL g, char *ps, uint z); virtual void Print(PGLOBAL g, char *ps, uint z);
void Empty(void); // void Empty(void);
void SetPrecision(PGLOBAL g, int p); void SetPrecision(PGLOBAL g, int p);
bool AddValue(PGLOBAL g, PSZ sp); bool AddValue(PGLOBAL g, PSZ sp);
bool AddValue(PGLOBAL g, short n); bool AddValue(PGLOBAL g, short n);
...@@ -92,7 +92,7 @@ class DllExport ARRAY : public XOBJECT, public CSORT { // Array descblock ...@@ -92,7 +92,7 @@ class DllExport ARRAY : public XOBJECT, public CSORT { // Array descblock
int Bot; // Bottom of research index int Bot; // Bottom of research index
int Top; // Top of research index int Top; // Top of research index
int X, Inf, Sup; // Used for block optimization int X, Inf, Sup; // Used for block optimization
bool Correlated; // -----------> Temporary //bool Correlated; // -----------> Temporary
}; // end of class ARRAY }; // end of class ARRAY
/***********************************************************************/ /***********************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment