transactd 3.2.1 → 3.3.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.
- checksums.yaml +4 -4
- data/bin/common/{tdclc_32_3_2.dll → tdclc_32_3_3.dll} +0 -0
- data/bin/common/{tdclc_64_3_2.dll → tdclc_64_3_3.dll} +0 -0
- data/build/swig/ruby/tdclrb_wrap.cpp +117 -549
- data/build/tdclc/tdclc.cbproj +1 -1
- data/build/tdclc/tdclc.rc +4 -4
- data/build/tdclcpp/tdclcpp.rc +4 -4
- data/build/tdclcpp/tdclcpp_bc.cbproj +1 -1
- data/build/tdclrb/tdclrb.rc +4 -4
- data/source/bzs/db/IBlobBuffer.h +2 -1
- data/source/bzs/db/blobBuffer.h +11 -10
- data/source/bzs/db/engine/mysql/database.cpp +13 -25
- data/source/bzs/db/engine/mysql/database.h +1 -8
- data/source/bzs/db/engine/mysql/mysqlProtocol.cpp +85 -68
- data/source/bzs/db/protocol/tdap/client/connMgr.cpp +99 -2
- data/source/bzs/db/protocol/tdap/client/connMgr.h +28 -2
- data/source/bzs/db/protocol/tdap/client/nsTable.cpp +21 -2
- data/source/bzs/db/protocol/tdap/client/nsTable.h +2 -1
- data/source/bzs/db/protocol/tdap/client/serializer.cpp +2 -2
- data/source/bzs/db/protocol/tdap/client/table.cpp +4 -19
- data/source/bzs/db/protocol/tdap/client/table.h +1 -2
- data/source/bzs/db/protocol/tdap/client/trdboostapiInternal.h +7 -0
- data/source/bzs/db/protocol/tdap/myDateTime.cpp +3 -2
- data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.cpp +49 -32
- data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.h +8 -6
- data/source/bzs/db/protocol/tdap/tdapSchema.h +9 -5
- data/source/bzs/db/protocol/tdap/tdapcapi.h +15 -5
- data/source/bzs/db/transactd/connManager.cpp +32 -8
- data/source/bzs/db/transactd/connManager.h +3 -2
- data/source/bzs/db/transactd/connectionRecord.h +37 -9
- data/source/bzs/db/transactd/transactd.cpp +21 -3
- data/source/bzs/test/tdclatl/test_v3.js +14 -3
- data/source/bzs/test/tdclphp/transactd_Test.php +3 -1
- data/source/bzs/test/tdclphp/transactd_v3_Test.php +11 -2
- data/source/bzs/test/tdclrb/transactd_spec.rb +3 -1
- data/source/bzs/test/tdclrb/transactd_v3_spec.rb +11 -1
- data/source/bzs/test/trdclengn/test_trdclengn.cpp +3 -1
- data/source/global/tdclatl/ConnMgr.cpp +20 -0
- data/source/global/tdclatl/ConnMgr.h +2 -0
- data/source/global/tdclatl/ConnRecord.cpp +13 -5
- data/source/global/tdclatl/ConnRecord.h +1 -0
- data/source/global/tdclatl/ConnRecords.h +2 -1
- data/source/global/tdclatl/tdclatl.idl +7 -0
- metadata +4 -4
data/build/tdclc/tdclc.cbproj
CHANGED
@@ -62,7 +62,7 @@
|
|
62
62
|
<VerInfo_Locale>1041</VerInfo_Locale>
|
63
63
|
<BRCC_CompilerToUse>rc</BRCC_CompilerToUse>
|
64
64
|
<BRCC_IncludePath>$(BDSINCLUDE)\windows\sdk;$(BRCC_IncludePath)</BRCC_IncludePath>
|
65
|
-
<DllSuffix>
|
65
|
+
<DllSuffix>_3_3</DllSuffix>
|
66
66
|
<DynamicRTL>false</DynamicRTL>
|
67
67
|
<BPILibOutputDir>..\..\lib</BPILibOutputDir>
|
68
68
|
<BCC_PCHUsage>None</BCC_PCHUsage>
|
data/build/tdclc/tdclc.rc
CHANGED
@@ -29,8 +29,8 @@
|
|
29
29
|
//
|
30
30
|
|
31
31
|
VS_VERSION_INFO VERSIONINFO
|
32
|
-
FILEVERSION 3,
|
33
|
-
PRODUCTVERSION 3,
|
32
|
+
FILEVERSION 3,3,0,198
|
33
|
+
PRODUCTVERSION 3,3,0,198
|
34
34
|
FILEFLAGSMASK 0x3fL
|
35
35
|
#ifdef _DEBUG
|
36
36
|
FILEFLAGS 0x1L
|
@@ -47,9 +47,9 @@ BEGIN
|
|
47
47
|
BEGIN
|
48
48
|
VALUE "CompanyName", "BizStation Corp."
|
49
49
|
VALUE "FileDescription", "Transactd C client"
|
50
|
-
VALUE "FileVersion", "3.
|
50
|
+
VALUE "FileVersion", "3.3.0.198"
|
51
51
|
VALUE "LegalCopyright", "Copyright(C) 2016 BizStation Corp"
|
52
|
-
VALUE "ProductVersion", "3.
|
52
|
+
VALUE "ProductVersion", "3.3.0.198"
|
53
53
|
VALUE "ProductName", "Transactd Client (GPL V2)"
|
54
54
|
END
|
55
55
|
END
|
data/build/tdclcpp/tdclcpp.rc
CHANGED
@@ -29,8 +29,8 @@
|
|
29
29
|
//
|
30
30
|
|
31
31
|
VS_VERSION_INFO VERSIONINFO
|
32
|
-
FILEVERSION 3,
|
33
|
-
PRODUCTVERSION 3,
|
32
|
+
FILEVERSION 3,3,0,198
|
33
|
+
PRODUCTVERSION 3,3,0,198
|
34
34
|
FILEFLAGSMASK 0x3fL
|
35
35
|
#ifdef _DEBUG
|
36
36
|
FILEFLAGS 0x1L
|
@@ -47,9 +47,9 @@ BEGIN
|
|
47
47
|
BEGIN
|
48
48
|
VALUE "CompanyName", "BizStation Corp."
|
49
49
|
VALUE "FileDescription", "Transactd C++ client"
|
50
|
-
VALUE "FileVersion", "3.
|
50
|
+
VALUE "FileVersion", "3.3.0.198"
|
51
51
|
VALUE "LegalCopyright", "Copyright(C) 2016 BizStation Corp"
|
52
|
-
VALUE "ProductVersion", "3.
|
52
|
+
VALUE "ProductVersion", "3.3.0.198"
|
53
53
|
VALUE "ProductName", "Transactd Client (GPL V2)"
|
54
54
|
END
|
55
55
|
END
|
@@ -153,7 +153,7 @@
|
|
153
153
|
<BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
|
154
154
|
<BCC_ExtendedErrorInfo>true</BCC_ExtendedErrorInfo>
|
155
155
|
<TD_VER_MAJOR>3</TD_VER_MAJOR>
|
156
|
-
<TD_VER_MINOR>
|
156
|
+
<TD_VER_MINOR>3</TD_VER_MINOR>
|
157
157
|
<DllSuffix>$(TD_VER_MAJOR)_$(TD_VER_MINOR)</DllSuffix>
|
158
158
|
<TD_CPU>32</TD_CPU>
|
159
159
|
</PropertyGroup>
|
data/build/tdclrb/tdclrb.rc
CHANGED
@@ -29,8 +29,8 @@
|
|
29
29
|
//
|
30
30
|
|
31
31
|
VS_VERSION_INFO VERSIONINFO
|
32
|
-
FILEVERSION 3,
|
33
|
-
PRODUCTVERSION 3,
|
32
|
+
FILEVERSION 3,3,0,198
|
33
|
+
PRODUCTVERSION 3,3,0,198
|
34
34
|
FILEFLAGSMASK 0x3fL
|
35
35
|
#ifdef _DEBUG
|
36
36
|
FILEFLAGS 0x1L
|
@@ -47,9 +47,9 @@ BEGIN
|
|
47
47
|
BEGIN
|
48
48
|
VALUE "CompanyName", "BizStation Corp."
|
49
49
|
VALUE "FileDescription", "Transactd Ruby client"
|
50
|
-
VALUE "FileVersion", "3.
|
50
|
+
VALUE "FileVersion", "3.3.0.198"
|
51
51
|
VALUE "LegalCopyright", "Copyright(C) 2016 BizStation Corp"
|
52
|
-
VALUE "ProductVersion", "3.
|
52
|
+
VALUE "ProductVersion", "3.3.0.198"
|
53
53
|
VALUE "ProductName", "Transactd Client (GPL V2)"
|
54
54
|
END
|
55
55
|
END
|
data/source/bzs/db/IBlobBuffer.h
CHANGED
@@ -18,10 +18,11 @@
|
|
18
18
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
19
19
|
02111-1307, USA.
|
20
20
|
=================================================================*/
|
21
|
-
|
21
|
+
//#include <boost/asio/buffer.hpp>
|
22
22
|
#include <vector>
|
23
23
|
#include "blobStructs.h"
|
24
24
|
|
25
|
+
namespace boost{namespace asio{class const_buffer;}}
|
25
26
|
namespace bzs
|
26
27
|
{
|
27
28
|
namespace db
|
data/source/bzs/db/blobBuffer.h
CHANGED
@@ -22,6 +22,7 @@
|
|
22
22
|
#include "IBlobBuffer.h"
|
23
23
|
#include <assert.h>
|
24
24
|
#include <boost/shared_array.hpp>
|
25
|
+
#include <boost/asio/buffer.hpp>
|
25
26
|
|
26
27
|
extern unsigned int g_pipeCommSharememSize;
|
27
28
|
#define FILE_MAP_SIZE (g_pipeCommSharememSize - 1024)
|
@@ -109,11 +110,11 @@ public:
|
|
109
110
|
* result buffer image
|
110
111
|
* ---------------------------
|
111
112
|
* n record image
|
112
|
-
* 2
|
113
|
-
*
|
114
|
-
* n(dataLength)
|
115
|
-
* 2
|
116
|
-
* 2
|
113
|
+
* 2 fieldNum
|
114
|
+
* 4 dataLength
|
115
|
+
* n(dataLength) data
|
116
|
+
* 2 null terminate
|
117
|
+
* 2 fieldNum ...
|
117
118
|
* ----------------------------
|
118
119
|
*/
|
119
120
|
|
@@ -165,11 +166,11 @@ public:
|
|
165
166
|
* result buffer image
|
166
167
|
* ---------------------------
|
167
168
|
* n record image
|
168
|
-
* 2
|
169
|
-
*
|
170
|
-
* n(dataLength)
|
171
|
-
* 2
|
172
|
-
* 2
|
169
|
+
* 2 fieldNum
|
170
|
+
* 4 dataLength
|
171
|
+
* n(dataLength) data
|
172
|
+
* 2 null terminate
|
173
|
+
* 2 fieldNum ...
|
173
174
|
* ----------------------------
|
174
175
|
*/
|
175
176
|
unsigned int writeBuffer(unsigned char* buffer, unsigned int maxsize,
|
@@ -290,11 +290,19 @@ void database::addDbName(const std::string& dbname)
|
|
290
290
|
secx->security_ctx.restore_security_context(m_thd, &secx->security_ctx);
|
291
291
|
|
292
292
|
//Get Grant
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
293
|
+
if (m_backup_sctx->cp_master_accsess() == (ulong)~NO_ACCESS)
|
294
|
+
cp_security_ctx(m_thd)->skip_grants();
|
295
|
+
else
|
296
|
+
{
|
297
|
+
const char* user = m_backup_sctx->cp_priv_user();
|
298
|
+
const char* host = m_backup_sctx->cp_priv_host();
|
299
|
+
bool ret = ::setGrant(m_thd, host ? host : "", user ? user : "", dbname.c_str());
|
300
|
+
if (ret)
|
301
|
+
check_access(m_thd, SELECT_ACL, dbname.c_str(), &secx->privilege, NULL, false, true);
|
302
|
+
else
|
303
|
+
secx->privilege = 0;
|
304
|
+
}
|
305
|
+
//Restore current ctx
|
298
306
|
restoreSctx();
|
299
307
|
}
|
300
308
|
|
@@ -2639,26 +2647,6 @@ const char* table::valStr(int fieldNum, int& size)
|
|
2639
2647
|
return m_str.c_ptr();
|
2640
2648
|
}
|
2641
2649
|
|
2642
|
-
uint table::makeBlobFieldList(int fieldNum)
|
2643
|
-
{
|
2644
|
-
m_blobBuffer->clear();
|
2645
|
-
int st = fieldNum == -1 ? 0 : fieldNum;
|
2646
|
-
int en = fieldNum == -1 ? m_table->s->fields : fieldNum + 1;
|
2647
|
-
uint count = 0;
|
2648
|
-
for (int i = st; i < en; i++)
|
2649
|
-
{
|
2650
|
-
Field* fd = m_table->field[fieldNum];
|
2651
|
-
if (isBlobType(fd->type()))
|
2652
|
-
{
|
2653
|
-
m_blobBuffer->addBlob(blob_len(fd), fd->field_index,
|
2654
|
-
fd->ptr + blob_var_bytes(fd));
|
2655
|
-
count++;
|
2656
|
-
}
|
2657
|
-
}
|
2658
|
-
m_blobBuffer->setFieldCount(count);
|
2659
|
-
return count;
|
2660
|
-
}
|
2661
|
-
|
2662
2650
|
inline void setSegmentValue(const KEY_PART_INFO& segment, const std::string& v)
|
2663
2651
|
{
|
2664
2652
|
segment.field->set_notnull();
|
@@ -679,15 +679,8 @@ public:
|
|
679
679
|
void endBulkInsert();
|
680
680
|
|
681
681
|
inline TABLE* internalTable() { return m_table; }
|
682
|
-
/// for debuglog
|
683
|
-
const char* valStr(int index, int& size);
|
684
|
-
/// for debuglog
|
685
682
|
|
686
|
-
|
687
|
-
* @param fieldNum field index if it is -1 then all fields of cureent row;
|
688
|
-
* @return field count of listed.
|
689
|
-
*/
|
690
|
-
uint makeBlobFieldList(int fieldNum);
|
683
|
+
const char* valStr(int index, int& size);
|
691
684
|
|
692
685
|
inline void addBlobBuffer(int fieldNum)
|
693
686
|
{
|
@@ -22,9 +22,10 @@
|
|
22
22
|
#endif
|
23
23
|
|
24
24
|
#include "mysqlProtocol.h"
|
25
|
-
#include "mysqlThd.h"
|
26
25
|
#include <bzs/env/crosscompile.h>
|
27
26
|
#include <bzs/db/protocol/tdap/tdapcapi.h>
|
27
|
+
#include <bzs/db/IBlobBuffer.h>
|
28
|
+
#include "mysqlThd.h"
|
28
29
|
|
29
30
|
#if defined(USE_BINLOG_VAR) && (!defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 50600)
|
30
31
|
# include "sql/binlog.h"
|
@@ -46,28 +47,28 @@
|
|
46
47
|
|
47
48
|
class dummyProtocol : public Protocol_mysql
|
48
49
|
{
|
49
|
-
|
50
|
+
THD* m_thd;
|
50
51
|
Protocol_mysql* m_backup;
|
51
52
|
|
52
53
|
public:
|
53
54
|
#if defined(MYSQL_5_7)
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
inline dummyProtocol(THD *thd_arg) : Protocol_mysql()
|
56
|
+
{
|
57
|
+
m_thd = thd_arg;
|
57
58
|
m_backup = m_thd->get_protocol();
|
58
|
-
|
59
|
-
|
60
|
-
|
59
|
+
m_thd->set_protocol(this);
|
60
|
+
}
|
61
|
+
inline virtual ~dummyProtocol()
|
61
62
|
{
|
62
63
|
m_thd->set_protocol(m_backup);
|
63
64
|
}
|
64
65
|
#else
|
65
|
-
|
66
|
-
|
67
|
-
|
66
|
+
inline dummyProtocol(THD *thd_arg) : Protocol_mysql(thd_arg)
|
67
|
+
{
|
68
|
+
m_thd = thd_arg;
|
68
69
|
m_backup = m_thd->protocol;
|
69
70
|
m_thd->protocol = this;
|
70
|
-
|
71
|
+
}
|
71
72
|
inline virtual ~dummyProtocol()
|
72
73
|
{
|
73
74
|
m_thd->protocol = m_backup;
|
@@ -91,7 +92,7 @@ public:
|
|
91
92
|
const CHARSET_INFO* /*tocs*/){return false;}
|
92
93
|
|
93
94
|
virtual bool send_out_parameters(List<Item_param> *sp_params){return false;}
|
94
|
-
|
95
|
+
virtual Protocol::enum_protocol_type type(void){ return CP_PROTOCOL; };
|
95
96
|
#ifdef MARIADB_BASE_VERSION //Mariadb 5.5 10.0 10.1
|
96
97
|
virtual bool store(MYSQL_TIME *time, int decimals){return false;}
|
97
98
|
virtual bool store_time(MYSQL_TIME *time, int decimals){ return false;}
|
@@ -101,28 +102,28 @@ public:
|
|
101
102
|
virtual bool store(const char *from, size_t length,
|
102
103
|
CHARSET_INFO *fromcs, CHARSET_INFO *tocs){return false;}
|
103
104
|
#elif defined(MYSQL_5_7)
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
105
|
+
bool store_decimal(const my_decimal *, uint, uint){ return true; }
|
106
|
+
bool store(Proto_field *){ return true; }
|
107
|
+
void start_row(){}
|
108
|
+
int read_packet(void){ return 0; }
|
109
|
+
int get_command(COM_DATA *, enum_server_command *){ return m_thd->lex->sql_command; }
|
110
|
+
enum_vio_type connection_type(void){ return VIO_TYPE_PLUGIN; }
|
111
|
+
ulong get_client_capabilities(void){ return 0; }
|
112
|
+
bool has_client_capability(unsigned long){ return false; }
|
113
|
+
bool connection_alive(void){ return false; }
|
114
|
+
bool end_row(void){ return false; }
|
115
|
+
void abort_row(void){}
|
116
|
+
void end_partial_result_set(void){}
|
117
|
+
int shutdown(bool){ return 0; }
|
118
|
+
SSL_handle get_ssl(void){ return NULL; }
|
119
|
+
uint get_rw_status(void){ return 0; }
|
120
|
+
bool get_compression(void){ return false; }
|
121
|
+
bool start_result_metadata(uint, uint, const CHARSET_INFO *){ return false; }
|
122
|
+
bool send_field_metadata(Send_field *, const CHARSET_INFO *){ return false; }
|
123
|
+
bool end_result_metadata(void){ return false; }
|
124
|
+
bool send_ok(uint, uint, ulonglong, ulonglong, const char *){ return false; }
|
125
|
+
bool send_eof(uint, uint){ return false; }
|
126
|
+
bool send_error(uint, const char *, const char *){ return false; }
|
126
127
|
#endif
|
127
128
|
};
|
128
129
|
|
@@ -149,7 +150,7 @@ public:
|
|
149
150
|
{
|
150
151
|
if (!m_writed)
|
151
152
|
{
|
152
|
-
|
153
|
+
strncpy(m_bpos->filename, from, BINLOGNAME_SIZE);
|
153
154
|
m_writed = true;
|
154
155
|
}
|
155
156
|
return false;
|
@@ -159,7 +160,7 @@ public:
|
|
159
160
|
{
|
160
161
|
if (!m_writed)
|
161
162
|
{
|
162
|
-
|
163
|
+
strncpy(m_bpos->filename, from, BINLOGNAME_SIZE);
|
163
164
|
m_writed = true;
|
164
165
|
}
|
165
166
|
return false;
|
@@ -181,11 +182,11 @@ bool safe_commit_lock::lock()
|
|
181
182
|
if (m_thd)
|
182
183
|
{
|
183
184
|
MDL_request mdl_request;
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
185
|
+
#if ((MYSQL_VERSION_NUM > 50700) && !defined(MARIADB_BASE_VERSION))
|
186
|
+
mdl_request.init_with_source(MDL_key::COMMIT, "", "", MDL_SHARED, MDL_EXPLICIT, __FILE__, __LINE__);
|
187
|
+
#else
|
188
|
+
mdl_request.init(MDL_key::COMMIT, "", "", MDL_SHARED, MDL_EXPLICIT);
|
189
|
+
#endif
|
189
190
|
if (m_thd->mdl_context.acquire_lock(&mdl_request,
|
190
191
|
m_thd->variables.lock_wait_timeout))
|
191
192
|
return false;
|
@@ -233,9 +234,9 @@ safe_commit_lock::~safe_commit_lock()
|
|
233
234
|
{
|
234
235
|
sprintf_s(bpos->gtid, GTID_SIZE, "%u-%u-%llu", gtid.domain_id, gtid.server_id, gtid.seq_no);
|
235
236
|
size_t dir_len = dirname_length(mysql_bin_log.get_log_fname());
|
236
|
-
|
237
|
-
|
238
|
-
|
237
|
+
strncpy(bpos->filename, mysql_bin_log.get_log_fname() + dir_len, BINLOGNAME_SIZE);
|
238
|
+
bpos->pos = my_b_tell(mysql_bin_log.get_log_file());
|
239
|
+
bpos->filename[BINLOGNAME_SIZE-1] = 0x00;
|
239
240
|
}
|
240
241
|
}
|
241
242
|
return 0;
|
@@ -248,10 +249,10 @@ safe_commit_lock::~safe_commit_lock()
|
|
248
249
|
{
|
249
250
|
if (mysql_bin_log.is_open())
|
250
251
|
{
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
252
|
+
size_t dir_len = dirname_length(mysql_bin_log.get_log_fname());
|
253
|
+
strncpy(bpos->filename, mysql_bin_log.get_log_fname() + dir_len, BINLOGNAME_SIZE);
|
254
|
+
bpos->pos = my_b_tell(mysql_bin_log.get_log_file());
|
255
|
+
bpos->filename[BINLOGNAME_SIZE-1] = 0x00;
|
255
256
|
bpos->type = REPL_POSTYPE_POS;
|
256
257
|
}
|
257
258
|
return 0;
|
@@ -270,7 +271,7 @@ int execSql(THD* thd, const char* sql)
|
|
270
271
|
{
|
271
272
|
thd->variables.lock_wait_timeout = OPEN_TABLE_TIMEOUT_SEC;
|
272
273
|
thd->clear_error();
|
273
|
-
|
274
|
+
int result = cp_query_command(thd, (char*)sql);
|
274
275
|
if (thd->is_error())
|
275
276
|
result = thd->cp_get_sql_error();
|
276
277
|
cp_lex_clear(thd); // reset values for insert
|
@@ -284,17 +285,23 @@ using namespace bzs::db::transactd;
|
|
284
285
|
class slaveStatus : public dummyProtocol
|
285
286
|
{
|
286
287
|
connection::records& m_records;
|
288
|
+
bzs::db::IblobBuffer* m_bb;
|
289
|
+
int m_blobfields;
|
287
290
|
connection::record& getRec()
|
288
291
|
{
|
289
292
|
m_records.push_back(connection::record());
|
290
293
|
return m_records[m_records.size() - 1];
|
291
294
|
}
|
292
295
|
public:
|
293
|
-
inline slaveStatus(THD *thd_arg, connection::records& recs) :
|
294
|
-
dummyProtocol(thd_arg), m_records(recs)
|
296
|
+
inline slaveStatus(THD *thd_arg, connection::records& recs, bzs::db::IblobBuffer* bb) :
|
297
|
+
dummyProtocol(thd_arg), m_records(recs), m_bb(bb), m_blobfields(0)
|
295
298
|
{
|
296
299
|
m_records.clear();
|
297
300
|
}
|
301
|
+
~slaveStatus()
|
302
|
+
{
|
303
|
+
m_bb->setFieldCount(m_blobfields);
|
304
|
+
}
|
298
305
|
bool store_longlong(longlong from, bool unsigned_flag)
|
299
306
|
{
|
300
307
|
connection::record& rec = getRec();
|
@@ -306,34 +313,44 @@ public:
|
|
306
313
|
{
|
307
314
|
connection::record& rec = getRec();
|
308
315
|
rec.type = 1;
|
309
|
-
strncpy(rec.
|
316
|
+
strncpy(rec.name, "NULL", CON_REC_VALUE_SIZE);
|
310
317
|
return false;
|
311
318
|
}
|
312
|
-
|
313
|
-
bool store(const char *from, size_t length, CHARSET_INFO *cs)
|
319
|
+
bool str_store(const char *from, size_t length)
|
314
320
|
{
|
315
321
|
connection::record& rec = getRec();
|
316
322
|
rec.type = 1;
|
317
323
|
if (length && from)
|
318
|
-
|
324
|
+
{
|
325
|
+
if (length >= CON_REC_VALUE_SIZE)
|
326
|
+
{
|
327
|
+
++m_blobfields;
|
328
|
+
rec.type = 2;
|
329
|
+
m_bb->addBlob((unsigned int)length, (unsigned short)(m_records.size() -1),
|
330
|
+
(const unsigned char*)from);
|
331
|
+
}else
|
332
|
+
strncpy(rec.name, from, CON_REC_VALUE_SIZE);
|
333
|
+
}
|
319
334
|
return false;
|
320
335
|
}
|
336
|
+
|
337
|
+
#if (MYSQL_VERSION_ID < 50600 || defined(MARIADB_BASE_VERSION)) // MySQL 5.5
|
338
|
+
bool store(const char *from, size_t length, CHARSET_INFO *cs)
|
339
|
+
{
|
340
|
+
return str_store(from, length);
|
341
|
+
}
|
321
342
|
#else
|
322
343
|
bool store(const char *from, size_t length, const CHARSET_INFO *cs)
|
323
344
|
{
|
324
|
-
|
325
|
-
rec.type = 1;
|
326
|
-
if (length && from)
|
327
|
-
strncpy(rec.value, from, CON_REC_VALUE_SIZE);
|
328
|
-
return false;
|
345
|
+
return str_store(from, length);
|
329
346
|
}
|
330
347
|
#endif
|
331
348
|
};
|
332
349
|
|
333
|
-
int getSlaveStatus(THD* thd, connection::records& recs)
|
350
|
+
int getSlaveStatus(THD* thd, connection::records& recs, bzs::db::IblobBuffer* bb)
|
334
351
|
{
|
335
|
-
|
336
|
-
|
352
|
+
slaveStatus ss(thd, recs, bb);
|
353
|
+
return execSql(thd, "show slave status");
|
337
354
|
}
|
338
355
|
|
339
356
|
#pragma GCC diagnostic warning "-Woverloaded-virtual"
|
@@ -373,23 +390,23 @@ bool setGrant(THD* thd, const char* host, const char* user, const char* db)
|
|
373
390
|
{
|
374
391
|
// sctx->master_access and sctx->db_access
|
375
392
|
return (acl_getroot(cp_security_ctx(thd), cp_strdup(user, MYF(0)),
|
376
|
-
|
393
|
+
cp_strdup(host, MYF(0)), cp_strdup(host, MYF(0)), (char*)db)) == false;
|
377
394
|
}
|
378
395
|
|
379
396
|
bool copyGrant(THD* thd, THD* thdSrc, const char* db)
|
380
397
|
{
|
381
398
|
Security_context* sctx = cp_security_ctx(thdSrc);
|
382
|
-
|
399
|
+
if (sctx->cp_master_accsess() == (ulong)~NO_ACCESS)
|
383
400
|
{
|
384
401
|
cp_security_ctx(thd)->skip_grants();
|
385
402
|
return true;
|
386
403
|
}
|
387
|
-
|
404
|
+
return setGrant(thd, sctx->cp_priv_host(), sctx->cp_priv_user(), db);
|
388
405
|
}
|
389
406
|
|
390
407
|
void setDbName(THD* thd, const char* name)
|
391
408
|
{
|
392
|
-
|
409
|
+
cp_set_db(thd, name);
|
393
410
|
}
|
394
411
|
|
395
412
|
/*
|