1 #ifndef BZS_DB_PROTOCOL_TDAP_TDAPSCHEMA_H
2 #define BZS_DB_PROTOCOL_TDAP_TDAPSCHEMA_H
22 #include <bzs/db/protocol/tdap/tdapcapi.h>
27 #include <bzs/env/compiler.h>
28 #include <bzs/env/crosscompile.h>
29 #include <bzs/db/protocol/tdap/mysql/characterset.h>
30 #include <bzs/db/blobStructs.h>
32 #include <bzs/db/protocol/tdap/myDateTime.h>
52 struct openTablePrams;
80 unsigned short bit0 : 1;
81 unsigned short bit1 : 1;
82 unsigned short bit2 : 1;
83 unsigned short bit3 : 1;
84 unsigned short bit4 : 1;
85 unsigned short bit5 : 1;
86 unsigned short bit6 : 1;
87 unsigned short bit7 : 1;
88 unsigned short bit8 : 1;
89 unsigned short bit9 : 1;
90 unsigned short bitA : 1;
91 unsigned short bitB : 1;
92 unsigned short bitC : 1;
93 unsigned short bitD : 1;
94 unsigned short bitE : 1;
95 unsigned short bitF : 1;
164 #define kf_duplicatable bit0
165 #define kf_changeatable bit1
166 #define kf_allseg_nullkey bit3
167 #define kf_order_desc bit6
168 #define kf_extend bit8
169 #define kf_seg_nullkey bit9
170 #define kf_incase bitA
176 #define MAX_KEY_SEGMENT 8
177 #define COMP_KEY_FLAGS(l, r, NAME) (l.NAME == r.NAME)
186 if (
this == &r)
return true;
188 if (!ret)
return false;
193 ret = COMP_KEY_FLAGS(f, rf, kf_duplicatable) &&
194 COMP_KEY_FLAGS(f, rf, kf_changeatable) &&
195 COMP_KEY_FLAGS(f, rf, kf_allseg_nullkey) &&
196 COMP_KEY_FLAGS(f, rf, kf_order_desc) &&
197 COMP_KEY_FLAGS(f, rf, kf_seg_nullkey) &&
198 COMP_KEY_FLAGS(f, rf, kf_incase);
199 if (!ret)
return false;
205 short synchronize(
const keydef* kd);
210 static const int MYSQL_FDNAME_SIZE = 64;
211 static const int MYSQL_TBNAME_SIZE = 64;
212 static const int PERVASIVE_FDNAME_SIZE = 20;
213 static const int FIELD_NAME_SIZE = MYSQL_FDNAME_SIZE;
214 static const int TABLE_NAME_SIZE = 32;
215 static const int FILE_NAME_SIZE = 266;
218 #if (defined(__x86_32__) || defined(__APPLE_32__))
219 static const int TABLEDEF_FILLER_SIZE = 17;
221 static const int TABLEDEF_FILLER_SIZE = 1;
225 #ifndef MYSQL_DYNAMIC_PLUGIN
238 lenByCharnum(uchar_td type, uchar_td charsetIndex, ushort_td charnum);
240 #endif // MYSQL_DYNAMIC_PLUGIN
256 case ft_mywvarbinary:
278 #define PAD_CHAR_OPTION_SAVED 1
279 #define USE_PAD_CHAR 2
280 #define TRIM_PAD_CHAR 4
282 #define FIELD_OPTION_NULLABLE 1
283 #define FIELD_OPTION_MARIADB 2
284 #define FIELD_OPTION_REGACY_TIME 4
286 #define DEFAULT_VALUE_SIZE 8
289 #define DIGITS_INT32 9
290 static const int decimalBytesBySurplus[DIGITS_INT32 + 1] = {0, 1, 1, 2, 2, 3, 3, 4, 4, 4};
296 unsigned __int64 m_i64;
303 inline void set(
int index,
bool value)
305 unsigned __int64 bits = 1ULL << index;
306 m_i64 = value ? m_i64 | bits : m_i64 & ~bits;
309 inline bool get(
int index)
const
311 unsigned __int64 bits = 1ULL << index;
312 return (m_i64 & bits) != 0;
317 inline bool operator[](
int index)
const {
return get(index); };
321 return (m_i64 == r.m_i64);
326 return all ? ((m_i64 & r.m_i64) == r.m_i64) : ((m_i64 & r.m_i64) != 0);
423 const wchar_t* name()
const;
424 const wchar_t* name(
wchar_t* buf)
const;
425 const wchar_t* chainChar()
const;
426 const wchar_t* defaultValue_str()
const;
427 void setName(
const wchar_t* s);
428 void setChainChar(
const wchar_t* s);
429 void setDefaultValue(
const wchar_t* s);
430 #else // NOT _UNICODE
432 #ifdef MYSQL_DYNAMIC_PLUGIN
440 inline void setName(
const char* s)
442 strncpy_s(m_name, FIELD_NAME_SIZE, s,
sizeof(m_name) - 1);
445 inline void setChainChar(
const char* s)
447 strncpy_s(m_chainChar, 2, s,
sizeof(m_chainChar) - 1);
450 inline void setDefaultValue(
const char* s)
454 memset(m_defValue, 0, DEFAULT_VALUE_SIZE);
458 enableFlags.bitF =
false;
465 myDateTime dt(7,
true);
468 memcpy(m_defValue, &i64, 7);
476 i64 = str_to_64<myDateTime, char>(7,
true, s);
477 memcpy(m_defValue, &i64, 7);
481 *((__int64*)m_defValue) = _atoi64(s);
488 case ft_autoIncUnsigned:
490 *((
unsigned __int64*)m_defValue) = strtoull(s, NULL, 10);
496 *((
double*)m_defValue) = atof(s);
499 strncpy_s(m_defValue, 8, s,
sizeof(m_defValue) - 1);
502 inline void setDefaultValue(
double v)
504 *((
double*)m_defValue) = v;
507 inline void setDefaultValue(__int64 v)
509 *((__int64*)m_defValue) = v;
513 #else // NOT MYSQL_DYNAMIC_PLUGIN
514 const char* name()
const;
515 const char* name(
char* buf)
const;
516 const char* chainChar()
const;
517 const char* defaultValue_str()
const;
518 void setName(
const char* s);
519 void setChainChar(
const char* s);
520 #endif // NOT MYSQL_DYNAMIC_PLUGIN
521 #endif // NOT _UNICODE
523 inline const char*
nameA()
const {
return m_name; };
527 strncpy_s(m_name, FIELD_NAME_SIZE, s,
sizeof(m_name) - 1);
530 #ifndef MYSQL_DYNAMIC_PLUGIN
531 void setDefaultValue(
const char* s);
533 void setDefaultValue(__int64 v);
535 void setDefaultValue(
double v);
542 double defaultValue()
const;
544 __int64 defaultValue64()
const;
555 void setDecimalDigits(
int dig,
int dec);
556 #endif // MYSQL_DYNAMIC_PLUGIN
560 return mysql::codePage((
unsigned short)m_charsetIndex);
569 return ((type == ft_mychar) || (type == ft_mywchar) ||
570 (type == ft_string) || (type == ft_wstring));
575 return ((type == ft_integer) || (type == ft_logical) || (type == ft_uinteger) ||
576 (type == ft_autoinc) || (type == ft_set) || (type == ft_bit) ||
577 (type == ft_enum) || (type == ft_autoIncUnsigned) || (type == ft_myyear));
582 return ((type == ft_integer) || (type == ft_decimal) ||
583 (type == ft_money) || (type == ft_logical) || (type == ft_currency) ||
584 (type == ft_numeric) || (type == ft_bfloat) || (type == ft_float) ||
585 (type == ft_uinteger) || (type == ft_autoinc) || (type == ft_set) ||
586 (type == ft_bit) || (type == ft_enum) || (type == ft_numericsts) ||
587 (type == ft_numericsa) || (type == ft_autoIncUnsigned) ||
588 (type == ft_myyear) || (type == ft_mydecimal));
593 return ((type == ft_date) || (type == ft_mydate) ||
594 (type == ft_time) || (type == ft_mytime) ||
595 (type == ft_datetime) || (type == ft_timestamp) ||
596 (type == ft_mydatetime) || (type == ft_mytimestamp));
601 return (nullValue == 0x00) && (len <= 8) &&
602 ((type == ft_logical) || (type == ft_integer) ||
603 (type == ft_uinteger) || (type == ft_enum)|| (type == ft_set));
609 unsigned int charNum()
const;
611 bool isValidCharNum()
const;
615 m_charsetIndex = index;
616 if ((type == ft_wstring) || (type == ft_wzstring) ||
617 (type == ft_mywvarchar) || (type == ft_mywvarbinary) ||
618 (type == ft_mywchar))
619 m_charsetIndex = CHARSET_UTF16LE;
626 return (type == ft_myblob) || (type == ft_mytext) || (type == ft_mygeometry) || (type == ft_myjson);
631 m_padCharOptions = 0;
632 m_padCharOptions |= PAD_CHAR_OPTION_SAVED;
633 if ((type == ft_mychar) || (type == ft_mywchar))
635 m_padCharOptions |= USE_PAD_CHAR;
637 m_padCharOptions |= TRIM_PAD_CHAR;
639 else if ((type == ft_string) || (type == ft_wstring))
642 m_padCharOptions |= USE_PAD_CHAR;
644 m_padCharOptions |= TRIM_PAD_CHAR;
649 inline bool isUsePadChar()
const {
return (m_padCharOptions & USE_PAD_CHAR) == USE_PAD_CHAR;}
653 inline bool isTrimPadChar()
const {
return (m_padCharOptions & TRIM_PAD_CHAR) == TRIM_PAD_CHAR;}
655 inline bool isNullable()
const {
return (m_options & FIELD_OPTION_NULLABLE) == FIELD_OPTION_NULLABLE;}
661 m_options |= FIELD_OPTION_NULLABLE;
662 enableFlags.bitF = defaultNull;
666 m_options &= ~FIELD_OPTION_NULLABLE;
667 enableFlags.bitF =
false;
673 if (type == ft_mytimestamp || type == ft_mydatetime)
674 m_defValue[7] = v ? 1: 0;
679 if (type == ft_mytimestamp || type == ft_mydatetime)
680 return (m_defValue[7] == 1);
686 return enableFlags.bitF;
691 return (m_options & FIELD_OPTION_REGACY_TIME) != 0;
705 if (((type >= ft_myvarchar) && (type <= ft_mywvarbinary)) ||
707 return len < 256 ? 1 : 2;
708 else if (type == ft_lvar)
713 bool operator==(
const fielddef& r)
const;
716 const char* defaultValue_strA(
char* p,
size_t size)
const;
719 inline uint_td dataLen(
const uchar_td* ptr)
const
721 int blen = varLenBytes();
725 return *((
unsigned char*)ptr);
726 return *((
unsigned short*)ptr);
729 inline uint_td blobDataLen(
const uchar_td* ptr)
const
731 int blen = blobLenBytes();
735 memcpy(&v, ptr, blen);
739 inline uint_td maxVarDatalen()
const
741 if (((type >= ft_myvarchar) && (type <= ft_mywvarbinary)) ||
743 return (len < 256) ? len - 1 : len - 2;
744 else if (type == ft_lvar)
767 inline const uchar_td* keyData(
const uchar_td* ptr)
const
770 return blobDataPtr(ptr);
771 int sizeByte = varLenBytes();
772 return ptr + sizeByte;
775 inline uint_td keyDataLen(
const uchar_td* ptr)
const
778 return blobDataLen(ptr);
784 inline bool isKeyVarType()
const
786 return (((type >= ft_myvarchar) && (type <= ft_mywvarbinary)) || isBlob());
791 inline ushort_td maxKeylen()
const {
return keylen ? keylen : len; };
798 inline uchar_td* keyCopy(uchar_td* to,
const uchar_td* from, ushort_td datalen,
799 bool isNull,
bool transactd)
801 ushort_td keylen = maxKeylen();
802 ushort_td keyVarlen = varLenByteForKey();
803 ushort_td copylen = std::min<ushort_td>(keylen, datalen);
805 memset(to, 0x00, keylen + 1);
806 if (isNullable() && transactd)
812 return to + 1 + keylen - keyVarlen;
821 copylen = (ushort_td)std::min<uint_td>((uint_td)copylen,
824 memcpy(to, ©len, 2);
827 from = keyData(from);
829 memcpy(to, from, copylen);
831 return to + keylen - keyVarlen;
834 inline const uchar_td* blobDataPtr(
const uchar_td* ptr)
const
836 int blen = blobLenBytes();
839 const uchar_td** p = (
const uchar_td**)(ptr + blen);
843 inline uint_td unPackCopy(uchar_td* dest,
const uchar_td* src)
const
845 int clen = varLenBytes();
849 clen += *((
unsigned char*)src);
851 clen += *((
unsigned short*)src);
852 memcpy(dest, src, clen);
856 inline ushort_td varLenByteForKey()
const
858 if (((type >= ft_myvarchar) && (type <= ft_mywvarbinary)) ||
859 (type == ft_lstring))
860 return len < 256 ? 1 : 2;
869 inline const uchar_td* getKeyValueFromKeybuf(
const uchar_td* from,
870 const uchar_td** data,
873 ushort_td keyVarlen =
877 size = *((ushort_td*)from);
894 inline unsigned char* setBlobFieldPointer(uchar_td* dest,
const blobHeader* hd,
895 unsigned char* blobBlock,
int fieldNum)
const
897 assert(hd->curRow < hd->rows);
898 const blobField* f = hd->nextField;
899 int sizeByte = blobLenBytes();
900 unsigned int size = f->size;
902 memcpy(dest, &size, sizeByte);
906 memcpy(blobBlock, f->data(), size);
908 memcpy(dest + sizeByte, &blobBlock,
sizeof(
char*));
910 memset(dest + sizeByte, 0,
sizeof(
char*));
911 hd->nextField = (blobField*)f->next();
912 if (fieldNum == hd->fieldCount - 1)
914 return blobBlock + size;
917 inline void setPadCharDefaultSettings()
919 if (!isPadCharOptionSaved())
922 if ((type == ft_string) || (type == ft_wstring) ||
923 (type == ft_mychar) || (type == ft_mywchar))
925 m_padCharOptions |= USE_PAD_CHAR;
926 m_padCharOptions |= TRIM_PAD_CHAR;
929 else if ((type == ft_mychar) || (type == ft_mywchar))
930 m_padCharOptions |= USE_PAD_CHAR;
936 bool isPadCharOptionSaved()
const
938 return (m_padCharOptions & PAD_CHAR_OPTION_SAVED) == PAD_CHAR_OPTION_SAVED;
940 #ifdef SP_SCOPE_FIELD_TEST
943 inline uchar_td nullbit()
const {
return m_nullbit;}
944 inline uchar_td nullbytes()
const {
return m_nullbytes;}
945 inline void setOptions(uchar_td v) {m_options = v;}
951 inline uint_td compDataLen(
const uchar_td* ptr,
bool part)
const
953 uint_td length = keyDataLen(ptr);
956 if ((type == ft_string) || (type == ft_zstring) ||
957 (type == ft_note) || (type == ft_mychar))
958 length = (uint_td)strlen((
const char*)ptr);
959 else if ((type == ft_wstring) || (type == ft_wzstring) ||
960 (type == ft_mywchar))
961 length = (uint_td)strlen16((char16_t*)ptr)*
sizeof(char16_t);
966 short synchronize(
const fielddef* td);
968 void fixCharnum_bug();
974 friend class client::recordCache;
977 friend class client::filter;
979 friend struct client::logic;
981 friend class client::sqlBuilder;
982 friend class mysql::schemaBuilder;
986 friend uint_td dataLen(
const fielddef& fd,
const uchar_td* ptr);
987 friend uint_td blobDataLen(
const fielddef& fd,
const uchar_td* ptr);
988 friend uint_td blobLenBytes(
const fielddef& fd);
993 inline void updateTimeStampStr(
const fielddef* fd,
char* p,
size_t size)
996 sprintf_s(p, 64,
" ON UPDATE CURRENT_TIMESTAMP");
998 sprintf_s(p, 64,
" ON UPDATE CURRENT_TIMESTAMP(%d)", fd->
decimals);
1002 inline void updateTimeStampStr(
const fielddef* fd,
wchar_t* p,
size_t size)
1004 if (fd->isLegacyTimeFormat())
1005 swprintf_s(p, 64, L
" ON UPDATE CURRENT_TIMESTAMP");
1008 int dec = (fd->type == ft_mytimestamp) ? (fd->len - 4) * 2 : (fd->len - 5) * 2;
1009 swprintf_s(p, 64, L
" ON UPDATE CURRENT_TIMESTAMP(%d)",dec);
1014 inline uint_td dataLen(
const fielddef& fd,
const uchar_td* ptr)
1016 return fd.dataLen(ptr);
1019 inline uint_td blobDataLen(
const fielddef& fd,
const uchar_td* ptr)
1021 return fd.blobDataLen(ptr);
1024 inline uint_td blobLenBytes(
const fielddef& fd)
1026 return fd.blobLenBytes();
1029 inline _TCHAR* timeStampDefaultStr(
const fielddef& fd, _TCHAR* buf,
size_t bufsize)
1031 if (fd.type == ft_mytimestamp || fd.type == ft_mydatetime)
1034 if (fd.isLegacyTimeFormat())
1035 _stprintf_s(buf, bufsize, _T(
"CURRENT_TIMESTAMP"));
1037 _stprintf_s(buf, bufsize, _T(
"CURRENT_TIMESTAMP(%d)"), fd.decimals);
1045 #define FORMAT_VERSON_BTRV_DEF 0
1046 #define FORMAT_VERSON_CURRENT 1
1056 friend struct client::openTablePrams;
1057 friend struct client::dbdimple;
1058 friend class client::filter;
1059 friend class client::recordCache;
1061 friend class client::sqlBuilder;
1062 friend class mysql::schemaBuilder;
1072 formatVersion = FORMAT_VERSON_CURRENT;
1073 m_utimeFieldNum = -1;
1078 schemaCodePage = 65001;
1081 m_useInMariadb =
true;
1085 const wchar_t* fileName()
const;
1086 const wchar_t* tableName()
const;
1087 void setFileName(
const wchar_t* s);
1088 void setTableName(
const wchar_t* s);
1089 void convertToUtf8Schema();
1091 const char* toChar(
char* buf,
const wchar_t* s,
int size)
const;
1093 #ifdef MYSQL_DYNAMIC_PLUGIN
1095 const char* fileName()
const {
return m_fileName; };
1097 const char* tableName()
const {
return m_tableName; };
1099 inline void setFileName(
const char* s) { setFileNameA(s); };
1101 inline void setTableName(
const char* s) { setTableNameA(s); };
1103 inline const char* toChar(
char* buf,
const char* s,
int size)
const
1105 strncpy_s(buf, size, s, size - 1);
1109 const char* fileName()
const;
1110 const char* tableName()
const;
1111 void setFileName(
const char* s);
1112 void setTableName(
const char* s);
1113 void convertToUtf8Schema();
1115 const char* toChar(
char* buf,
const char* s,
int size)
const;
1116 #endif // MYSQL_DYNAMIC_PLUGIN
1125 strncpy_s(m_fileName, FILE_NAME_SIZE, s, FILE_NAME_SIZE - 1);
1130 strncpy_s(m_tableName, TABLE_NAME_SIZE, s,
sizeof(m_tableName) - 1);
1137 inline uchar_td
inUse()
const {
return m_inUse; }
1140 short fieldNumByName(
const _TCHAR* name)
const;
1142 inline ushort_td
recordlen()
const {
return m_maxRecordLen; }
1144 uint_td unPack(
char* ptr,
size_t size)
const;
1148 m_useInMariadb = isMariadb;
1149 m_srvMinorVer = srvMinorVersion;
1156 if (fd.
type == ft_mytime || fd.
type == ft_mydatetime ||
1157 fd.
type == ft_mytimestamp)
1161 if (fd.
decimals == 0 && (m_srvMinorVer == 5 || m_srvMinorVer == 0))
return true;
1165 if (m_srvMinorVer < 6)
return true;
1170 bool operator==(
const tabledef& r)
const;
1173 short synchronize(
const tabledef* td);
1174 bool isNullKey(
const keydef& key)
const;
1175 uint_td pack(
char* ptr,
size_t size)
const;
1176 short findKeynumByFieldNum(
short fieldNum)
const;
1177 inline ushort_td recordlenServer()
const {
return m_maxRecordLen;}
1178 bool isNeedNis(
const keydef& key)
const;
1179 bool isNULLFieldFirstKeySegField(
const keydef& key)
const;
1180 bool isNullValueZeroAll(
const keydef& key)
const;
1181 void setMysqlNullMode(
bool v);
1182 void calcReclordlen(
bool force=
false);
1183 inline keydef* setKeydefsPtr()
1185 return keyDefs = (keydef*)((
char*)
this +
sizeof(tabledef) +
1186 (fieldCount *
sizeof(fielddef)));
1189 inline fielddef* setFielddefsPtr()
1191 return fieldDefs = (fielddef*)((
char*)
this +
sizeof(tabledef));
1194 inline bool isMariaTimeFormat()
const
1196 return (m_useInMariadb && (m_srvMajorVer == 5 || m_srvMinorVer == 0));
1222 char m_fileName[FILE_NAME_SIZE];
1223 char m_tableName[TABLE_NAME_SIZE];
1229 uchar_td m_nullfields;
1230 uchar_td m_nullbytes;
1232 bool m_mysqlNullMode ;
1233 bool m_useInMariadb ;
1234 uchar_td m_srvMajorVer;
1235 uchar_td m_srvMinorVer;
1236 ushort_td m_utimeFieldNum;
1237 uchar_td m_filler0[8];
1246 ushort_td m_maxRecordLen;
1261 uchar_td reserved[TABLEDEF_FILLER_SIZE];
1269 #define MAX_SCHEMASIZE 33672
1293 const _TCHAR* moduleVersionShortString(_TCHAR* buf);
1294 const _TCHAR* moduleTypeString();
1298 if (majorVersion >= 10)
return true;
1299 if ((majorVersion == 5) && (minorVersion > 5))
return true;
1305 return isSupportDateTimeTimeStamp();
1308 inline bool isMariaDB()
const {
return type == MYSQL_TYPE_MARIA; }
1312 if ((majorVersion == 10) && (minorVersion >= 1))
return true;
1313 if ((majorVersion == 5) && (minorVersion >= 6))
return true;
1319 return !isMariaDB() && (minorVersion < 6);
1329 #define VER_IDX_CLINET 0
1330 #define VER_IDX_DB_SERVER 1
1331 #define VER_IDX_PLUGIN 2
1347 #endif // BZS_DB_PROTOCOL_TDAP_TDAPSCHEMA_H
ushort_td preAlloc
Definition: tdapSchema.h:150
uchar_td iconIndex
Definition: tdapSchema.h:1249
bool isMysql56TimeFormat() const
Definition: tdapSchema.h:1310
uchar_td replicaKeyNum
Definition: tdapSchema.h:1242
ushort_td filterId
Definition: tdapSchema.h:364
void setFileNameA(const char *s)
Definition: tdapSchema.h:1123
bool isBlob() const
Definition: tdapSchema.h:624
ushort_td keylen
Definition: tdapSchema.h:374
uchar_td inUse() const
Definition: tdapSchema.h:1137
ushort_td minorVersion
Definition: tdapSchema.h:1290
ushort_td fixedRecordLen
Definition: tdapSchema.h:1251
uchar_td lookTable
Definition: tdapSchema.h:349
フィールド定義構造体
Definition: tdapSchema.h:333
ushort_td ddfid
Definition: tdapSchema.h:361
bool isDefaultNull() const
Definition: tdapSchema.h:684
ushort_td len
Definition: tdapSchema.h:340
サーバーおよびクライアントモジュールのバージョン構造体
Definition: tdapSchema.h:1287
int autoIncExSpace
Definition: tdapSchema.h:1252
FLAGS fileFlag
Definition: tdapSchema.h:148
void setPadCharSettings(bool set, bool trim)
Definition: tdapSchema.h:629
uchar_td parentKeyNum
Definition: tdapSchema.h:1241
bool isLegacyTimeFormat() const
Definition: tdapSchema.h:689
unsigned short bitC
Definition: tdapSchema.h:117
pragma_pop
Definition: btrDate.h:107
uchar_td decimals
Definition: tdapSchema.h:341
bool isNullKeysegType() const
Definition: tdapSchema.h:599
ushort_td viewWidth
Definition: tdapSchema.h:343
unsigned short bitB
Definition: tdapSchema.h:116
ushort_td recLen
Definition: tdapSchema.h:144
void setTimeStampOnUpdate(bool v)
Definition: tdapSchema.h:671
ushort_td varSize
Definition: tdapSchema.h:1213
uchar_td m_charsetIndex
Definition: tdapSchema.h:377
uchar_td reserve1[2]
Definition: tdapSchema.h:149
char m_name[N]
Definition: tdapSchema.h:336
uchar_td reserve2[2]
Definition: tdapSchema.h:135
uint_td varLenBytes() const
Definition: tdapSchema.h:703
bool isLegacyTimeFormat(const fielddef &fd) const
Definition: tdapSchema.h:1154
unsigned int codePage() const
Definition: tdapSchema.h:558
bool isIntegerType() const
Definition: tdapSchema.h:573
bool isStringType(uchar_td type)
Definition: tdapSchema.h:262
ushort_td preAlloc
Definition: tdapSchema.h:1217
const char * nameA() const
Definition: tdapSchema.h:523
uchar_td acsNo
Definition: tdapSchema.h:137
keydef * keyDefs
Definition: tdapSchema.h:1264
uchar_td iconIndex3
Definition: tdapSchema.h:1254
bool isUsePadChar() const
Definition: tdapSchema.h:649
ushort_td id
Definition: tdapSchema.h:1200
void setSchemaCodePage(uint_td v)
Definition: tdapSchema.h:385
キーセグメント定義構造体
Definition: tdapSchema.h:156
const char * fileNameA() const
Definition: tdapSchema.h:1119
PACKAGE const _TCHAR * getTypeName(short type)
void setNameA(const char *s)
Definition: tdapSchema.h:525
フィールド定義構造体
Definition: tdapSchema.h:419
bool operator==(const bitset &r) const
Definition: tdapSchema.h:319
ビットフィールド共用体
Definition: tdapSchema.h:99
fielddef_t< MYSQL_FDNAME_SIZE > fielddef_t_my
Definition: tdapSchema.h:412
unsigned short all
Definition: tdapSchema.h:101
bool isTimeStampOnUpdate() const
Definition: tdapSchema.h:677
フィールドコレクションクラス
Definition: fields.h:256
bool isNullable() const
Definition: tdapSchema.h:655
bool isMysqlNullMode() const
Definition: tdapSchema.h:1152
char m_chainChar[2]
Definition: tdapSchema.h:356
bool operator==(const keydef &r) const
Definition: tdapSchema.h:184
uint_td keyCount
Definition: tdapSchema.h:132
__int64 internalValue() const
Definition: tdapSchema.h:315
バージョン配列構造体
Definition: tdapSchema.h:1324
FLAGS enableFlags
Definition: tdapSchema.h:383
bitset(__int64 v)
Definition: tdapSchema.h:301
PACKAGE ushort_td lenByCharnum(uchar_td type, uchar_td charsetIndex, ushort_td charnum)
uchar_td nullbytes() const
Definition: tdapSchema.h:1135
uchar_td treeIndex
Definition: tdapSchema.h:1248
const char * tableNameA() const
Definition: tdapSchema.h:1121
テーブルスキーマ管理クラス (nocopyable noncreatable)
Definition: dbDef.h:46
テーブルアクセスクラス (nocopyable)
Definition: table.h:91
unsigned short bit8
Definition: tdapSchema.h:113
uchar_td keyCount
Definition: tdapSchema.h:1219
ushort_td majorVersion
Definition: tdapSchema.h:1289
ushort_td userOption
Definition: tdapSchema.h:367
bool isFullLegacyTimeFormat() const
Definition: tdapSchema.h:1317
unsigned short bit7
Definition: tdapSchema.h:112
bitset()
Definition: tdapSchema.h:299
uint_td schemaCodePage
Definition: tdapSchema.h:1255
FLAGS keyFlag
Definition: tdapSchema.h:131
char m_defValue[DEFAULT_VALUE_SIZE]
Definition: tdapSchema.h:347
uchar_td m_padCharOptions
Definition: tdapSchema.h:379
FLAGS flags
Definition: tdapSchema.h:159
fielddef のコレクションクラス
Definition: field.h:74
bool isMariaDB() const
Definition: tdapSchema.h:1308
uchar_td type
Definition: tdapSchema.h:339
bool operator[](int index) const
Definition: tdapSchema.h:317
uchar_td charsetIndex() const
Definition: tdapSchema.h:622
キー定義構造体
Definition: tdapSchema.h:178
uint_td recCount
Definition: tdapSchema.h:147
uchar_td keyType
Definition: tdapSchema.h:133
uchar_td nullValue
Definition: tdapSchema.h:134
unsigned short bitE
Definition: tdapSchema.h:119
double min
Definition: tdapSchema.h:345
ushort_td fieldCount
Definition: tdapSchema.h:1218
uint_td blobLenBytes() const
Definition: tdapSchema.h:694
FLAGS optionFlags
Definition: tdapSchema.h:1243
FLAGS flags
Definition: tdapSchema.h:1239
create tableで使用するキーセグメント定義構造体
Definition: tdapSchema.h:127
uchar_td lookFields[3]
Definition: tdapSchema.h:351
tabledef()
Definition: tdapSchema.h:1065
ushort_td ddfid
Definition: tdapSchema.h:1250
recordset フィルタリングクエリー
Definition: groupQuery.h:107
ushort_td pos
Definition: tdapSchema.h:352
unsigned short bitD
Definition: tdapSchema.h:118
bool isPadCharType() const
Definition: tdapSchema.h:567
void setDefaultValue(const bitset &v)
Definition: tdapSchema.h:537
uchar_td nullfields() const
Definition: tdapSchema.h:1133
keySegment segments[MAX_KEY_SEGMENT]
Definition: tdapSchema.h:181
void setValidationTarget(bool isMariadb, uchar_td srvMinorVersion)
Definition: tdapSchema.h:1146
bool isDateTimeType() const
Definition: tdapSchema.h:591
unsigned short bitF
Definition: tdapSchema.h:120
bool contains(const bitset &r, bool all=true) const
Definition: tdapSchema.h:324
unsigned short bitA
Definition: tdapSchema.h:115
short version
Definition: tdapSchema.h:1226
unsigned short bit9
Definition: tdapSchema.h:114
uchar_td fieldNum
Definition: tdapSchema.h:158
ushort_td pageSize
Definition: tdapSchema.h:1212
void setNullable(bool v, bool defaultNull=true)
Definition: tdapSchema.h:657
ushort_td keyPos
Definition: tdapSchema.h:129
uchar_td keyNumber
Definition: tdapSchema.h:182
uchar_td m_nullbit
Definition: tdapSchema.h:354
uchar_td iconIndex2
Definition: tdapSchema.h:1253
ushort_td keyLen
Definition: tdapSchema.h:130
uchar_td primaryKeyNum
Definition: tdapSchema.h:1240
uchar_td segmentCount
Definition: tdapSchema.h:180
void setLenByCharnum(ushort_td charnum)
Definition: tdapSchema.h:550
pragma_pack1
Definition: btrDate.h:36
void set(int index, bool value)
Definition: tdapSchema.h:303
bool isNumericType() const
Definition: tdapSchema.h:580
unsigned short bit1
Definition: tdapSchema.h:106
ushort_td digits
Definition: tdapSchema.h:362
fielddef_t< PERVASIVE_FDNAME_SIZE > fielddef_t_pv
Definition: tdapSchema.h:413
unsigned short bit3
Definition: tdapSchema.h:108
unsigned short bit5
Definition: tdapSchema.h:110
friend struct tabledef
Definition: tdapSchema.h:983
unsigned short bit6
Definition: tdapSchema.h:111
データベースアクセスクラス
Definition: database.h:59
void setCharsetIndex(uchar_td index)
Definition: tdapSchema.h:613
uchar_td filterKeynum
Definition: tdapSchema.h:365
uchar_td lookDBNum
Definition: tdapSchema.h:368
uchar_td lookField
Definition: tdapSchema.h:350
uchar_td nullValue
Definition: tdapSchema.h:366
uchar_td m_nullbytes
Definition: tdapSchema.h:355
unsigned short bit0
Definition: tdapSchema.h:105
fielddef * fieldDefs
Definition: tdapSchema.h:1263
bool isSupportMultiTimeStamp() const
Definition: tdapSchema.h:1303
unsigned short bit2
Definition: tdapSchema.h:107
ビット集合アクセスクラス
Definition: tdapSchema.h:294
bool isTrimPadChar() const
Definition: tdapSchema.h:653
ushort_td convertFileNum
Definition: tdapSchema.h:1244
void cleanup()
Definition: tdapSchema.h:1069
int align() const
Definition: tdapSchema.h:548
ushort_td recordlen() const
Definition: tdapSchema.h:1142
char viewNum
Definition: tdapSchema.h:342
ushort_td m_schemaCodePage
Definition: tdapSchema.h:378
PACKAGE uchar_td getFilterLogicTypeCode(const _TCHAR *cmpstr)
bool isStringTypeForIndex(uchar_td type)
Definition: tdapSchema.h:243
bool isSupportDateTimeTimeStamp() const
Definition: tdapSchema.h:1296
unsigned char type
Definition: tdapSchema.h:1291
PACKAGE int getTypeAlign(short type)
uchar_td charsetIndex
Definition: tdapSchema.h:1227
uchar_td keyNo
Definition: tdapSchema.h:136
rowの実装クラス
Definition: memRecord.h:69
create tableで使用するファイル定義構造体
Definition: tdapSchema.h:142
テーブル定義構造体
Definition: tdapSchema.h:1051
keySpec keySpecs[1]
Definition: tdapSchema.h:151
ushort_td pageSize
Definition: tdapSchema.h:145
double max
Definition: tdapSchema.h:344
uchar_td m_options
Definition: tdapSchema.h:380
フィールドアクセスクラス
Definition: field.h:118
const _TCHAR * typeName() const
Definition: tdapSchema.h:546
unsigned short bit4
Definition: tdapSchema.h:109
ushort_td indexCount
Definition: tdapSchema.h:146
void setTableNameA(const char *s)
Definition: tdapSchema.h:1128
bool isStringType() const
Definition: tdapSchema.h:565