transactd 1.2.0 → 2.0.0

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.
Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/BUILD_UNIX-JA +46 -67
  3. data/BUILD_WIN-JA +106 -63
  4. data/CMakeLists.txt +40 -15
  5. data/README +219 -75
  6. data/README-JA +207 -76
  7. data/README_ORMSRCGEN +118 -0
  8. data/README_ORMSRCGEN-JA +115 -0
  9. data/bin/common/tdclc_32_2_0.dll +0 -0
  10. data/bin/common/tdclc_64_2_0.dll +0 -0
  11. data/build/common/check_for_link_iconv.cmake +18 -14
  12. data/build/common/create_symlink.cmake.in +25 -0
  13. data/build/common/get_boost_libs.cmake +23 -23
  14. data/build/common/options.cmake +0 -66
  15. data/build/common/smart_install.cmake +3 -3
  16. data/build/common/transactd.rc.in +15 -5
  17. data/build/common/transactd_cl_common.cmake +37 -18
  18. data/build/common/transactd_cl_output.cmake +55 -13
  19. data/build/common/transactd_common.cmake +108 -31
  20. data/build/swig/php/generate.cmake.in +15 -17
  21. data/build/swig/php/generate.cmd.in +15 -9
  22. data/build/swig/php/php.swg +124 -82
  23. data/build/swig/php/transactd.no_yield.php +4494 -0
  24. data/build/swig/php/transactd.no_yield.php.git.patch +685 -0
  25. data/build/swig/php/transactd.no_yield.php.patch +685 -0
  26. data/build/swig/php/transactd.yield.php +4461 -0
  27. data/build/swig/php/transactd.yield.php.git.patch +652 -0
  28. data/build/swig/php/transactd.yield.php.patch +652 -0
  29. data/build/swig/referencecounter.h +79 -0
  30. data/build/swig/ruby/ruby.swg +226 -76
  31. data/build/swig/ruby/threadBlockRegionWrapper.h +71 -0
  32. data/build/swig/ruby/without_gvl.swg +87 -0
  33. data/build/swig/tdcl.i +659 -170
  34. data/build/swig/validatablepointer.h +91 -0
  35. data/build/tdclc/CMakeLists.txt +49 -34
  36. data/build/tdclc/{tdclc_64.cbproj → tdclc.cbproj} +65 -20
  37. data/build/tdclc/tdclc.rc +0 -0
  38. data/build/tdclcpp/CMakeLists.txt +84 -20
  39. data/build/tdclcpp/tdclcpp.rc +0 -0
  40. data/build/tdclcpp/{tdclcpp_bcb_64.cbproj → tdclcpp_bc.cbproj} +168 -44
  41. data/build/tdclrb/CMakeLists.txt +84 -66
  42. data/build/tdclrb/bldgem/extconf.rb +28 -3
  43. data/build/tdclrb/gem/helper.rb +11 -1
  44. data/build/tdclrb/gem_output.cmake +20 -16
  45. data/index_ja.html +15 -0
  46. data/source/bzs/db/IBlobBuffer.h +15 -17
  47. data/source/bzs/db/blobBuffer.h +186 -140
  48. data/source/bzs/db/blobStructs.h +37 -37
  49. data/source/bzs/db/engine/mysql/IReadRecords.h +34 -34
  50. data/source/bzs/db/engine/mysql/bookmark.h +150 -147
  51. data/source/bzs/db/engine/mysql/database.cpp +1721 -1526
  52. data/source/bzs/db/engine/mysql/database.h +608 -370
  53. data/source/bzs/db/engine/mysql/dbManager.cpp +213 -201
  54. data/source/bzs/db/engine/mysql/dbManager.h +115 -104
  55. data/source/bzs/db/engine/mysql/errorMessage.cpp +49 -50
  56. data/source/bzs/db/engine/mysql/errorMessage.h +25 -26
  57. data/source/bzs/db/engine/mysql/fieldAccess.h +55 -61
  58. data/source/bzs/db/engine/mysql/mydebuglog.cpp +326 -292
  59. data/source/bzs/db/engine/mysql/mydebuglog.h +63 -55
  60. data/source/bzs/db/engine/mysql/mysqlInternal.h +182 -125
  61. data/source/bzs/db/engine/mysql/mysqlThd.cpp +121 -121
  62. data/source/bzs/db/engine/mysql/mysqlThd.h +20 -20
  63. data/source/bzs/db/engine/mysql/percentageKey.h +241 -228
  64. data/source/bzs/db/protocol/ICommandExecuter.h +18 -17
  65. data/source/bzs/db/protocol/hs/hsCommandExecuter.cpp +543 -514
  66. data/source/bzs/db/protocol/hs/hsCommandExecuter.h +155 -158
  67. data/source/bzs/db/protocol/tdap/btrDate.cpp +213 -180
  68. data/source/bzs/db/protocol/tdap/btrDate.h +39 -37
  69. data/source/bzs/db/protocol/tdap/client/activeTable.cpp +173 -0
  70. data/source/bzs/db/protocol/tdap/client/activeTable.h +165 -0
  71. data/source/bzs/db/protocol/tdap/client/activeTableImple.h +370 -0
  72. data/source/bzs/db/protocol/tdap/client/bulkInsert.h +13 -23
  73. data/source/bzs/db/protocol/tdap/client/client.cpp +81 -68
  74. data/source/bzs/db/protocol/tdap/client/client.h +361 -320
  75. data/source/bzs/db/protocol/tdap/client/connMgr.cpp +17 -22
  76. data/source/bzs/db/protocol/tdap/client/connMgr.h +17 -19
  77. data/source/bzs/db/protocol/tdap/client/connectionPool.cpp +243 -0
  78. data/source/bzs/db/protocol/tdap/client/connectionPool.h +109 -0
  79. data/source/bzs/db/protocol/tdap/client/database.cpp +327 -219
  80. data/source/bzs/db/protocol/tdap/client/database.h +141 -118
  81. data/source/bzs/db/protocol/tdap/client/databaseFactory.cpp +60 -62
  82. data/source/bzs/db/protocol/tdap/client/databaseManager.h +255 -0
  83. data/source/bzs/db/protocol/tdap/client/dbDef.cpp +315 -202
  84. data/source/bzs/db/protocol/tdap/client/dbDef.h +40 -32
  85. data/source/bzs/db/protocol/tdap/client/dllmain.cpp +390 -371
  86. data/source/bzs/db/protocol/tdap/client/errorMessage.cpp +148 -56
  87. data/source/bzs/db/protocol/tdap/client/errorMessage_ja.cpp +149 -57
  88. data/source/bzs/db/protocol/tdap/client/export.h +35 -0
  89. data/source/bzs/db/protocol/tdap/client/field.cpp +1985 -0
  90. data/source/bzs/db/protocol/tdap/client/field.h +393 -0
  91. data/source/bzs/db/protocol/tdap/client/fieldDDF.cpp +14 -14
  92. data/source/bzs/db/protocol/tdap/client/fieldDDF.h +11 -14
  93. data/source/bzs/db/protocol/tdap/client/fieldNameAlias.cpp +123 -0
  94. data/source/bzs/db/protocol/tdap/client/fieldNameAlias.h +58 -0
  95. data/source/bzs/db/protocol/tdap/client/fields.h +178 -0
  96. data/source/bzs/db/protocol/tdap/client/fileDDF.cpp +13 -16
  97. data/source/bzs/db/protocol/tdap/client/fileDDF.h +11 -17
  98. data/source/bzs/db/protocol/tdap/client/filter.h +423 -259
  99. data/source/bzs/db/protocol/tdap/client/groupComp.h +117 -0
  100. data/source/bzs/db/protocol/tdap/client/groupQuery.cpp +818 -0
  101. data/source/bzs/db/protocol/tdap/client/groupQuery.h +281 -0
  102. data/source/bzs/db/protocol/tdap/client/indexDDF.cpp +14 -17
  103. data/source/bzs/db/protocol/tdap/client/indexDDF.h +11 -14
  104. data/source/bzs/db/protocol/tdap/client/memRecord.cpp +231 -0
  105. data/source/bzs/db/protocol/tdap/client/memRecord.h +145 -0
  106. data/source/bzs/db/protocol/tdap/client/memRecordset.cpp +448 -0
  107. data/source/bzs/db/protocol/tdap/client/memRecordset.h +159 -0
  108. data/source/bzs/db/protocol/tdap/client/nsDatabase.cpp +300 -173
  109. data/source/bzs/db/protocol/tdap/client/nsDatabase.h +53 -36
  110. data/source/bzs/db/protocol/tdap/client/nsTable.cpp +171 -128
  111. data/source/bzs/db/protocol/tdap/client/nsTable.h +121 -87
  112. data/source/bzs/db/protocol/tdap/client/pooledDatabaseManager.h +173 -0
  113. data/source/bzs/db/protocol/tdap/client/recordset.cpp +209 -0
  114. data/source/bzs/db/protocol/tdap/client/recordset.h +86 -0
  115. data/source/bzs/db/protocol/tdap/client/recordsetImple.h +596 -0
  116. data/source/bzs/db/protocol/tdap/client/request.h +227 -170
  117. data/source/bzs/db/protocol/tdap/client/serializer.cpp +1288 -0
  118. data/source/bzs/db/protocol/tdap/client/serializer.h +295 -0
  119. data/source/bzs/db/protocol/tdap/client/sharedData.cpp +9 -12
  120. data/source/bzs/db/protocol/tdap/client/sharedData.h +18 -16
  121. data/source/bzs/db/protocol/tdap/client/sqlBuilder.cpp +494 -473
  122. data/source/bzs/db/protocol/tdap/client/sqlBuilder.h +51 -53
  123. data/source/bzs/db/protocol/tdap/client/stringConverter.h +214 -148
  124. data/source/bzs/db/protocol/tdap/client/table.cpp +929 -1665
  125. data/source/bzs/db/protocol/tdap/client/table.h +413 -87
  126. data/source/bzs/db/protocol/tdap/client/trdboostapi.h +642 -534
  127. data/source/bzs/db/protocol/tdap/client/trdboostapiInternal.h +25 -40
  128. data/source/bzs/db/protocol/tdap/client/trdclcppautolink.h +11 -15
  129. data/source/bzs/db/protocol/tdap/client/trdormapi.h +378 -437
  130. data/source/bzs/db/protocol/tdap/client/trnsctcl.def +1 -1
  131. data/source/bzs/db/protocol/tdap/fieldComp.h +127 -0
  132. data/source/bzs/db/protocol/tdap/myDateTime.cpp +352 -345
  133. data/source/bzs/db/protocol/tdap/mysql/characterset.cpp +75 -78
  134. data/source/bzs/db/protocol/tdap/mysql/characterset.h +18 -19
  135. data/source/bzs/db/protocol/tdap/mysql/databaseSchema.cpp +216 -199
  136. data/source/bzs/db/protocol/tdap/mysql/databaseSchema.h +23 -14
  137. data/source/bzs/db/protocol/tdap/mysql/debuglog.cpp +354 -314
  138. data/source/bzs/db/protocol/tdap/mysql/debuglog.h +57 -47
  139. data/source/bzs/db/protocol/tdap/mysql/recordsetReader.h +905 -739
  140. data/source/bzs/db/protocol/tdap/mysql/request.h +152 -159
  141. data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.cpp +1044 -879
  142. data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.h +87 -81
  143. data/source/bzs/db/protocol/tdap/tdapRequest.h +162 -130
  144. data/source/bzs/db/protocol/tdap/tdapSchema.cpp +368 -166
  145. data/source/bzs/db/protocol/tdap/tdapSchema.h +702 -566
  146. data/source/bzs/db/protocol/tdap/tdapcapi.h +387 -353
  147. data/source/bzs/db/transactd/appBuilderImple.h +21 -20
  148. data/source/bzs/db/transactd/appModule.cpp +350 -98
  149. data/source/bzs/db/transactd/appModule.h +31 -37
  150. data/source/bzs/db/transactd/connManager.cpp +138 -135
  151. data/source/bzs/db/transactd/connManager.h +28 -21
  152. data/source/bzs/db/transactd/connectionRecord.h +39 -39
  153. data/source/bzs/db/transactd/transactd.cpp +217 -203
  154. data/source/bzs/env/boost_bcb_link.h +131 -0
  155. data/source/bzs/env/compiler.h +136 -79
  156. data/source/bzs/env/crosscompile.cpp +57 -57
  157. data/source/bzs/env/crosscompile.h +130 -115
  158. data/source/bzs/env/fileopen.h +7 -8
  159. data/source/bzs/env/mbcswchrLinux.cpp +4 -9
  160. data/source/bzs/env/mbcswchrLinux.h +37 -34
  161. data/source/bzs/env/tcharMinGW.h +59 -0
  162. data/source/bzs/env/tstring.h +90 -95
  163. data/source/bzs/example/changeSchema.cpp +22 -23
  164. data/source/bzs/example/changeSchema_c.cpp +22 -24
  165. data/source/bzs/example/connection_pool_c.cpp +49 -104
  166. data/source/bzs/example/createDatabase.cpp +40 -47
  167. data/source/bzs/example/createDatabase_c.cpp +38 -43
  168. data/source/bzs/example/deleteRecords.cpp +10 -15
  169. data/source/bzs/example/deleteRecords_c.cpp +10 -14
  170. data/source/bzs/example/dropDatabase.cpp +3 -9
  171. data/source/bzs/example/dropDatabase_c.cpp +5 -6
  172. data/source/bzs/example/insertRecords.cpp +37 -29
  173. data/source/bzs/example/insertRecords_c.cpp +19 -25
  174. data/source/bzs/example/ormap_c.cpp +621 -0
  175. data/source/bzs/example/queryData.cpp +371 -0
  176. data/source/bzs/example/queryData.h +16 -0
  177. data/source/bzs/example/query_c.cpp +109 -0
  178. data/source/bzs/example/readRecords.cpp +27 -27
  179. data/source/bzs/example/readRecords_c.cpp +25 -23
  180. data/source/bzs/example/updateRecords.cpp +16 -21
  181. data/source/bzs/example/updateRecords_c.cpp +8 -12
  182. data/source/bzs/example/update_with_transaction.cpp +21 -24
  183. data/source/bzs/example/update_with_transaction_c.cpp +12 -15
  184. data/source/bzs/example/useORMRecord.cpp +177 -0
  185. data/source/bzs/netsvc/client/tcpClient.cpp +167 -156
  186. data/source/bzs/netsvc/client/tcpClient.h +541 -489
  187. data/source/bzs/netsvc/server/IAppModule.h +119 -32
  188. data/source/bzs/netsvc/server/iserver.h +21 -23
  189. data/source/bzs/netsvc/server/serverCpt.cpp +421 -391
  190. data/source/bzs/netsvc/server/serverCpt.h +41 -43
  191. data/source/bzs/netsvc/server/serverPipe.cpp +580 -565
  192. data/source/bzs/netsvc/server/serverPipe.h +44 -45
  193. data/source/bzs/netsvc/server/serverTpool.cpp +333 -303
  194. data/source/bzs/netsvc/server/serverTpool.h +38 -43
  195. data/source/bzs/rtl/benchmark.cpp +91 -31
  196. data/source/bzs/rtl/benchmark.h +76 -22
  197. data/source/bzs/rtl/datetime.cpp +231 -233
  198. data/source/bzs/rtl/datetime.h +16 -16
  199. data/source/bzs/rtl/debuglog.cpp +48 -51
  200. data/source/bzs/rtl/debuglog.h +55 -44
  201. data/source/bzs/rtl/exception.h +55 -48
  202. data/source/bzs/rtl/stl_uty.cpp +27 -28
  203. data/source/bzs/rtl/stl_uty.h +28 -29
  204. data/source/bzs/rtl/stringBuffers.cpp +8 -6
  205. data/source/bzs/rtl/stringBuffers.h +16 -9
  206. data/source/bzs/rtl/strtrim.cpp +90 -91
  207. data/source/bzs/rtl/strtrim.h +14 -16
  208. data/source/bzs/test/tdclatl/bench_query_atl.js +647 -0
  209. data/source/bzs/test/tdclatl/bench_tdclatl.js +303 -303
  210. data/source/bzs/test/tdclatl/test_query_atl.js +669 -0
  211. data/source/bzs/test/tdclphp/bench.php +357 -0
  212. data/source/bzs/test/tdclphp/transactd_Test.php +907 -303
  213. data/source/bzs/test/tdclphp/transactd_blob_Test.php +21 -49
  214. data/source/bzs/test/tdclphp/transactd_datetime_Test.php +41 -75
  215. data/source/bzs/test/tdclphp/transactd_kanjischema_Test.php +23 -37
  216. data/source/bzs/test/tdclphp/transactd_pool_Test.php +120 -0
  217. data/source/bzs/test/tdclrb/bench_tdclcpp.rb +4 -6
  218. data/source/bzs/test/tdclrb/prepare.rb +15 -12
  219. data/source/bzs/test/tdclrb/transactd_blob_spec.rb +29 -32
  220. data/source/bzs/test/tdclrb/transactd_datetime_spec.rb +0 -29
  221. data/source/bzs/test/tdclrb/transactd_kanjischema_spec.rb +18 -19
  222. data/source/bzs/test/tdclrb/transactd_pool_spec.rb +107 -0
  223. data/source/bzs/test/tdclrb/transactd_spec.rb +734 -142
  224. data/source/bzs/test/transactdBench/query_bench.cpp +156 -0
  225. data/source/bzs/test/transactdBench/scaling_bench.cpp +265 -0
  226. data/source/bzs/test/transactdBench/transactdBench.cpp +107 -83
  227. data/source/bzs/test/transactdBench/transactdBench2.cpp +122 -83
  228. data/source/bzs/test/transactdBench/workerBase.cpp +5 -0
  229. data/source/bzs/test/transactdBench/workerBase.h +88 -0
  230. data/source/bzs/test/transactdBench/workerMySQLImple.h +333 -0
  231. data/source/bzs/test/transactdBench/workerTransactdImple.h +201 -0
  232. data/source/bzs/test/trdclengn/test_blob.cpp +121 -73
  233. data/source/bzs/test/trdclengn/test_trdclengn.cpp +1244 -426
  234. data/source/global/ormsrcgen/confParam.h +80 -0
  235. data/source/global/ormsrcgen/fieldName.cpp +77 -0
  236. data/source/global/ormsrcgen/fieldName.h +43 -0
  237. data/source/global/ormsrcgen/main.cpp +196 -0
  238. data/source/global/ormsrcgen/srcgen.cpp +763 -0
  239. data/source/global/ormsrcgen/srcgen.h +72 -0
  240. data/source/global/ormsrcgen/template/fieldNameList_sample.txt +2 -0
  241. data/source/global/ormsrcgen/template/ormDataClass_template.cpp +48 -0
  242. data/source/global/ormsrcgen/template/ormDataClass_template.h +34 -0
  243. data/source/global/ormsrcgen/template/ormMapClass_template.cpp +51 -0
  244. data/source/global/ormsrcgen/template/ormMapClass_template.h +62 -0
  245. data/source/global/ormsrcgen/template/template.cnf +38 -0
  246. data/source/global/querystmts/querystmts.cpp +237 -0
  247. data/source/global/tdclatl/ConnectParams.cpp +77 -0
  248. data/source/global/tdclatl/ConnectParams.h +70 -0
  249. data/source/global/tdclatl/Database.cpp +132 -128
  250. data/source/global/tdclatl/Database.h +60 -49
  251. data/source/global/tdclatl/DbDef.cpp +68 -64
  252. data/source/global/tdclatl/DbDef.h +36 -36
  253. data/source/global/tdclatl/Field.cpp +12 -17
  254. data/source/global/tdclatl/Field.h +15 -12
  255. data/source/global/tdclatl/FieldDef.cpp +75 -36
  256. data/source/global/tdclatl/FieldDef.h +38 -19
  257. data/source/global/tdclatl/FieldDefs.cpp +74 -0
  258. data/source/global/tdclatl/FieldDefs.h +56 -0
  259. data/source/global/tdclatl/FieldNames.cpp +99 -0
  260. data/source/global/tdclatl/FieldNames.h +66 -0
  261. data/source/global/tdclatl/Flags.cpp +75 -37
  262. data/source/global/tdclatl/Flags.h +13 -12
  263. data/source/global/tdclatl/GroupQuery.cpp +119 -0
  264. data/source/global/tdclatl/GroupQuery.h +65 -0
  265. data/source/global/tdclatl/KeyDef.cpp +15 -14
  266. data/source/global/tdclatl/KeyDef.h +20 -17
  267. data/source/global/tdclatl/KeySegment.cpp +13 -12
  268. data/source/global/tdclatl/PooledDbManager.cpp +223 -0
  269. data/source/global/tdclatl/PooledDbManager.h +76 -0
  270. data/source/global/tdclatl/QueryBase.cpp +206 -127
  271. data/source/global/tdclatl/QueryBase.h +55 -59
  272. data/source/global/tdclatl/Record.cpp +214 -0
  273. data/source/global/tdclatl/Record.h +96 -0
  274. data/source/global/tdclatl/Recordset.cpp +278 -0
  275. data/source/global/tdclatl/Recordset.h +83 -0
  276. data/source/global/tdclatl/RecordsetQuery.cpp +118 -0
  277. data/source/global/tdclatl/RecordsetQuery.h +126 -0
  278. data/source/global/tdclatl/Table.cpp +57 -60
  279. data/source/global/tdclatl/Table.h +32 -29
  280. data/source/global/tdclatl/TableDef.cpp +63 -62
  281. data/source/global/tdclatl/TableDef.h +20 -22
  282. data/source/global/tdclatl/TdVersion.cpp +3 -3
  283. data/source/global/tdclatl/TdVersion.h +15 -11
  284. data/source/global/tdclatl/_IDatabaseEvents_CP.h +99 -92
  285. data/source/global/tdclatl/activeTable.cpp +355 -0
  286. data/source/global/tdclatl/activeTable.h +79 -0
  287. data/source/global/tdclatl/dllmain.cpp +4 -3
  288. data/source/global/tdclatl/dllmain.h +7 -6
  289. data/source/global/tdclatl/keySegment.h +22 -18
  290. data/source/global/tdclatl/resource.h +0 -0
  291. data/source/global/tdclatl/stdafx.h +6 -4
  292. data/source/global/tdclatl/targetver.h +0 -1
  293. data/source/global/tdclatl/tdclatl.cpp +10 -5
  294. data/source/global/tdclatl/tdclatl.idl +530 -14
  295. data/source/linux/charsetConvert.h +78 -79
  296. data/source/linux/linuxTypes.h +9 -12
  297. data/source/linux/tchar.h +168 -166
  298. data/transactd.gemspec +24 -16
  299. metadata +98 -12
  300. data/bin/common/tdclc_32_1_2.dll +0 -0
  301. data/bin/common/tdclc_64_1_2.dll +0 -0
  302. data/build/tdclc/tdclc_32.cbproj +0 -173
  303. data/build/tdclcpp/tdclcpp_bcb_32.cbproj +0 -232
  304. data/build/tdclrb/GEM_VERSION +0 -3
  305. data/source/bzs/db/protocol/tdap/client/filter.cpp +0 -43
  306. data/source/bzs/example/useORM.cpp +0 -585
@@ -1,36 +1,37 @@
1
- #ifndef MYDEBUGLOG_H
2
- #define MYDEBUGLOG_H
3
- /*=================================================================
4
- Copyright (C) 2012 2013 BizStation Corp All rights reserved.
5
-
6
- This program is free software; you can redistribute it and/or
7
- modify it under the terms of the GNU General Public License
8
- as published by the Free Software Foundation; either version 2
9
- of the License, or (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with this program; if not, write to the Free Software
18
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
- 02111-1307, USA.
20
- =================================================================*/
1
+ #ifndef BZS_DB_ENGINE_MYSQL_MYDEBUGLOG_H
2
+ #define BZS_DB_ENGINE_MYSQL_MYDEBUGLOG_H
3
+ /* =================================================================
4
+ Copyright (C) 2012 2013 BizStation Corp All rights reserved.
5
+
6
+ This program is free software; you can redistribute it and/or
7
+ modify it under the terms of the GNU General Public License
8
+ as published by the Free Software Foundation; either version 2
9
+ of the License, or (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program; if not, write to the Free Software
18
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
+ 02111-1307, USA.
20
+ ================================================================= */
21
21
  #include <bzs/db/protocol/tdap/mysql/request.h>
22
22
  #include <boost/noncopyable.hpp>
23
23
  #include <stdio.h>
24
24
  #include <bzs/rtl/debuglog.h>
25
25
 
26
- using namespace bzs::rtl;
26
+ using namespace bzs::rtl;
27
27
 
28
28
  namespace bzs
29
29
  {
30
-
30
+
31
31
  namespace db
32
32
  {
33
- using namespace protocol::tdap::mysql;
33
+ using namespace protocol::tdap::mysql;
34
+
34
35
  namespace engine
35
36
  {
36
37
  namespace mysql
@@ -40,50 +41,57 @@ class table;
40
41
 
41
42
  class debugdb : public rtl::debuglog
42
43
  {
43
- void fieldDump(table* tb);
44
+ void fieldDump(table* tb);
45
+
44
46
  public:
45
- virtual ~debugdb(){};
46
-
47
- virtual void stop();
48
- void write(ushort_td op, protocol::tdap::mysql::request& req, bool error = false);
49
- void writeInsert(table* tb, const char* packPtr,int packlen, int row, int errorCount);
47
+ virtual ~debugdb(){};
48
+
49
+ virtual void stop();
50
+ void write(ushort_td op, protocol::tdap::mysql::request& req,
51
+ bool error = false);
52
+ void writeInsert(table* tb, const char* packPtr, int packlen, int row,
53
+ int errorCount);
50
54
  };
51
55
 
52
56
  extern char msg[1024];
53
57
 
54
58
  #ifdef DEBUG_LOG
55
-
56
- #define DEBUG_WRITELOG2(OP, REQ) ((debugdb*)debuglog::get())->write(OP, REQ);
57
- #define DEBUG_WRITELOG3(OP, REQ, ERR) ((debugdb*)debuglog::get())->write(OP, REQ, ERR);
58
- #define DEBUG_WRITELOG_SP1(FORMAT, PARAM) \
59
- sprintf_s(msg,FORMAT, PARAM); \
60
- debuglog::get()->write(msg);
61
-
62
- #else //DEBUG_LOG
63
- #define DEBUG_WRITELOG2(OP, REQ)
64
- #define DEBUG_WRITELOG3(OP, REQ, ERR)
65
- #define DEBUG_WRITELOG_SP1(FORMAT, PARAM)
66
- #endif //DEBUG_LOG
59
+
60
+ #define DEBUG_WRITELOG2(OP, REQ) ((debugdb*)debuglog::get())->write(OP, REQ);
61
+ #define DEBUG_WRITELOG3(OP, REQ, ERR) \
62
+ ((debugdb*)debuglog::get())->write(OP, REQ, ERR);
63
+ #define DEBUG_WRITELOG_SP1(FORMAT, PARAM) \
64
+ sprintf_s(msg, FORMAT, PARAM); \
65
+ debuglog::get()->write(msg);
66
+ #define DEBUG_MEMDUMP(MSG, PTR, SIZE) \
67
+ ((debugdb*)debuglog::get())->writeDump(MSG, (const char*)PTR, SIZE);
68
+
69
+ #else // DEBUG_LOG
70
+ #define DEBUG_WRITELOG2(OP, REQ)
71
+ #define DEBUG_WRITELOG3(OP, REQ, ERR)
72
+ #define DEBUG_WRITELOG_SP1(FORMAT, PARAM)
73
+ #define DEBUG_MEMDUMP(MSG, PTR, SIZE)
74
+ #endif // DEBUG_LOG
67
75
 
68
76
  #ifdef DEBUG_LOG_BINSERT
69
- #define DEBUG_INSERT(TB,PTR,LEN,ROW,ERRORS) ((debugdb*)debuglog::get())->writeInsert(TB, PTR, LEN, ROW, ERRORS);
77
+ #define DEBUG_INSERT(TB, PTR, LEN, ROW, ERRORS) \
78
+ ((debugdb*)debuglog::get())->writeInsert(TB, PTR, LEN, ROW, ERRORS);
70
79
  #else
71
- #define DEBUG_INSERT(TB,PTR,LEN,ROW,ERRORS)
80
+ #define DEBUG_INSERT(TB, PTR, LEN, ROW, ERRORS)
72
81
  #endif
73
82
 
74
-
75
- #ifdef DEBUG_READRECORDS
76
- #define DEBUG_RECORDS_BEGIN( RDEF, REQ) debuglog::get()->writeReadRecordsBegin(RDEF, REQ);
77
- #define DEBUG_RECORDS_END( WRITER) debuglog::get()->writeReadRecordsEnd(WRITER);
83
+ #ifdef DEBUG_READRECORDS
84
+ #define DEBUG_RECORDS_BEGIN(RDEF, REQ) \
85
+ debuglog::get()->writeReadRecordsBegin(RDEF, REQ);
86
+ #define DEBUG_RECORDS_END(WRITER) debuglog::get()->writeReadRecordsEnd(WRITER);
78
87
  #else
79
- #define DEBUG_RECORDS_BEGIN( RDEF, REQ)
80
- #define DEBUG_RECORDS_END( WRITER)
88
+ #define DEBUG_RECORDS_BEGIN(RDEF, REQ)
89
+ #define DEBUG_RECORDS_END(WRITER)
81
90
  #endif
82
91
 
92
+ } // namespace mysql
93
+ } // namespace engine
94
+ } // namespace db
95
+ } // namespace bzs
83
96
 
84
- }//namespace mysql
85
- }//namespace engine
86
- }//namespace db
87
- }//namespace bzs
88
-
89
- #endif //MYDEBUGLOG_H
97
+ #endif // BZS_DB_ENGINE_MYSQL_MYDEBUGLOG_H
@@ -1,30 +1,29 @@
1
- #ifndef MYSQLINTERNAL_H
2
- #define MYSQLINTERNAL_H
3
-
4
- /*=================================================================
5
- Copyright (C) 2012 2013 BizStation Corp All rights reserved.
6
-
7
- This program is free software; you can redistribute it and/or
8
- modify it under the terms of the GNU General Public License
9
- as published by the Free Software Foundation; either version 2
10
- of the License, or (at your option) any later version.
11
-
12
- This program is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with this program; if not, write to the Free Software
19
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20
- 02111-1307, USA.
21
- =================================================================*/
1
+ #ifndef BZS_DB_ENGINE_MYSQL_MYSQLINTERNAL_H
2
+ #define BZS_DB_ENGINE_MYSQL_MYSQLINTERNAL_H
3
+ /* =================================================================
4
+ Copyright (C) 2012 2013 BizStation Corp All rights reserved.
5
+
6
+ This program is free software; you can redistribute it and/or
7
+ modify it under the terms of the GNU General Public License
8
+ as published by the Free Software Foundation; either version 2
9
+ of the License, or (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program; if not, write to the Free Software
18
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
+ 02111-1307, USA.
20
+ ================================================================= */
22
21
 
23
22
  #undef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
24
23
  #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
25
24
 
26
25
  #ifndef MYSQL_DYNAMIC_PLUGIN
27
- #define MYSQL_DYNAMIC_PLUGIN
26
+ #define MYSQL_DYNAMIC_PLUGIN
28
27
  #endif
29
28
 
30
29
  #define MYSQL_SERVER 1
@@ -33,7 +32,7 @@
33
32
  #define HAVE_CONFIG_H
34
33
  #endif
35
34
 
36
- #define HAVE_PSI_INTERFACE //50700
35
+ #define HAVE_PSI_INTERFACE // 50700
37
36
  #define NO_USE_MALLOC_SERVICE_INTERFACE
38
37
 
39
38
  #ifdef ERROR
@@ -44,23 +43,23 @@
44
43
  #undef NOMINMAX
45
44
  #endif
46
45
  #ifdef _MSC_VER
47
- #pragma warning(disable:4800)
48
- #pragma warning(disable:4267)
49
- #pragma warning(disable:4996)
50
- #pragma warning(disable:4805)
46
+ #pragma warning(disable : 4800)
47
+ #pragma warning(disable : 4267)
48
+ #pragma warning(disable : 4996)
49
+ #pragma warning(disable : 4805)
51
50
  #endif
52
51
 
53
52
  #include <my_config.h>
54
53
  #include <mysql/plugin.h>
55
54
  #include <mysql_version.h>
56
55
  #include <sql/sql_const.h>
57
- #include "sql/mysqld.h"
56
+ #include "sql/mysqld.h"
58
57
 
59
58
  #if ((MYSQL_VERSION_ID >= 50600) && !defined(MARIADB_BASE_VERSION))
60
- #include "sql/global_threads.h"
59
+ #include "sql/global_threads.h"
61
60
  #endif
62
61
 
63
- #include "sql/sql_plugin.h"
62
+ #include "sql/sql_plugin.h"
64
63
  #include "sql/sql_cache.h"
65
64
  #include "sql/structs.h"
66
65
  #include "sql/sql_priv.h"
@@ -71,7 +70,7 @@
71
70
  #include "my_global.h"
72
71
  #include "sql/transaction.h"
73
72
  #include "sql/sql_base.h"
74
- #include "sql/sql_parse.h"
73
+ #include "sql/sql_parse.h"
75
74
  #include "sql/sql_table.h"
76
75
  #include "sql/sql_db.h"
77
76
  #include "sql_acl.h"
@@ -89,125 +88,183 @@
89
88
  #endif
90
89
 
91
90
  #ifdef _MSC_VER
92
- #pragma warning(default:4996)
93
- #pragma warning(default:4267)
94
- #pragma warning(default:4800)
95
- #pragma warning(default:4805)
91
+ #pragma warning(default : 4996)
92
+ #pragma warning(default : 4267)
93
+ #pragma warning(default : 4800)
94
+ #pragma warning(default : 4805)
96
95
  #endif
97
96
 
98
97
  #undef min
99
98
  #undef max
100
99
  #define THD_KILLED_STATE THD::killed_state
101
- #define THD_NOT_KILLED THD::NOT_KILLED
102
-
103
-
100
+ #define THD_NOT_KILLED THD::NOT_KILLED
104
101
 
105
102
  #if defined(MARIADB_BASE_VERSION)
106
- #define MARIADB_VERSION_NUM MYSQL_VERSION_ID
107
- #define MYSQL_VERSION_NUM 1000000
103
+ #define MARIADB_VERSION_NUM MYSQL_VERSION_ID
104
+ #define MYSQL_VERSION_NUM 1000000
108
105
  #else
109
- #define MARIADB_VERSION_NUM 1000000
110
- #define MYSQL_VERSION_NUM MYSQL_VERSION_ID
106
+ #define MARIADB_VERSION_NUM 1000000
107
+ #define MYSQL_VERSION_NUM MYSQL_VERSION_ID
111
108
  #endif
112
109
 
113
110
  #if defined(MARIADB_BASE_VERSION)
114
- #define MDL_SHARED_UPGRADABLE MDL_SHARED_WRITE
115
- #undef THD_KILLED_STATE
116
- #define THD_KILLED_STATE killed_state
117
- #undef THD_NOT_KILLED
118
- #define THD_NOT_KILLED NOT_KILLED
119
- #endif
120
-
121
- #if (MYSQL_VERSION_ID < 50600) //MySQL and MariaDB both
122
- #define user_defined_key_parts key_parts
123
- #define MDL_SHARED_UPGRADABLE MDL_SHARED_WRITE
124
- #define cp_get_sql_error() stmt_da->sql_errno()
125
- #define cp_isOk() stmt_da->is_ok()
126
- #elif ((MYSQL_VERSION_NUM > 50700) && !defined(MARIADB_BASE_VERSION))
127
- #define cp_get_sql_error() get_stmt_da()->mysql_errno()
128
- #define query_cache_invalidate3(A, B, C) query_cache.invalidate(A, B, C)
129
- #define cp_isOk() get_stmt_da()->is_ok()
130
- #else
131
- #define cp_get_sql_error() get_stmt_da()->sql_errno()
132
- #define cp_isOk() get_stmt_da()->is_ok()
111
+ #define MDL_SHARED_UPGRADABLE MDL_SHARED_WRITE
112
+ #undef THD_KILLED_STATE
113
+ #define THD_KILLED_STATE killed_state
114
+ #undef THD_NOT_KILLED
115
+ #define THD_NOT_KILLED NOT_KILLED
133
116
  #endif
134
117
 
135
- #if (MYSQL_VERSION_NUM < 50600) //MySQL Only
136
- #define ha_index_next index_next
137
- #define ha_index_prev index_prev
138
- #define ha_index_first index_first
139
- #define ha_index_last index_last
140
- #define ha_index_next_same index_next_same
141
- #define ha_rnd_next rnd_next
142
- #define ha_rnd_pos rnd_pos
143
- #endif
118
+ #if (MYSQL_VERSION_ID < 50600) // MySQL and MariaDB both
119
+ #define user_defined_key_parts key_parts
120
+ #define MDL_SHARED_UPGRADABLE MDL_SHARED_WRITE
121
+ #define cp_get_sql_error() stmt_da->sql_errno()
122
+ #define cp_isOk() stmt_da->is_ok()
123
+ #define cp_set_overwrite_status(A) stmt_da->can_overwrite_status = A
124
+ #elif((MYSQL_VERSION_NUM > 50700) && !defined(MARIADB_BASE_VERSION))
125
+ #define cp_get_sql_error() get_stmt_da()->mysql_errno()
126
+ #define query_cache_invalidate3(A, B, C) query_cache.invalidate(A, B, C)
127
+ #define cp_isOk() get_stmt_da()->is_ok()
128
+ #define cp_set_overwrite_status(A) get_stmt_da()->set_overwrite_status(A)
129
+ #else
130
+ #define cp_get_sql_error() get_stmt_da()->sql_errno()
131
+ #define cp_isOk() get_stmt_da()->is_ok()
132
+ #define cp_set_overwrite_status(A) get_stmt_da()->set_overwrite_status(A)
144
133
 
134
+ #endif
145
135
 
136
+ #if (MYSQL_VERSION_NUM < 50600) // MySQL Only
137
+ #define ha_index_next index_next
138
+ #define ha_index_prev index_prev
139
+ #define ha_index_first index_first
140
+ #define ha_index_last index_last
141
+ #define ha_index_next_same index_next_same
142
+ #define ha_rnd_next rnd_next
143
+ #define ha_rnd_pos rnd_pos
144
+ #endif
146
145
 
147
146
  #if ((MYSQL_VERSION_NUM < 50600) || defined(MARIADB_BASE_VERSION))
148
- inline void cp_add_global_thread(THD* thd){;}
149
- inline void cp_remove_global_thread(THD* thd){;}
150
- inline void cp_thd_release_resources(THD* thd){;}
151
-
152
- inline void cp_restore_globals(THD* thd)
153
- {
154
- my_pthread_setspecific_ptr(THR_THD, 0);
155
- my_pthread_setspecific_ptr(THR_MALLOC, 0);
156
- }
157
-
158
- inline bool cp_is_write_lock(handler* file){return true;}
159
- inline void cp_thd_set_read_only(THD* thd){;}
160
- inline bool cp_open_table(THD* thd, TABLE_LIST* tables, Open_table_context* ot_act)
161
- {
162
- return open_table(thd, tables, thd->mem_root, ot_act);
163
- }
164
- #define set_mysys_var(A)
147
+
148
+ inline void cp_add_global_thread(THD* thd)
149
+ {
150
+ ;
151
+ }
152
+
153
+ inline void cp_remove_global_thread(THD* thd)
154
+ {
155
+ ;
156
+ }
157
+
158
+ inline void cp_thd_release_resources(THD* thd)
159
+ {
160
+ ;
161
+ }
162
+
163
+ inline void cp_restore_globals(THD* thd)
164
+ {
165
+ my_pthread_setspecific_ptr(THR_THD, 0);
166
+ my_pthread_setspecific_ptr(THR_MALLOC, 0);
167
+ }
168
+
169
+ inline bool cp_is_write_lock(handler* file)
170
+ {
171
+ return true;
172
+ }
173
+
174
+ inline void cp_thd_set_read_only(THD* thd)
175
+ {
176
+ ;
177
+ }
178
+
179
+ inline bool cp_open_table(THD* thd, TABLE_LIST* tables,
180
+ Open_table_context* ot_act)
181
+ {
182
+ return open_table(thd, tables, thd->mem_root, ot_act);
183
+ }
184
+ #define set_mysys_var(A)
165
185
  #else
166
- inline void cp_add_global_thread(THD* thd){add_global_thread(thd);}
167
- inline void cp_remove_global_thread(THD* thd){remove_global_thread(thd);}
168
- inline void cp_thd_release_resources(THD* thd){thd->release_resources();}
169
- inline void cp_set_mysys_var(st_my_thread_var* var){set_mysys_var(var);}
170
- inline void cp_restore_globals(THD* thd){thd->restore_globals();}
171
- inline bool cp_is_write_lock(handler* file){return (file->get_lock_type() == F_WRLCK);}
172
- inline void cp_thd_set_read_only(THD* thd){thd->tx_read_only = (thd->variables.tx_read_only != 0);}
173
- inline bool cp_open_table(THD* thd, TABLE_LIST* tables, Open_table_context* ot_act)
174
- {
175
- return open_table(thd, tables, ot_act);
176
- }
186
+
187
+ inline void cp_add_global_thread(THD* thd)
188
+ {
189
+ add_global_thread(thd);
190
+ }
191
+
192
+ inline void cp_remove_global_thread(THD* thd)
193
+ {
194
+ remove_global_thread(thd);
195
+ }
196
+
197
+ inline void cp_thd_release_resources(THD* thd)
198
+ {
199
+ thd->release_resources();
200
+ }
201
+
202
+ inline void cp_set_mysys_var(st_my_thread_var* var)
203
+ {
204
+ set_mysys_var(var);
205
+ }
206
+
207
+ inline void cp_restore_globals(THD* thd)
208
+ {
209
+ thd->restore_globals();
210
+ }
211
+
212
+ inline bool cp_is_write_lock(handler* file)
213
+ {
214
+ return (file->get_lock_type() == F_WRLCK);
215
+ }
216
+
217
+ inline void cp_thd_set_read_only(THD* thd)
218
+ {
219
+ thd->tx_read_only = (thd->variables.tx_read_only != 0);
220
+ }
221
+
222
+ inline bool cp_open_table(THD* thd, TABLE_LIST* tables,
223
+ Open_table_context* ot_act)
224
+ {
225
+ return open_table(thd, tables, ot_act);
226
+ }
177
227
  #endif
178
228
 
179
229
  #if (MYSQL_VERSION_NUM < 50611)
180
- #define ha_index_read_map index_read_map
230
+ #define ha_index_read_map index_read_map
181
231
  #endif
182
232
 
183
233
  /* memory management */
184
234
  #if ((MYSQL_VERSION_NUM > 50700) && !defined(MARIADB_BASE_VERSION))
185
- #define td_malloc(A, B) my_malloc(PSI_NOT_INSTRUMENTED, A, B)
186
- #define td_realloc(A, B, C) my_realloc(PSI_NOT_INSTRUMENTED, A, B, C)
187
- #define td_strdup(A, B) my_strdup(PSI_NOT_INSTRUMENTED, A, B)
188
- #define td_free(A) my_free(A)
189
-
190
- /* On Windows,
191
- "operator delete()" function is implemented in mysqld.
192
- But "operator new" operation implement in transactd.dll.
193
- Therefore, memory managers differ.*/
194
- #ifdef _WIN32
195
- inline void releaseTHD(THD* thd)
196
- {
197
- thd->~THD();
198
- operator delete((void*)thd);
199
- }
200
- #else
201
- inline void releaseTHD(THD* thd){delete thd;}
202
- #endif
235
+ #define td_malloc(A, B) my_malloc(PSI_NOT_INSTRUMENTED, A, B)
236
+ #define td_realloc(A, B, C) my_realloc(PSI_NOT_INSTRUMENTED, A, B, C)
237
+ #define td_strdup(A, B) my_strdup(PSI_NOT_INSTRUMENTED, A, B)
238
+ #define td_free(A) my_free(A)
239
+
240
+ /* On Windows,
241
+ "operator delete()" function is implemented in mysqld.
242
+ But "operator new" operation implement in transactd.dll.
243
+ Therefore, memory managers differ. */
244
+ #ifdef _WIN32
245
+
246
+ inline void releaseTHD(THD* thd)
247
+ {
248
+ thd->~THD();
249
+ operator delete((void*)thd);
250
+ }
203
251
  #else
204
- #define td_malloc(A, B) my_malloc(A, B)
205
- #define td_realloc(A, B, C) my_realloc(A, B, C)
206
- #define td_strdup(A, B) my_strdup(A, B)
207
- #define td_free(A) my_free(A)
208
- inline void releaseTHD(THD* thd){delete thd;}
209
- #endif
210
-
211
252
 
253
+ inline void releaseTHD(THD* thd)
254
+ {
255
+ delete thd;
256
+ }
257
+ #endif
258
+ #else
259
+ #define td_malloc(A, B) my_malloc(A, B)
260
+ #define td_realloc(A, B, C) my_realloc(A, B, C)
261
+ #define td_strdup(A, B) my_strdup(A, B)
262
+ #define td_free(A) my_free(A)
263
+
264
+ inline void releaseTHD(THD* thd)
265
+ {
266
+ delete thd;
267
+ }
268
+ #endif
212
269
 
213
- #endif //MYSQLINTERNAL_H
270
+ #endif // BZS_DB_ENGINE_MYSQL_MYSQLINTERNAL_H