diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2014-03-10 18:29:04 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2014-03-10 18:29:04 +0100 |
commit | e5729127b8a50a0e553fd8b87b2683e4a684dfcc (patch) | |
tree | e1aa801ddbce432955725707a90e0be9b8d8845f /storage/connect/value.cpp | |
parent | 126bb34513f34eba97598d2357bfc1c2fbf594b4 (diff) | |
download | mariadb-git-e5729127b8a50a0e553fd8b87b2683e4a684dfcc.tar.gz |
- NOTE: an experimental implementation of MRR was done but not kept
in this version. Sure enough, it never caused any improvement in
the execution speed and rather caused a small increase of execution
time. This is probably because values are sorted by rowid in each
range of CONNECT indexes. This could be reconsidered if a customer
have a need for processing very big files.
- Fix a bug in ha_connect::CheckCond. The negated form of BETWEEN and
IS NULL operators was not recognized.
modified:
storage/connect/ha_connect.cc
- Add long jump initialization in CntReadNext. This was causing a server
crash when an error occured in a ReadColumn.
modified:
storage/connect/connect.cc
- General cleanup of CONNECT source code eliminating all code not used by
CONNECT, including the MRR test code (saved separately).
modified:
storage/connect/catalog.h
storage/connect/colblk.cpp
storage/connect/colblk.h
storage/connect/connect.cc
storage/connect/connect.h
storage/connect/domdoc.h
storage/connect/filamap.cpp
storage/connect/filamap.h
storage/connect/filamdbf.h
storage/connect/filamfix.cpp
storage/connect/filamfix.h
storage/connect/filamtxt.cpp
storage/connect/filamtxt.h
storage/connect/filamvct.cpp
storage/connect/filamvct.h
storage/connect/filamzip.cpp
storage/connect/filamzip.h
storage/connect/global.h
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/myconn.h
storage/connect/plgcnx.h
storage/connect/plgdbsem.h
storage/connect/plugutil.c
storage/connect/preparse.h
storage/connect/reldef.cpp
storage/connect/reldef.h
storage/connect/tabcol.h
storage/connect/tabdos.cpp
storage/connect/tabdos.h
storage/connect/tabfix.cpp
storage/connect/tabfmt.cpp
storage/connect/tabfmt.h
storage/connect/table.cpp
storage/connect/tabmac.h
storage/connect/tabmul.h
storage/connect/tabmysql.cpp
storage/connect/tabmysql.h
storage/connect/taboccur.h
storage/connect/tabodbc.cpp
storage/connect/tabodbc.h
storage/connect/tabsys.cpp
storage/connect/tabsys.h
storage/connect/tabtbl.cpp
storage/connect/tabtbl.h
storage/connect/tabutil.h
storage/connect/tabvct.cpp
storage/connect/tabvct.h
storage/connect/tabwmi.cpp
storage/connect/tabwmi.h
storage/connect/tabxml.cpp
storage/connect/tabxml.h
storage/connect/user_connect.cc
storage/connect/user_connect.h
storage/connect/valblk.cpp
storage/connect/valblk.h
storage/connect/value.cpp
storage/connect/value.h
storage/connect/xindex.cpp
storage/connect/xindex.h
storage/connect/xobject.cpp
storage/connect/xobject.h
storage/connect/xtable.h
Diffstat (limited to 'storage/connect/value.cpp')
-rw-r--r-- | storage/connect/value.cpp | 120 |
1 files changed, 1 insertions, 119 deletions
diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index c818070b970..2f284a06319 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -83,6 +83,7 @@ int DTVAL::Shift = 0; /* Routines called externally. */ /***********************************************************************/ bool PlugEvalLike(PGLOBAL, LPCSTR, LPCSTR, bool); + #if !defined(WIN32) extern "C" { PSZ strupr(PSZ s); @@ -277,55 +278,6 @@ const char *GetFmt(int type, bool un) return fmt; } // end of GetFmt -#if 0 -/***********************************************************************/ -/* ConvertType: what this function does is to determine the type to */ -/* which should be converted a value so no precision would be lost. */ -/* This can be a numeric type if num is true or non numeric if false. */ -/* Note: this is an ultra simplified version of this function that */ -/* should become more and more complex as new types are added. */ -/* Not evaluated types (TYPE_VOID or TYPE_UNDEF) return false from */ -/* IsType... functions so match does not prevent correct setting. */ -/***********************************************************************/ -int ConvertType(int target, int type, CONV kind, bool match) - { - switch (kind) { - case CNV_CHAR: - if (match && (!IsTypeChar(target) || !IsTypeChar(type))) - return TYPE_ERROR; - - return TYPE_STRING; - case CNV_NUM: - if (match && (!IsTypeNum(target) || !IsTypeNum(type))) - return TYPE_ERROR; - - return (target == TYPE_DOUBLE || type == TYPE_DOUBLE) ? TYPE_DOUBLE - : (target == TYPE_DATE || type == TYPE_DATE) ? TYPE_DATE - : (target == TYPE_BIGINT || type == TYPE_BIGINT) ? TYPE_BIGINT - : (target == TYPE_INT || type == TYPE_INT) ? TYPE_INT - : (target == TYPE_SHORT || type == TYPE_SHORT) ? TYPE_SHORT - : TYPE_TINY; - default: - if (target == TYPE_ERROR || target == type) - return type; - - if (match && ((IsTypeChar(target) && !IsTypeChar(type)) || - (IsTypeNum(target) && !IsTypeNum(type)))) - return TYPE_ERROR; - - return (target == TYPE_DOUBLE || type == TYPE_DOUBLE) ? TYPE_DOUBLE - : (target == TYPE_DATE || type == TYPE_DATE) ? TYPE_DATE - : (target == TYPE_BIGINT || type == TYPE_BIGINT) ? TYPE_BIGINT - : (target == TYPE_INT || type == TYPE_INT) ? TYPE_INT - : (target == TYPE_SHORT || type == TYPE_SHORT) ? TYPE_SHORT - : (target == TYPE_STRING || type == TYPE_STRING) ? TYPE_STRING - : (target == TYPE_TINY || type == TYPE_TINY) ? TYPE_TINY - : TYPE_ERROR; - } // endswitch kind - - } // end of ConvertType -#endif // 0 - /***********************************************************************/ /* AllocateConstant: allocates a constant Value. */ /***********************************************************************/ @@ -422,76 +374,6 @@ PVAL AllocateValue(PGLOBAL g, int type, int len, int prec, return valp; } // end of AllocateValue -#if 0 -/***********************************************************************/ -/* Allocate a constant Value converted to newtype. */ -/* Can also be used to copy a Value eventually converted. */ -/***********************************************************************/ -PVAL AllocateValue(PGLOBAL g, PVAL valp, int newtype, int uns) - { - PSZ p, sp; - bool un = (uns < 0) ? false : (uns > 0) ? true : valp->IsUnsigned(); - - if (newtype == TYPE_VOID) // Means allocate a value of the same type - newtype = valp->GetType(); - - switch (newtype) { - case TYPE_STRING: - p = (PSZ)PlugSubAlloc(g, NULL, 1 + valp->GetValLen()); - - if ((sp = valp->GetCharString(p)) != p) - strcpy (p, sp); - - valp = new(g) TYPVAL<PSZ>(g, p, valp->GetValLen(), valp->GetValPrec()); - break; - case TYPE_SHORT: - if (un) - valp = new(g) TYPVAL<ushort>(valp->GetUShortValue(), - TYPE_SHORT, 0, true); - else - valp = new(g) TYPVAL<short>(valp->GetShortValue(), TYPE_SHORT); - - break; - case TYPE_INT: - if (un) - valp = new(g) TYPVAL<uint>(valp->GetUIntValue(), TYPE_INT, 0, true); - else - valp = new(g) TYPVAL<int>(valp->GetIntValue(), TYPE_INT); - - break; - case TYPE_BIGINT: - if (un) - valp = new(g) TYPVAL<ulonglong>(valp->GetUBigintValue(), - TYPE_BIGINT, 0, true); - else - valp = new(g) TYPVAL<longlong>(valp->GetBigintValue(), TYPE_BIGINT); - - break; - case TYPE_DATE: - valp = new(g) DTVAL(g, valp->GetIntValue()); - break; - case TYPE_DOUBLE: - valp = new(g) TYPVAL<double>(valp->GetFloatValue(), TYPE_DOUBLE, - valp->GetValPrec()); - break; - case TYPE_TINY: - if (un) - valp = new(g) TYPVAL<uchar>(valp->GetUTinyValue(), - TYPE_TINY, 0, true); - else - valp = new(g) TYPVAL<char>(valp->GetTinyValue(), TYPE_TINY); - - break; - default: - sprintf(g->Message, MSG(BAD_VALUE_TYPE), newtype); - return NULL; - } // endswitch type - - valp->SetGlobal(g); - return valp; - } // end of AllocateValue -#endif // 0 - /* -------------------------- Class VALUE ---------------------------- */ /***********************************************************************/ |