transactd 3.4.1 → 3.5.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/CMakeLists.txt +2 -2
- data/bin/common/tdclc_32_3_5.dll +0 -0
- data/bin/common/tdclc_64_3_5.dll +0 -0
- data/build/common/options.cmake +12 -0
- data/build/common/transactd_cl_common.cmake +1 -0
- data/build/common/transactd_required.cmake +5 -0
- data/build/swig/ruby/tdclrb_wrap.cpp +1029 -130
- data/build/swig/tdcl.i +60 -5
- data/build/tdclc/CMakeLists.txt +30 -32
- data/build/tdclc/libtdclcm.map +1 -1
- data/build/tdclc/tdclc.cbproj +1 -1
- data/build/tdclc/tdclc.rc +4 -4
- data/build/tdclcpp/CMakeLists.txt +39 -48
- data/build/tdclcpp/tdclcpp.rc +4 -4
- data/build/tdclcpp/tdclcpp_bc.cbproj +4 -1
- data/build/tdclrb/CMakeLists.txt +5 -4
- data/build/tdclrb/tdclrb.rc +4 -4
- data/source/bzs/db/engine/mysql/database.cpp +45 -35
- data/source/bzs/db/engine/mysql/database.h +6 -8
- data/source/bzs/db/engine/mysql/dbManager.cpp +11 -0
- data/source/bzs/db/engine/mysql/dbManager.h +1 -0
- data/source/bzs/db/engine/mysql/ha.cpp +174 -0
- data/source/bzs/db/engine/mysql/ha.h +50 -0
- data/source/bzs/db/engine/mysql/mysqlInternal.h +18 -1
- data/source/bzs/db/engine/mysql/mysqlProtocol.cpp +222 -9
- data/source/bzs/db/engine/mysql/mysqlProtocol.h +5 -0
- data/source/bzs/db/protocol/tdap/client/client.cpp +23 -9
- data/source/bzs/db/protocol/tdap/client/client.h +125 -94
- data/source/bzs/db/protocol/tdap/client/connMgr.cpp +139 -30
- data/source/bzs/db/protocol/tdap/client/connMgr.h +40 -8
- data/source/bzs/db/protocol/tdap/client/database.cpp +17 -17
- data/source/bzs/db/protocol/tdap/client/database.h +15 -0
- data/source/bzs/db/protocol/tdap/client/dllmain.cpp +10 -4
- data/source/bzs/db/protocol/tdap/client/haNameResolver.cpp +486 -0
- data/source/bzs/db/protocol/tdap/client/haNameResolver.h +74 -0
- data/source/bzs/db/protocol/tdap/client/nsDatabase.cpp +102 -71
- data/source/bzs/db/protocol/tdap/client/nsDatabase.h +15 -3
- data/source/bzs/db/protocol/tdap/client/nsTable.cpp +2 -5
- data/source/bzs/db/protocol/tdap/client/nsTable.h +2 -1
- data/source/bzs/db/protocol/tdap/client/sqlBuilder.cpp +2 -2
- data/source/bzs/db/protocol/tdap/client/table.cpp +1 -2
- data/source/bzs/db/protocol/tdap/client/trdboostapi.h +13 -0
- data/source/bzs/db/protocol/tdap/client/trnsctcl.def +1 -0
- data/source/bzs/db/protocol/tdap/mysql/databaseSchema.cpp +9 -7
- data/source/bzs/db/protocol/tdap/mysql/recordsetReader.h +2 -2
- data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.cpp +328 -117
- data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.h +7 -8
- data/source/bzs/db/protocol/tdap/tdapcapi.h +81 -41
- data/source/bzs/db/transactd/connManager.cpp +118 -93
- data/source/bzs/db/transactd/connManager.h +6 -1
- data/source/bzs/db/transactd/connectionRecord.h +27 -7
- data/source/bzs/db/transactd/transactd.cpp +24 -13
- data/source/bzs/env/crosscompile.h +2 -0
- data/source/bzs/netsvc/client/iconnection.h +2 -0
- data/source/bzs/netsvc/client/tcpClient.cpp +45 -14
- data/source/bzs/netsvc/client/tcpClient.h +21 -4
- data/source/bzs/netsvc/server/IAppModule.h +1 -0
- data/source/bzs/netsvc/server/serverCpt.cpp +1 -1
- data/source/bzs/netsvc/server/serverPipe.cpp +2 -0
- data/source/bzs/netsvc/server/serverTpool.cpp +3 -5
- data/source/bzs/test/tdclatl/test_v3.js +91 -3
- data/source/bzs/test/tdclphp/transactd_v3_Test.php +89 -3
- data/source/bzs/test/tdclrb/transactd_v3_spec.rb +69 -2
- data/source/bzs/test/trdclengn/testField.h +19 -1
- data/source/bzs/test/trdclengn/test_tdclcpp_ha.cpp +388 -0
- data/source/bzs/test/trdclengn/test_tdclcpp_v3.cpp +6 -1
- data/source/bzs/test/trdclengn/test_trdclengn.cpp +1 -0
- data/source/bzs/test/trdclengn/testbase.h +7 -1
- data/source/global/replication/haCommand.cpp +843 -0
- data/source/global/replication/haCommand.h +78 -0
- data/source/global/replication/haMgr.cpp +321 -0
- data/source/global/replication/replCommand.cpp +696 -0
- data/source/global/replication/replCommand.h +161 -0
- data/source/global/tdclatl/BinlogPos.cpp +10 -0
- data/source/global/tdclatl/BinlogPos.h +1 -0
- data/source/global/tdclatl/ConnMgr.cpp +89 -2
- data/source/global/tdclatl/ConnMgr.h +13 -1
- data/source/global/tdclatl/ConnRecord.cpp +8 -2
- data/source/global/tdclatl/ConnRecord.h +4 -3
- data/source/global/tdclatl/Database.cpp +13 -0
- data/source/global/tdclatl/Database.h +2 -0
- data/source/global/tdclatl/HaNameREsolver.cpp +54 -0
- data/source/global/tdclatl/HaNameREsolver.h +68 -0
- data/source/global/tdclatl/resource.h +0 -0
- data/source/global/tdclatl/tdclatl.idl +76 -5
- metadata +16 -6
- data/bin/common/tdclc_32_3_4.dll +0 -0
- data/bin/common/tdclc_64_3_4.dll +0 -0
- data/source/bzs/db/protocol/tdap/mysql/debuglog.cpp +0 -423
- data/source/bzs/db/protocol/tdap/mysql/debuglog.h +0 -116
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
|
|
2
|
+
#ifndef GLOBAL_REPLICATION_REPLCOMMANDH
|
|
3
|
+
#define GLOBAL_REPLICATION_REPLCOMMANDH
|
|
4
|
+
/*=================================================================
|
|
5
|
+
Copyright (C) 2016 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
|
+
=================================================================*/
|
|
22
|
+
#include <bzs/db/protocol/tdap/client/fields.h>
|
|
23
|
+
#include <bzs/db/protocol/tdap/client/trdboostapi.h>
|
|
24
|
+
#include <bzs/db/protocol/tdap/client/connMgr.h>
|
|
25
|
+
|
|
26
|
+
namespace bz = bzs::db::protocol::tdap;
|
|
27
|
+
namespace bzc = bzs::db::protocol::tdap::client;
|
|
28
|
+
|
|
29
|
+
// Copy mode
|
|
30
|
+
#define CP_NO_SCHEMA 1
|
|
31
|
+
#define CP_NO_DB 2
|
|
32
|
+
|
|
33
|
+
// Node options
|
|
34
|
+
#define OPT_UNTIL_WAIT 1
|
|
35
|
+
#define OPT_CREATE_BY_SCHEM_IF 2
|
|
36
|
+
#define OPT_DISABLE_LOGBIN 4
|
|
37
|
+
#define OPT_RESET_MASTER 8
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
// Replication mode
|
|
41
|
+
#define REP_TYPE_REGACY 0
|
|
42
|
+
#define REP_TYPE_GTID_MA 1
|
|
43
|
+
#define REP_TYPE_GTID_MY 2
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
// Replication error
|
|
47
|
+
#define ERROR_IO_THREAD 1
|
|
48
|
+
#define ERROR_SQL_THREAD 2
|
|
49
|
+
#define ERROR_LOG_BROKN 3
|
|
50
|
+
#define ERROR_FAILED 4
|
|
51
|
+
|
|
52
|
+
// Replication error resolve results
|
|
53
|
+
#define RESOLV_RESULT_CANCEL 2
|
|
54
|
+
#define RESOLV_RESULT_YES 6
|
|
55
|
+
#define RESOLV_RESULT_NO 7
|
|
56
|
+
|
|
57
|
+
// Replication params
|
|
58
|
+
struct node
|
|
59
|
+
{
|
|
60
|
+
private:
|
|
61
|
+
int options;
|
|
62
|
+
public:
|
|
63
|
+
std::_tstring host;
|
|
64
|
+
std::_tstring port;
|
|
65
|
+
std::_tstring db;
|
|
66
|
+
std::_tstring schema;
|
|
67
|
+
std::_tstring user;
|
|
68
|
+
std::_tstring passwd;
|
|
69
|
+
|
|
70
|
+
node() : options(OPT_UNTIL_WAIT) {};
|
|
71
|
+
bzc::connectParams cp(int opt=0);
|
|
72
|
+
bool option(int op) const { return (options & op) != 0 ;}
|
|
73
|
+
void setOption(int op, bool enable=true);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
struct masterNode : public node
|
|
77
|
+
{
|
|
78
|
+
masterNode() : node(){}
|
|
79
|
+
std::string repPort;
|
|
80
|
+
std::string repUser;
|
|
81
|
+
std::string repPasswd;
|
|
82
|
+
std::string repOption;
|
|
83
|
+
std::string channel;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
struct replicationParam
|
|
88
|
+
{
|
|
89
|
+
masterNode master;
|
|
90
|
+
node slave;
|
|
91
|
+
std::vector<std::_tstring> skipTables;
|
|
92
|
+
int type;
|
|
93
|
+
bool needSlaveWait() { return slave.option(OPT_UNTIL_WAIT);}
|
|
94
|
+
void setSlaveWait(bool v){ slave.setOption(OPT_UNTIL_WAIT, v);}
|
|
95
|
+
bool isCreateBySchemIf() { return slave.option(OPT_CREATE_BY_SCHEM_IF);}
|
|
96
|
+
void setCreateBySchemIf(bool v){ slave.setOption(OPT_CREATE_BY_SCHEM_IF, v);}
|
|
97
|
+
bool isDisableLogbin() { return slave.option(OPT_DISABLE_LOGBIN);}
|
|
98
|
+
void setDisableLogbin(bool v){ slave.setOption(OPT_DISABLE_LOGBIN, v);}
|
|
99
|
+
replicationParam() : type(REP_TYPE_REGACY) {}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
#define REP_NF_WAIT 1000
|
|
103
|
+
|
|
104
|
+
class replicationNotify
|
|
105
|
+
{
|
|
106
|
+
public:
|
|
107
|
+
virtual ~replicationNotify() {};
|
|
108
|
+
virtual void onUpdateStaus(int status) = 0;
|
|
109
|
+
virtual int onResolvError(int type, const bzc::connMgr::records& recs) = 0;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
// replication manegemnet operations
|
|
114
|
+
class replSlave
|
|
115
|
+
{
|
|
116
|
+
struct replImpl* m_impl;
|
|
117
|
+
bzc::database_ptr m_db;
|
|
118
|
+
bzc::connMgr* m_mgr;
|
|
119
|
+
bool m_mysqlGtid;
|
|
120
|
+
void validateError(const _TCHAR* msg);
|
|
121
|
+
bool isSlaveSync(bzc::binlogPos& bpos, replicationNotify* nf);
|
|
122
|
+
bool resolvBroknError(const bzc::connMgr::records& recs, replicationNotify* nf);
|
|
123
|
+
bool resolvIOError(const bzc::connMgr::records& recs, replicationNotify* nf);
|
|
124
|
+
bool resolvSqlError(const bzc::connMgr::records& recs, bzc::binlogPos& bpos, replicationNotify* nf);
|
|
125
|
+
|
|
126
|
+
public:
|
|
127
|
+
enum autoPosType{slave_pos, current_pos};
|
|
128
|
+
|
|
129
|
+
replSlave(bzc::database_ptr db, replicationParam& pm, bzc::connMgr* mgr);
|
|
130
|
+
~replSlave();
|
|
131
|
+
void setSkipError(const char* gtid);
|
|
132
|
+
void stop(bool all=true);
|
|
133
|
+
void start(bool all=true);
|
|
134
|
+
void startNoThrow();
|
|
135
|
+
void reset();
|
|
136
|
+
void resetAll();
|
|
137
|
+
bool startUntil(bzc::binlogPos& bpos);
|
|
138
|
+
void waitForSlaveSync(bzc::binlogPos& bpos, int waitTime, replicationNotify* nf);
|
|
139
|
+
void changeMaster(const bzc::binlogPos* bpos);
|
|
140
|
+
void switchMaster(autoPosType v);
|
|
141
|
+
void skipLogEvent(const char* gtid);
|
|
142
|
+
void stopAndReset();
|
|
143
|
+
void resetMaster();
|
|
144
|
+
bool isMysqlGtidMode() const {return m_mysqlGtid;}
|
|
145
|
+
const replicationParam& params() const;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
std::string toUtf8(const std::_tstring& s);
|
|
149
|
+
bool isGtidAutoPos(const bzc::connMgr::records& recs);
|
|
150
|
+
bool isPosBrokn(const bzc::connMgr::records& recs);
|
|
151
|
+
std::string getSkipGtid(const bzc::connMgr::records& recs);
|
|
152
|
+
bool isSlaveSqlRunning(const bzc::connMgr::records& recs);
|
|
153
|
+
bool isSlaveIoRunning(const bzc::connMgr::records& recs);
|
|
154
|
+
void notyfy(replicationNotify* nf, int v);
|
|
155
|
+
int resolv(replicationNotify* nf, int type, const bzc::connMgr::records& recs, int defValue);
|
|
156
|
+
|
|
157
|
+
static const bool all=true;
|
|
158
|
+
static const bool one=false;
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
#endif // GLOBAL_REPLICATION_REPLCOMMANDH
|
|
@@ -59,6 +59,16 @@ STDMETHODIMP CBinlogPos::get_Gtid(BSTR* retVal)
|
|
|
59
59
|
return S_OK;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
STDMETHODIMP CBinlogPos::put_Gtid(BSTR Value)
|
|
63
|
+
{
|
|
64
|
+
int size = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, Value, -1, NULL, 0, NULL, NULL);
|
|
65
|
+
char* p = new char[size + 1];
|
|
66
|
+
WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, Value, -1, p, size + 1, NULL, NULL);
|
|
67
|
+
m_pos.setGtid(p);
|
|
68
|
+
delete [] p;
|
|
69
|
+
return S_OK;
|
|
70
|
+
}
|
|
71
|
+
|
|
62
72
|
|
|
63
73
|
|
|
64
74
|
|
|
@@ -159,14 +159,14 @@ STDMETHODIMP CConnMgr::Statusvars(IConnRecords** retVal)
|
|
|
159
159
|
return S_OK;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
STDMETHODIMP CConnMgr::SlaveStatus(IConnRecords** retVal)
|
|
162
|
+
STDMETHODIMP CConnMgr::SlaveStatus(BSTR channel, IConnRecords** retVal)
|
|
163
163
|
{
|
|
164
164
|
if (m_mgr == NULL) Error(_T("No database error"), IID_IConnMgr);
|
|
165
165
|
CComObject<CConnRecords>* obj;
|
|
166
166
|
CComObject<CConnRecords>::CreateInstance(&obj);
|
|
167
167
|
if (!obj)
|
|
168
168
|
return Error("CreateInstance ConnRecords", IID_IConnMgr);
|
|
169
|
-
obj->m_recs = m_mgr->slaveStatus();
|
|
169
|
+
obj->m_recs = m_mgr->slaveStatus(channel);
|
|
170
170
|
setResult(obj, retVal);
|
|
171
171
|
return S_OK;
|
|
172
172
|
}
|
|
@@ -303,4 +303,91 @@ STDMETHODIMP CConnMgr::StatusvarName(int index, BSTR* retVal)
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
|
|
306
|
+
STDMETHODIMP CConnMgr::Extendedvars(IConnRecords** retVal)
|
|
307
|
+
{
|
|
308
|
+
if (m_mgr == NULL) Error(_T("No database error"), IID_IConnMgr);
|
|
309
|
+
CComObject<CConnRecords>* obj;
|
|
310
|
+
CComObject<CConnRecords>::CreateInstance(&obj);
|
|
311
|
+
if (!obj)
|
|
312
|
+
return Error("CreateInstance ConnRecords", IID_IConnMgr);
|
|
313
|
+
obj->m_recs = m_mgr->extendedvars();
|
|
314
|
+
setResult(obj, retVal);
|
|
315
|
+
return S_OK;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
STDMETHODIMP CConnMgr::SlaveHosts(IConnRecords** retVal)
|
|
319
|
+
{
|
|
320
|
+
if (m_mgr == NULL) Error(_T("No database error"), IID_IConnMgr);
|
|
321
|
+
CComObject<CConnRecords>* obj;
|
|
322
|
+
CComObject<CConnRecords>::CreateInstance(&obj);
|
|
323
|
+
if (!obj)
|
|
324
|
+
return Error("CreateInstance ConnRecords", IID_IConnMgr);
|
|
325
|
+
obj->m_recs = m_mgr->slaveHosts();
|
|
326
|
+
setResult(obj, retVal);
|
|
327
|
+
return S_OK;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
STDMETHODIMP CConnMgr::Channels(IConnRecords** retVal)
|
|
331
|
+
{
|
|
332
|
+
if (m_mgr == NULL) Error(_T("No database error"), IID_IConnMgr);
|
|
333
|
+
CComObject<CConnRecords>* obj;
|
|
334
|
+
CComObject<CConnRecords>::CreateInstance(&obj);
|
|
335
|
+
if (!obj)
|
|
336
|
+
return Error("CreateInstance ConnRecords", IID_IConnMgr);
|
|
337
|
+
obj->m_recs = m_mgr->channels();
|
|
338
|
+
setResult(obj, retVal);
|
|
339
|
+
return S_OK;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
STDMETHODIMP CConnMgr::ExtendedVarName(int index, BSTR* retVal)
|
|
343
|
+
{
|
|
344
|
+
CComBSTR ret= connMgr::extendedVarName(index);
|
|
345
|
+
*retVal = ret.Copy();
|
|
346
|
+
return S_OK;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
STDMETHODIMP CConnMgr::HaLock(VARIANT_BOOL* retVal)
|
|
350
|
+
{
|
|
351
|
+
if (m_mgr == NULL) Error(_T("No database error"), IID_IConnMgr);
|
|
352
|
+
*retVal = m_mgr->haLock();
|
|
353
|
+
return S_OK;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
STDMETHODIMP CConnMgr::HaUnlock()
|
|
357
|
+
{
|
|
358
|
+
if (m_mgr == NULL) Error(_T("No database error"), IID_IConnMgr);
|
|
359
|
+
m_mgr->haUnlock();
|
|
360
|
+
return S_OK;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
STDMETHODIMP CConnMgr::SetRole(int v, VARIANT_BOOL* retVal)
|
|
364
|
+
{
|
|
365
|
+
if (m_mgr == NULL) Error(_T("No database error"), IID_IConnMgr);
|
|
366
|
+
*retVal = m_mgr->setRole(v);
|
|
367
|
+
return S_OK;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
STDMETHODIMP CConnMgr::SetTrxBlock(VARIANT_BOOL v, VARIANT_BOOL* retVal)
|
|
371
|
+
{
|
|
372
|
+
if (m_mgr == NULL) Error(_T("No database error"), IID_IConnMgr);
|
|
373
|
+
*retVal = m_mgr->setTrxBlock(v!=0);
|
|
374
|
+
return S_OK;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
STDMETHODIMP CConnMgr::SetEnableFailover(VARIANT_BOOL v, VARIANT_BOOL* retVal)
|
|
378
|
+
{
|
|
379
|
+
if (m_mgr == NULL) Error(_T("No database error"), IID_IConnMgr);
|
|
380
|
+
*retVal = m_mgr->setEnableFailover(v!=0);
|
|
381
|
+
return S_OK;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
STDMETHODIMP CConnMgr::get_IsOpen(VARIANT_BOOL* retVal)
|
|
385
|
+
{
|
|
386
|
+
if (m_mgr == NULL) Error(_T("No database error"), IID_IConnMgr);
|
|
387
|
+
*retVal = m_mgr->isOpen();
|
|
388
|
+
return S_OK;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
306
393
|
|
|
@@ -59,7 +59,7 @@ public:
|
|
|
59
59
|
STDMETHOD(Views)(BSTR dbname, IConnRecords** retVal);
|
|
60
60
|
STDMETHOD(SchemaTables)(BSTR dbname, IConnRecords** retVal);
|
|
61
61
|
STDMETHOD(Sysvars)(IConnRecords** retVal);
|
|
62
|
-
STDMETHOD(SlaveStatus)(IConnRecords** retVal);
|
|
62
|
+
STDMETHOD(SlaveStatus)(BSTR channel, IConnRecords** retVal);
|
|
63
63
|
STDMETHOD(Connections)(IConnRecords** retVal);
|
|
64
64
|
#ifdef _WIN64
|
|
65
65
|
STDMETHOD(InUseDatabases)(__int64 connid, IConnRecords** retVal);
|
|
@@ -80,6 +80,18 @@ public:
|
|
|
80
80
|
STDMETHOD(Statusvars)(IConnRecords** retVal);
|
|
81
81
|
STDMETHOD(StatusvarName)(int index, BSTR* retVal);
|
|
82
82
|
|
|
83
|
+
STDMETHOD(Extendedvars)(IConnRecords** retVal);
|
|
84
|
+
STDMETHOD(SlaveHosts)(IConnRecords** retVal);
|
|
85
|
+
STDMETHOD(Channels)(IConnRecords** retVal);
|
|
86
|
+
STDMETHOD(ExtendedVarName)(int index, BSTR* retVal);
|
|
87
|
+
|
|
88
|
+
STDMETHOD(HaLock)(VARIANT_BOOL* retVal);
|
|
89
|
+
STDMETHOD(HaUnlock)();
|
|
90
|
+
STDMETHOD(SetRole)(int v, VARIANT_BOOL* retVal);
|
|
91
|
+
STDMETHOD(SetTrxBlock)(VARIANT_BOOL v, VARIANT_BOOL* retVal);
|
|
92
|
+
STDMETHOD(SetEnableFailover)(VARIANT_BOOL v, VARIANT_BOOL* retVal);
|
|
93
|
+
STDMETHOD(get_IsOpen)(VARIANT_BOOL* retVal);
|
|
94
|
+
|
|
83
95
|
};
|
|
84
96
|
|
|
85
97
|
OBJECT_ENTRY_AUTO(__uuidof(ConnMgr), CConnMgr)
|
|
@@ -58,13 +58,13 @@ STDMETHODIMP CConnRecord::get_Id(int* retVal)
|
|
|
58
58
|
return S_OK;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
STDMETHODIMP CConnRecord::get_Db(
|
|
61
|
+
STDMETHODIMP CConnRecord::get_Db(int* retVal)
|
|
62
62
|
{
|
|
63
63
|
*retVal = m_rec.db;
|
|
64
64
|
return S_OK;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
STDMETHODIMP CConnRecord::get_Type(
|
|
67
|
+
STDMETHODIMP CConnRecord::get_Type(int* retVal)
|
|
68
68
|
{
|
|
69
69
|
*retVal = m_rec.type;
|
|
70
70
|
return S_OK;
|
|
@@ -128,4 +128,10 @@ STDMETHODIMP CConnRecord::get_InsCount(int* retVal)
|
|
|
128
128
|
{
|
|
129
129
|
*retVal = m_rec.insCount;
|
|
130
130
|
return S_OK;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
STDMETHODIMP CConnRecord::get_Port(int* retVal)
|
|
134
|
+
{
|
|
135
|
+
*retVal = m_rec.port;
|
|
136
|
+
return S_OK;
|
|
131
137
|
}
|
|
@@ -55,9 +55,9 @@ public:
|
|
|
55
55
|
#else
|
|
56
56
|
STDMETHOD (get_ConId)(BSTR* retVal);
|
|
57
57
|
#endif
|
|
58
|
-
STDMETHOD (get_Id)(int* retVal);
|
|
59
|
-
STDMETHOD (get_Db)(
|
|
60
|
-
STDMETHOD (get_Type)(
|
|
58
|
+
STDMETHOD (get_Id)(int* retVal);
|
|
59
|
+
STDMETHOD (get_Db)(int* retVal);
|
|
60
|
+
STDMETHOD (get_Type)(int* retVal);
|
|
61
61
|
STDMETHOD (get_Name)(BSTR* retVal);
|
|
62
62
|
STDMETHOD (get_Value)(BSTR* retVal);
|
|
63
63
|
STDMETHOD (get_Status)(short* retVal);
|
|
@@ -66,5 +66,6 @@ public:
|
|
|
66
66
|
STDMETHOD (get_DelCount)(int* retVal);
|
|
67
67
|
STDMETHOD (get_InsCount)(int* retVal);
|
|
68
68
|
STDMETHOD (get_LongValue)(BSTR* retVal);
|
|
69
|
+
STDMETHOD (get_Port)(int* retVal);
|
|
69
70
|
};
|
|
70
71
|
|
|
@@ -635,6 +635,19 @@ STDMETHODIMP CDatabase::GetCreateViewSql(BSTR name, BSTR* retVal)
|
|
|
635
635
|
return S_OK;
|
|
636
636
|
}
|
|
637
637
|
|
|
638
|
+
STDMETHODIMP CDatabase::get_EnableAutoReconnect(VARIANT_BOOL* retVal)
|
|
639
|
+
{
|
|
640
|
+
*retVal = m_db->enableAutoReconnect();
|
|
641
|
+
return S_OK;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
STDMETHODIMP CDatabase::put_EnableAutoReconnect(VARIANT_BOOL val)
|
|
645
|
+
{
|
|
646
|
+
m_db->setEnableAutoReconnect(val != 0);
|
|
647
|
+
return S_OK;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
|
|
638
651
|
void __stdcall onCopyData(database* db, table* tb, int recordCount, int count,
|
|
639
652
|
bool& cancel)
|
|
640
653
|
{
|
|
@@ -165,6 +165,8 @@ public:
|
|
|
165
165
|
STDMETHOD(get_IsAssociate)(VARIANT_BOOL* retVal);
|
|
166
166
|
STDMETHOD(GetCreateViewSql)(BSTR name, BSTR* retVal);
|
|
167
167
|
STDMETHOD(ExecSql)(BSTR Sql, VARIANT_BOOL* Value);
|
|
168
|
+
STDMETHOD(get_EnableAutoReconnect)(VARIANT_BOOL* retVal);
|
|
169
|
+
STDMETHOD(put_EnableAutoReconnect)(VARIANT_BOOL val);
|
|
168
170
|
};
|
|
169
171
|
|
|
170
172
|
OBJECT_ENTRY_AUTO(__uuidof(Database), CDatabase)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// HaNameREsolver.cpp : CHaNameREsolver �̎���
|
|
2
|
+
|
|
3
|
+
#include "stdafx.h"
|
|
4
|
+
#include "HaNameREsolver.h"
|
|
5
|
+
#include <comutil.h>
|
|
6
|
+
using namespace bzs::db::protocol::tdap::client;
|
|
7
|
+
|
|
8
|
+
// CHaNameREsolver
|
|
9
|
+
STDMETHODIMP CHaNameResolver::Start(BSTR master, BSTR slaves,
|
|
10
|
+
BSTR slaveHostsWithPort, short slaveNum,
|
|
11
|
+
BSTR userName,
|
|
12
|
+
BSTR password,
|
|
13
|
+
int option, int* retVal)
|
|
14
|
+
{
|
|
15
|
+
*retVal = haNameResolver::start(_bstr_t(master), _bstr_t(slaves),
|
|
16
|
+
_bstr_t(slaveHostsWithPort),slaveNum,
|
|
17
|
+
_bstr_t(userName),_bstr_t(password),
|
|
18
|
+
option);
|
|
19
|
+
return S_OK;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
STDMETHODIMP CHaNameResolver::AddPortMap(short mysqlPort, short transactdPort)
|
|
23
|
+
{
|
|
24
|
+
haNameResolver::addPortMap(mysqlPort, transactdPort);
|
|
25
|
+
return S_OK;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
STDMETHODIMP CHaNameResolver::ClearPortMap()
|
|
29
|
+
{
|
|
30
|
+
haNameResolver::clearPortMap();
|
|
31
|
+
return S_OK;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
STDMETHODIMP CHaNameResolver::Stop()
|
|
35
|
+
{
|
|
36
|
+
haNameResolver::stop();
|
|
37
|
+
return S_OK;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
STDMETHODIMP CHaNameResolver::get_Master(BSTR* retVal)
|
|
41
|
+
{
|
|
42
|
+
CComBSTR ret= haNameResolver::master();
|
|
43
|
+
*retVal = ret.Copy();
|
|
44
|
+
return S_OK;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
STDMETHODIMP CHaNameResolver::get_Slave(BSTR* retVal)
|
|
48
|
+
{
|
|
49
|
+
CComBSTR ret= haNameResolver::slave();
|
|
50
|
+
*retVal = ret.Copy();
|
|
51
|
+
return S_OK;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|