transactd 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/common/tdclc_32_3_2.dll +0 -0
- data/bin/common/{tdclc_64_3_1.dll → tdclc_64_3_2.dll} +0 -0
- data/build/swig/ruby/ruby.swg +3 -0
- data/build/swig/ruby/tdclrb_wrap.cpp +2413 -126
- data/build/swig/tdcl.i +120 -9
- data/build/tdclc/tdclc.cbproj +4 -1
- data/build/tdclc/tdclc.rc +4 -4
- data/build/tdclcpp/tdclcpp.rc +4 -4
- data/build/tdclcpp/tdclcpp_bc.cbproj +8 -1
- data/build/tdclrb/tdclrb.rc +4 -4
- data/source/bzs/db/engine/mysql/database.cpp +138 -130
- data/source/bzs/db/engine/mysql/database.h +43 -48
- data/source/bzs/db/engine/mysql/dbManager.cpp +81 -96
- data/source/bzs/db/engine/mysql/dbManager.h +13 -22
- data/source/bzs/db/engine/mysql/mysqlInternal.h +157 -291
- data/source/bzs/db/engine/mysql/mysqlProtocol.cpp +425 -0
- data/source/bzs/db/engine/mysql/mysqlProtocol.h +72 -0
- data/source/bzs/db/engine/mysql/mysqlThd.cpp +8 -6
- data/source/bzs/db/protocol/hs/hsCommandExecuter.cpp +7 -3
- data/source/bzs/db/protocol/hs/hsCommandExecuter.h +1 -0
- data/source/bzs/db/protocol/tdap/client/client.h +22 -8
- data/source/bzs/db/protocol/tdap/client/connMgr.cpp +225 -21
- data/source/bzs/db/protocol/tdap/client/connMgr.h +42 -16
- data/source/bzs/db/protocol/tdap/client/database.cpp +58 -15
- data/source/bzs/db/protocol/tdap/client/database.h +3 -3
- data/source/bzs/db/protocol/tdap/client/dbDef.cpp +93 -85
- data/source/bzs/db/protocol/tdap/client/dbDef.h +1 -2
- data/source/bzs/db/protocol/tdap/client/dllmain.cpp +9 -5
- data/source/bzs/db/protocol/tdap/client/filter.h +2 -2
- data/source/bzs/db/protocol/tdap/client/groupComp.h +2 -2
- data/source/bzs/db/protocol/tdap/client/memRecord.cpp +1 -1
- data/source/bzs/db/protocol/tdap/client/nsDatabase.cpp +71 -12
- data/source/bzs/db/protocol/tdap/client/nsDatabase.h +7 -1
- data/source/bzs/db/protocol/tdap/client/nsTable.cpp +35 -2
- data/source/bzs/db/protocol/tdap/client/nsTable.h +1 -0
- data/source/bzs/db/protocol/tdap/client/recordset.cpp +5 -1
- data/source/bzs/db/protocol/tdap/client/recordset.h +15 -0
- data/source/bzs/db/protocol/tdap/client/recordsetImple.h +21 -16
- data/source/bzs/db/protocol/tdap/client/serializer.cpp +32 -11
- data/source/bzs/db/protocol/tdap/client/serializer.h +4 -1
- data/source/bzs/db/protocol/tdap/client/sqlBuilder.cpp +3 -2
- data/source/bzs/db/protocol/tdap/client/sqlBuilder.h +3 -0
- data/source/bzs/db/protocol/tdap/client/table.cpp +18 -14
- data/source/bzs/db/protocol/tdap/client/trdboostapi.h +8 -3
- data/source/bzs/db/protocol/tdap/mysql/characterset.cpp +1 -0
- data/source/bzs/db/protocol/tdap/mysql/databaseSchema.cpp +83 -43
- data/source/bzs/db/protocol/tdap/mysql/databaseSchema.h +3 -1
- data/source/bzs/db/protocol/tdap/mysql/recordsetReader.h +7 -7
- data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.cpp +247 -137
- data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.h +9 -9
- data/source/bzs/db/protocol/tdap/tdapSchema.cpp +1 -4
- data/source/bzs/db/protocol/tdap/tdapSchema.h +3 -7
- data/source/bzs/db/protocol/tdap/tdapcapi.h +23 -3
- data/source/bzs/db/protocol/tdap/uri.h +40 -0
- data/source/bzs/db/transactd/appModule.cpp +14 -5
- data/source/bzs/db/transactd/appModule.h +10 -1
- data/source/bzs/db/transactd/connManager.cpp +93 -48
- data/source/bzs/db/transactd/connManager.h +10 -7
- data/source/bzs/db/transactd/connectionRecord.h +114 -19
- data/source/bzs/env/tstring.h +2 -0
- data/source/bzs/example/changeSchema.cpp +1 -1
- data/source/bzs/example/changeSchema_c.cpp +1 -1
- data/source/bzs/example/insertRecords.cpp +2 -1
- data/source/bzs/example/insertRecords_c.cpp +2 -1
- data/source/bzs/example/queryData.cpp +5 -2
- data/source/bzs/netsvc/server/IAppModule.h +6 -0
- data/source/bzs/test/tdclatl/test_v3.js +75 -0
- data/source/bzs/test/tdclphp/transactd_v3_Test.php +104 -7
- data/source/bzs/test/tdclrb/transactd_v3_spec.rb +84 -0
- data/source/bzs/test/trdclengn/testField.h +66 -6
- data/source/bzs/test/trdclengn/test_tdclcpp_v3.cpp +10 -1
- data/source/bzs/test/trdclengn/test_trdclengn.cpp +85 -0
- data/source/bzs/test/trdclengn/testbase.h +1 -1
- data/source/global/tdclatl/BinlogPos.cpp +64 -0
- data/source/global/tdclatl/BinlogPos.h +84 -0
- data/source/global/tdclatl/ConnMgr.cpp +285 -0
- data/source/global/tdclatl/ConnMgr.h +83 -0
- data/source/global/tdclatl/ConnRecord.cpp +123 -0
- data/source/global/tdclatl/ConnRecord.h +69 -0
- data/source/global/tdclatl/ConnRecords.cpp +57 -0
- data/source/global/tdclatl/ConnRecords.h +55 -0
- data/source/global/tdclatl/Database.cpp +36 -0
- data/source/global/tdclatl/Database.h +4 -0
- data/source/global/tdclatl/Table.cpp +14 -1
- data/source/global/tdclatl/Table.h +1 -0
- data/source/global/tdclatl/resource.h +0 -0
- data/source/global/tdclatl/tdclatl.idl +148 -4
- metadata +14 -4
- data/bin/common/tdclc_32_3_1.dll +0 -0
@@ -0,0 +1,83 @@
|
|
1
|
+
#pragma once
|
2
|
+
/*=================================================================
|
3
|
+
Copyright (C) 2016 BizStation Corp All rights reserved.
|
4
|
+
|
5
|
+
This program is free software; you can redistribute it and/or
|
6
|
+
modify it under the terms of the GNU General Public License
|
7
|
+
as published by the Free Software Foundation; either version 2
|
8
|
+
of the License, or (at your option) any later version.
|
9
|
+
|
10
|
+
This program is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU General Public License
|
16
|
+
along with this program; if not, write to the Free Software
|
17
|
+
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
18
|
+
02111-1307, USA.
|
19
|
+
=================================================================*/
|
20
|
+
#include "resource.h"
|
21
|
+
|
22
|
+
#include "tdclatl_i.h"
|
23
|
+
#include <bzs/db/protocol/tdap/client/connMgr.h>
|
24
|
+
|
25
|
+
using namespace ATL;
|
26
|
+
|
27
|
+
class ATL_NO_VTABLE CConnMgr
|
28
|
+
: public CComObjectRootEx<CComSingleThreadModel>,
|
29
|
+
public CComCoClass<CConnMgr, &CLSID_ConnMgr>,
|
30
|
+
public ISupportErrorInfo,
|
31
|
+
public IDispatchImpl<IConnMgr, &IID_IConnMgr, &LIBID_transactd,
|
32
|
+
/*wMajor =*/1, /*wMinor =*/0>
|
33
|
+
{
|
34
|
+
bzs::db::protocol::tdap::client::connMgr* m_mgr;
|
35
|
+
|
36
|
+
public:
|
37
|
+
CConnMgr() : m_mgr(NULL) {}
|
38
|
+
|
39
|
+
DECLARE_REGISTRY_RESOURCEID(IDR_CONNMGR)
|
40
|
+
|
41
|
+
BEGIN_COM_MAP(CConnMgr)
|
42
|
+
COM_INTERFACE_ENTRY(IConnMgr)
|
43
|
+
COM_INTERFACE_ENTRY(IDispatch)
|
44
|
+
COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
45
|
+
END_COM_MAP()
|
46
|
+
|
47
|
+
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
|
48
|
+
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
49
|
+
HRESULT FinalConstruct() { return S_OK; }
|
50
|
+
void FinalRelease() { if (m_mgr)m_mgr->release(); }
|
51
|
+
|
52
|
+
public:
|
53
|
+
STDMETHOD(SetDatabase)(VARIANT db);
|
54
|
+
|
55
|
+
STDMETHOD(Connect)(BSTR uri, VARIANT_BOOL* retVal);
|
56
|
+
STDMETHOD(Disconnect)();
|
57
|
+
STDMETHOD(Databases)(IConnRecords** retVal);
|
58
|
+
STDMETHOD(Tables)(BSTR dbname, IConnRecords** retVal);
|
59
|
+
STDMETHOD(Views)(BSTR dbname, IConnRecords** retVal);
|
60
|
+
STDMETHOD(SchemaTables)(BSTR dbname, IConnRecords** retVal);
|
61
|
+
STDMETHOD(Sysvars)(IConnRecords** retVal);
|
62
|
+
STDMETHOD(SlaveStatus)(IConnRecords** retVal);
|
63
|
+
STDMETHOD(Connections)(IConnRecords** retVal);
|
64
|
+
#ifdef _WIN64
|
65
|
+
STDMETHOD(InUseDatabases)(__int64 connid, IConnRecords** retVal);
|
66
|
+
STDMETHOD(InUseTables)(__int64 connid, int db, IConnRecords** retVal);
|
67
|
+
STDMETHOD(PostDisconnectOne)(__int64 connid);
|
68
|
+
#else
|
69
|
+
STDMETHOD(InUseDatabases)(BSTR connid, IConnRecords** retVal);
|
70
|
+
STDMETHOD(InUseTables)(BSTR connid, int db, IConnRecords** retVal);
|
71
|
+
STDMETHOD(PostDisconnectOne)(BSTR connid);
|
72
|
+
#endif
|
73
|
+
STDMETHOD(PostDisconnectAll)();
|
74
|
+
STDMETHOD(get_Stat)(short* retVal);
|
75
|
+
STDMETHOD(TdapErr)(OLE_HANDLE hWnd, BSTR* retVal);
|
76
|
+
|
77
|
+
STDMETHOD(RemoveSystemDb)(IConnRecords** retVal);
|
78
|
+
STDMETHOD(SlaveStatusName)(int index, BSTR* retVal);
|
79
|
+
STDMETHOD(SysvarName)(int index, BSTR* retVal);
|
80
|
+
|
81
|
+
};
|
82
|
+
|
83
|
+
OBJECT_ENTRY_AUTO(__uuidof(ConnMgr), CConnMgr)
|
@@ -0,0 +1,123 @@
|
|
1
|
+
/*=================================================================
|
2
|
+
Copyright (C) 2016 BizStation Corp All rights reserved.
|
3
|
+
|
4
|
+
This program is free software; you can redistribute it and/or
|
5
|
+
modify it under the terms of the GNU General Public License
|
6
|
+
as published by the Free Software Foundation; either version 2
|
7
|
+
of the License, or (at your option) any later version.
|
8
|
+
|
9
|
+
This program is distributed in the hope that it will be useful,
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
GNU General Public License for more details.
|
13
|
+
|
14
|
+
You should have received a copy of the GNU General Public License
|
15
|
+
along with this program; if not, write to the Free Software
|
16
|
+
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
17
|
+
02111-1307, USA.
|
18
|
+
=================================================================*/
|
19
|
+
#include "stdafx.h"
|
20
|
+
#include "ConnRecord.h"
|
21
|
+
STDMETHODIMP CConnRecord::InterfaceSupportsErrorInfo(REFIID riid)
|
22
|
+
{
|
23
|
+
static const IID* const arr[] =
|
24
|
+
{
|
25
|
+
&IID_IConnRecord
|
26
|
+
};
|
27
|
+
|
28
|
+
for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
|
29
|
+
{
|
30
|
+
if (InlineIsEqualGUID(*arr[i],riid))
|
31
|
+
return S_OK;
|
32
|
+
}
|
33
|
+
return S_FALSE;
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
#ifdef _WIN64
|
38
|
+
STDMETHODIMP CConnRecord::get_ConId(__int64* retVal)
|
39
|
+
{
|
40
|
+
*retVal = m_rec.conId;
|
41
|
+
return S_OK;
|
42
|
+
}
|
43
|
+
#else
|
44
|
+
STDMETHODIMP CConnRecord::get_ConId(BSTR* retVal)
|
45
|
+
{
|
46
|
+
wchar_t tmp[256];
|
47
|
+
_i64tot_s(m_rec.conId, tmp, 256, 10);
|
48
|
+
CComBSTR ret = tmp;
|
49
|
+
*retVal = ret.Copy();
|
50
|
+
|
51
|
+
return S_OK;
|
52
|
+
}
|
53
|
+
#endif
|
54
|
+
|
55
|
+
STDMETHODIMP CConnRecord::get_Id(int* retVal)
|
56
|
+
{
|
57
|
+
*retVal = m_rec.id;
|
58
|
+
return S_OK;
|
59
|
+
}
|
60
|
+
|
61
|
+
STDMETHODIMP CConnRecord::get_Db(short* retVal)
|
62
|
+
{
|
63
|
+
*retVal = m_rec.db;
|
64
|
+
return S_OK;
|
65
|
+
}
|
66
|
+
|
67
|
+
STDMETHODIMP CConnRecord::get_Type(short* retVal)
|
68
|
+
{
|
69
|
+
*retVal = m_rec.type;
|
70
|
+
return S_OK;
|
71
|
+
}
|
72
|
+
|
73
|
+
STDMETHODIMP CConnRecord::get_Name(BSTR* retVal)
|
74
|
+
{
|
75
|
+
CComBSTR ret;
|
76
|
+
wchar_t tmp[256];
|
77
|
+
ret = m_rec.nameW(tmp, 256);
|
78
|
+
*retVal = ret.Copy();
|
79
|
+
return S_OK;
|
80
|
+
}
|
81
|
+
|
82
|
+
STDMETHODIMP CConnRecord::get_Value(BSTR* retVal)
|
83
|
+
{
|
84
|
+
CComBSTR ret;
|
85
|
+
wchar_t tmp[256];
|
86
|
+
if (m_rec.name[0] == 0x00 && m_rec.longValue)
|
87
|
+
_i64tot_s(m_rec.longValue, tmp, 256, 10);
|
88
|
+
else
|
89
|
+
m_rec.nameW(tmp, 256);
|
90
|
+
ret = tmp;
|
91
|
+
*retVal = ret.Copy();
|
92
|
+
return S_OK;
|
93
|
+
}
|
94
|
+
|
95
|
+
STDMETHODIMP CConnRecord::get_Status(short* retVal)
|
96
|
+
{
|
97
|
+
*retVal = m_rec.status;
|
98
|
+
return S_OK;
|
99
|
+
}
|
100
|
+
|
101
|
+
STDMETHODIMP CConnRecord::get_ReadCount(int* retVal)
|
102
|
+
{
|
103
|
+
*retVal = m_rec.readCount;
|
104
|
+
return S_OK;
|
105
|
+
}
|
106
|
+
|
107
|
+
STDMETHODIMP CConnRecord::get_UpdCount(int* retVal)
|
108
|
+
{
|
109
|
+
*retVal = m_rec.updCount;
|
110
|
+
return S_OK;
|
111
|
+
}
|
112
|
+
|
113
|
+
STDMETHODIMP CConnRecord::get_DelCount(int* retVal)
|
114
|
+
{
|
115
|
+
*retVal = m_rec.delCount;
|
116
|
+
return S_OK;
|
117
|
+
}
|
118
|
+
|
119
|
+
STDMETHODIMP CConnRecord::get_InsCount(int* retVal)
|
120
|
+
{
|
121
|
+
*retVal = m_rec.insCount;
|
122
|
+
return S_OK;
|
123
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
#pragma once
|
2
|
+
/*=================================================================
|
3
|
+
Copyright (C) 2016 BizStation Corp All rights reserved.
|
4
|
+
|
5
|
+
This program is free software; you can redistribute it and/or
|
6
|
+
modify it under the terms of the GNU General Public License
|
7
|
+
as published by the Free Software Foundation; either version 2
|
8
|
+
of the License, or (at your option) any later version.
|
9
|
+
|
10
|
+
This program is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU General Public License
|
16
|
+
along with this program; if not, write to the Free Software
|
17
|
+
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
18
|
+
02111-1307, USA.
|
19
|
+
=================================================================*/
|
20
|
+
#include "resource.h"
|
21
|
+
|
22
|
+
#include "tdclatl_i.h"
|
23
|
+
#include <bzs/db/transactd/connectionRecord.h>
|
24
|
+
|
25
|
+
using namespace ATL;
|
26
|
+
|
27
|
+
class ATL_NO_VTABLE CConnRecord
|
28
|
+
: public CComObjectRootEx<CComSingleThreadModel>,
|
29
|
+
public CComCoClass<CConnRecord, &CLSID_ConnRecord>,
|
30
|
+
public ISupportErrorInfo,
|
31
|
+
public IDispatchImpl<IConnRecord, &IID_IConnRecord, &LIBID_transactd,
|
32
|
+
/*wMajor =*/1, /*wMinor =*/0>
|
33
|
+
{
|
34
|
+
|
35
|
+
void setResult(IConnRecord** retVal);
|
36
|
+
|
37
|
+
public:
|
38
|
+
bzs::db::transactd::connection::record m_rec;
|
39
|
+
CConnRecord() {}
|
40
|
+
|
41
|
+
BEGIN_COM_MAP(CConnRecord)
|
42
|
+
COM_INTERFACE_ENTRY(IConnRecord)
|
43
|
+
COM_INTERFACE_ENTRY(IDispatch)
|
44
|
+
COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
45
|
+
END_COM_MAP()
|
46
|
+
|
47
|
+
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
|
48
|
+
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
49
|
+
HRESULT FinalConstruct() { return S_OK; }
|
50
|
+
void FinalRelease() {}
|
51
|
+
|
52
|
+
public:
|
53
|
+
#ifdef _WIN64
|
54
|
+
STDMETHOD (get_ConId)(__int64* retVal);
|
55
|
+
#else
|
56
|
+
STDMETHOD (get_ConId)(BSTR* retVal);
|
57
|
+
#endif
|
58
|
+
STDMETHOD (get_Id)(int* retVal); //unsigned int value_id;
|
59
|
+
STDMETHOD (get_Db)(short* retVal);
|
60
|
+
STDMETHOD (get_Type)(short* retVal); //trnType
|
61
|
+
STDMETHOD (get_Name)(BSTR* retVal);
|
62
|
+
STDMETHOD (get_Value)(BSTR* retVal);
|
63
|
+
STDMETHOD (get_Status)(short* retVal);
|
64
|
+
STDMETHOD (get_ReadCount)(int* retVal);
|
65
|
+
STDMETHOD (get_UpdCount)(int* retVal);
|
66
|
+
STDMETHOD (get_DelCount)(int* retVal);
|
67
|
+
STDMETHOD (get_InsCount)(int* retVal);
|
68
|
+
};
|
69
|
+
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/*=================================================================
|
2
|
+
Copyright (C) 2016 BizStation Corp All rights reserved.
|
3
|
+
|
4
|
+
This program is free software; you can redistribute it and/or
|
5
|
+
modify it under the terms of the GNU General Public License
|
6
|
+
as published by the Free Software Foundation; either version 2
|
7
|
+
of the License, or (at your option) any later version.
|
8
|
+
|
9
|
+
This program is distributed in the hope that it will be useful,
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
GNU General Public License for more details.
|
13
|
+
|
14
|
+
You should have received a copy of the GNU General Public License
|
15
|
+
along with this program; if not, write to the Free Software
|
16
|
+
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
17
|
+
02111-1307, USA.
|
18
|
+
=================================================================*/
|
19
|
+
#include "stdafx.h"
|
20
|
+
#include "ConnRecords.h"
|
21
|
+
#include "ConnRecord.h"
|
22
|
+
STDMETHODIMP CConnRecords::InterfaceSupportsErrorInfo(REFIID riid)
|
23
|
+
{
|
24
|
+
static const IID* const arr[] =
|
25
|
+
{
|
26
|
+
&IID_IConnRecords
|
27
|
+
};
|
28
|
+
|
29
|
+
for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
|
30
|
+
{
|
31
|
+
if (InlineIsEqualGUID(*arr[i],riid))
|
32
|
+
return S_OK;
|
33
|
+
}
|
34
|
+
return S_FALSE;
|
35
|
+
}
|
36
|
+
|
37
|
+
STDMETHODIMP CConnRecords::get_Record(short index, IConnRecord** retVal)
|
38
|
+
{
|
39
|
+
if (index >= (short)m_recs.size())
|
40
|
+
return Error("Invalid index", IID_IConnRecords);
|
41
|
+
CComObject<CConnRecord>* obj;
|
42
|
+
CComObject<CConnRecord>::CreateInstance(&obj);
|
43
|
+
if (!obj)
|
44
|
+
return Error("CreateInstance ConnRecord", IID_IConnRecords);
|
45
|
+
obj->m_rec = m_recs[index];
|
46
|
+
IConnRecord* rec;
|
47
|
+
obj->QueryInterface(IID_IConnRecord, (void**)&rec);
|
48
|
+
_ASSERTE(rec);
|
49
|
+
*retVal = rec;
|
50
|
+
return S_OK;
|
51
|
+
}
|
52
|
+
|
53
|
+
STDMETHODIMP CConnRecords::get_Size(int* retVal)
|
54
|
+
{
|
55
|
+
*retVal = (int)m_recs.size();
|
56
|
+
return S_OK;
|
57
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#pragma once
|
2
|
+
/*=================================================================
|
3
|
+
Copyright (C) 2016 BizStation Corp All rights reserved.
|
4
|
+
|
5
|
+
This program is free software; you can redistribute it and/or
|
6
|
+
modify it under the terms of the GNU General Public License
|
7
|
+
as published by the Free Software Foundation; either version 2
|
8
|
+
of the License, or (at your option) any later version.
|
9
|
+
|
10
|
+
This program is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU General Public License
|
16
|
+
along with this program; if not, write to the Free Software
|
17
|
+
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
18
|
+
02111-1307, USA.
|
19
|
+
=================================================================*/
|
20
|
+
#include "resource.h"
|
21
|
+
|
22
|
+
#include "tdclatl_i.h"
|
23
|
+
#include <bzs/db/transactd/connectionRecord.h>
|
24
|
+
|
25
|
+
using namespace ATL;
|
26
|
+
|
27
|
+
class ATL_NO_VTABLE CConnRecords
|
28
|
+
: public CComObjectRootEx<CComSingleThreadModel>,
|
29
|
+
public CComCoClass<CConnRecords, &CLSID_ConnRecords>,
|
30
|
+
public ISupportErrorInfo,
|
31
|
+
public IDispatchImpl<IConnRecords, &IID_IConnRecords, &LIBID_transactd,
|
32
|
+
/*wMajor =*/1, /*wMinor =*/0>
|
33
|
+
{
|
34
|
+
void setResult(IConnRecords** retVal);
|
35
|
+
|
36
|
+
public:
|
37
|
+
CConnRecords() {}
|
38
|
+
bzs::db::transactd::connection::records m_recs;
|
39
|
+
|
40
|
+
BEGIN_COM_MAP(CConnRecords)
|
41
|
+
COM_INTERFACE_ENTRY(IConnRecords)
|
42
|
+
COM_INTERFACE_ENTRY(IDispatch)
|
43
|
+
COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
44
|
+
END_COM_MAP()
|
45
|
+
|
46
|
+
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
|
47
|
+
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
48
|
+
HRESULT FinalConstruct() {return S_OK;}
|
49
|
+
void FinalRelease() {}
|
50
|
+
|
51
|
+
public:
|
52
|
+
STDMETHOD(get_Record)(short index, IConnRecord** retVal);
|
53
|
+
STDMETHOD(get_Size)(int* retVal);
|
54
|
+
};
|
55
|
+
|
@@ -589,6 +589,42 @@ STDMETHODIMP CDatabase::GetSqlStringForCreateTable(BSTR tableName, BSTR* retVal)
|
|
589
589
|
return S_OK;
|
590
590
|
}
|
591
591
|
|
592
|
+
STDMETHODIMP CDatabase::CreateAssociate(IDatabase** retVal)
|
593
|
+
{
|
594
|
+
CComObject<CDatabase>* ptb;
|
595
|
+
CComObject<CDatabase>::CreateInstance(&ptb);
|
596
|
+
HRESULT ret = ptb->AtatchDatabase((__int64*)m_db->createAssociate());
|
597
|
+
if (ret == S_OK)
|
598
|
+
{
|
599
|
+
IDatabase* dbPtr;
|
600
|
+
ptb->QueryInterface(IID_IDatabase, (void**)&dbPtr);
|
601
|
+
_ASSERTE(dbPtr);
|
602
|
+
*retVal = dbPtr;
|
603
|
+
return S_OK;
|
604
|
+
}
|
605
|
+
return ret;
|
606
|
+
}
|
607
|
+
|
608
|
+
STDMETHODIMP CDatabase::get_IsAssociate(VARIANT_BOOL* retVal)
|
609
|
+
{
|
610
|
+
*retVal = m_db->isAssociate();
|
611
|
+
return S_OK;
|
612
|
+
}
|
613
|
+
|
614
|
+
STDMETHODIMP CDatabase::GetCreateViewSql(BSTR name, BSTR* retVal)
|
615
|
+
{
|
616
|
+
uint_td size = 65000;
|
617
|
+
char* tmp = new char[size];
|
618
|
+
wchar_t* tmpw = new wchar_t[size];
|
619
|
+
m_db->getCreateViewSql(name, tmp, &size);
|
620
|
+
MultiByteToWideChar(CP_UTF8, 0, tmp, -1, tmpw, size);
|
621
|
+
CComBSTR ret = tmpw;
|
622
|
+
*retVal = ret.Copy();
|
623
|
+
delete [] tmp;
|
624
|
+
delete [] tmpw;
|
625
|
+
return S_OK;
|
626
|
+
}
|
627
|
+
|
592
628
|
void __stdcall onCopyData(database* db, table* tb, int recordCount, int count,
|
593
629
|
bool& cancel)
|
594
630
|
{
|
@@ -161,6 +161,10 @@ public:
|
|
161
161
|
STDMETHOD(put_CompatibleMode)(int Value);
|
162
162
|
STDMETHOD(get_CompatibleMode)(int* Value);
|
163
163
|
STDMETHOD(GetSqlStringForCreateTable)(BSTR tableName, BSTR* retValue);
|
164
|
+
STDMETHOD(CreateAssociate)(IDatabase** retVal);
|
165
|
+
STDMETHOD(get_IsAssociate)(VARIANT_BOOL* retVal);
|
166
|
+
STDMETHOD(GetCreateViewSql)(BSTR name, BSTR* retVal);
|
167
|
+
|
164
168
|
};
|
165
169
|
|
166
170
|
OBJECT_ENTRY_AUTO(__uuidof(Database), CDatabase)
|
@@ -850,7 +850,20 @@ STDMETHODIMP CTableTd::GetFVbits(VARIANT Index, IBitset** Value)
|
|
850
850
|
*Value = bi;
|
851
851
|
return S_OK;
|
852
852
|
}
|
853
|
-
|
853
|
+
|
854
|
+
STDMETHODIMP CTableTd::GetCreateSql(BSTR* retVal)
|
855
|
+
{
|
856
|
+
uint_td size = 65000;
|
857
|
+
char* tmp = new char[size];
|
858
|
+
wchar_t* tmpw = new wchar_t[size];
|
859
|
+
m_tb->getCreateSql(tmp, &size);
|
860
|
+
MultiByteToWideChar(CP_UTF8, 0, tmp, -1, tmpw, size);
|
861
|
+
CComBSTR ret = tmpw;
|
862
|
+
*retVal = ret.Copy();
|
863
|
+
delete [] tmp;
|
864
|
+
delete [] tmpw;
|
865
|
+
return S_OK;
|
866
|
+
}
|
854
867
|
|
855
868
|
void __stdcall onRecordCount(bzs::db::protocol::tdap::client::table* tb,
|
856
869
|
int count, bool& cancel)
|
Binary file
|
@@ -48,7 +48,7 @@ interface IPreparedQuery;
|
|
48
48
|
interface IBookmark;
|
49
49
|
interface IBitset;
|
50
50
|
interface IBinlogPos;
|
51
|
-
|
51
|
+
interface IConnMgr;
|
52
52
|
|
53
53
|
typedef
|
54
54
|
[
|
@@ -563,11 +563,16 @@ interface IDatabase : IDispatch
|
|
563
563
|
HRESULT _stdcall CompatibleMode([out, retval] int* Value);
|
564
564
|
[id(0x000000FC)]
|
565
565
|
HRESULT _stdcall GetSqlStringForCreateTable([in] BSTR tableName, [out, retval] BSTR* retValue);
|
566
|
+
[id(0x000000FD)]
|
567
|
+
HRESULT _stdcall CreateAssociate([out, retval] IDatabase** retVal);
|
568
|
+
[propget, id(0x000000FF)]
|
569
|
+
HRESULT _stdcall IsAssociate([out, retval] VARIANT_BOOL* retVal);
|
570
|
+
[id(0x00000100)]
|
571
|
+
HRESULT _stdcall GetCreateViewSql([in]BSTR name, [out, retval] BSTR* retVal);
|
572
|
+
|
566
573
|
};
|
567
574
|
|
568
575
|
|
569
|
-
|
570
|
-
|
571
576
|
[
|
572
577
|
object,
|
573
578
|
uuid(907FD3F0-130F-4A44-BC79-AAECBDBE93AF),
|
@@ -829,7 +834,8 @@ interface ITable : IDispatch
|
|
829
834
|
HRESULT _stdcall SetTimestampMode([in] eTimeStampMode mode);
|
830
835
|
[id(0x000000EE)]
|
831
836
|
HRESULT _stdcall GetFVbits([in] VARIANT Index, [out, retval] IBitset** Value);
|
832
|
-
|
837
|
+
[id(0x000000EF)]
|
838
|
+
HRESULT _stdcall GetCreateSql([out, retval] BSTR* retVal);
|
833
839
|
|
834
840
|
};
|
835
841
|
[
|
@@ -1774,6 +1780,118 @@ interface IBinlogPos : IDispatch{
|
|
1774
1780
|
HRESULT _stdcall Gtid([out, retval] BSTR* retVal);
|
1775
1781
|
};
|
1776
1782
|
|
1783
|
+
[
|
1784
|
+
object,
|
1785
|
+
uuid(E7A70DBE-00F0-41AD-AC80-7EBDF930E79B),
|
1786
|
+
dual,
|
1787
|
+
nonextensible,
|
1788
|
+
pointer_default(unique)
|
1789
|
+
]
|
1790
|
+
interface IConnRecord : IDispatch{
|
1791
|
+
[propget, id(0x0000001)]
|
1792
|
+
#ifdef _WIN64
|
1793
|
+
HRESULT _stdcall ConId([out, retval] __int64* retVal);
|
1794
|
+
#else
|
1795
|
+
HRESULT _stdcall ConId([out, retval] BSTR* retVal);
|
1796
|
+
#endif
|
1797
|
+
[propget, id(0x0000002)]
|
1798
|
+
HRESULT _stdcall Id([out, retval] int* retVal); //unsigned int value_id;
|
1799
|
+
[propget, id(0x0000003)]
|
1800
|
+
HRESULT _stdcall Db([out, retval] short* retVal);
|
1801
|
+
[propget, id(0x0000004)]
|
1802
|
+
HRESULT _stdcall Type([out, retval] short* retVal); //trnType
|
1803
|
+
[propget, id(0x0000005)]
|
1804
|
+
HRESULT _stdcall Name([out, retval] BSTR* retVal);
|
1805
|
+
[propget, id(0x0000006)]
|
1806
|
+
HRESULT _stdcall Value([out, retval] BSTR* retVal);
|
1807
|
+
[propget, id(0x0000007)]
|
1808
|
+
HRESULT _stdcall Status([out, retval] short* retVal);
|
1809
|
+
[propget, id(0x0000008)]
|
1810
|
+
HRESULT _stdcall ReadCount([out, retval] int* retVal);
|
1811
|
+
[propget, id(0x0000009)]
|
1812
|
+
HRESULT _stdcall UpdCount([out, retval] int* retVal);
|
1813
|
+
[propget, id(0x000000A)]
|
1814
|
+
HRESULT _stdcall DelCount([out, retval] int* retVal);
|
1815
|
+
[propget, id(0x000000B)]
|
1816
|
+
HRESULT _stdcall InsCount([out, retval] int* retVal);
|
1817
|
+
}
|
1818
|
+
|
1819
|
+
[
|
1820
|
+
object,
|
1821
|
+
uuid(53076AFA-08D3-4877-A519-529BFD161F42),
|
1822
|
+
dual,
|
1823
|
+
nonextensible,
|
1824
|
+
pointer_default(unique)
|
1825
|
+
]
|
1826
|
+
interface IConnRecords : IDispatch{
|
1827
|
+
[propget, id(0)]
|
1828
|
+
HRESULT _stdcall Record([in] short index, [out, retval] IConnRecord** retVal);
|
1829
|
+
[propget, id(1)]
|
1830
|
+
HRESULT _stdcall Size([out, retval] int* Value);
|
1831
|
+
}
|
1832
|
+
|
1833
|
+
[
|
1834
|
+
object,
|
1835
|
+
uuid(1A37F719-9B06-4A27-9BB8-073FAD6C2BDC),
|
1836
|
+
dual,
|
1837
|
+
nonextensible,
|
1838
|
+
pointer_default(unique)
|
1839
|
+
]
|
1840
|
+
interface IConnMgr : IDispatch{
|
1841
|
+
[id(0x0000001)]
|
1842
|
+
HRESULT _stdcall SetDatabase([in] VARIANT db);
|
1843
|
+
[id(0x0000002)]
|
1844
|
+
HRESULT _stdcall Connect([in] BSTR uri, [out, retval] VARIANT_BOOL* retVal);
|
1845
|
+
[id(0x0000003)]
|
1846
|
+
HRESULT _stdcall Disconnect();
|
1847
|
+
[id(0x0000004)]
|
1848
|
+
HRESULT _stdcall Databases([out, retval] IConnRecords** retVal);
|
1849
|
+
[id(0x0000005)]
|
1850
|
+
HRESULT _stdcall Tables([in]BSTR dbname, [out, retval] IConnRecords** retVal);
|
1851
|
+
[id(0x0000006)]
|
1852
|
+
HRESULT _stdcall Views([in]BSTR dbname, [out, retval] IConnRecords** retVal);
|
1853
|
+
[id(0x0000007)]
|
1854
|
+
HRESULT _stdcall SchemaTables([in]BSTR dbname, [out, retval] IConnRecords** retVal);
|
1855
|
+
[id(0x0000008)]
|
1856
|
+
HRESULT _stdcall Sysvars([out, retval] IConnRecords** retVal);
|
1857
|
+
[id(0x0000011)]
|
1858
|
+
HRESULT _stdcall SlaveStatus([out, retval] IConnRecords** retVal);
|
1859
|
+
[id(0x0000009)]
|
1860
|
+
HRESULT _stdcall Connections([out, retval] IConnRecords** retVal);
|
1861
|
+
[id(0x000000A)]
|
1862
|
+
#ifdef _WIN64
|
1863
|
+
HRESULT _stdcall InUseDatabases([in]__int64 connid, [out, retval] IConnRecords** retVal);
|
1864
|
+
#else
|
1865
|
+
HRESULT _stdcall InUseDatabases([in]BSTR connid, [out, retval] IConnRecords** retVal);
|
1866
|
+
#endif
|
1867
|
+
[id(0x000000B)]
|
1868
|
+
#ifdef _WIN64
|
1869
|
+
HRESULT _stdcall InUseTables([in]__int64 connid, [in] int db, [out, retval] IConnRecords** retVal);
|
1870
|
+
#else
|
1871
|
+
HRESULT _stdcall InUseTables([in]BSTR connid, [in] int db, [out, retval] IConnRecords** retVal);
|
1872
|
+
#endif
|
1873
|
+
[id(0x000000C)]
|
1874
|
+
#ifdef _WIN64
|
1875
|
+
HRESULT _stdcall PostDisconnectOne([in] __int64 connid);
|
1876
|
+
#else
|
1877
|
+
HRESULT _stdcall PostDisconnectOne([in] BSTR connid);
|
1878
|
+
#endif
|
1879
|
+
[id(0x000000D)]
|
1880
|
+
HRESULT _stdcall PostDisconnectAll();
|
1881
|
+
[propget, id(0x000000E)]
|
1882
|
+
HRESULT _stdcall Stat([out, retval] short* retVal);
|
1883
|
+
[id(0x000000F)]
|
1884
|
+
HRESULT _stdcall TdapErr([in]OLE_HANDLE hWnd, [out, retval] BSTR* retVal);
|
1885
|
+
|
1886
|
+
[id(0x0000010)]
|
1887
|
+
HRESULT _stdcall RemoveSystemDb([in, out]IConnRecords** retVal);
|
1888
|
+
[id(0x0000012)]
|
1889
|
+
HRESULT _stdcall SlaveStatusName([in]int index, [out, retval] BSTR* retVal);
|
1890
|
+
[id(0x0000013)]
|
1891
|
+
HRESULT _stdcall SysvarName([in]int index, [out, retval] BSTR* retVal);
|
1892
|
+
};
|
1893
|
+
|
1894
|
+
|
1777
1895
|
[
|
1778
1896
|
uuid(3B712514-E2EF-4040-8A3C-BCACB839EB3E),
|
1779
1897
|
version(1.0),
|
@@ -2043,6 +2161,32 @@ library transactd
|
|
2043
2161
|
{
|
2044
2162
|
[default] interface IBinlogPos;
|
2045
2163
|
};
|
2164
|
+
|
2165
|
+
[
|
2166
|
+
uuid(A58AD1FB-E72C-472B-B465-93E098959046)
|
2167
|
+
,noncreatable
|
2168
|
+
]
|
2169
|
+
coclass ConnRecord
|
2170
|
+
{
|
2171
|
+
[default] interface IConnRecord;
|
2172
|
+
};
|
2173
|
+
|
2174
|
+
[
|
2175
|
+
uuid(5D1AFE02-2BAF-494A-9512-8591903CE778)
|
2176
|
+
,noncreatable
|
2177
|
+
]
|
2178
|
+
coclass ConnRecords
|
2179
|
+
{
|
2180
|
+
[default] interface IConnRecords;
|
2181
|
+
};
|
2182
|
+
|
2183
|
+
[
|
2184
|
+
uuid(7D8E310E-EA0A-4B54-A813-14BBB3E82EB5)
|
2185
|
+
]
|
2186
|
+
coclass ConnMgr
|
2187
|
+
{
|
2188
|
+
[default] interface IConnMgr;
|
2189
|
+
};
|
2046
2190
|
|
2047
2191
|
};
|
2048
2192
|
|