transactd 2.3.0 → 2.4.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/{BUILD_UNIX-JA → BUILD_UNIX-JA.md} +6 -6
- data/CMakeLists.txt +20 -15
- data/{README-JA → README-JA.md} +23 -23
- data/{README → README.md} +22 -24
- data/RELEASE_NOTE +120 -0
- data/RELEASE_NOTE-JA +110 -0
- data/bin/common/tdclc_32_2_4.dll +0 -0
- data/bin/common/tdclc_64_2_4.dll +0 -0
- data/build/common/get_ruby_path.cmake +1 -1
- data/build/swig/ruby/tdclrb_wrap.cpp +1319 -830
- data/build/swig/tdcl.i +22 -2
- 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 +2 -1
- data/build/tdclrb/CMakeLists.txt +6 -1
- data/build/tdclrb/bldgem/extconf.rb +5 -1
- data/build/tdclrb/tdclrb.rc +4 -4
- data/source/bzs/db/engine/mysql/database.cpp +44 -40
- data/source/bzs/db/engine/mysql/database.h +28 -8
- data/source/bzs/db/engine/mysql/dbManager.cpp +2 -0
- data/source/bzs/db/engine/mysql/dbManager.h +2 -7
- data/source/bzs/db/engine/mysql/mysqlInternal.h +79 -7
- data/source/bzs/db/protocol/hs/hsCommandExecuter.h +5 -1
- data/source/bzs/db/protocol/tdap/client/activeTable.cpp +32 -8
- data/source/bzs/db/protocol/tdap/client/activeTable.h +17 -4
- data/source/bzs/db/protocol/tdap/client/activeTableImple.h +10 -4
- data/source/bzs/db/protocol/tdap/client/client.cpp +51 -6
- data/source/bzs/db/protocol/tdap/client/client.h +41 -11
- data/source/bzs/db/protocol/tdap/client/connMgr.cpp +51 -15
- data/source/bzs/db/protocol/tdap/client/connMgr.h +6 -1
- data/source/bzs/db/protocol/tdap/client/database.cpp +26 -5
- data/source/bzs/db/protocol/tdap/client/database.h +3 -2
- data/source/bzs/db/protocol/tdap/client/dbDef.cpp +38 -28
- data/source/bzs/db/protocol/tdap/client/dbDef.h +1 -1
- data/source/bzs/db/protocol/tdap/client/dllmain.cpp +2 -32
- data/source/bzs/db/protocol/tdap/client/field.cpp +0 -1
- data/source/bzs/db/protocol/tdap/client/filter.h +60 -33
- data/source/bzs/db/protocol/tdap/client/groupQuery.cpp +2 -5
- data/source/bzs/db/protocol/tdap/client/memRecord.cpp +9 -0
- data/source/bzs/db/protocol/tdap/client/memRecord.h +1 -0
- data/source/bzs/db/protocol/tdap/client/nsDatabase.cpp +99 -48
- data/source/bzs/db/protocol/tdap/client/nsDatabase.h +5 -2
- data/source/bzs/db/protocol/tdap/client/nsTable.cpp +76 -26
- data/source/bzs/db/protocol/tdap/client/nsTable.h +6 -4
- data/source/bzs/db/protocol/tdap/client/request.h +28 -11
- data/source/bzs/db/protocol/tdap/client/sqlBuilder.cpp +19 -11
- data/source/bzs/db/protocol/tdap/client/table.cpp +157 -70
- data/source/bzs/db/protocol/tdap/client/table.h +20 -5
- data/source/bzs/db/protocol/tdap/client/trdboostapi.h +57 -4
- data/source/bzs/db/protocol/tdap/client/trdormapi.h +55 -20
- data/source/bzs/db/protocol/tdap/mysql/databaseSchema.cpp +65 -31
- data/source/bzs/db/protocol/tdap/mysql/databaseSchema.h +2 -0
- data/source/bzs/db/protocol/tdap/mysql/recordsetReader.h +24 -36
- data/source/bzs/db/protocol/tdap/mysql/request.h +1 -1
- data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.cpp +98 -18
- data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.h +12 -7
- data/source/bzs/db/protocol/tdap/tdapRequest.h +3 -8
- data/source/bzs/db/protocol/tdap/tdapSchema.cpp +1 -9
- data/source/bzs/db/protocol/tdap/tdapSchema.h +31 -1
- data/source/bzs/db/protocol/tdap/tdapcapi.h +49 -6
- data/source/bzs/db/protocol/tdap/uri.h +41 -6
- data/source/bzs/db/transactd/appModule.cpp +0 -1
- data/source/bzs/db/transactd/appModule.h +0 -2
- data/source/bzs/db/transactd/connManager.cpp +202 -33
- data/source/bzs/db/transactd/connManager.h +11 -4
- data/source/bzs/db/transactd/connectionRecord.h +19 -5
- data/source/bzs/db/transactd/transactd.cpp +39 -8
- data/source/bzs/env/crosscompile.cpp +1 -1
- data/source/bzs/example/queryData.cpp +1 -1
- data/source/bzs/netsvc/client/iconnection.h +2 -0
- data/source/bzs/netsvc/client/tcpClient.cpp +48 -26
- data/source/bzs/netsvc/client/tcpClient.h +171 -106
- data/source/bzs/netsvc/server/IAppModule.h +0 -1
- data/source/bzs/netsvc/server/serverPipe.cpp +5 -1
- data/source/bzs/netsvc/server/serverPipe.h +2 -1
- data/source/bzs/test/tdclatl/test_query_atl.js +105 -0
- data/source/bzs/test/tdclphp/transactd_Test.php +129 -11
- data/source/bzs/test/tdclrb/transactd_spec.rb +74 -2
- data/source/bzs/test/transactdBench/scaling_bench.cpp +1 -1
- data/source/bzs/test/trdclengn/test_trdclengn.cpp +45 -20
- data/source/global/tdclatl/Bookmark.cpp +28 -0
- data/source/global/tdclatl/Bookmark.h +65 -0
- data/source/global/tdclatl/Database.cpp +2 -2
- data/source/global/tdclatl/Database.h +1 -3
- data/source/global/tdclatl/DbDef.cpp +6 -0
- data/source/global/tdclatl/DbDef.h +1 -0
- data/source/global/tdclatl/QueryBase.cpp +29 -0
- data/source/global/tdclatl/QueryBase.h +4 -0
- data/source/global/tdclatl/Record.cpp +14 -2
- data/source/global/tdclatl/Record.h +1 -1
- data/source/global/tdclatl/Table.cpp +80 -16
- data/source/global/tdclatl/Table.h +23 -8
- data/source/global/tdclatl/_IDatabaseEvents_CP.h +39 -0
- data/source/global/tdclatl/activeTable.cpp +2 -2
- data/source/global/tdclatl/activeTable.h +1 -1
- data/source/global/tdclatl/tdclatl.idl +64 -14
- metadata +12 -12
- data/bin/common/tdclc_32_2_3.dll +0 -0
- data/bin/common/tdclc_64_2_3.dll +0 -0
- data/build/tdclcpp/BUILDNUMBER.txt +0 -1
- data/build/tdclrb/BUILDNUMBER.txt +0 -1
- /data/{BUILD_WIN-JA → BUILD_WIN-JA.md} +0 -0
- /data/{README_ORMSRCGEN-JA → README_ORMSRCGEN-JA.md} +0 -0
- /data/{README_ORMSRCGEN → README_ORMSRCGEN.md} +0 -0
data/build/swig/tdcl.i
CHANGED
|
@@ -263,9 +263,9 @@ using namespace bzs::db::protocol::tdap::client;
|
|
|
263
263
|
g_vPtrList.add(p->table().get());
|
|
264
264
|
return p;
|
|
265
265
|
}
|
|
266
|
-
activeTable(database* db, const _TCHAR* tableName) {
|
|
266
|
+
activeTable(database* db, const _TCHAR* tableName, short mode) {
|
|
267
267
|
bzs::db::protocol::tdap::client::activeTable* p =
|
|
268
|
-
bzs::db::protocol::tdap::client::activeTable::create(db, tableName);
|
|
268
|
+
bzs::db::protocol::tdap::client::activeTable::create(db, tableName, mode);
|
|
269
269
|
g_vPtrList.add(p->table().get());
|
|
270
270
|
return p;
|
|
271
271
|
}
|
|
@@ -663,6 +663,7 @@ using namespace bzs::db::protocol::tdap::client;
|
|
|
663
663
|
%ignore bzs::db::protocol::tdap::client::table::setMra;
|
|
664
664
|
%ignore bzs::db::protocol::tdap::client::table::setFVA;
|
|
665
665
|
%ignore bzs::db::protocol::tdap::client::table::getFVAstr;
|
|
666
|
+
%ignore bzs::db::protocol::tdap::client::table::insertBookmarks;
|
|
666
667
|
|
|
667
668
|
// create and release methods for query class
|
|
668
669
|
%extend bzs::db::protocol::tdap::client::query {
|
|
@@ -760,6 +761,11 @@ using namespace bzs::db::protocol::tdap::client;
|
|
|
760
761
|
%ignore bzs::db::protocol::tdap::client::insertKey;
|
|
761
762
|
%ignore bzs::db::protocol::tdap::client::insertRecord;
|
|
762
763
|
%ignore bzs::db::protocol::tdap::client::insertTable;
|
|
764
|
+
%ignore bzs::db::protocol::tdap::client::deleteTable
|
|
765
|
+
%ignore bzs::db::protocol::tdap::client::renumberTable
|
|
766
|
+
%ignore bzs::db::protocol::tdap::client::deleteField
|
|
767
|
+
%ignore bzs::db::protocol::tdap::client::deleteKey
|
|
768
|
+
%ignore bzs::db::protocol::tdap::client::validateTableDef
|
|
763
769
|
%ignore bzs::db::protocol::tdap::client::isSameUri;
|
|
764
770
|
%ignore bzs::db::protocol::tdap::client::lexical_cast;
|
|
765
771
|
%ignore bzs::db::protocol::tdap::client::openDatabase;
|
|
@@ -807,6 +813,9 @@ using namespace bzs::db::protocol::tdap::client;
|
|
|
807
813
|
%ignore bzs::db::protocol::tdap::client::mraResetter;
|
|
808
814
|
|
|
809
815
|
// * bzs/db/protocol/tdap/tdapcapi.h *
|
|
816
|
+
#ignore BOOKMARK::val;
|
|
817
|
+
#ignore BOOKMARK::empty;
|
|
818
|
+
#ignore MAX_BOOKMARK_SIZE
|
|
810
819
|
%ignore BOOKMARK_ALLOC_SIZE;
|
|
811
820
|
%ignore BTRV_MAX_DATA_SIZE;
|
|
812
821
|
%ignore POS_BLOCK_SIZE;
|
|
@@ -879,6 +888,8 @@ using namespace bzs::db::protocol::tdap::client;
|
|
|
879
888
|
%ignore TD_GET_BLOB_BUF;
|
|
880
889
|
%ignore TD_STASTISTICS;
|
|
881
890
|
%ignore TD_KEY_SEEK_MULTI;
|
|
891
|
+
%ignore TD_ACL_RELOAD;
|
|
892
|
+
%ignore TD_RECONNECT;
|
|
882
893
|
%ignore CR_SUBOP_DROP;
|
|
883
894
|
%ignore CR_SUBOP_RENAME;
|
|
884
895
|
%ignore CR_SUBOP_SWAPNAME;
|
|
@@ -891,9 +902,18 @@ using namespace bzs::db::protocol::tdap::client;
|
|
|
891
902
|
%ignore TD_STSTCS_READ;
|
|
892
903
|
%ignore TD_STSTCS_DISCONNECT_ONE;
|
|
893
904
|
%ignore TD_STSTCS_DISCONNECT_ALL;
|
|
905
|
+
%ignore TD_STSTCS_DATABASE_LIST;
|
|
906
|
+
%ignore TD_STSTCS_SYSTEM_VARIABLES;
|
|
907
|
+
%ignore TD_STSTCS_SCHEMA_TABLE_LIST;
|
|
894
908
|
%ignore LG_SUBOP_CONNECT;
|
|
895
909
|
%ignore LG_SUBOP_DISCONNECT;
|
|
896
910
|
%ignore LG_SUBOP_NEWCONNECT;
|
|
911
|
+
%ignore LG_SUBOP_RECONNECT;
|
|
912
|
+
%ignore LG_SUBOP_DISCONNECT_EX;
|
|
913
|
+
%ignore CMPLOGICAL_VAR_COMP_ALL;
|
|
914
|
+
%ignore CMPLOGICAL_CMPACS;
|
|
915
|
+
%ignore CMPLOGICAL_FIELD;
|
|
916
|
+
%ignore CMPLOGICAL_CASEINSENSITIVE;
|
|
897
917
|
%ignore C_INTERFACE_VER_MAJOR;
|
|
898
918
|
%ignore C_INTERFACE_VER_MINOR;
|
|
899
919
|
%ignore C_INTERFACE_VER_RELEASE;
|
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>_2_4</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 2,
|
|
33
|
-
PRODUCTVERSION 2,
|
|
32
|
+
FILEVERSION 2,4,0,66
|
|
33
|
+
PRODUCTVERSION 2,4,0,66
|
|
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", "2.
|
|
50
|
+
VALUE "FileVersion", "2.4.0.66"
|
|
51
51
|
VALUE "LegalCopyright", "Copyright(C) 2014 BizStation Corp"
|
|
52
|
-
VALUE "ProductVersion", "2.
|
|
52
|
+
VALUE "ProductVersion", "2.4.0.66"
|
|
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 2,
|
|
33
|
-
PRODUCTVERSION 2,
|
|
32
|
+
FILEVERSION 2,4,0,66
|
|
33
|
+
PRODUCTVERSION 2,4,0,66
|
|
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", "2.
|
|
50
|
+
VALUE "FileVersion", "2.4.0.66"
|
|
51
51
|
VALUE "LegalCopyright", "Copyright(C) 2014 BizStation Corp"
|
|
52
|
-
VALUE "ProductVersion", "2.
|
|
52
|
+
VALUE "ProductVersion", "2.4.0.66"
|
|
53
53
|
VALUE "ProductName", "Transactd Client (GPL V2)"
|
|
54
54
|
END
|
|
55
55
|
END
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
<BCVER Condition="'$(ProductVersion)'>='12.0' and '$(ProductVersion)' < '13.0'">190</BCVER>
|
|
16
16
|
<BCVER Condition="'$(ProductVersion)'>='14.0' and '$(ProductVersion)' < '15.0'">200</BCVER>
|
|
17
17
|
<BCVER Condition="'$(ProductVersion)'>='15.0' and '$(ProductVersion)' < '16.0'">210</BCVER>
|
|
18
|
+
<BCVER Condition="'$(ProductVersion)'>='16.0' and '$(ProductVersion)' < '17.0'">220</BCVER>
|
|
18
19
|
</PropertyGroup>
|
|
19
20
|
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
|
20
21
|
<Base>true</Base>
|
|
@@ -152,7 +153,7 @@
|
|
|
152
153
|
<BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
|
|
153
154
|
<BCC_ExtendedErrorInfo>true</BCC_ExtendedErrorInfo>
|
|
154
155
|
<TD_VER_MAJOR>2</TD_VER_MAJOR>
|
|
155
|
-
<TD_VER_MINOR>
|
|
156
|
+
<TD_VER_MINOR>4</TD_VER_MINOR>
|
|
156
157
|
<DllSuffix>$(TD_VER_MAJOR)_$(TD_VER_MINOR)</DllSuffix>
|
|
157
158
|
<TD_CPU>32</TD_CPU>
|
|
158
159
|
</PropertyGroup>
|
data/build/tdclrb/CMakeLists.txt
CHANGED
|
@@ -152,7 +152,12 @@ else()
|
|
|
152
152
|
if(MSVC)
|
|
153
153
|
target_link_libraries(${this_target} "tdclcppmr")
|
|
154
154
|
else()
|
|
155
|
-
|
|
155
|
+
if(NOT TRANSACTD_WITHOUT_C_CPP_CLIENTS)
|
|
156
|
+
target_link_libraries(${this_target} "tdclcppm")
|
|
157
|
+
else()
|
|
158
|
+
transactd_link_boost_libraries("timer;filesystem;thread;chrono;system")
|
|
159
|
+
target_link_libraries(${this_target} "tdclcpp_64m")
|
|
160
|
+
endif()
|
|
156
161
|
endif()
|
|
157
162
|
endif()
|
|
158
163
|
|
|
@@ -56,6 +56,7 @@ ruby_library_path = arg_config('--ruby_library_path', '').gsub(/"\n/, '')
|
|
|
56
56
|
install_prefix = arg_config('--install_prefix', '').gsub(/"\n/, '')
|
|
57
57
|
build_type = arg_config('--build_type', '').gsub(/"\n/, '')
|
|
58
58
|
no_rb_tbr = arg_config('--without_rb_thread_blocking_region', '').gsub(/"\n/, '').downcase
|
|
59
|
+
no_c_cpp = arg_config('--without_c_cpp_clients')
|
|
59
60
|
|
|
60
61
|
# boost
|
|
61
62
|
if boost != '' && boost !=~ /^\-DBOOST_ROOT/
|
|
@@ -121,10 +122,13 @@ rb_tbr = ' -DTRANSACTD_HAVE_RB_THREAD_CALL_WITHOUT_GVL=' +
|
|
|
121
122
|
' -DTRANSACTD_HAVE_RB_THREAD_BLOCKING_REGION=' +
|
|
122
123
|
(use_TBR ? 'ON' : 'OFF')
|
|
123
124
|
|
|
125
|
+
# no_c_cpp
|
|
126
|
+
no_c_cpp = no_c_cpp ? ' -DTRANSACTD_WITHOUT_C_CPP_CLIENTS=ON' : ''
|
|
127
|
+
|
|
124
128
|
# cmake
|
|
125
129
|
cmake_cmd = ['cmake', to_native_path(transactd_gem_root_relative), '-DTRANSACTD_RUBY_GEM=ON',
|
|
126
130
|
generator, boost, ruby_executable, ruby_library_path, ruby_include_dirs,
|
|
127
|
-
install_prefix, gem_root, build_type, rb_tbr, '>> cmake_generate.log'].join(' ')
|
|
131
|
+
install_prefix, gem_root, build_type, rb_tbr, no_c_cpp, '>> cmake_generate.log'].join(' ')
|
|
128
132
|
begin
|
|
129
133
|
f = open('cmake_generate.log', 'w')
|
|
130
134
|
f.puts cmake_cmd
|
data/build/tdclrb/tdclrb.rc
CHANGED
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
//
|
|
30
30
|
|
|
31
31
|
VS_VERSION_INFO VERSIONINFO
|
|
32
|
-
FILEVERSION 2,
|
|
33
|
-
PRODUCTVERSION 2,
|
|
32
|
+
FILEVERSION 2,4,0,66
|
|
33
|
+
PRODUCTVERSION 2,4,0,66
|
|
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", "2.
|
|
50
|
+
VALUE "FileVersion", "2.4.0.66"
|
|
51
51
|
VALUE "LegalCopyright", "Copyright(C) 2014 BizStation Corp"
|
|
52
|
-
VALUE "ProductVersion", "2.
|
|
52
|
+
VALUE "ProductVersion", "2.4.0.66"
|
|
53
53
|
VALUE "ProductName", "Transactd Client (GPL V2)"
|
|
54
54
|
END
|
|
55
55
|
END
|
|
@@ -92,7 +92,6 @@ void tableCacheCounter::addref(const std::string& dbname,
|
|
|
92
92
|
const std::string& tbname)
|
|
93
93
|
{
|
|
94
94
|
|
|
95
|
-
boost::mutex::scoped_lock lck(m_mutex);
|
|
96
95
|
size_t pos = getCounterIndex(dbname, tbname);
|
|
97
96
|
++m_counts[pos];
|
|
98
97
|
}
|
|
@@ -108,7 +107,6 @@ int tableCacheCounter::count(const std::string& dbname,
|
|
|
108
107
|
void tableCacheCounter::release(const std::string& dbname,
|
|
109
108
|
const std::string& tbname)
|
|
110
109
|
{
|
|
111
|
-
boost::mutex::scoped_lock lck(m_mutex);
|
|
112
110
|
size_t pos = getCounterIndex(dbname, tbname);
|
|
113
111
|
--m_counts[pos];
|
|
114
112
|
}
|
|
@@ -202,7 +200,15 @@ database::~database()
|
|
|
202
200
|
use();
|
|
203
201
|
unUseTables(true/*rollback*/);
|
|
204
202
|
closeForReopen();
|
|
205
|
-
|
|
203
|
+
{
|
|
204
|
+
boost::mutex::scoped_lock lck(tableRef.mutex());
|
|
205
|
+
for (size_t i = 0 ; i < m_tables.size(); ++i)
|
|
206
|
+
{
|
|
207
|
+
if (m_tables[i])
|
|
208
|
+
database::tableRef.release(name(), m_tables[i]->m_name);
|
|
209
|
+
}
|
|
210
|
+
m_tables.clear(); // It clears ahead of the destructor of m_trn.
|
|
211
|
+
}
|
|
206
212
|
deleteThdForThread(m_thd);
|
|
207
213
|
}
|
|
208
214
|
|
|
@@ -459,7 +465,7 @@ table* database::useTable(int index, enum_sql_command cmd, rowLockMode* lck)
|
|
|
459
465
|
if (tb == NULL)
|
|
460
466
|
THROW_BZS_ERROR_WITH_CODEMSG(STATUS_FILE_NOT_OPENED,
|
|
461
467
|
"Invalid table id.");
|
|
462
|
-
if (tb->m_blobBuffer)
|
|
468
|
+
if (tb->m_blobBuffer && tb->blobFields())
|
|
463
469
|
tb->m_blobBuffer->clear();
|
|
464
470
|
|
|
465
471
|
// Change to shared lock is user tranasction only.
|
|
@@ -718,7 +724,10 @@ TABLE* database::doOpenTable(const std::string& name, short mode,
|
|
|
718
724
|
if (ER_LOCK_WAIT_TIMEOUT == m_thd->cp_get_sql_error())
|
|
719
725
|
m_stat = STATUS_CANNOT_LOCK_TABLE;
|
|
720
726
|
else
|
|
727
|
+
{
|
|
728
|
+
m_stat = m_thd->cp_get_sql_error();
|
|
721
729
|
cp_open_error_release(m_thd, tables);
|
|
730
|
+
}
|
|
722
731
|
return NULL;
|
|
723
732
|
}
|
|
724
733
|
cp_set_transaction_duration_for_all_locks(m_thd);
|
|
@@ -764,11 +773,15 @@ table* database::openTable(const std::string& name, short mode,
|
|
|
764
773
|
{
|
|
765
774
|
boost::shared_ptr<table> tb(
|
|
766
775
|
new table(t, *this, name, mode, (int)m_tables.size()));
|
|
767
|
-
|
|
776
|
+
{
|
|
777
|
+
boost::mutex::scoped_lock lck(tableRef.mutex());
|
|
778
|
+
m_tables.push_back(tb);
|
|
779
|
+
tableRef.addref(m_dbname, name); // addef first then table open.
|
|
780
|
+
}
|
|
768
781
|
m_stat = STATUS_SUCCESS;
|
|
769
782
|
if (tb->isExclusveMode())
|
|
770
783
|
++m_usingExclusive;
|
|
771
|
-
|
|
784
|
+
|
|
772
785
|
return tb.get();
|
|
773
786
|
}
|
|
774
787
|
return NULL;
|
|
@@ -832,12 +845,19 @@ void database::closeTable(table* tb)
|
|
|
832
845
|
break;
|
|
833
846
|
if (*tbl)
|
|
834
847
|
close_thread_table(m_thd, tbl);
|
|
835
|
-
|
|
848
|
+
releaseTable(i);
|
|
836
849
|
DEBUG_WRITELOG_SP1("CLOSE TABLE table id=%d \n", i);
|
|
837
850
|
}
|
|
838
851
|
}
|
|
839
852
|
}
|
|
840
853
|
|
|
854
|
+
void database::releaseTable(size_t index)
|
|
855
|
+
{
|
|
856
|
+
boost::mutex::scoped_lock lck(database::tableRef.mutex());
|
|
857
|
+
database::tableRef.release(name(), m_tables[index]->m_name);
|
|
858
|
+
m_tables[index].reset();
|
|
859
|
+
}
|
|
860
|
+
|
|
841
861
|
void database::closeForReopen()
|
|
842
862
|
{
|
|
843
863
|
// A transaction is committed compulsorily.
|
|
@@ -864,7 +884,7 @@ void database::reopen()
|
|
|
864
884
|
if (table)
|
|
865
885
|
m_tables[i]->resetInternalTable(table);
|
|
866
886
|
else
|
|
867
|
-
|
|
887
|
+
releaseTable(i);
|
|
868
888
|
}
|
|
869
889
|
}
|
|
870
890
|
}
|
|
@@ -910,7 +930,7 @@ table::table(TABLE* myTable, database& db, const std::string& name, short mode,
|
|
|
910
930
|
int id)
|
|
911
931
|
: m_table(myTable), m_name(name), m_mode(mode), m_id(id), m_db(db),
|
|
912
932
|
m_keybuf(new unsigned char[MAX_KEYLEN]),
|
|
913
|
-
|
|
933
|
+
m_stat(0),
|
|
914
934
|
m_keyconv(m_table->key_info, m_table->s->keys), m_blobBuffer(NULL),
|
|
915
935
|
m_readCount(0), m_updCount(0), m_delCount(0), m_insCount(0),
|
|
916
936
|
m_keyNum(-1), m_nonNcc(false), m_validCursor(true), m_cursor(false),
|
|
@@ -968,7 +988,6 @@ table::table(TABLE* myTable, database& db, const std::string& name, short mode,
|
|
|
968
988
|
table::~table()
|
|
969
989
|
{
|
|
970
990
|
resetInternalTable(NULL);
|
|
971
|
-
database::tableRef.release(m_db.name(), m_name);
|
|
972
991
|
for (size_t i = 0; i < preparedStatements.size(); ++i)
|
|
973
992
|
preparedStatements[i]->release();
|
|
974
993
|
}
|
|
@@ -987,7 +1006,6 @@ void table::resetTransctionInfo(THD* thd)
|
|
|
987
1006
|
m_locked = false;
|
|
988
1007
|
m_validCursor = false;
|
|
989
1008
|
m_nounlock = false;
|
|
990
|
-
m_readCount = m_updCount = m_delCount = m_insCount = 0;
|
|
991
1009
|
}
|
|
992
1010
|
|
|
993
1011
|
void table::resetInternalTable(TABLE* table)
|
|
@@ -1098,13 +1116,13 @@ short table::setKeyValuesPacked(const uchar* ptr, int size)
|
|
|
1098
1116
|
KEY_PART_INFO& seg = key.key_part[j];
|
|
1099
1117
|
if (seg.null_bit)
|
|
1100
1118
|
{
|
|
1101
|
-
m_keybuf[to++] = 0x00;
|
|
1102
|
-
seg.field->set_notnull()
|
|
1119
|
+
m_keybuf[to++] = 0x00; // set null to mysql null indicator.
|
|
1120
|
+
seg.field->set_notnull();// Ignore null for read.
|
|
1103
1121
|
}
|
|
1104
1122
|
if (seg.null_bit && isNisField(seg.field->field_name))
|
|
1105
1123
|
{
|
|
1106
|
-
m_keybuf[to++] = 0x00;
|
|
1107
|
-
|
|
1124
|
+
m_keybuf[to++] = 0x00; // set null to nis field.
|
|
1125
|
+
//continue next segment
|
|
1108
1126
|
}
|
|
1109
1127
|
else
|
|
1110
1128
|
{
|
|
@@ -1793,6 +1811,7 @@ void table::stepFirst()
|
|
|
1793
1811
|
}
|
|
1794
1812
|
else
|
|
1795
1813
|
{
|
|
1814
|
+
m_keyNum = -1;
|
|
1796
1815
|
if (setNonKey(true))
|
|
1797
1816
|
{
|
|
1798
1817
|
unlockRow(m_delayAutoCommit);
|
|
@@ -2068,11 +2087,7 @@ bool table::isNisKey(char num) const
|
|
|
2068
2087
|
if ((num >= 0) && (num < (short)m_table->s->keys))
|
|
2069
2088
|
{
|
|
2070
2089
|
Field* fd = m_table->key_info[num].key_part[0].field;
|
|
2071
|
-
|
|
2072
|
-
if (isNisField(fd->field_name))
|
|
2073
|
-
return true;
|
|
2074
|
-
else if ((fd->pack_length() == 1) && (fd->type() == MYSQL_TYPE_TINY) &&
|
|
2075
|
-
fd->null_bit)
|
|
2090
|
+
if (fd->null_bit)
|
|
2076
2091
|
return true;
|
|
2077
2092
|
}
|
|
2078
2093
|
return false;
|
|
@@ -2160,9 +2175,6 @@ __int64 table::insert(bool ncc)
|
|
|
2160
2175
|
|
|
2161
2176
|
{
|
|
2162
2177
|
autoincSetup setup(m_table);
|
|
2163
|
-
if (!ncc)
|
|
2164
|
-
key_copy(&m_nonNccKeybuf[0], m_table->record[1],
|
|
2165
|
-
&m_table->key_info[m_keyNum], KEYLEN_ALLCOPY);
|
|
2166
2178
|
setKeyNullFlags();
|
|
2167
2179
|
setFiledNullFlags();
|
|
2168
2180
|
|
|
@@ -2179,9 +2191,9 @@ __int64 table::insert(bool ncc)
|
|
|
2179
2191
|
if (m_stat == 0)
|
|
2180
2192
|
{
|
|
2181
2193
|
++m_insCount;
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2194
|
+
// innodb default is ncc=-1.
|
|
2195
|
+
m_nonNcc = !ncc;
|
|
2196
|
+
if (!ncc && !m_bulkInserting)
|
|
2185
2197
|
key_copy(&m_keybuf[0], m_table->record[0],
|
|
2186
2198
|
&m_table->key_info[m_keyNum], KEYLEN_ALLCOPY);
|
|
2187
2199
|
|
|
@@ -2199,15 +2211,10 @@ void table::beginUpdate(char keyNum)
|
|
|
2199
2211
|
if (m_stat == 0)
|
|
2200
2212
|
{
|
|
2201
2213
|
if (keyNum >= 0)
|
|
2202
|
-
|
|
2203
|
-
key_copy(&m_nonNccKeybuf[0], m_table->record[0],
|
|
2204
|
-
&m_table->key_info[keyNum], KEYLEN_ALLCOPY);
|
|
2205
|
-
setKeyNum(keyNum);
|
|
2206
|
-
}
|
|
2214
|
+
setKeyNum(keyNum);
|
|
2207
2215
|
store_record(m_table, record[1]);
|
|
2208
2216
|
}
|
|
2209
2217
|
}
|
|
2210
|
-
|
|
2211
2218
|
void table::beginDel()
|
|
2212
2219
|
{
|
|
2213
2220
|
if ((m_mode == TD_OPEN_READONLY) || (m_table->reginfo.lock_type < TL_WRITE))
|
|
@@ -2278,14 +2285,11 @@ void table::update(bool ncc)
|
|
|
2278
2285
|
const KEY& key = m_table->key_info[m_keyNum];
|
|
2279
2286
|
key_copy(&m_keybuf[0], m_table->record[0], (KEY*)&key,
|
|
2280
2287
|
KEYLEN_ALLCOPY);
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
if (nullFieldsOfCurrentKey == 0)
|
|
2287
|
-
m_nonNcc = true;
|
|
2288
|
-
}
|
|
2288
|
+
|
|
2289
|
+
// Since the NULL key was set, a current position is
|
|
2290
|
+
// lost.
|
|
2291
|
+
if (nullFieldsOfCurrentKey == 0)
|
|
2292
|
+
m_nonNcc = true;
|
|
2289
2293
|
}
|
|
2290
2294
|
}
|
|
2291
2295
|
/* Do not change to m_changed = false */
|
|
@@ -73,9 +73,10 @@ namespace mysql
|
|
|
73
73
|
/** bookmark size
|
|
74
74
|
* btreive API is MAX 4 byte
|
|
75
75
|
*/
|
|
76
|
-
#define REF_SIZE_MAX
|
|
76
|
+
#define REF_SIZE_MAX 112
|
|
77
77
|
class table;
|
|
78
78
|
|
|
79
|
+
|
|
79
80
|
/** Control mysql table cahche
|
|
80
81
|
*/
|
|
81
82
|
class tableCacheCounter
|
|
@@ -93,6 +94,7 @@ public:
|
|
|
93
94
|
void addref(const std::string& dbname, const std::string& tbname);
|
|
94
95
|
int count(const std::string& dbname, const std::string& tbname);
|
|
95
96
|
void release(const std::string& dbname, const std::string& tbname);
|
|
97
|
+
boost::mutex& mutex() { return m_mutex; }
|
|
96
98
|
};
|
|
97
99
|
|
|
98
100
|
struct rowLockMode
|
|
@@ -130,6 +132,7 @@ private:
|
|
|
130
132
|
void prebuildLocktype(table* tb, enum_sql_command& cmd, rowLockMode* lck) ;
|
|
131
133
|
void changeIntentionLock(table* tb, thr_lock_type lock_type);
|
|
132
134
|
void checkACL(enum_sql_command cmd);
|
|
135
|
+
void releaseTable(size_t index);
|
|
133
136
|
public:
|
|
134
137
|
|
|
135
138
|
|
|
@@ -153,6 +156,8 @@ public:
|
|
|
153
156
|
|
|
154
157
|
short transactionType() const { return m_trnType; }
|
|
155
158
|
|
|
159
|
+
enum_tx_isolation transactionIsolation() const { return m_iso; }
|
|
160
|
+
|
|
156
161
|
bool inSnapshot() const { return m_inSnapshot != 0; }
|
|
157
162
|
|
|
158
163
|
const std::vector<boost::shared_ptr<table> >& tables() const
|
|
@@ -255,7 +260,6 @@ class table : private boost::noncopyable
|
|
|
255
260
|
#endif
|
|
256
261
|
database& m_db;
|
|
257
262
|
mutable boost::scoped_array<unsigned char> m_keybuf;
|
|
258
|
-
mutable boost::scoped_array<unsigned char> m_nonNccKeybuf;
|
|
259
263
|
|
|
260
264
|
int m_stat;
|
|
261
265
|
int m_percentResult;
|
|
@@ -264,10 +268,10 @@ class table : private boost::noncopyable
|
|
|
264
268
|
keynumConvert m_keyconv;
|
|
265
269
|
IblobBuffer* m_blobBuffer;
|
|
266
270
|
std::vector<Field*> m_nonKeySegNullFields;
|
|
267
|
-
int m_readCount;
|
|
268
|
-
int m_updCount;
|
|
269
|
-
int m_delCount;
|
|
270
|
-
int m_insCount;
|
|
271
|
+
unsigned int m_readCount;
|
|
272
|
+
unsigned int m_updCount;
|
|
273
|
+
unsigned int m_delCount;
|
|
274
|
+
unsigned int m_insCount;
|
|
271
275
|
char m_keyNum;
|
|
272
276
|
struct
|
|
273
277
|
{
|
|
@@ -386,7 +390,7 @@ public:
|
|
|
386
390
|
|
|
387
391
|
inline bool isChanged() { return m_changed; }
|
|
388
392
|
|
|
389
|
-
int id() { return m_id; };
|
|
393
|
+
int id() const { return m_id; };
|
|
390
394
|
|
|
391
395
|
/* The singleRowLock is no effects with Transaction or Snapshot. */
|
|
392
396
|
inline void unUse()
|
|
@@ -473,6 +477,7 @@ public:
|
|
|
473
477
|
{
|
|
474
478
|
return (1U << m_table->key_info[m_keyNum].user_defined_key_parts) - 1;
|
|
475
479
|
}
|
|
480
|
+
unsigned long long tableFlags() const { return m_table->file->ha_table_flags();}
|
|
476
481
|
void seekKey(enum ha_rkey_function find_flag, key_part_map keyMap);
|
|
477
482
|
void getNextSame(key_part_map keyMap);
|
|
478
483
|
void getLast();
|
|
@@ -744,7 +749,13 @@ public:
|
|
|
744
749
|
void setKeyValues(const std::vector<std::string>& values, int keypart,
|
|
745
750
|
const std::string* inValue = NULL);
|
|
746
751
|
|
|
747
|
-
|
|
752
|
+
inline unsigned int readCount() const { return m_readCount; }
|
|
753
|
+
|
|
754
|
+
inline unsigned int updCount() const { return m_updCount; }
|
|
755
|
+
|
|
756
|
+
inline unsigned int delCount() const { return m_delCount; }
|
|
757
|
+
|
|
758
|
+
inline unsigned int insCount() const { return m_insCount; }
|
|
748
759
|
};
|
|
749
760
|
|
|
750
761
|
class fieldBitmap
|
|
@@ -875,6 +886,15 @@ struct smartForceConsistantRead
|
|
|
875
886
|
}
|
|
876
887
|
};
|
|
877
888
|
|
|
889
|
+
|
|
890
|
+
class igetDatabases
|
|
891
|
+
{
|
|
892
|
+
public:
|
|
893
|
+
virtual ~igetDatabases(){};
|
|
894
|
+
virtual const databases& dbs() const = 0;
|
|
895
|
+
virtual boost::mutex& mutex() = 0;
|
|
896
|
+
};
|
|
897
|
+
|
|
878
898
|
#define BUILINSERT_SCOPE
|
|
879
899
|
|
|
880
900
|
} // namespace mysql
|
|
@@ -192,6 +192,7 @@ database* dbManager::getDatabase(const char* dbname, short cid, bool& created) c
|
|
|
192
192
|
if (db == NULL)
|
|
193
193
|
THROW_BZS_ERROR_WITH_CODEMSG(1, "Can not create database object.");
|
|
194
194
|
id = (int)m_dbs.size();
|
|
195
|
+
boost::mutex::scoped_lock lck(m_mutex);
|
|
195
196
|
m_dbs.push_back(db);
|
|
196
197
|
created = true;
|
|
197
198
|
}
|
|
@@ -245,6 +246,7 @@ int dbManager::ddl_dropDataBase(THD* thd, const std::string& dbname,
|
|
|
245
246
|
smartDbsReopen::removeName = dbname;
|
|
246
247
|
int ret = ddl_execSql(thd, cmd);
|
|
247
248
|
smartDbsReopen::removeName = "";
|
|
249
|
+
boost::mutex::scoped_lock lck(m_mutex);
|
|
248
250
|
for (int i = (int)m_dbs.size() - 1; i >= 0; i--)
|
|
249
251
|
{
|
|
250
252
|
if (m_dbs[i] && (m_dbs[i]->name() == dbname))
|
|
@@ -105,14 +105,9 @@ public:
|
|
|
105
105
|
virtual ~dbManager();
|
|
106
106
|
bool isShutDown() const;
|
|
107
107
|
|
|
108
|
-
const databases& dbs() const { return m_dbs; }
|
|
109
|
-
};
|
|
108
|
+
const databases& dbs() const { return m_dbs; }
|
|
110
109
|
|
|
111
|
-
|
|
112
|
-
{
|
|
113
|
-
public:
|
|
114
|
-
virtual ~igetDatabases(){};
|
|
115
|
-
virtual const engine::mysql::databases& dbs() const = 0;
|
|
110
|
+
boost::mutex& mutex() { return m_mutex; }
|
|
116
111
|
};
|
|
117
112
|
|
|
118
113
|
} // namespace mysql
|