transactd 2.4.4 → 2.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e7abf08f4fbb6ae8be30ab0a8621eab5239758b
4
- data.tar.gz: b3ee43a9939a276f4ab9578eb7670fa8392ec5fc
3
+ metadata.gz: 2de552536553b6f1ec957ded4f1c690fe8cec516
4
+ data.tar.gz: 0ba45cc088a557220ad580c41425a71c66703090
5
5
  SHA512:
6
- metadata.gz: 44ad488e33db8e808097073e000bda47a5a8e9959f2f916b6ad2618ae42376d54eeed12ea256e7a473f2b8fba1559a35dfd2d0a055caaf98e955a16767732a74
7
- data.tar.gz: b7e5bf6bbc400ccf8cefc8fec44b1611cc74e091b346ab02edca1f1c9f0792b777ab22d689af6424937041a9424143f838872d371361ecec21a3b4bc23b656a7
6
+ metadata.gz: 14aeb6ef47eac061acf54e79abe374d91b7c855bb2a2469918d78685ba652690eea12ec7d376d2931019d771e6f8415f8ec82eac5da9361f64cc927ac268fb4b
7
+ data.tar.gz: 58918f295465ee10d3cd28312133fa4018e4aae8c23f79e510a6bf800f6d5d594a094afd21878818fe775d11f1b2e8b04b96069241a6cfd57e62139f59c83965
data/README-JA.md CHANGED
@@ -228,7 +228,9 @@ loose-transactd_hostcheck_username = yourUserName
228
228
  ```
229
229
  を加えてください。yourUserNameは任意のユーザー名にできます。
230
230
 
231
-
231
+ ### ファイアーウォールの設定
232
+ TransactdプラグインはデフォルトでTCPポート8610を使用します。もし、このポートが
233
+ ブロックされている場合は、クライアントホストからアクセスできるように設定します。
232
234
 
233
235
  テストとベンチマークの起動
234
236
  -------------------------------------------------------------------------------
data/README.md CHANGED
@@ -229,7 +229,9 @@ loose-transactd_hostcheck_username = yourUserName
229
229
  ```
230
230
  Replace yourUserName to an actual user name.
231
231
 
232
-
232
+ ### Setting of firewall
233
+ Transactd Plugin is used TCP port 8610 as default. If this port is blocked,
234
+ please be able to access from your client host.
233
235
 
234
236
  Execution of test and benchmark program
235
237
  -------------------------------------------------------------------------------
Binary file
Binary file
@@ -112,7 +112,7 @@ macro(bz_do_smart_install_dll)
112
112
  string(STRIP "${tmp_var}" tmp_var)
113
113
  string(REGEX REPLACE "\n" ";" tmp_list "${tmp_var}")
114
114
  foreach(tmp_line ${tmp_list})
115
- message(STATUS "${tmp_line}")
115
+ #message(STATUS "${tmp_line}")
116
116
  foreach(tmp_key "Installing-if-grater: " "Up-to-date-if-grater: ")
117
117
  string(REGEX MATCH "${tmp_key}(.*)" tmp_filename "${tmp_line}")
118
118
  string(STRIP "${tmp_filename}" tmp_filename)
@@ -50,26 +50,34 @@ if(NOT COMMAND bz_get_compiler)
50
50
  macro(bz_get_compiler)
51
51
  set(BZ_COMPILER "")
52
52
  if(WIN32)
53
- if(MSVC60)
54
- set(BZ_COMPILER "_vc60")
55
- elseif(MSVC70)
56
- set(BZ_COMPILER "_vc70")
57
- elseif(MSVC80)
58
- set(BZ_COMPILER "_vc80")
59
- elseif(MSVC90)
60
- set(BZ_COMPILER "_vc90")
61
- elseif(MSVC10)
62
- set(BZ_COMPILER "_vc100")
63
- elseif(MSVC11)
64
- set(BZ_COMPILER "_vc110")
65
- elseif(MSVC12)
66
- set(BZ_COMPILER "_vc120")
53
+ if(MSVC)
54
+ if(MSVC60)
55
+ set(BZ_COMPILER "_vc60")
56
+ elseif(MSVC70)
57
+ set(BZ_COMPILER "_vc70")
58
+ elseif(MSVC80)
59
+ set(BZ_COMPILER "_vc80")
60
+ elseif(MSVC90)
61
+ set(BZ_COMPILER "_vc90")
62
+ elseif(MSVC10)
63
+ set(BZ_COMPILER "_vc100")
64
+ elseif(MSVC11)
65
+ set(BZ_COMPILER "_vc110")
66
+ elseif(MSVC12)
67
+ set(BZ_COMPILER "_vc120")
68
+ elseif(MSVC14)
69
+ set(BZ_COMPILER "_vc140")
70
+ else()
71
+ MESSAGE(FATAL_ERROR "Unknown Visual Studio version.")
72
+ endif()
67
73
  elseif(MINGW)
68
74
  string(REPLACE "." ";" tmp_list ${CMAKE_CXX_COMPILER_VERSION})
69
75
  list (GET tmp_list 0 MINGW_MAJOR)
70
76
  list (GET tmp_list 1 MINGW_MINOR)
71
77
  list (GET tmp_list 2 MINGW_RELEASE)
72
78
  set(BZ_COMPILER "_mgw${MINGW_MAJOR}${MINGW_MINOR}")
79
+ else()
80
+ MESSAGE(FATAL_ERROR "Unknown compiler.")
73
81
  endif()
74
82
  endif()
75
83
  endmacro()
@@ -121,4 +129,3 @@ macro(bz_get_win_sysdir)
121
129
  endif()
122
130
  endmacro()
123
131
  endif()
124
-
@@ -184,7 +184,7 @@ macro(transactd_set_MTMD MT_OR_MD)
184
184
  string(TOUPPER "${MT_OR_MD}" MT_OR_MD)
185
185
  if( (NOT ("${MT_OR_MD}" STREQUAL "MT")) AND
186
186
  (NOT ("${MT_OR_MD}" STREQUAL "MD")))
187
- message(ERROR "[${MT_OR_MD}] is invalid. Please specify MT or MD.")
187
+ message(SEND_ERROR "[${MT_OR_MD}] is invalid. Please specify MT or MD.")
188
188
  endif()
189
189
  foreach(build_type "_RELEASE" "_DEBUG" "_RELWITHDEBINFO" "_MINSIZEREL")
190
190
  set(CMAKE_CXX_FLAGS${build_type}_BEFORE_${this_target} "${CMAKE_CXX_FLAGS${build_type}}")
@@ -321,7 +321,7 @@ macro(transactd_link_boost_libraries boost_components)
321
321
  endif()
322
322
 
323
323
  transactd_has_MD_option("${CMAKE_CXX_FLAGS_${BUILD_TYPE}}")
324
- message(STATUS "CMAKE_CXX_FLAGS_${BUILD_TYPE} = ${CMAKE_CXX_FLAGS_${BUILD_TYPE}} IS_MD=${IS_MD}")
324
+ #message(STATUS "CMAKE_CXX_FLAGS_${BUILD_TYPE} = ${CMAKE_CXX_FLAGS_${BUILD_TYPE}} IS_MD=${IS_MD}")
325
325
  if ("${IS_MD}" STREQUAL "ON")
326
326
  if("${BUILD_TYPE}" STREQUAL "DEBUG")
327
327
  set(boost_libs_for${BT_NAME} "${Boost_LIBRARIES_STATIC_USE_RUNTIME_DEBUG}")
data/build/tdclc/tdclc.rc CHANGED
@@ -29,8 +29,8 @@
29
29
  //
30
30
 
31
31
  VS_VERSION_INFO VERSIONINFO
32
- FILEVERSION 2,4,4,97
33
- PRODUCTVERSION 2,4,4,97
32
+ FILEVERSION 2,4,5,103
33
+ PRODUCTVERSION 2,4,5,103
34
34
  FILEFLAGSMASK 0x3fL
35
35
  #ifdef _DEBUG
36
36
  FILEFLAGS 0x1L
@@ -47,9 +47,9 @@ BEGIN
47
47
  BEGIN
48
48
  VALUE "CompanyName", "BizStation Corp."
49
49
  VALUE "FileDescription", "Transactd C client"
50
- VALUE "FileVersion", "2.4.4.97"
50
+ VALUE "FileVersion", "2.4.5.103"
51
51
  VALUE "LegalCopyright", "Copyright(C) 2014 BizStation Corp"
52
- VALUE "ProductVersion", "2.4.4.97"
52
+ VALUE "ProductVersion", "2.4.5.103"
53
53
  VALUE "ProductName", "Transactd Client (GPL V2)"
54
54
  END
55
55
  END
@@ -49,7 +49,7 @@ elseif("${this_target}" STREQUAL "tdclcppmr")
49
49
  set(TDCL_CPP_CHARSET m)
50
50
  set(TDCL_CPP_USE_RUNTIME_LIBS ON)
51
51
  else()
52
- message(ERROR "Invalid project name ${this_target}")
52
+ set(TDCL_CPP_USE_RUNTIME_LIBS OFF)
53
53
  endif()
54
54
 
55
55
 
@@ -139,7 +139,7 @@ else()
139
139
  LINUX)
140
140
  else()
141
141
  set_property(TARGET ${this_target} APPEND PROPERTY COMPILE_DEFINITIONS
142
- WIN32 _WIN32)
142
+ WIN32 _WIN32 _SYS_TIME_H_ _GETTIMEOFDAY_DEFINED)
143
143
  endif()
144
144
  endif()
145
145
  if(TRANSACTD_RUBY_GEM OR TRANSACTD_PHP)
@@ -29,8 +29,8 @@
29
29
  //
30
30
 
31
31
  VS_VERSION_INFO VERSIONINFO
32
- FILEVERSION 2,4,4,97
33
- PRODUCTVERSION 2,4,4,97
32
+ FILEVERSION 2,4,5,103
33
+ PRODUCTVERSION 2,4,5,103
34
34
  FILEFLAGSMASK 0x3fL
35
35
  #ifdef _DEBUG
36
36
  FILEFLAGS 0x1L
@@ -47,9 +47,9 @@ BEGIN
47
47
  BEGIN
48
48
  VALUE "CompanyName", "BizStation Corp."
49
49
  VALUE "FileDescription", "Transactd C++ client"
50
- VALUE "FileVersion", "2.4.4.97"
50
+ VALUE "FileVersion", "2.4.5.103"
51
51
  VALUE "LegalCopyright", "Copyright(C) 2014 BizStation Corp"
52
- VALUE "ProductVersion", "2.4.4.97"
52
+ VALUE "ProductVersion", "2.4.5.103"
53
53
  VALUE "ProductName", "Transactd Client (GPL V2)"
54
54
  END
55
55
  END
@@ -59,8 +59,8 @@ endif()
59
59
  if("${TRANSACTD_RUBY_LIBRARY_PATH}" STREQUAL "")
60
60
  set(TRANSACTD_RUBY_LIBRARY_PATH "${RUBY_LIB_PATH}")
61
61
  endif()
62
- message(STATUS " TRANSACTD_RUBY_INCLUDE_PATH ${TRANSACTD_RUBY_INCLUDE_PATH}")
63
- message(STATUS " TRANSACTD_RUBY_LIBRARY_PATH ${TRANSACTD_RUBY_LIBRARY_PATH}")
62
+ #message(STATUS " TRANSACTD_RUBY_INCLUDE_PATH ${TRANSACTD_RUBY_INCLUDE_PATH}")
63
+ #message(STATUS " TRANSACTD_RUBY_LIBRARY_PATH ${TRANSACTD_RUBY_LIBRARY_PATH}")
64
64
  set(TDCL_GEM_PREFIX "${RUBY_VERSION_FOR_GEM}")
65
65
  if("${TRANSACTD_RUBY_GEM_ROOT_PATH}" STREQUAL "")
66
66
  set(TRANSACTD_RUBY_GEM_ROOT_PATH "${TRANSACTD_BINARY_ROOT}")
@@ -69,10 +69,10 @@ endif()
69
69
  # ==========================================================
70
70
  # add library path
71
71
  # ==========================================================
72
- if(WIN32)
72
+ if(WIN32)
73
73
  link_directories("${TRANSACTD_RUBY_GEM_ROOT_PATH}/bin/common")
74
74
  else()
75
- link_directories("../tdclcpp")
75
+ link_directories("../tdclcpp")
76
76
  endif()
77
77
 
78
78
 
@@ -29,8 +29,8 @@
29
29
  //
30
30
 
31
31
  VS_VERSION_INFO VERSIONINFO
32
- FILEVERSION 2,4,4,97
33
- PRODUCTVERSION 2,4,4,97
32
+ FILEVERSION 2,4,5,103
33
+ PRODUCTVERSION 2,4,5,103
34
34
  FILEFLAGSMASK 0x3fL
35
35
  #ifdef _DEBUG
36
36
  FILEFLAGS 0x1L
@@ -47,9 +47,9 @@ BEGIN
47
47
  BEGIN
48
48
  VALUE "CompanyName", "BizStation Corp."
49
49
  VALUE "FileDescription", "Transactd Ruby client"
50
- VALUE "FileVersion", "2.4.4.97"
50
+ VALUE "FileVersion", "2.4.5.103"
51
51
  VALUE "LegalCopyright", "Copyright(C) 2014 BizStation Corp"
52
- VALUE "ProductVersion", "2.4.4.97"
52
+ VALUE "ProductVersion", "2.4.5.103"
53
53
  VALUE "ProductName", "Transactd Client (GPL V2)"
54
54
  END
55
55
  END
@@ -114,7 +114,9 @@ void tableCacheCounter::release(const std::string& dbname,
114
114
  bool lockTable(THD* thd, TABLE* tb)
115
115
  {
116
116
  bool append = (thd->lock != 0);
117
-
117
+ #ifdef MARIADDB_10_1
118
+ thd->variables.option_bits |= OPTION_TABLE_LOCK;
119
+ #endif
118
120
  MYSQL_LOCK* lock = mysql_lock_tables(thd, &tb, 1, 0);
119
121
  if (!append)
120
122
  thd->lock = lock;
@@ -267,10 +269,10 @@ unsigned char* database::getUserSha1Passwd(const char* host, const char* user,
267
269
  // true ok false fail
268
270
  bool database::setGrant(const char* host, const char* user)
269
271
  {
270
- bool ret = (acl_getroot(cp_security_ctx(m_thd), cp_strdup(user, MYF(0)),
272
+ bool ret = (acl_getroot(cp_security_ctx(m_thd), cp_strdup(user, MYF(0)),
271
273
  cp_strdup(host, MYF(0)), cp_strdup(host, MYF(0)), (char*)m_dbname.c_str())) == false;
272
274
  if (ret)
273
- check_access(m_thd, SELECT_ACL, m_dbname.c_str(), &m_privilege, NULL, false, true);
275
+ check_access(m_thd, SELECT_ACL, m_dbname.c_str(), &m_privilege, NULL, false, true);
274
276
 
275
277
  return ret;
276
278
  }
@@ -279,9 +281,9 @@ bool database::setGrant(const char* host, const char* user)
279
281
  short database::aclReload()
280
282
  {
281
283
  if (name() != "mysql")
282
- return STATUS_ACCESS_DENIED;
283
- if(!(m_privilege & GRANT_ACL))
284
- return STATUS_ACCESS_DENIED;
284
+ return STATUS_ACCESS_DENIED;
285
+ if(!(m_privilege & GRANT_ACL))
286
+ return STATUS_ACCESS_DENIED;
285
287
  short ret = STATUS_SUCCESS;
286
288
 
287
289
  THD* thdCur = _current_thd();
@@ -708,9 +710,9 @@ TABLE* database::doOpenTable(const std::string& name, short mode,
708
710
  m_thd->variables.lock_wait_timeout = OPEN_TABLE_TIMEOUT_SEC;
709
711
  tables.init_one_table(m_dbname.c_str(), m_dbname.size(), name.c_str(),
710
712
  name.size(), name.c_str(), TL_READ);
711
- if(!(m_privilege & SELECT_ACL) &&
712
- (check_grant(m_thd, SELECT_ACL, &tables, FALSE, 1, true)))
713
- {
713
+ if(!(m_privilege & SELECT_ACL) &&
714
+ (check_grant(m_thd, SELECT_ACL, &tables, FALSE, 1, true)))
715
+ {
714
716
  m_stat = STATUS_ACCESS_DENIED;
715
717
  return NULL;
716
718
  }
@@ -983,6 +985,17 @@ table::table(TABLE* myTable, database& db, const std::string& name, short mode,
983
985
  m_nonKeySegNullFields.push_back(fd);
984
986
  }
985
987
  }
988
+ // Chash timestamp field
989
+ for (int i = 0; i < (int)m_table->s->fields; ++i)
990
+ {
991
+ Field* fd = m_table->field[i];
992
+ if (fd->unireg_check == Field::TIMESTAMP_UN_FIELD ||
993
+ fd->unireg_check == Field::TIMESTAMP_DNUN_FIELD ||
994
+ fd->unireg_check == Field::TIMESTAMP_DN_FIELD)
995
+ {
996
+ m_timeStampFields.push_back(fd);
997
+ }
998
+ }
986
999
  }
987
1000
 
988
1001
  table::~table()
@@ -2164,6 +2177,30 @@ void table::setFiledNullFlags()
2164
2177
  }
2165
2178
  }
2166
2179
 
2180
+ void table::setTimeStamp(bool insert)
2181
+ {
2182
+ if (m_timeStampFields.size())
2183
+ m_db.setCurTime();
2184
+ std::vector<Field*>::iterator it = m_timeStampFields.begin();
2185
+ while (it != m_timeStampFields.end())
2186
+ {
2187
+ /*if (g_timestamp_always)
2188
+ {
2189
+ if ((insert && cp_has_insert_default_function((*it))) ||
2190
+ (!insert && cp_has_update_default_function((*it))))
2191
+ (*it)->store(0.0f);
2192
+ }*/
2193
+ if (/*!(*it)->is_null() &&*/ ((*it)->val_real() == 0))
2194
+ {
2195
+ if (insert)
2196
+ cp_evaluate_insert_default_function((*it));
2197
+ else
2198
+ cp_evaluate_update_default_function((*it));
2199
+ }
2200
+ ++it;
2201
+ }
2202
+ }
2203
+
2167
2204
  __int64 table::insert(bool ncc)
2168
2205
  {
2169
2206
  if ((m_mode == TD_OPEN_READONLY) || (m_table->reginfo.lock_type < TL_WRITE))
@@ -2177,6 +2214,7 @@ __int64 table::insert(bool ncc)
2177
2214
  autoincSetup setup(m_table);
2178
2215
  setKeyNullFlags();
2179
2216
  setFiledNullFlags();
2217
+ setTimeStamp(true /* insert */);
2180
2218
 
2181
2219
  m_stat = m_table->file->ha_write_row(m_table->record[0]);
2182
2220
  autoincValue = m_table->file->insert_id_for_cur_row;
@@ -2248,7 +2286,7 @@ void table::beginDel()
2248
2286
  movePos(position(true), -1, true);
2249
2287
 
2250
2288
  // Has blob fields then ignore conflicts.
2251
- if ((m_table->s->blob_fields == 0) &&
2289
+ if ((m_stat == 0) && (m_table->s->blob_fields == 0) &&
2252
2290
  cmp_record(m_table, record[1]))
2253
2291
  m_stat = STATUS_CHANGE_CONFLICT;
2254
2292
 
@@ -2271,6 +2309,7 @@ void table::update(bool ncc)
2271
2309
  {
2272
2310
  int nullFieldsOfCurrentKey = setKeyNullFlags();
2273
2311
  setFiledNullFlags();
2312
+ setTimeStamp(false /* update */);
2274
2313
  m_stat = m_table->file->ha_update_row(m_table->record[1],
2275
2314
  m_table->record[0]);
2276
2315
  if (m_stat == 0 || (m_stat == HA_ERR_RECORD_IS_THE_SAME))
@@ -195,6 +195,7 @@ public:
195
195
  }
196
196
 
197
197
  short aclReload();
198
+ inline void setCurTime(){m_thd->set_current_time();}
198
199
 
199
200
  static tableCacheCounter tableRef;
200
201
 
@@ -267,6 +268,7 @@ class table : private boost::noncopyable
267
268
  String m_str;
268
269
  keynumConvert m_keyconv;
269
270
  IblobBuffer* m_blobBuffer;
271
+ std::vector<Field*> m_timeStampFields;
270
272
  std::vector<Field*> m_nonKeySegNullFields;
271
273
  unsigned int m_readCount;
272
274
  unsigned int m_updCount;
@@ -300,6 +302,7 @@ class table : private boost::noncopyable
300
302
  void seekPos(const uchar* pos);
301
303
  int setKeyNullFlags();
302
304
  void setFiledNullFlags();
305
+ void setTimeStamp(bool insert);
303
306
 
304
307
  bookmarks* bms();
305
308
  int percentage(uchar* first, uchar* last, uchar* cur);
@@ -45,14 +45,21 @@
45
45
  #pragma warning(disable : 4996)
46
46
  #pragma warning(disable : 4805)
47
47
  #pragma warning(disable : 4005)
48
+ #pragma warning(disable : 4101)
48
49
  #define NOMINMAX
49
50
  #endif
50
51
  #include <my_config.h>
51
52
  #include <mysql_version.h>
52
- #if defined(MARIADB_BASE_VERSION) && (MYSQL_VERSION_ID > 100000)
53
- #define MARIADDB_10_0 MYSQL_VERSION_ID
53
+
54
+ #if defined(MARIADB_BASE_VERSION) && (MYSQL_VERSION_ID > 100107)
55
+ # define MARIADDB_10_1 MYSQL_VERSION_ID
56
+ #else
57
+ # if defined(MARIADB_BASE_VERSION) && (MYSQL_VERSION_ID > 100000)
58
+ # define MARIADDB_10_0 MYSQL_VERSION_ID
59
+ # endif
54
60
  #endif
55
61
 
62
+
56
63
  #include <sql/sql_const.h>
57
64
  #include "my_global.h"
58
65
  #include <math.h>
@@ -117,6 +124,7 @@ extern "C" {
117
124
  #pragma warning(default : 4800)
118
125
  #pragma warning(default : 4805)
119
126
  #pragma warning(default : 4005)
127
+ #pragma warning(default : 4101)
120
128
  #endif
121
129
 
122
130
  #undef min
@@ -216,9 +224,56 @@ inline bool cp_thd_get_global_read_only(THD* thd)
216
224
  inline bool cp_open_table(THD* thd, TABLE_LIST* tables,
217
225
  Open_table_context* ot_act)
218
226
  {
227
+ #if defined(MARIADDB_10_1)
228
+ return open_table(thd, tables, ot_act);
229
+ #else
219
230
  return open_table(thd, tables, thd->mem_root, ot_act);
231
+ #endif
220
232
  }
221
233
  #define set_mysys_var(A)
234
+
235
+
236
+ inline bool cp_has_insert_default_function(Field* fd)
237
+ {
238
+ return fd->unireg_check == Field::TIMESTAMP_DN_FIELD ||
239
+ fd->unireg_check == Field::TIMESTAMP_DNUN_FIELD;
240
+ }
241
+
242
+ inline bool cp_has_update_default_function(Field* fd)
243
+ {
244
+ return fd->unireg_check == Field::TIMESTAMP_UN_FIELD ||
245
+ fd->unireg_check == Field::TIMESTAMP_DNUN_FIELD;
246
+ }
247
+
248
+ inline void cp_evaluate_insert_default_function(Field* fd)
249
+ {
250
+ #if (MYSQL_VERSION_ID > 50600)
251
+ Field* ft = fd;
252
+ #else
253
+ Field_timestamp* ft = (Field_timestamp*)(fd);
254
+ #endif
255
+ if (ft)
256
+ ft->set_time();
257
+ }
258
+
259
+ inline void cp_evaluate_update_default_function(Field* fd)
260
+ {
261
+
262
+ #if (MYSQL_VERSION_ID > 50600)
263
+ Field* ft = fd;
264
+ #else
265
+ Field_timestamp* ft = (Field_timestamp*)(fd);
266
+ #endif
267
+ if (ft)
268
+ ft->set_time();
269
+ }
270
+
271
+ inline unsigned char* cp_null_ptr(Field* fd, unsigned char* /*record*/)
272
+ {
273
+ return (unsigned char*)fd->null_ptr;
274
+ }
275
+
276
+
222
277
  #else
223
278
 
224
279
 
@@ -227,14 +282,12 @@ inline void cp_thd_release_resources(THD* thd)
227
282
  thd->release_resources();
228
283
  }
229
284
 
230
- inline void cp_set_mysys_var(st_my_thread_var* var)
231
- {
232
285
  #if(MYSQL_VERSION_NUM < 50700)
286
+ inline void cp_set_mysys_var(struct st_my_thread_var* var)
287
+ {
233
288
  set_mysys_var(var);
234
- #else
235
- set_mysys_thread_var(var);
236
- #endif
237
289
  }
290
+ #endif
238
291
 
239
292
  inline void cp_restore_globals(THD* thd)
240
293
  {
@@ -256,6 +309,33 @@ inline bool cp_open_table(THD* thd, TABLE_LIST* tables,
256
309
  {
257
310
  return open_table(thd, tables, ot_act);
258
311
  }
312
+
313
+ inline bool cp_has_insert_default_function(Field* fd)
314
+ {
315
+ return fd->has_insert_default_function();
316
+ }
317
+
318
+ inline bool cp_has_update_default_function(Field* fd)
319
+ {
320
+ return fd->has_update_default_function();
321
+
322
+ }
323
+
324
+ inline void cp_evaluate_insert_default_function(Field* fd)
325
+ {
326
+ fd->evaluate_insert_default_function();
327
+ }
328
+
329
+ inline void cp_evaluate_update_default_function(Field* fd)
330
+ {
331
+ fd->evaluate_update_default_function();
332
+ }
333
+
334
+ inline unsigned char* cp_null_ptr(Field* fd, unsigned char* record)
335
+ {
336
+ return fd->null_offset() + record;
337
+ }
338
+
259
339
  #endif
260
340
 
261
341
  #if (MYSQL_VERSION_NUM < 50611)
@@ -485,16 +565,18 @@ inline bool cp_query_command(THD* thd, char* str)
485
565
  make_db_list function is not static, but it is not list in sql_show.h.
486
566
  */
487
567
 
488
- #ifdef MARIADDB_10_0
568
+ #if (defined(MARIADDB_10_0) || defined(MARIADDB_10_1))
489
569
  typedef Dynamic_array<LEX_STRING*> SQL_Strings;
570
+ #if (!defined(MARIADDB_10_1))
490
571
  typedef struct st_lookup_field_values
491
572
  {
492
573
  LEX_STRING db_value, table_value;
493
574
  bool wild_db_value, wild_table_value;
494
575
  } LOOKUP_FIELD_VALUES;
495
-
576
+ #endif
496
577
  extern int make_db_list(THD *thd, Dynamic_array<LEX_STRING*> *files,
497
578
  LOOKUP_FIELD_VALUES *lookup_field_vals);
579
+
498
580
  inline int db_list(THD *thd, SQL_Strings *files)
499
581
  {
500
582
  LOOKUP_FIELD_VALUES lv;
@@ -99,12 +99,12 @@ void endThread()
99
99
  setStackaddr(0);
100
100
  }
101
101
 
102
- void waitForServerStart()
103
- {
104
- mysql_mutex_lock(&LOCK_server_started);
105
- while (!mysqld_server_started)
106
- mysql_cond_wait(&COND_server_started, &LOCK_server_started);
107
- mysql_mutex_unlock(&LOCK_server_started);
102
+ void waitForServerStart()
103
+ {
104
+ mysql_mutex_lock(&LOCK_server_started);
105
+ while (!mysqld_server_started)
106
+ mysql_cond_wait(&COND_server_started, &LOCK_server_started);
107
+ mysql_mutex_unlock(&LOCK_server_started);
108
108
  }
109
109
 
110
110
  int getTransactdIsolation()
@@ -136,10 +136,10 @@ THD* buildTHD()
136
136
 
137
137
  thd->thread_stack = reinterpret_cast<char*>(&thd);
138
138
  thd->store_globals();
139
- assert(thd->mysys_var);
140
- cp_set_mysys_var(thd->mysys_var);
141
- thd->system_thread = NON_SYSTEM_THREAD;
139
+ thd->system_thread = NON_SYSTEM_THREAD;
142
140
  #ifndef MYSQL_578_LATER
141
+ assert(thd->mysys_var);
142
+ cp_set_mysys_var(thd->mysys_var);
143
143
  const NET v = { 0 };
144
144
  thd->net = v;
145
145
  #endif
@@ -168,11 +168,15 @@ THD* attachThd(THD* thd)
168
168
  else
169
169
  {
170
170
  initThread(thd);
171
+ #ifndef MYSQL_578_LATER
171
172
  assert(thd->mysys_var);
173
+ #endif
172
174
  if (curThd != thd)
173
175
  {
174
176
  thd->store_globals();
177
+ #ifndef MYSQL_578_LATER
175
178
  cp_set_mysys_var(thd->mysys_var);
179
+ #endif
176
180
  }
177
181
  }
178
182
  return curThd;
@@ -22,6 +22,7 @@
22
22
  #include "groupQuery.h"
23
23
  #ifdef _DEBUG
24
24
  #include <iostream>
25
+ #include <iomanip>
25
26
  #endif
26
27
 
27
28
  namespace bzs
@@ -35,6 +36,86 @@ namespace tdap
35
36
  namespace client
36
37
  {
37
38
 
39
+ #ifdef _DEBUG
40
+
41
+ /*
42
+ Print record set whole row like a mysql command line tool.
43
+ */
44
+ template <class RS>
45
+ class dumpRecordset
46
+ {
47
+ std::vector<size_t> m_widths;
48
+ std::vector<std::ios::fmtflags> m_ailgns;
49
+
50
+ void cacheWidthAndAlign(RS& rs)
51
+ {
52
+ const fielddefs& fds = *rs.fieldDefs();
53
+ m_widths.clear();
54
+ m_widths.resize(fds.size());
55
+ m_ailgns.clear();
56
+ m_ailgns.resize(fds.size());
57
+
58
+ for (size_t col = 0; col < fds.size(); ++col)
59
+ {
60
+ m_widths[col] = std::max(_tcslen(fds[col].name()), m_widths[col]);
61
+ m_ailgns[col] = fds[col].isStringType() ? std::ios::left : std::ios::right;
62
+ }
63
+ for(size_t i = 0; i < rs.size(); ++i)
64
+ {
65
+ row& rec = rs[i];
66
+ for (size_t col = 0; col < fds.size(); ++col)
67
+ m_widths[col] = std::max(_tcslen(rec[col].c_str()), m_widths[col]);
68
+ }
69
+ }
70
+
71
+ std::_tstring makeLine()
72
+ {
73
+ std::_tstring s = _T("+");
74
+ for (size_t i = 0;i < m_widths.size(); ++i)
75
+ {
76
+ s += std::_tstring(m_widths[i] + 2, _T('-'));
77
+ s += _T('+');
78
+ }
79
+ s += _T("\n");
80
+ return s;
81
+ }
82
+
83
+ void printValue(size_t width, std::ios::fmtflags f, const _TCHAR* value)
84
+ {
85
+ std::tcout.setf(f, std::ios::adjustfield);
86
+ std::tcout << _T(" ") << std::setw(width) << value << _T(" |");
87
+ }
88
+
89
+ const _TCHAR* value(const fielddef& fd) {return fd.name();}
90
+ const _TCHAR* value(const field& fd) {return fd.c_str();}
91
+
92
+ template <class T>
93
+ void printRecord(const T& coll)
94
+ {
95
+ std::tcout << _T("|");
96
+ for (size_t col = 0; col < m_widths.size(); ++col)
97
+ printValue(m_widths[col], m_ailgns[col], value(coll[col]));
98
+ std::tcout << std::endl;
99
+ }
100
+ public:
101
+ void operator()(RS& rs)
102
+ {
103
+ cacheWidthAndAlign(rs);
104
+ std::_tstring line = makeLine();
105
+ //header
106
+ std::tcout << line;
107
+ printRecord(*rs.fieldDefs());
108
+ std::tcout << line;
109
+
110
+ //field value
111
+ for(size_t i = 0; i < rs.size(); ++i)
112
+ printRecord(rs[i]);
113
+ std::tcout << line;
114
+ }
115
+ };
116
+ #endif
117
+
118
+
38
119
  struct sortDescription
39
120
  {
40
121
  short index;
@@ -595,21 +676,8 @@ public:
595
676
  #ifdef _DEBUG
596
677
  void dump()
597
678
  {
598
- const fielddefs& fields = *fieldDefs();
599
- for (int j = 0; j < (int)fields.size(); ++j)
600
- std::tcout << fields[j].name() << _T("\t");
601
- std::tcout << _T("\n");
602
-
603
- for (int i = 0; i < (int)size(); ++i)
604
- {
605
- row& m = (operator[](i));
606
- for (int j = 0; j < (int)m.size(); ++j)
607
- {
608
- std::tcout << m[(short)j].c_str() << _T("\t");
609
- if (j == (int)m.size() - 1)
610
- std::tcout << _T("\n");
611
- }
612
- }
679
+ dumpRecordset<recordsetImple> dumpRs;
680
+ dumpRs(*this);
613
681
  }
614
682
  #endif
615
683
  };
@@ -85,19 +85,29 @@ uchar_td convFieldType(enum enum_field_types type, uint flags, bool binary,
85
85
  return ft_uinteger;
86
86
  return ft_integer;
87
87
  case MYSQL_TYPE_ENUM:
88
- return ft_integer;
89
88
  case MYSQL_TYPE_SET:
89
+ case MYSQL_TYPE_BIT:
90
90
  return ft_uinteger;
91
91
  case MYSQL_TYPE_FLOAT:
92
92
  case MYSQL_TYPE_DOUBLE:
93
93
  return ft_float;
94
94
  case MYSQL_TYPE_DATE:
95
+ case MYSQL_TYPE_NEWDATE:
95
96
  return ft_mydate;
96
97
  case MYSQL_TYPE_TIME:
98
+ #if(MYSQL_VERSION_ID > 50600)
99
+ case MYSQL_TYPE_TIME2:
100
+ #endif
97
101
  return ft_mytime;
98
102
  case MYSQL_TYPE_DATETIME:
103
+ #if(MYSQL_VERSION_ID > 50600)
104
+ case MYSQL_TYPE_DATETIME2:
105
+ #endif
99
106
  return ft_mydatetime;
100
107
  case MYSQL_TYPE_TIMESTAMP:
108
+ #if(MYSQL_VERSION_ID > 50600)
109
+ case MYSQL_TYPE_TIMESTAMP2:
110
+ #endif
101
111
  return ft_mytimestamp;
102
112
  case MYSQL_TYPE_VARCHAR:
103
113
  case MYSQL_TYPE_VAR_STRING: //?
@@ -115,15 +125,16 @@ uchar_td convFieldType(enum enum_field_types type, uint flags, bool binary,
115
125
  if (flags & BINARY_FLAG)
116
126
  return ft_myblob;
117
127
  return ft_mytext;
118
- default:
119
- return unicode ? ft_wzstring : ft_zstring;
128
+ default: // MYSQL_TYPE_NEWDECIMAL MYSQL_TYPE_GEOMETRY
129
+ return unicode ? ft_wstring : ft_string;
120
130
  }
121
131
  return 0;
122
132
  }
123
133
 
124
134
  bool isUnicode(const CHARSET_INFO& cs)
125
135
  {
126
- return (charsetIndex(cs.csname) == CHARSET_UTF16LE);
136
+ int index = charsetIndex(cs.csname);
137
+ return (index == CHARSET_UTF16LE) || (index == CHARSET_USC2);
127
138
  }
128
139
 
129
140
  bool isBinary(const CHARSET_INFO& cs)
@@ -236,7 +236,8 @@ typedef void(__STDCALL* WIN_TPOOL_SHUTDOWN_PTR)();
236
236
  #define ft_myblob 51
237
237
  #define ft_autoIncUnsigned 52
238
238
  #define ft_myfixedbinary 53
239
-
239
+ #define ft_enum 54
240
+ #define ft_set 55
240
241
  #define ft_nullindicator 255
241
242
 
242
243
  /** charset type number
@@ -503,7 +504,7 @@ struct handshale_t
503
504
  */
504
505
  #define C_INTERFACE_VER_MAJOR "2"//##1 Build marker! Don't remove
505
506
  #define C_INTERFACE_VER_MINOR "4"//##2 Build marker! Don't remove
506
- #define C_INTERFACE_VER_RELEASE "4"//##3 Build marker! Don't remove
507
+ #define C_INTERFACE_VER_RELEASE "5"//##3 Build marker! Don't remove
507
508
 
508
509
  /* dnamic load library name.
509
510
  The default extention of Mac is ".boudle", Therefore ".so" is popular. */
@@ -567,7 +568,7 @@ struct handshale_t
567
568
 
568
569
  #define CPP_INTERFACE_VER_MAJOR "2"//##4 Build marker! Don't remove
569
570
  #define CPP_INTERFACE_VER_MINOR "4"//##5 Build marker! Don't remove
570
- #define CPP_INTERFACE_VER_RELEASE "4"//##6 Build marker! Don't remove
571
+ #define CPP_INTERFACE_VER_RELEASE "5"//##6 Build marker! Don't remove
571
572
 
572
573
  /* use autolink tdclcpp */
573
574
  #if (__BCPLUSPLUS__ || _MSC_VER)
@@ -584,6 +585,6 @@ struct handshale_t
584
585
 
585
586
  #define TRANSACTD_VER_MAJOR 2//##7 Build marker! Don't remove
586
587
  #define TRANSACTD_VER_MINOR 4//##8 Build marker! Don't remove
587
- #define TRANSACTD_VER_RELEASE 4//##9 Build marker! Don't remove
588
+ #define TRANSACTD_VER_RELEASE 5//##9 Build marker! Don't remove
588
589
 
589
590
  #endif // BZS_DB_PROTOCOL_TDAP_TDAPCAPI_H
@@ -233,7 +233,7 @@ const connManager::records& connManager::getDefinedDatabaseList() const
233
233
  cp_security_ctx(thd)->skip_grants();
234
234
  SQL_Strings files;
235
235
  db_list(thd, &files);
236
- #ifdef MARIADDB_10_0
236
+ #if defined(MARIADDB_10_0) || defined(MARIADDB_10_1)
237
237
  for (int i = 0; i < (int)files.elements(); ++i)
238
238
  appenDbList(m_records, files.at(i));
239
239
  #else
@@ -23,6 +23,9 @@
23
23
  #pragma warn -8022
24
24
  #endif
25
25
  #include <boost/test/included/unit_test.hpp>
26
+ #ifndef BOOST_TEST_MESSAGE
27
+ #define BOOST_TEST_MESSAGE BOOST_MESSAGE
28
+ #endif
26
29
  #if defined(__BCPLUSPLUS__)
27
30
  #pragma warn .8012
28
31
  #pragma warn .8022
@@ -410,7 +413,8 @@ void testVersion(database* db)
410
413
  "mysql_server_Major = " << vv.versions[1].majorVersion);
411
414
  BOOST_CHECK_MESSAGE(
412
415
  ((5 <= vv.versions[1].minorVersion) ||
413
- (0 == vv.versions[1].minorVersion)),
416
+ (0 == vv.versions[1].minorVersion) ||
417
+ (1 == vv.versions[1].minorVersion)),
414
418
  "mysql_server_Miner = " << vv.versions[1].minorVersion);
415
419
  BOOST_CHECK_MESSAGE((int)'M' == (int)vv.versions[1].type,
416
420
  "mysql_server_Type = " << vv.versions[1].type);
@@ -2420,7 +2424,7 @@ void testLogin(database* db)
2420
2424
  #ifndef _UNICODE
2421
2425
  TCHAR buf[256];
2422
2426
  sprintf_s(buf, 256, "bad host db->stat()=%d", db->stat());
2423
- BOOST_MESSAGE(buf);
2427
+ BOOST_TEST_MESSAGE(buf);
2424
2428
  #endif
2425
2429
  }
2426
2430
 
@@ -2750,7 +2754,7 @@ void doTestverField(table* tb, bool unicodeField, bool varCharField)
2750
2754
  bool f = string(tb->getFVAstr(1)) == string("0松本");
2751
2755
  BOOST_CHECK_MESSAGE(f, "Get Set A3");
2752
2756
  if (!f)
2753
- BOOST_MESSAGE(tb->getFVAstr(1));
2757
+ BOOST_TEST_MESSAGE(tb->getFVAstr(1));
2754
2758
  }
2755
2759
  BOOST_CHECK_MESSAGE(string(tb->getFVAstr(2)) == string("68"), "Orverrun 2");
2756
2760
 
@@ -2845,13 +2849,13 @@ void testVarField(database* db)
2845
2849
  BOOST_CHECK_MESSAGE(0 == db->stat(), "open 1");
2846
2850
  table* tb = db->openTable(_T("user1"));
2847
2851
  BOOST_CHECK_MESSAGE(0 == db->stat(), "openTable");
2848
- BOOST_MESSAGE("Start acp varchar");
2852
+ BOOST_TEST_MESSAGE("Start acp varchar");
2849
2853
  doTestverField(tb, false, true);
2850
2854
  tb->release();
2851
2855
 
2852
2856
  tb = db->openTable(_T("user2"));
2853
2857
  BOOST_CHECK_MESSAGE(0 == db->stat(), "openTable2");
2854
- BOOST_MESSAGE("Start acp varbinary");
2858
+ BOOST_TEST_MESSAGE("Start acp varbinary");
2855
2859
  doTestverField(tb, false, false);
2856
2860
  tb->release();
2857
2861
 
@@ -2859,19 +2863,19 @@ void testVarField(database* db)
2859
2863
  {
2860
2864
  tb = db->openTable(_T("user3"));
2861
2865
  BOOST_CHECK_MESSAGE(0 == db->stat(), "openTable3");
2862
- BOOST_MESSAGE("Start unicode varchar");
2866
+ BOOST_TEST_MESSAGE("Start unicode varchar");
2863
2867
  doTestverField(tb, true, true);
2864
2868
  tb->release();
2865
2869
  }
2866
2870
  tb = db->openTable(_T("user4"));
2867
2871
  BOOST_CHECK_MESSAGE(0 == db->stat(), "openTable4");
2868
- BOOST_MESSAGE("Start unicode varbinary");
2872
+ BOOST_TEST_MESSAGE("Start unicode varbinary");
2869
2873
  doTestverField(tb, true, false);
2870
2874
  tb->release();
2871
2875
 
2872
2876
  tb = db->openTable(_T("user5"));
2873
2877
  BOOST_CHECK_MESSAGE(0 == db->stat(), "openTable5");
2874
- BOOST_MESSAGE("Start utf8 varchar");
2878
+ BOOST_TEST_MESSAGE("Start utf8 varchar");
2875
2879
  doTestverField(tb, true, true);
2876
2880
 
2877
2881
  tb->release();
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transactd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.4
4
+ version: 2.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - BizStation Corp.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-08 00:00:00.000000000 Z
11
+ date: 2015-10-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Transactd client for ruby gem
14
14
  email: transactd@bizstation.jp