18 #ifndef NDB_SQL_UTIL_HPP
19 #define NDB_SQL_UTIL_HPP
21 #include <ndb_global.h>
22 #include <kernel/ndb_limits.h>
51 typedef int Cmp(
const void* info,
const void* p1, uint n1,
const void* p2, uint n2);
60 typedef int Like(
const void* info,
const void* p1,
unsigned n1,
const void* p2,
unsigned n2);
69 typedef int AndMask(
const void* data,
unsigned dataLen,
const void* mask,
unsigned maskLen,
bool cmpZero);
73 Undefined = NDB_TYPE_UNDEFINED,
74 Tinyint = NDB_TYPE_TINYINT,
75 Tinyunsigned = NDB_TYPE_TINYUNSIGNED,
76 Smallint = NDB_TYPE_SMALLINT,
77 Smallunsigned = NDB_TYPE_SMALLUNSIGNED,
78 Mediumint = NDB_TYPE_MEDIUMINT,
79 Mediumunsigned = NDB_TYPE_MEDIUMUNSIGNED,
81 Unsigned = NDB_TYPE_UNSIGNED,
83 Bigunsigned = NDB_TYPE_BIGUNSIGNED,
84 Float = NDB_TYPE_FLOAT,
85 Double = NDB_TYPE_DOUBLE,
86 Olddecimal = NDB_TYPE_OLDDECIMAL,
88 Varchar = NDB_TYPE_VARCHAR,
89 Binary = NDB_TYPE_BINARY,
90 Varbinary = NDB_TYPE_VARBINARY,
91 Datetime = NDB_TYPE_DATETIME,
96 Longvarchar = NDB_TYPE_LONGVARCHAR,
97 Longvarbinary = NDB_TYPE_LONGVARBINARY,
100 Timestamp = NDB_TYPE_TIMESTAMP,
101 Olddecimalunsigned = NDB_TYPE_OLDDECIMALUNSIGNED,
102 Decimal = NDB_TYPE_DECIMAL,
103 Decimalunsigned = NDB_TYPE_DECIMALUNSIGNED
120 static uint check_column_for_hash_index(Uint32 typeId,
const void* info);
121 static uint check_column_for_ordered_index(Uint32 typeId,
const void* info);
128 static bool get_var_length(Uint32 typeId,
const void* p,
unsigned attrlen, Uint32& lb, Uint32& len);
139 uchar *dst,
size_t dstlen,
140 const uchar *src,
size_t srclen);
153 Uint32 dataByteSize);
160 static const Type m_typeList[];
164 static Cmp cmpTinyint;
165 static Cmp cmpTinyunsigned;
166 static Cmp cmpSmallint;
167 static Cmp cmpSmallunsigned;
168 static Cmp cmpMediumint;
169 static Cmp cmpMediumunsigned;
171 static Cmp cmpUnsigned;
172 static Cmp cmpBigint;
173 static Cmp cmpBigunsigned;
175 static Cmp cmpDouble;
176 static Cmp cmpOlddecimal;
178 static Cmp cmpVarchar;
179 static Cmp cmpBinary;
180 static Cmp cmpVarbinary;
181 static Cmp cmpDatetime;
186 static Cmp cmpLongvarchar;
187 static Cmp cmpLongvarbinary;
190 static Cmp cmpTimestamp;
191 static Cmp cmpOlddecimalunsigned;
192 static Cmp cmpDecimal;
193 static Cmp cmpDecimalunsigned;
195 static Like likeChar;
196 static Like likeBinary;
197 static Like likeVarchar;
198 static Like likeVarbinary;
199 static Like likeLongvarchar;
200 static Like likeLongvarbinary;