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