Commit fa4aa616 authored by Olivier Bertrand's avatar Olivier Bertrand

- Rewriting the VALUE classes as template classes

modified:
  storage/connect/tabdos.cpp
  storage/connect/tabdos.h
  storage/connect/tabmysql.cpp
  storage/connect/tabodbc.cpp
  storage/connect/tabsys.cpp
  storage/connect/tabxml.cpp
  storage/connect/value.cpp
  storage/connect/value.h
  storage/connect/xobject.h
parent f2b8155a
...@@ -991,7 +991,7 @@ bool DOSCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) ...@@ -991,7 +991,7 @@ bool DOSCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
} else if (Buf_Type == TYPE_FLOAT) } else if (Buf_Type == TYPE_FLOAT)
// Float values must be written with the correct (column) precision // Float values must be written with the correct (column) precision
// Note: maybe this should be forced by ShowValue instead of this ? // Note: maybe this should be forced by ShowValue instead of this ?
((DFVAL *)value)->SetPrec(GetPrecision()); value->SetPrec(GetPrecision());
Value = value; // Directly access the external value Value = value; // Directly access the external value
} else { } else {
...@@ -1031,7 +1031,8 @@ void DOSCOL::ReadColumn(PGLOBAL g) ...@@ -1031,7 +1031,8 @@ void DOSCOL::ReadColumn(PGLOBAL g)
{ {
char *p; char *p;
int i, rc; int i, rc;
int field; int field;
double dval;
PTDBDOS tdbp = (PTDBDOS)To_Tdb; PTDBDOS tdbp = (PTDBDOS)To_Tdb;
if (trace > 1) if (trace > 1)
...@@ -1066,14 +1067,17 @@ void DOSCOL::ReadColumn(PGLOBAL g) ...@@ -1066,14 +1067,17 @@ void DOSCOL::ReadColumn(PGLOBAL g)
if (Nod) switch (Buf_Type) { if (Nod) switch (Buf_Type) {
case TYPE_INT: case TYPE_INT:
case TYPE_SHORT: case TYPE_SHORT:
case TYPE_BIGINT:
Value->SetValue_char(p, field - Dcm); Value->SetValue_char(p, field - Dcm);
break; break;
case TYPE_FLOAT: case TYPE_FLOAT:
Value->SetValue_char(p, field); Value->SetValue_char(p, field);
dval = Value->GetFloatValue();
for (i = 0; i < Dcm; i++) for (i = 0; i < Dcm; i++)
((DFVAL*)Value)->Divide(10.0); dval /= 10.0;
Value->SetValue(dval);
break; break;
default: default:
Value->SetValue_char(p, field); Value->SetValue_char(p, field);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "colblk.h" // Column base class declares #include "colblk.h" // Column base class declares
#include "xindex.h" #include "xindex.h"
typedef struct _tabdesc *PTABD; // For friend setting //pedef struct _tabdesc *PTABD; // For friend setting
typedef class TXTFAM *PTXF; typedef class TXTFAM *PTXF;
/***********************************************************************/ /***********************************************************************/
......
...@@ -960,7 +960,7 @@ bool MYSQLCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) ...@@ -960,7 +960,7 @@ bool MYSQLCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
} else if (Buf_Type == TYPE_FLOAT) } else if (Buf_Type == TYPE_FLOAT)
// Float values must be written with the correct (column) precision // Float values must be written with the correct (column) precision
// Note: maybe this should be forced by ShowValue instead of this ? // Note: maybe this should be forced by ShowValue instead of this ?
((DFVAL *)value)->SetPrec(GetPrecision()); value->SetPrec(GetPrecision());
Value = value; // Directly access the external value Value = value; // Directly access the external value
} else { } else {
......
...@@ -757,7 +757,7 @@ bool ODBCCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) ...@@ -757,7 +757,7 @@ bool ODBCCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
} else if (Buf_Type == TYPE_FLOAT) } else if (Buf_Type == TYPE_FLOAT)
// Float values must be written with the correct (column) precision // Float values must be written with the correct (column) precision
// Note: maybe this should be forced by ShowValue instead of this ? // Note: maybe this should be forced by ShowValue instead of this ?
((DFVAL *)value)->SetPrec(GetPrecision()); value->SetPrec(GetPrecision());
Value = value; // Directly access the external value Value = value; // Directly access the external value
} else { } else {
......
...@@ -455,7 +455,7 @@ bool INICOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) ...@@ -455,7 +455,7 @@ bool INICOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
} else if (Buf_Type == TYPE_FLOAT) } else if (Buf_Type == TYPE_FLOAT)
// Float values must be written with the correct (column) precision // Float values must be written with the correct (column) precision
// Note: maybe this should be forced by ShowValue instead of this ? // Note: maybe this should be forced by ShowValue instead of this ?
((DFVAL *)value)->SetPrec(GetPrecision()); value->SetPrec(GetPrecision());
Value = value; // Directly access the external value Value = value; // Directly access the external value
} else { } else {
......
...@@ -1148,7 +1148,7 @@ bool XMLCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) ...@@ -1148,7 +1148,7 @@ bool XMLCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
} else if (Buf_Type == TYPE_FLOAT) } else if (Buf_Type == TYPE_FLOAT)
// Float values must be written with the correct (column) precision // Float values must be written with the correct (column) precision
// Note: maybe this should be forced by ShowValue instead of this ? // Note: maybe this should be forced by ShowValue instead of this ?
((DFVAL *)value)->SetPrec(GetPrecision()); value->SetPrec(GetPrecision());
Value = value; // Directly access the external value Value = value; // Directly access the external value
} else { } else {
......
This diff is collapsed.
This diff is collapsed.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
/***********************************************************************/ /***********************************************************************/
/* Types used in some class definitions. */ /* Types used in some class definitions. */
/***********************************************************************/ /***********************************************************************/
typedef struct _tabdesc *PTABD; // For friend setting //typedef struct _tabdesc *PTABD; // For friend setting
/***********************************************************************/ /***********************************************************************/
/* The pointer to the one and only needed void object. */ /* The pointer to the one and only needed void object. */
......
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