From c055e5e0efcdd3750550230a483cdf8847b3d414 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 28 Dec 2013 15:46:49 +0100 Subject: - Add the DECIMAL data type (TYPE_DECIM) Change the variable name of the DOUBLE type from TYPE_FLOAT to TYPE_DOUBLE Change some names to reflect ODBC version 3. This affects some variable names, function names and catalog table column names. Qualifier -> Catalog Owner (Creator) -> Schema Length -> Precision Prec -> Scale modified: storage/connect/catalog.h storage/connect/colblk.cpp storage/connect/colblk.h storage/connect/filamdbf.cpp storage/connect/global.h storage/connect/ha_connect.cc storage/connect/myconn.cpp storage/connect/mysql-test/connect/r/mysql_new.result storage/connect/mysql-test/connect/r/odbc_oracle.result storage/connect/myutil.cpp storage/connect/odbconn.cpp storage/connect/plgdbutl.cpp storage/connect/rcmsg.c storage/connect/reldef.cpp storage/connect/reldef.h storage/connect/tabcol.cpp storage/connect/tabcol.h storage/connect/tabdos.cpp storage/connect/tabfmt.cpp storage/connect/tabmysql.cpp storage/connect/tabodbc.cpp storage/connect/tabodbc.h storage/connect/tabsys.cpp storage/connect/tabutil.cpp storage/connect/tabwmi.cpp storage/connect/tabxml.cpp storage/connect/valblk.cpp storage/connect/value.cpp storage/connect/value.h storage/connect/xindex.cpp storage/connect/xobject.cpp storage/connect/xobject.h - Fix crash when GetTDB returned NULL in Open_Table modified: storage/connect/ha_connect.cc - Fix assert error setting double values from PSZ modified: storage/connect/valblk.cpp --- storage/connect/valblk.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'storage/connect/valblk.cpp') diff --git a/storage/connect/valblk.cpp b/storage/connect/valblk.cpp index b041760e1c4..bef5d6ef716 100644 --- a/storage/connect/valblk.cpp +++ b/storage/connect/valblk.cpp @@ -57,6 +57,7 @@ PVBLK AllocValBlock(PGLOBAL g, void *mp, int type, int nval, int len, switch (type) { case TYPE_STRING: + case TYPE_DECIM: if (len) blkp = new(g) CHRBLK(mp, nval, len, prec, blank); else @@ -87,7 +88,7 @@ PVBLK AllocValBlock(PGLOBAL g, void *mp, int type, int nval, int len, blkp = new(g) TYPBLK(mp, nval, type); break; - case TYPE_FLOAT: + case TYPE_DOUBLE: blkp = new(g) TYPBLK(mp, nval, type, prec); break; case TYPE_TINY: @@ -343,6 +344,21 @@ ulonglong TYPBLK::MaxVal(void) {return INT_MAX64;} template <> ulonglong TYPBLK::MaxVal(void) {return ULONGLONG_MAX;} +template <> +void TYPBLK::SetValue(PSZ p, int n) + { + ChkIndx(n); + + if (Check) { + PGLOBAL& g = Global; + strcpy(g->Message, MSG(BAD_SET_STRING)); + longjmp(g->jumper[g->jump_level], Type); + } // endif Check + + Typp[n] = atof(p); + SetNull(n, false); + } // end of SetValue + /***********************************************************************/ /* Set one value in a block from an array of characters. */ /***********************************************************************/ @@ -1163,7 +1179,7 @@ DATBLK::DATBLK(void *mp, int nval) : TYPBLK(mp, nval, TYPE_INT) /***********************************************************************/ bool DATBLK::SetFormat(PGLOBAL g, PSZ fmt, int len, int year) { - if (!(Dvalp = AllocateValue(g, TYPE_DATE, len, year, fmt))) + if (!(Dvalp = AllocateValue(g, TYPE_DATE, len, year, false, fmt))) return true; return false; -- cgit v1.2.1