transactd 2.0.1 → 2.1.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 (146) hide show
  1. checksums.yaml +4 -4
  2. data/BUILD_UNIX-JA +6 -6
  3. data/README +16 -16
  4. data/README-JA +16 -16
  5. data/bin/common/tdclc_32_2_1.dll +0 -0
  6. data/bin/common/tdclc_64_2_1.dll +0 -0
  7. data/build/common/transactd_cl_common.cmake +0 -1
  8. data/build/common/transactd_common.cmake +28 -38
  9. data/build/swig/ruby/ruby.swg +36 -30
  10. data/build/swig/ruby/tdclrb_wrap.cpp +35016 -0
  11. data/build/swig/tdcl.i +217 -62
  12. data/build/tdclc/CMakeLists.txt +14 -26
  13. data/build/tdclc/libtdclcm.map +4 -0
  14. data/build/tdclc/tdclc.cbproj +1 -1
  15. data/build/tdclc/tdclc.rc +0 -0
  16. data/build/tdclcpp/CMakeLists.txt +7 -22
  17. data/build/tdclcpp/tdclcpp.rc +0 -0
  18. data/build/tdclcpp/tdclcpp_bc.cbproj +1 -1
  19. data/build/tdclrb/CMakeLists.txt +7 -49
  20. data/build/tdclrb/tdclrb.rc +62 -0
  21. data/source/bzs/db/blobBuffer.h +5 -0
  22. data/source/bzs/db/blobStructs.h +2 -0
  23. data/source/bzs/db/engine/mysql/IReadRecords.h +9 -0
  24. data/source/bzs/db/engine/mysql/database.cpp +391 -169
  25. data/source/bzs/db/engine/mysql/database.h +178 -40
  26. data/source/bzs/db/engine/mysql/dbManager.cpp +45 -3
  27. data/source/bzs/db/engine/mysql/dbManager.h +3 -39
  28. data/source/bzs/db/engine/mysql/errorMessage.cpp +11 -7
  29. data/source/bzs/db/engine/mysql/errorMessage.h +1 -1
  30. data/source/bzs/db/engine/mysql/mydebuglog.cpp +1 -2
  31. data/source/bzs/db/engine/mysql/mysqlInternal.h +8 -8
  32. data/source/bzs/db/engine/mysql/mysqlThd.cpp +11 -0
  33. data/source/bzs/db/protocol/hs/hsCommandExecuter.cpp +1 -1
  34. data/source/bzs/db/protocol/tdap/client/activeTable.cpp +41 -6
  35. data/source/bzs/db/protocol/tdap/client/activeTable.h +177 -8
  36. data/source/bzs/db/protocol/tdap/client/activeTableImple.h +141 -62
  37. data/source/bzs/db/protocol/tdap/client/client.cpp +39 -35
  38. data/source/bzs/db/protocol/tdap/client/client.h +52 -25
  39. data/source/bzs/db/protocol/tdap/client/connectionPool.cpp +17 -0
  40. data/source/bzs/db/protocol/tdap/client/connectionPool.h +1 -0
  41. data/source/bzs/db/protocol/tdap/client/database.cpp +5 -1
  42. data/source/bzs/db/protocol/tdap/client/database.h +1 -1
  43. data/source/bzs/db/protocol/tdap/client/databaseFactory.cpp +49 -12
  44. data/source/bzs/db/protocol/tdap/client/databaseManager.h +42 -5
  45. data/source/bzs/db/protocol/tdap/client/dbDef.cpp +4 -2
  46. data/source/bzs/db/protocol/tdap/client/dllmain.cpp +71 -41
  47. data/source/bzs/db/protocol/tdap/client/errorMessage_ja.cpp +49 -49
  48. data/source/bzs/db/protocol/tdap/client/field.cpp +22 -13
  49. data/source/bzs/db/protocol/tdap/client/field.h +7 -3
  50. data/source/bzs/db/protocol/tdap/client/fieldDDF.cpp +1 -1
  51. data/source/bzs/db/protocol/tdap/client/fieldNameAlias.cpp +0 -1
  52. data/source/bzs/db/protocol/tdap/client/fieldNameAlias.h +1 -0
  53. data/source/bzs/db/protocol/tdap/client/fields.h +111 -24
  54. data/source/bzs/db/protocol/tdap/client/fileDDF.cpp +1 -1
  55. data/source/bzs/db/protocol/tdap/client/filter.h +687 -310
  56. data/source/bzs/db/protocol/tdap/client/groupQuery.cpp +12 -4
  57. data/source/bzs/db/protocol/tdap/client/indexDDF.cpp +1 -1
  58. data/source/bzs/db/protocol/tdap/client/memRecord.cpp +190 -32
  59. data/source/bzs/db/protocol/tdap/client/memRecord.h +64 -22
  60. data/source/bzs/db/protocol/tdap/client/nsDatabase.cpp +4 -4
  61. data/source/bzs/db/protocol/tdap/client/nsDatabase.h +4 -2
  62. data/source/bzs/db/protocol/tdap/client/nsTable.cpp +6 -3
  63. data/source/bzs/db/protocol/tdap/client/nsTable.h +1 -1
  64. data/source/bzs/db/protocol/tdap/client/pooledDatabaseManager.h +19 -8
  65. data/source/bzs/db/protocol/tdap/client/recordsetImple.h +194 -87
  66. data/source/bzs/db/protocol/tdap/client/request.h +84 -26
  67. data/source/bzs/db/protocol/tdap/client/stringConverter.h +22 -12
  68. data/source/bzs/db/protocol/tdap/client/table.cpp +494 -286
  69. data/source/bzs/db/protocol/tdap/client/table.h +48 -5
  70. data/source/bzs/db/protocol/tdap/client/trdboostapi.h +133 -87
  71. data/source/bzs/db/protocol/tdap/client/trdboostapiInternal.h +22 -22
  72. data/source/bzs/db/protocol/tdap/client/trdormapi.h +43 -18
  73. data/source/bzs/db/protocol/tdap/client/trnsctcl.def +3 -3
  74. data/source/bzs/db/protocol/tdap/mysql/databaseSchema.cpp +1 -0
  75. data/source/bzs/db/protocol/tdap/mysql/recordsetReader.h +268 -74
  76. data/source/bzs/db/protocol/tdap/mysql/request.h +4 -4
  77. data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.cpp +179 -43
  78. data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.h +4 -4
  79. data/source/bzs/db/protocol/tdap/tdapRequest.h +15 -14
  80. data/source/bzs/db/protocol/tdap/tdapSchema.h +125 -90
  81. data/source/bzs/db/protocol/tdap/tdapcapi.h +46 -5
  82. data/source/bzs/db/transactd/appModule.h +1 -1
  83. data/source/bzs/db/transactd/connManager.cpp +2 -0
  84. data/source/bzs/db/transactd/transactd.cpp +1 -0
  85. data/source/bzs/env/compiler.h +10 -0
  86. data/source/bzs/env/mbcswchrLinux.cpp +42 -6
  87. data/source/bzs/env/mbcswchrLinux.h +40 -12
  88. data/source/bzs/example/queryData.cpp +33 -4
  89. data/source/bzs/netsvc/client/iconnection.h +107 -0
  90. data/source/bzs/netsvc/client/tcpClient.cpp +15 -1
  91. data/source/bzs/netsvc/client/tcpClient.h +96 -87
  92. data/source/bzs/netsvc/server/serverCpt.cpp +5 -6
  93. data/source/bzs/rtl/benchmark.cpp +2 -2
  94. data/source/bzs/rtl/stringBuffers.cpp +3 -3
  95. data/source/bzs/rtl/stringBuffers.h +2 -2
  96. data/source/bzs/test/tdclatl/bench_query_atl.js +92 -99
  97. data/source/bzs/test/tdclatl/test_query_atl.js +224 -115
  98. data/source/bzs/test/tdclphp/bench.php +126 -101
  99. data/source/bzs/test/tdclphp/transactd_Test.php +1122 -158
  100. data/source/bzs/test/tdclrb/bench_tdclcpp.rb +12 -14
  101. data/source/bzs/test/tdclrb/transactd_spec.rb +1127 -142
  102. data/source/bzs/test/transactdBench/query_bench.cpp +32 -15
  103. data/source/bzs/test/transactdBench/scaling_bench.cpp +32 -7
  104. data/source/bzs/test/transactdBench/transactdBench.cpp +1 -1
  105. data/source/bzs/test/transactdBench/workerBase.h +46 -0
  106. data/source/bzs/test/transactdBench/workerMySQLImple.h +15 -7
  107. data/source/bzs/test/transactdBench/workerTransactdImple.h +10 -18
  108. data/source/bzs/test/trdclengn/test_trdclengn.cpp +1487 -174
  109. data/source/global/ormsrcgen/main.cpp +2 -0
  110. data/source/global/tdclatl/Database.cpp +2 -2
  111. data/source/global/tdclatl/Database.h +1 -1
  112. data/source/global/tdclatl/FieldDefs.cpp +0 -3
  113. data/source/global/tdclatl/PooledDbManager.cpp +2 -2
  114. data/source/global/tdclatl/PooledDbManager.h +1 -1
  115. data/source/global/tdclatl/PreparedQuery.cpp +53 -0
  116. data/source/global/tdclatl/PreparedQuery.h +61 -0
  117. data/source/global/tdclatl/QueryBase.cpp +2 -1
  118. data/source/global/tdclatl/QueryBase.h +1 -1
  119. data/source/global/tdclatl/Record.cpp +3 -15
  120. data/source/global/tdclatl/Recordset.cpp +15 -10
  121. data/source/global/tdclatl/Recordset.h +3 -0
  122. data/source/global/tdclatl/Table.cpp +42 -7
  123. data/source/global/tdclatl/Table.h +3 -1
  124. data/source/global/tdclatl/activeTable.cpp +264 -76
  125. data/source/global/tdclatl/activeTable.h +12 -3
  126. data/source/global/tdclatl/tdclatl.idl +92 -10
  127. data/source/linux/charsetConvert.h +7 -7
  128. data/transactd.gemspec +14 -27
  129. metadata +18 -27
  130. data/bin/common/tdclc_32_2_0.dll +0 -0
  131. data/bin/common/tdclc_64_2_0.dll +0 -0
  132. data/build/swig/php/generate.cmake.in +0 -56
  133. data/build/swig/php/generate.cmd.in +0 -47
  134. data/build/swig/php/php.swg +0 -197
  135. data/build/swig/php/transactd.no_yield.php +0 -4494
  136. data/build/swig/php/transactd.no_yield.php.git.patch +0 -685
  137. data/build/swig/php/transactd.no_yield.php.patch +0 -685
  138. data/build/swig/php/transactd.yield.php +0 -4461
  139. data/build/swig/php/transactd.yield.php.git.patch +0 -652
  140. data/build/swig/php/transactd.yield.php.patch +0 -652
  141. data/build/swig/ruby/generate.cmake.in +0 -35
  142. data/build/swig/ruby/generate.cmd.in +0 -19
  143. data/build/tdclc/BUILDNUMBER.txt +0 -1
  144. data/build/tdclcpp/BUILDNUMBER.txt +0 -1
  145. data/build/tdclrb/BUILDNUMBER.txt +0 -1
  146. data/build/tdclrb/GEM_RELEASE_VERSION +0 -1
@@ -1,652 +0,0 @@
1
- diff --git transactd.yield.php transactd.yield.php
2
- index 080159f..212ef62 100644
3
- --- transactd.yield.php
4
- +++ transactd.yield.php
5
- @@ -1,4 +1,9 @@
6
- <?php
7
- +//
8
- +// Transactd Client for PHP
9
- +// ( YIELD-VERSION : for PHP 5.5.x or later )
10
- +//
11
- +namespace BizStation\Transactd;
12
-
13
- /* ----------------------------------------------------------------------------
14
- * This file was automatically generated by SWIG (http://www.swig.org).
15
- @@ -2342,12 +2347,7 @@ class database extends nsdatabase {
16
-
17
- function __clone() {
18
- $r=database___clone($this->_cPtr);
19
- - if (is_resource($r)) {
20
- - $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
21
- - if (class_exists($c)) return new $c($r);
22
- - return new database($r);
23
- - }
24
- - return $r;
25
- + $this->__construct($r);
26
- }
27
-
28
- function create($uri,$type=0) {
29
- @@ -2619,10 +2619,111 @@ class btrTimeStamp {
30
- }
31
- }
32
-
33
- -class fielddefs {
34
- +abstract class RangeIterator implements \Iterator {
35
- + protected $_position = 0;
36
- + protected $_start = -1;
37
- + protected $_end = -1;
38
- +
39
- + function __construct($start, $end) {
40
- + $this->_position = 0;
41
- + $this->_start = $start;
42
- + $this->_end = $end;
43
- + }
44
- +
45
- + public function rewind() {
46
- + $this->_position = $this->_start;
47
- + }
48
- +
49
- + public function valid() {
50
- + return $this->_position <= $this->_end;
51
- + }
52
- +
53
- + abstract public function current();
54
- +
55
- + public function key() {
56
- + return $this->_position;
57
- + }
58
- +
59
- + public function next() {
60
- + $this->_position++;
61
- + }
62
- +}
63
- +
64
- +class fielddefsIterator extends RangeIterator {
65
- + private $_fielddefs_ptr = NULL;
66
- +
67
- + function __construct($fielddefs_ptr, $start, $end) {
68
- + $this->_fielddefs_ptr = $fielddefs_ptr;
69
- + parent::__construct($start, $end);
70
- + }
71
- +
72
- + public function current() {
73
- + $r = fielddefs_getFielddef($this->_fielddefs_ptr,$this->_position);
74
- + if (is_resource($r))
75
- + return new fielddef($r);
76
- + return $r;
77
- + }
78
- +}
79
- +
80
- +class fielddefs implements \ArrayAccess, \Countable, \IteratorAggregate {
81
- public $_cPtr=null;
82
- protected $_pData=array();
83
-
84
- + // IteratorAggregate
85
- + public function getIterator() {
86
- + return new fielddefsIterator($this->_cPtr, 0, (fielddefs_size($this->_cPtr) - 1));
87
- + }
88
- +
89
- + // ArrayAccess
90
- + public function offsetExists($offset) {
91
- + return (\gettype($offset) === "integer" &&
92
- + $offset >= 0 && $offset < fielddefs_size($this->_cPtr));
93
- + }
94
- +
95
- + public function offsetGet($offset) {
96
- + if (\gettype($offset) !== "integer" ||
97
- + $offset < 0 || $offset >= fielddefs_size($this->_cPtr))
98
- + throw new \OutOfRangeException();
99
- + $r = fielddefs_getFielddef($this->_cPtr,$offset);
100
- + if (is_resource($r))
101
- + return new fielddef($r);
102
- + return $r;
103
- + }
104
- +
105
- + public function offsetSet($offset, $value) {
106
- + throw new \BadMethodCallException();
107
- + }
108
- +
109
- + public function offsetUnset($offset) {
110
- + throw new \BadMethodCallException();
111
- + }
112
- +
113
- + // Countable
114
- + public function count() {
115
- + return fielddefs_size($this->_cPtr);
116
- + }
117
- +
118
- + // Generator
119
- + function range($start = null, $end = null) {
120
- + $count = fielddefs_size($this->_cPtr);
121
- + if (\gettype($start) !== 'integer' || $start < 0) {
122
- + $i = 0;
123
- + } else {
124
- + $i = $start;
125
- + }
126
- + if (\gettype($end) !== 'integer' || $end < 0 || $end >= $count) {
127
- + $end = $count - 1;
128
- + }
129
- + while ($i <= $end) {
130
- + $r = fielddefs_getFielddef($this->_cPtr, $i);
131
- + if (is_resource($r))
132
- + yield new fielddef($r);
133
- + else
134
- + yield $r;
135
- + $i++;
136
- + }
137
- + }
138
- +
139
- function __set($var,$value) {
140
- if ($var === 'thisown') return swig_transactd_alter_newobject($this->_cPtr,$value);
141
- $this->_pData[$var] = $value;
142
- @@ -2640,12 +2741,7 @@ class fielddefs {
143
-
144
- function __clone() {
145
- $r=fielddefs___clone($this->_cPtr);
146
- - if (is_resource($r)) {
147
- - $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
148
- - if (class_exists($c)) return new $c($r);
149
- - return new fielddefs($r);
150
- - }
151
- - return $r;
152
- + $this->__construct($r);
153
- }
154
-
155
- function indexByName($name) {
156
- @@ -2680,6 +2776,51 @@ class fielddefs {
157
- }
158
-
159
- class field {
160
- + public function getFV() {
161
- + switch ($this->type()) {
162
- + case transactd::ft_integer:
163
- + case transactd::ft_uinteger:
164
- + case transactd::ft_autoinc:
165
- + case transactd::ft_autoIncUnsigned:
166
- + case transactd::ft_logical:
167
- + case transactd::ft_bit:
168
- + return $this->i64();
169
- + case transactd::ft_float:
170
- + case transactd::ft_decimal:
171
- + case transactd::ft_money:
172
- + case transactd::ft_numeric:
173
- + case transactd::ft_bfloat:
174
- + case transactd::ft_numericsts:
175
- + case transactd::ft_numericsa:
176
- + case transactd::ft_currency:
177
- + return $this->d();
178
- + case transactd::ft_mychar:
179
- + case transactd::ft_myvarchar:
180
- + case transactd::ft_mywchar:
181
- + case transactd::ft_mywvarchar:
182
- + case transactd::ft_mytext:
183
- + case transactd::ft_mydate:
184
- + case transactd::ft_mytime:
185
- + case transactd::ft_mydatetime:
186
- + case transactd::ft_mytimestamp:
187
- + case transactd::ft_date:
188
- + case transactd::ft_time:
189
- + case transactd::ft_datetime:
190
- + case transactd::ft_timestamp:
191
- + case transactd::ft_note:
192
- + case transactd::ft_zstring:
193
- + return $this->c_str();
194
- + case transactd::ft_string:
195
- + case transactd::ft_myvarbinary:
196
- + case transactd::ft_mywvarbinary:
197
- + case transactd::ft_myblob:
198
- + return $this->getBin();
199
- + default:
200
- + return $this->c_str();
201
- + }
202
- + return null;
203
- + }
204
- +
205
- public $_cPtr=null;
206
- protected $_pData=array();
207
-
208
- @@ -2766,7 +2907,141 @@ class field {
209
- }
210
- }
211
-
212
- -abstract class Record {
213
- +class RecordIterator implements \Iterator {
214
- + private $_record_cPtr = null;
215
- + private $_position = 0;
216
- + private $_count = -1;
217
- + private $_field = null;
218
- + private $_fielddefs = null;
219
- +
220
- + function __construct($record_cPtr, $fielddefs) {
221
- + $this->_record_cPtr = $record_cPtr;
222
- + $this->_position = 0;
223
- + $this->_count = Record_size($record_cPtr);
224
- + $this->_fielddefs = $fielddefs;
225
- + $this->_field = new field();
226
- + }
227
- +
228
- + public function rewind() {
229
- + $this->_position = 0;
230
- + }
231
- +
232
- + public function valid() {
233
- + return $this->_position < $this->_count;
234
- + }
235
- +
236
- + public function current() {
237
- + Record_getFieldByIndexRef($this->_record_cPtr, $this->_position, $this->_field);
238
- + return $this->_field->getFV();
239
- + }
240
- +
241
- + public function key() {
242
- + return $this->_fielddefs->getFielddef($this->_position)->name();
243
- + }
244
- +
245
- + public function next() {
246
- + $this->_position++;
247
- + }
248
- +}
249
- +
250
- +class Record implements \ArrayAccess, \Countable, \IteratorAggregate {
251
- + protected $_field = null;
252
- + protected $_fielddefs = null;
253
- +
254
- + function __clone() {
255
- + $this->_field = new field();
256
- + }
257
- +
258
- + // IteratorAggregate
259
- + public function getIterator() {
260
- + return new RecordIterator($this->_cPtr, $this->_fielddefs);
261
- + }
262
- +
263
- + // ArrayAccess
264
- + public function offsetExists($offset) {
265
- + switch (\gettype($offset)) {
266
- + case "integer":
267
- + return $offset >= 0 && $offset < $this->count();
268
- + case "string":
269
- + return Record_indexByName($this->_cPtr, $offset) >= 0;
270
- + default:
271
- + return false;
272
- + }
273
- + }
274
- +
275
- + public function offsetGet($offset) {
276
- + switch (\gettype($offset)) {
277
- + case "integer":
278
- + Record_getFieldByIndexRef($this->_cPtr, $offset, $this->_field);
279
- + break;
280
- + case "string":
281
- + Record_getFieldByNameRef($this->_cPtr, $offset, $this->_field);
282
- + break;
283
- + default:
284
- + throw new \OutOfRangeException();
285
- + }
286
- + return $this->_field->getFV();
287
- + }
288
- +
289
- + public function offsetSet($offset, $value) {
290
- + throw new \BadMethodCallException();
291
- + }
292
- +
293
- + public function offsetUnset($offset) {
294
- + throw new \BadMethodCallException();
295
- + }
296
- +
297
- + // Countable
298
- + public function count() {
299
- + return Record_size($this->_cPtr);
300
- + }
301
- +
302
- + // Generator
303
- + function keys() {
304
- + $count = Record_size($this->_cPtr);
305
- + for ($i = 0; $i < $count; $i++) {
306
- + yield $this->_fielddefs->getFielddef($i)->name();
307
- + }
308
- + }
309
- +
310
- + function values() {
311
- + $count = Record_size($this->_cPtr);
312
- + for ($i = 0; $i < $count; $i++) {
313
- + Record_getFieldByIndexRef($this->_cPtr, $i, $this->_field);
314
- + yield $this->_field->getFV();
315
- + }
316
- + }
317
- +
318
- + // toArray
319
- + function keysArray() {
320
- + $ret = array();
321
- + $count = Record_size($this->_cPtr);
322
- + for ($i = 0; $i < $count; $i++) {
323
- + $ret[] = $this->_fielddefs->getFielddef($i)->name();
324
- + }
325
- + return $ret;
326
- + }
327
- +
328
- + function valuesArray() {
329
- + $ret = array();
330
- + $count = Record_size($this->_cPtr);
331
- + for ($i = 0; $i < $count; $i++) {
332
- + Record_getFieldByIndexRef($this->_cPtr, $i, $this->_field);
333
- + $ret[] = $this->_field->getFV();
334
- + }
335
- + return $ret;
336
- + }
337
- +
338
- + function toArray() {
339
- + $ret = array();
340
- + $count = Record_size($this->_cPtr);
341
- + for ($i = 0; $i < $count; $i++) {
342
- + Record_getFieldByIndexRef($this->_cPtr, $i, $this->_field);
343
- + $ret[$this->_fielddefs->getFielddef($i)->name()] = $this->_field->getFV();
344
- + }
345
- + return $ret;
346
- + }
347
- +
348
- public $_cPtr=null;
349
- protected $_pData=array();
350
-
351
- @@ -2786,6 +3061,8 @@ abstract class Record {
352
- }
353
- function __construct($h) {
354
- $this->_cPtr=$h;
355
- + $this->_fielddefs = $this->fieldDefs();
356
- + $this->_field = new field();
357
- }
358
-
359
- function isInvalidRecord() {
360
- @@ -2863,14 +3140,31 @@ class memoryRecord extends Record {
361
-
362
- function __construct($fds) {
363
- if (is_resource($fds) && get_resource_type($fds) === '_p_bzs__db__protocol__tdap__client__memoryRecord') {
364
- + parent::__construct($fds);
365
- $this->_cPtr=$fds;
366
- return;
367
- }
368
- $this->_cPtr=new_memoryRecord($fds);
369
- + parent::__construct($this->_cPtr);
370
- }
371
- }
372
-
373
- class writableRecord extends memoryRecord {
374
- + // override ArrayAccess method (set value).
375
- + public function offsetSet($offset, $value) {
376
- + $this->offsetGet($offset);
377
- + switch ($this->_field->type()) {
378
- + case transactd::ft_string:
379
- + case transactd::ft_myvarbinary:
380
- + case transactd::ft_mywvarbinary:
381
- + case transactd::ft_myblob:
382
- + $this->_field->setFV($value, strlen($value));
383
- + break;
384
- + default:
385
- + $this->_field->setFV($value);
386
- + }
387
- + }
388
- +
389
- public $_cPtr=null;
390
-
391
- function __set($var,$value) {
392
- @@ -2889,6 +3183,8 @@ class writableRecord extends memoryRecord {
393
- }
394
- function __construct($h) {
395
- $this->_cPtr=$h;
396
- + $this->_fielddefs = $this->fieldDefs();
397
- + $this->_field = new field();
398
- }
399
-
400
- function read($KeysetAlrady=false) {
401
- @@ -3225,6 +3521,7 @@ class recordsetQuery {
402
-
403
- abstract class groupFuncBase extends recordsetQuery {
404
- public $_cPtr=null;
405
- + protected $resultName = '';
406
-
407
- function __set($var,$value) {
408
- if ($var === 'thisown') return swig_transactd_alter_newobject($this->_cPtr,$value);
409
- @@ -3259,7 +3556,8 @@ abstract class groupFuncBase extends recordsetQuery {
410
- }
411
-
412
- function setResultName($v) {
413
- - groupFuncBase_setResultName($this->_cPtr,$v);
414
- + $this->resultName = $v;
415
- + groupFuncBase_setResultName($this->_cPtr,$this->resultName);
416
- }
417
-
418
- function resultKey() {
419
- @@ -3372,6 +3670,7 @@ class groupQuery {
420
-
421
- class sum extends groupFuncBase {
422
- public $_cPtr=null;
423
- + protected $targetNames = null;
424
-
425
- function __set($var,$value) {
426
- if ($var === 'thisown') return swig_transactd_alter_newobject($this->_cPtr,$value);
427
- @@ -3399,9 +3698,11 @@ class sum extends groupFuncBase {
428
- $this->_cPtr=$targetNames;
429
- return;
430
- }
431
- + $this->targetNames = $targetNames;
432
- + $this->resultName = $resultName;
433
- switch (func_num_args()) {
434
- - case 1: $this->_cPtr=new_sum($targetNames); break;
435
- - default: $this->_cPtr=new_sum($targetNames,$resultName);
436
- + case 1: $this->_cPtr=new_sum($this->targetNames); break;
437
- + default: $this->_cPtr=new_sum($this->targetNames,$this->resultName);
438
- }
439
- }
440
- }
441
- @@ -3435,7 +3736,8 @@ class count extends groupFuncBase {
442
- $this->_cPtr=$resultName;
443
- return;
444
- }
445
- - $this->_cPtr=new_count($resultName);
446
- + $this->resultName = $resultName;
447
- + $this->_cPtr=new_count($this->resultName);
448
- }
449
- }
450
-
451
- @@ -3468,9 +3770,11 @@ class avg extends sum {
452
- $this->_cPtr=$targetNames;
453
- return;
454
- }
455
- + $this->targetNames = $targetNames;
456
- + $this->resultName = $resultName;
457
- switch (func_num_args()) {
458
- - case 1: $this->_cPtr=new_avg($targetNames); break;
459
- - default: $this->_cPtr=new_avg($targetNames,$resultName);
460
- + case 1: $this->_cPtr=new_avg($this->targetNames); break;
461
- + default: $this->_cPtr=new_avg($this->targetNames,$this->resultName);
462
- }
463
- }
464
- }
465
- @@ -3504,9 +3808,11 @@ class min extends sum {
466
- $this->_cPtr=$targetNames;
467
- return;
468
- }
469
- + $this->targetNames = $targetNames;
470
- + $this->resultName = $resultName;
471
- switch (func_num_args()) {
472
- - case 1: $this->_cPtr=new_min($targetNames); break;
473
- - default: $this->_cPtr=new_min($targetNames,$resultName);
474
- + case 1: $this->_cPtr=new_min($this->targetNames); break;
475
- + default: $this->_cPtr=new_min($this->targetNames,$this->resultName);
476
- }
477
- }
478
- }
479
- @@ -3540,14 +3846,130 @@ class max extends sum {
480
- $this->_cPtr=$targetNames;
481
- return;
482
- }
483
- + $this->targetNames = $targetNames;
484
- + $this->resultName = $resultName;
485
- switch (func_num_args()) {
486
- - case 1: $this->_cPtr=new_max($targetNames); break;
487
- - default: $this->_cPtr=new_max($targetNames,$resultName);
488
- + case 1: $this->_cPtr=new_max($this->targetNames); break;
489
- + default: $this->_cPtr=new_max($this->targetNames,$this->resultName);
490
- + }
491
- + }
492
- +}
493
- +
494
- +class RecordsetIterator implements \SeekableIterator {
495
- + private $_recordset_cPtr = null;
496
- + private $_position = 0;
497
- + private $_fieldsBase_p_p = null;
498
- + private $_record = null;
499
- + private $_count = -1;
500
- +
501
- + function __construct($recordset_cPtr, $fielddefs) {
502
- + $this->_recordset_cPtr = $recordset_cPtr;
503
- + $this->_position = 0;
504
- + $this->_fieldsBase_p_p = new_fieldsBase_p_p();
505
- + $this->_count = Recordset_count($recordset_cPtr);
506
- + $this->_record = new Record(memoryRecord::createRecord($fielddefs));
507
- + }
508
- +
509
- + function __destruct() {
510
- + delete_fieldsBase_p_p($this->_fieldsBase_p_p);
511
- + }
512
- +
513
- + public function rewind() {
514
- + $this->_position = 0;
515
- + }
516
- +
517
- + public function valid() {
518
- + return $this->_position < $this->_count;
519
- + }
520
- +
521
- + public function current() {
522
- + Recordset_getRow($this->_recordset_cPtr, $this->_position, $this->_fieldsBase_p_p);
523
- + $this->_record->_cPtr = fieldsBase_p_p_value($this->_fieldsBase_p_p);
524
- + return $this->_record;
525
- + }
526
- +
527
- + public function key() {
528
- + return $this->_position;
529
- + }
530
- +
531
- + public function next() {
532
- + $this->_position++;
533
- + }
534
- +
535
- + public function seek($position) {
536
- + if ($position < 0 || $position >= $this->_count) {
537
- + throw new \OutOfBoundsException("invalid seek position ($position)");
538
- }
539
- + $this->_position = $position;
540
- }
541
- }
542
-
543
- -class Recordset {
544
- +class Recordset implements \ArrayAccess, \Countable, \IteratorAggregate {
545
- + private $_fieldsBase_p_p = null;
546
- + private $_record = null;
547
- +
548
- + function __destruct() {
549
- + transactd::delete_fieldsBase_p_p($this->_fieldsBase_p_p);
550
- + }
551
- +
552
- + // IteratorAggregate
553
- + public function getIterator() {
554
- + return new RecordsetIterator($this->_cPtr, $this->fieldDefs());
555
- + }
556
- +
557
- + // ArrayAccess
558
- + public function offsetExists($offset) {
559
- + return \gettype($offset) !== 'integer' && $offset >= 0 && $offset < $this->count();
560
- + }
561
- +
562
- + public function offsetGet($offset) {
563
- + Recordset_getRow($this->_cPtr, $offset, $this->_fieldsBase_p_p);
564
- + $this->_record->_cPtr = fieldsBase_p_p_value($this->_fieldsBase_p_p);
565
- + return $this->_record;
566
- + }
567
- +
568
- + public function offsetSet($offset, $value) {
569
- + throw new \BadMethodCallException();
570
- + }
571
- +
572
- + public function offsetUnset($offset) {
573
- + throw new \BadMethodCallException();
574
- + }
575
- +
576
- + // random access
577
- + function first() {
578
- + if ($this->count() <= 0) {
579
- + throw new \OutOfBoundsException('no records in recordset');
580
- + }
581
- + return $this->offsetGet(0);
582
- + }
583
- +
584
- + function last() {
585
- + if ($this->count() <= 0) {
586
- + throw new \OutOfBoundsException('no records in recordset');
587
- + }
588
- + return $this->offsetGet($this->count() - 1);
589
- + }
590
- +
591
- + // Generator
592
- + function range($start = null, $end = null) {
593
- + $count = $this->count();
594
- + if (\gettype($start) !== 'integer' || $start < 0) {
595
- + $i = 0;
596
- + } else {
597
- + $i = $start;
598
- + }
599
- + if (\gettype($end) !== 'integer' || $end < 0 || $end >= $count) {
600
- + $end = $count - 1;
601
- + }
602
- + while ($i <= $end) {
603
- + Recordset_getRow($this->_cPtr, $i, $this->_fieldsBase_p_p);
604
- + $this->_record->_cPtr = fieldsBase_p_p_value($this->_fieldsBase_p_p);
605
- + yield $this->_record;
606
- + $i++;
607
- + }
608
- + }
609
- +
610
- public $_cPtr=null;
611
- protected $_pData=array();
612
-
613
- @@ -3569,11 +3991,12 @@ class Recordset {
614
- function __clone() {
615
- $r=Recordset___clone($this->_cPtr);
616
- if (is_resource($r)) {
617
- - $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
618
- - if (class_exists($c)) return new $c($r);
619
- - return new Recordset($r);
620
- + $this->_cPtr = $r;
621
- + } else {
622
- + $this->_cPtr = $r->_cPtr;
623
- }
624
- - return $r;
625
- + $this->_fieldsBase_p_p = new_fieldsBase_p_p();
626
- + $this->_record = new Record(memoryRecord::createRecord($this->fieldDefs()));
627
- }
628
-
629
- function size() {
630
- @@ -3697,9 +4120,13 @@ class Recordset {
631
- function __construct($res=null) {
632
- if (is_resource($res) && get_resource_type($res) === '_p_bzs__db__protocol__tdap__client__recordset') {
633
- $this->_cPtr=$res;
634
- + $this->_fieldsBase_p_p = new_fieldsBase_p_p();
635
- + $this->_record = new Record(memoryRecord::createRecord($this->fieldDefs()));
636
- return;
637
- }
638
- $this->_cPtr=new_Recordset();
639
- + $this->_fieldsBase_p_p = new_fieldsBase_p_p();
640
- + $this->_record = new Record(memoryRecord::createRecord($this->fieldDefs()));
641
- }
642
- }
643
-
644
- @@ -3831,7 +4258,7 @@ class activeTable {
645
- }
646
- }
647
-
648
- - function __construct($mgr_or_db,$tableName) {
649
- + function __construct($mgr_or_db,$tableName=null) {
650
- if (is_resource($mgr_or_db) && get_resource_type($mgr_or_db) === '_p_bzs__db__protocol__tdap__client__activeTable') {
651
- $this->_cPtr=$mgr_or_db;
652
- return;