Merge lp:~dshrews/drizzle/bug600795 into lp:~drizzle-trunk/drizzle/development
- bug600795
- Merge into development
Status: | Merged |
---|---|
Approved by: | Monty Taylor |
Approved revision: | 1721 |
Merged at revision: | 1735 |
Proposed branch: | lp:~dshrews/drizzle/bug600795 |
Merge into: | lp:~drizzle-trunk/drizzle/development |
Diff against target: |
743 lines (+306/-105) 4 files modified
drizzled/cursor.cc (+1/-0) drizzled/message/transaction_reader.cc (+56/-2) drizzled/transaction_services.cc (+171/-39) drizzled/transaction_services.h (+78/-64) |
To merge this branch: | bzr merge lp:~dshrews/drizzle/bug600795 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Merge Team | Pending | ||
Review via email: mp+33919@code.launchpad.net |
Commit message
Description of the change
This enables logging of the INSERTs produced by LOAD DATA.
As a consequence, I had to introduce a transaction message size threshold, because otherwise, we would have a large Transaction object for LOAD DATA that would contain all of the INSERTs for a single LOAD DATA statement. That could use a lot of memory and create a large GPB message, which has a maximum of 64M. (Right now, the transaction message size threshold is hard coded to 1M. I'll make this configurable in the near future once our sys var changes are merged into trunk.)
This means that we may have multiple Transactions in the replication stream for a single transaction, but they will all have the same transaction id, and all but the last Transaction will have the Statement end_segment attribute set to FALSE.
So a reader of the stream (or transaction log) will know to COMMIT when either:
a) The transaction id changes
b) Or, the Statement(s) within the Transaction have end_segment = TRUE
- 1722. By David Shrewsbury
-
Merge from trunk, resolve conflict with transaction_
services. h
Preview Diff
1 | === modified file 'drizzled/cursor.cc' | |||
2 | --- drizzled/cursor.cc 2010-08-26 17:42:07 +0000 | |||
3 | +++ drizzled/cursor.cc 2010-08-28 01:13:43 +0000 | |||
4 | @@ -1363,6 +1363,7 @@ | |||
5 | 1363 | break; | 1363 | break; |
6 | 1364 | case SQLCOM_INSERT: | 1364 | case SQLCOM_INSERT: |
7 | 1365 | case SQLCOM_INSERT_SELECT: | 1365 | case SQLCOM_INSERT_SELECT: |
8 | 1366 | case SQLCOM_LOAD: | ||
9 | 1366 | /* | 1367 | /* |
10 | 1367 | * The else block below represents an | 1368 | * The else block below represents an |
11 | 1368 | * INSERT ... ON DUPLICATE KEY UPDATE that | 1369 | * INSERT ... ON DUPLICATE KEY UPDATE that |
12 | 1369 | 1370 | ||
13 | === modified file 'drizzled/message/transaction_reader.cc' | |||
14 | --- drizzled/message/transaction_reader.cc 2010-07-17 06:28:29 +0000 | |||
15 | +++ drizzled/message/transaction_reader.cc 2010-08-28 01:13:43 +0000 | |||
16 | @@ -95,20 +95,74 @@ | |||
17 | 95 | } | 95 | } |
18 | 96 | } | 96 | } |
19 | 97 | 97 | ||
20 | 98 | static bool isEndStatement(const message::Statement &statement) | ||
21 | 99 | { | ||
22 | 100 | switch (statement.type()) | ||
23 | 101 | { | ||
24 | 102 | case (message::Statement::INSERT): | ||
25 | 103 | { | ||
26 | 104 | const message::InsertData &data= statement.insert_data(); | ||
27 | 105 | if (not data.end_segment()) | ||
28 | 106 | return false; | ||
29 | 107 | break; | ||
30 | 108 | } | ||
31 | 109 | case (message::Statement::UPDATE): | ||
32 | 110 | { | ||
33 | 111 | const message::UpdateData &data= statement.update_data(); | ||
34 | 112 | if (not data.end_segment()) | ||
35 | 113 | return false; | ||
36 | 114 | break; | ||
37 | 115 | } | ||
38 | 116 | case (message::Statement::DELETE): | ||
39 | 117 | { | ||
40 | 118 | const message::DeleteData &data= statement.delete_data(); | ||
41 | 119 | if (not data.end_segment()) | ||
42 | 120 | return false; | ||
43 | 121 | break; | ||
44 | 122 | } | ||
45 | 123 | default: | ||
46 | 124 | return true; | ||
47 | 125 | } | ||
48 | 126 | return true; | ||
49 | 127 | } | ||
50 | 128 | |||
51 | 98 | static void printTransaction(const message::Transaction &transaction) | 129 | static void printTransaction(const message::Transaction &transaction) |
52 | 99 | { | 130 | { |
53 | 131 | static uint64_t last_trx_id= 0; | ||
54 | 132 | bool should_commit= true; | ||
55 | 100 | const message::TransactionContext trx= transaction.transaction_context(); | 133 | const message::TransactionContext trx= transaction.transaction_context(); |
56 | 101 | 134 | ||
57 | 102 | size_t num_statements= transaction.statement_size(); | 135 | size_t num_statements= transaction.statement_size(); |
58 | 103 | size_t x; | 136 | size_t x; |
59 | 104 | 137 | ||
61 | 105 | cout << "START TRANSACTION;" << endl; | 138 | /* |
62 | 139 | * One way to determine when a new transaction begins is when the | ||
63 | 140 | * transaction id changes. We check that here. | ||
64 | 141 | */ | ||
65 | 142 | if (trx.transaction_id() != last_trx_id) | ||
66 | 143 | cout << "START TRANSACTION;" << endl; | ||
67 | 144 | |||
68 | 145 | last_trx_id= trx.transaction_id(); | ||
69 | 146 | |||
70 | 106 | for (x= 0; x < num_statements; ++x) | 147 | for (x= 0; x < num_statements; ++x) |
71 | 107 | { | 148 | { |
72 | 108 | const message::Statement &statement= transaction.statement(x); | 149 | const message::Statement &statement= transaction.statement(x); |
73 | 150 | |||
74 | 151 | if (should_commit) | ||
75 | 152 | should_commit= isEndStatement(statement); | ||
76 | 153 | |||
77 | 109 | printStatement(statement); | 154 | printStatement(statement); |
78 | 110 | } | 155 | } |
80 | 111 | cout << "COMMIT;" << endl; | 156 | |
81 | 157 | /* | ||
82 | 158 | * If ALL Statements are end segments, we can commit this Transaction. | ||
83 | 159 | * We can also check to see if the transaction_id changed, but this | ||
84 | 160 | * wouldn't work for the last Transaction in the transaction log since | ||
85 | 161 | * we don't have another Transaction to compare to. Checking for all | ||
86 | 162 | * end segments (like we do above) covers this case. | ||
87 | 163 | */ | ||
88 | 164 | if (should_commit) | ||
89 | 165 | cout << "COMMIT;" << endl; | ||
90 | 112 | } | 166 | } |
91 | 113 | 167 | ||
92 | 114 | int main(int argc, char* argv[]) | 168 | int main(int argc, char* argv[]) |
93 | 115 | 169 | ||
94 | === modified file 'drizzled/transaction_services.cc' | |||
95 | --- drizzled/transaction_services.cc 2010-08-26 15:33:12 +0000 | |||
96 | +++ drizzled/transaction_services.cc 2010-08-28 01:13:43 +0000 | |||
97 | @@ -80,6 +80,9 @@ | |||
98 | 80 | namespace drizzled | 80 | namespace drizzled |
99 | 81 | { | 81 | { |
100 | 82 | 82 | ||
101 | 83 | /** @TODO: Make this a system variable */ | ||
102 | 84 | static const size_t trx_msg_threshold= 1024 * 1024; | ||
103 | 85 | |||
104 | 83 | /** | 86 | /** |
105 | 84 | * @defgroup Transactions | 87 | * @defgroup Transactions |
106 | 85 | * | 88 | * |
107 | @@ -895,7 +898,7 @@ | |||
108 | 895 | return replication_services.isActive(); | 898 | return replication_services.isActive(); |
109 | 896 | } | 899 | } |
110 | 897 | 900 | ||
112 | 898 | message::Transaction *TransactionServices::getActiveTransactionMessage(Session *in_session) | 901 | message::Transaction *TransactionServices::getActiveTransactionMessage(Session *in_session, bool should_inc_trx_id) |
113 | 899 | { | 902 | { |
114 | 900 | message::Transaction *transaction= in_session->getTransactionMessage(); | 903 | message::Transaction *transaction= in_session->getTransactionMessage(); |
115 | 901 | 904 | ||
116 | @@ -907,7 +910,7 @@ | |||
117 | 907 | * deleting transaction message when done with it. | 910 | * deleting transaction message when done with it. |
118 | 908 | */ | 911 | */ |
119 | 909 | transaction= new (nothrow) message::Transaction(); | 912 | transaction= new (nothrow) message::Transaction(); |
121 | 910 | initTransactionMessage(*transaction, in_session); | 913 | initTransactionMessage(*transaction, in_session, should_inc_trx_id); |
122 | 911 | in_session->setTransactionMessage(transaction); | 914 | in_session->setTransactionMessage(transaction); |
123 | 912 | return transaction; | 915 | return transaction; |
124 | 913 | } | 916 | } |
125 | @@ -916,11 +919,17 @@ | |||
126 | 916 | } | 919 | } |
127 | 917 | 920 | ||
128 | 918 | void TransactionServices::initTransactionMessage(message::Transaction &in_transaction, | 921 | void TransactionServices::initTransactionMessage(message::Transaction &in_transaction, |
130 | 919 | Session *in_session) | 922 | Session *in_session, |
131 | 923 | bool should_inc_trx_id) | ||
132 | 920 | { | 924 | { |
133 | 921 | message::TransactionContext *trx= in_transaction.mutable_transaction_context(); | 925 | message::TransactionContext *trx= in_transaction.mutable_transaction_context(); |
134 | 922 | trx->set_server_id(in_session->getServerId()); | 926 | trx->set_server_id(in_session->getServerId()); |
136 | 923 | trx->set_transaction_id(getNextTransactionId()); | 927 | |
137 | 928 | if (should_inc_trx_id) | ||
138 | 929 | trx->set_transaction_id(getNextTransactionId()); | ||
139 | 930 | else | ||
140 | 931 | trx->set_transaction_id(getCurrentTransactionId()); | ||
141 | 932 | |||
142 | 924 | trx->set_start_timestamp(in_session->getCurrentTimestamp()); | 933 | trx->set_start_timestamp(in_session->getCurrentTimestamp()); |
143 | 925 | } | 934 | } |
144 | 926 | 935 | ||
145 | @@ -1014,7 +1023,7 @@ | |||
146 | 1014 | * attach it to the transaction, and push it to replicators. | 1023 | * attach it to the transaction, and push it to replicators. |
147 | 1015 | */ | 1024 | */ |
148 | 1016 | transaction->Clear(); | 1025 | transaction->Clear(); |
150 | 1017 | initTransactionMessage(*transaction, in_session); | 1026 | initTransactionMessage(*transaction, in_session, true); |
151 | 1018 | 1027 | ||
152 | 1019 | message::Statement *statement= transaction->add_statement(); | 1028 | message::Statement *statement= transaction->add_statement(); |
153 | 1020 | 1029 | ||
154 | @@ -1029,9 +1038,11 @@ | |||
155 | 1029 | } | 1038 | } |
156 | 1030 | 1039 | ||
157 | 1031 | message::Statement &TransactionServices::getInsertStatement(Session *in_session, | 1040 | message::Statement &TransactionServices::getInsertStatement(Session *in_session, |
159 | 1032 | Table *in_table) | 1041 | Table *in_table, |
160 | 1042 | uint32_t *next_segment_id) | ||
161 | 1033 | { | 1043 | { |
162 | 1034 | message::Statement *statement= in_session->getStatementMessage(); | 1044 | message::Statement *statement= in_session->getStatementMessage(); |
163 | 1045 | message::Transaction *transaction= NULL; | ||
164 | 1035 | 1046 | ||
165 | 1036 | /* | 1047 | /* |
166 | 1037 | * Check the type for the current Statement message, if it is anything | 1048 | * Check the type for the current Statement message, if it is anything |
167 | @@ -1047,21 +1058,59 @@ | |||
168 | 1047 | } | 1058 | } |
169 | 1048 | else if (statement != NULL) | 1059 | else if (statement != NULL) |
170 | 1049 | { | 1060 | { |
173 | 1050 | const message::InsertHeader &insert_header= statement->insert_header(); | 1061 | /* |
174 | 1051 | string old_table_name= insert_header.table_metadata().table_name(); | 1062 | * If we've passed our threshold for the statement size (possible for |
175 | 1063 | * a bulk insert), we'll finalize the Statement and Transaction (doing | ||
176 | 1064 | * the Transaction will keep it from getting huge). | ||
177 | 1065 | */ | ||
178 | 1066 | if (static_cast<size_t>(statement->ByteSize()) >= trx_msg_threshold) | ||
179 | 1067 | { | ||
180 | 1068 | message::InsertData *current_data= statement->mutable_insert_data(); | ||
181 | 1069 | |||
182 | 1070 | /* Caller should use this value when adding a new record */ | ||
183 | 1071 | *next_segment_id= current_data->segment_id() + 1; | ||
184 | 1072 | |||
185 | 1073 | current_data->set_end_segment(false); | ||
186 | 1074 | |||
187 | 1075 | /* | ||
188 | 1076 | * Send the trx message to replicators after finalizing the | ||
189 | 1077 | * statement and transaction. This will also set the Transaction | ||
190 | 1078 | * and Statement objects in Session to NULL. | ||
191 | 1079 | */ | ||
192 | 1080 | commitTransactionMessage(in_session); | ||
193 | 1081 | |||
194 | 1082 | /* | ||
195 | 1083 | * Statement and Transaction should now be NULL, so new ones will get | ||
196 | 1084 | * created. We reuse the transaction id since we are segmenting | ||
197 | 1085 | * one transaction. | ||
198 | 1086 | */ | ||
199 | 1087 | statement= in_session->getStatementMessage(); | ||
200 | 1088 | transaction= getActiveTransactionMessage(in_session, false); | ||
201 | 1089 | } | ||
202 | 1090 | else | ||
203 | 1091 | { | ||
204 | 1092 | const message::InsertHeader &insert_header= statement->insert_header(); | ||
205 | 1093 | string old_table_name= insert_header.table_metadata().table_name(); | ||
206 | 1052 | 1094 | ||
213 | 1053 | string current_table_name; | 1095 | string current_table_name; |
214 | 1054 | (void) in_table->getShare()->getTableName(current_table_name); | 1096 | (void) in_table->getShare()->getTableName(current_table_name); |
215 | 1055 | if (current_table_name.compare(old_table_name)) | 1097 | if (current_table_name.compare(old_table_name)) |
216 | 1056 | { | 1098 | { |
217 | 1057 | finalizeStatementMessage(*statement, in_session); | 1099 | finalizeStatementMessage(*statement, in_session); |
218 | 1058 | statement= in_session->getStatementMessage(); | 1100 | statement= in_session->getStatementMessage(); |
219 | 1101 | } | ||
220 | 1059 | } | 1102 | } |
221 | 1060 | } | 1103 | } |
222 | 1061 | 1104 | ||
223 | 1062 | if (statement == NULL) | 1105 | if (statement == NULL) |
224 | 1063 | { | 1106 | { |
226 | 1064 | message::Transaction *transaction= getActiveTransactionMessage(in_session); | 1107 | /* |
227 | 1108 | * Transaction will be non-NULL only if we had to segment it due to | ||
228 | 1109 | * transaction size above. | ||
229 | 1110 | */ | ||
230 | 1111 | if (transaction == NULL) | ||
231 | 1112 | transaction= getActiveTransactionMessage(in_session); | ||
232 | 1113 | |||
233 | 1065 | /* | 1114 | /* |
234 | 1066 | * Transaction message initialized and set, but no statement created | 1115 | * Transaction message initialized and set, but no statement created |
235 | 1067 | * yet. We construct one and initialize it, here, then return the | 1116 | * yet. We construct one and initialize it, here, then return the |
236 | @@ -1132,10 +1181,11 @@ | |||
237 | 1132 | return true; | 1181 | return true; |
238 | 1133 | } | 1182 | } |
239 | 1134 | 1183 | ||
241 | 1135 | message::Statement &statement= getInsertStatement(in_session, in_table); | 1184 | uint32_t next_segment_id= 1; |
242 | 1185 | message::Statement &statement= getInsertStatement(in_session, in_table, &next_segment_id); | ||
243 | 1136 | 1186 | ||
244 | 1137 | message::InsertData *data= statement.mutable_insert_data(); | 1187 | message::InsertData *data= statement.mutable_insert_data(); |
246 | 1138 | data->set_segment_id(1); | 1188 | data->set_segment_id(next_segment_id); |
247 | 1139 | data->set_end_segment(true); | 1189 | data->set_end_segment(true); |
248 | 1140 | message::InsertRecord *record= data->add_record(); | 1190 | message::InsertRecord *record= data->add_record(); |
249 | 1141 | 1191 | ||
250 | @@ -1169,9 +1219,11 @@ | |||
251 | 1169 | message::Statement &TransactionServices::getUpdateStatement(Session *in_session, | 1219 | message::Statement &TransactionServices::getUpdateStatement(Session *in_session, |
252 | 1170 | Table *in_table, | 1220 | Table *in_table, |
253 | 1171 | const unsigned char *old_record, | 1221 | const unsigned char *old_record, |
255 | 1172 | const unsigned char *new_record) | 1222 | const unsigned char *new_record, |
256 | 1223 | uint32_t *next_segment_id) | ||
257 | 1173 | { | 1224 | { |
258 | 1174 | message::Statement *statement= in_session->getStatementMessage(); | 1225 | message::Statement *statement= in_session->getStatementMessage(); |
259 | 1226 | message::Transaction *transaction= NULL; | ||
260 | 1175 | 1227 | ||
261 | 1176 | /* | 1228 | /* |
262 | 1177 | * Check the type for the current Statement message, if it is anything | 1229 | * Check the type for the current Statement message, if it is anything |
263 | @@ -1187,21 +1239,59 @@ | |||
264 | 1187 | } | 1239 | } |
265 | 1188 | else if (statement != NULL) | 1240 | else if (statement != NULL) |
266 | 1189 | { | 1241 | { |
273 | 1190 | const message::UpdateHeader &update_header= statement->update_header(); | 1242 | /* |
274 | 1191 | string old_table_name= update_header.table_metadata().table_name(); | 1243 | * If we've passed our threshold for the statement size (possible for |
275 | 1192 | 1244 | * a bulk insert), we'll finalize the Statement and Transaction (doing | |
276 | 1193 | string current_table_name; | 1245 | * the Transaction will keep it from getting huge). |
277 | 1194 | (void) in_table->getShare()->getTableName(current_table_name); | 1246 | */ |
278 | 1195 | if (current_table_name.compare(old_table_name)) | 1247 | if (static_cast<size_t>(statement->ByteSize()) >= trx_msg_threshold) |
279 | 1196 | { | 1248 | { |
281 | 1197 | finalizeStatementMessage(*statement, in_session); | 1249 | message::UpdateData *current_data= statement->mutable_update_data(); |
282 | 1250 | |||
283 | 1251 | /* Caller should use this value when adding a new record */ | ||
284 | 1252 | *next_segment_id= current_data->segment_id() + 1; | ||
285 | 1253 | |||
286 | 1254 | current_data->set_end_segment(false); | ||
287 | 1255 | |||
288 | 1256 | /* | ||
289 | 1257 | * Send the trx message to replicators after finalizing the | ||
290 | 1258 | * statement and transaction. This will also set the Transaction | ||
291 | 1259 | * and Statement objects in Session to NULL. | ||
292 | 1260 | */ | ||
293 | 1261 | commitTransactionMessage(in_session); | ||
294 | 1262 | |||
295 | 1263 | /* | ||
296 | 1264 | * Statement and Transaction should now be NULL, so new ones will get | ||
297 | 1265 | * created. We reuse the transaction id since we are segmenting | ||
298 | 1266 | * one transaction. | ||
299 | 1267 | */ | ||
300 | 1198 | statement= in_session->getStatementMessage(); | 1268 | statement= in_session->getStatementMessage(); |
301 | 1269 | transaction= getActiveTransactionMessage(in_session, false); | ||
302 | 1270 | } | ||
303 | 1271 | else | ||
304 | 1272 | { | ||
305 | 1273 | const message::UpdateHeader &update_header= statement->update_header(); | ||
306 | 1274 | string old_table_name= update_header.table_metadata().table_name(); | ||
307 | 1275 | |||
308 | 1276 | string current_table_name; | ||
309 | 1277 | (void) in_table->getShare()->getTableName(current_table_name); | ||
310 | 1278 | if (current_table_name.compare(old_table_name)) | ||
311 | 1279 | { | ||
312 | 1280 | finalizeStatementMessage(*statement, in_session); | ||
313 | 1281 | statement= in_session->getStatementMessage(); | ||
314 | 1282 | } | ||
315 | 1199 | } | 1283 | } |
316 | 1200 | } | 1284 | } |
317 | 1201 | 1285 | ||
318 | 1202 | if (statement == NULL) | 1286 | if (statement == NULL) |
319 | 1203 | { | 1287 | { |
321 | 1204 | message::Transaction *transaction= getActiveTransactionMessage(in_session); | 1288 | /* |
322 | 1289 | * Transaction will be non-NULL only if we had to segment it due to | ||
323 | 1290 | * transaction size above. | ||
324 | 1291 | */ | ||
325 | 1292 | if (transaction == NULL) | ||
326 | 1293 | transaction= getActiveTransactionMessage(in_session); | ||
327 | 1294 | |||
328 | 1205 | /* | 1295 | /* |
329 | 1206 | * Transaction message initialized and set, but no statement created | 1296 | * Transaction message initialized and set, but no statement created |
330 | 1207 | * yet. We construct one and initialize it, here, then return the | 1297 | * yet. We construct one and initialize it, here, then return the |
331 | @@ -1288,10 +1378,11 @@ | |||
332 | 1288 | if (! replication_services.isActive()) | 1378 | if (! replication_services.isActive()) |
333 | 1289 | return; | 1379 | return; |
334 | 1290 | 1380 | ||
336 | 1291 | message::Statement &statement= getUpdateStatement(in_session, in_table, old_record, new_record); | 1381 | uint32_t next_segment_id= 1; |
337 | 1382 | message::Statement &statement= getUpdateStatement(in_session, in_table, old_record, new_record, &next_segment_id); | ||
338 | 1292 | 1383 | ||
339 | 1293 | message::UpdateData *data= statement.mutable_update_data(); | 1384 | message::UpdateData *data= statement.mutable_update_data(); |
341 | 1294 | data->set_segment_id(1); | 1385 | data->set_segment_id(next_segment_id); |
342 | 1295 | data->set_end_segment(true); | 1386 | data->set_end_segment(true); |
343 | 1296 | message::UpdateRecord *record= data->add_record(); | 1387 | message::UpdateRecord *record= data->add_record(); |
344 | 1297 | 1388 | ||
345 | @@ -1375,9 +1466,11 @@ | |||
346 | 1375 | } | 1466 | } |
347 | 1376 | 1467 | ||
348 | 1377 | message::Statement &TransactionServices::getDeleteStatement(Session *in_session, | 1468 | message::Statement &TransactionServices::getDeleteStatement(Session *in_session, |
350 | 1378 | Table *in_table) | 1469 | Table *in_table, |
351 | 1470 | uint32_t *next_segment_id) | ||
352 | 1379 | { | 1471 | { |
353 | 1380 | message::Statement *statement= in_session->getStatementMessage(); | 1472 | message::Statement *statement= in_session->getStatementMessage(); |
354 | 1473 | message::Transaction *transaction= NULL; | ||
355 | 1381 | 1474 | ||
356 | 1382 | /* | 1475 | /* |
357 | 1383 | * Check the type for the current Statement message, if it is anything | 1476 | * Check the type for the current Statement message, if it is anything |
358 | @@ -1393,21 +1486,59 @@ | |||
359 | 1393 | } | 1486 | } |
360 | 1394 | else if (statement != NULL) | 1487 | else if (statement != NULL) |
361 | 1395 | { | 1488 | { |
368 | 1396 | const message::DeleteHeader &delete_header= statement->delete_header(); | 1489 | /* |
369 | 1397 | string old_table_name= delete_header.table_metadata().table_name(); | 1490 | * If we've passed our threshold for the statement size (possible for |
370 | 1398 | 1491 | * a bulk insert), we'll finalize the Statement and Transaction (doing | |
371 | 1399 | string current_table_name; | 1492 | * the Transaction will keep it from getting huge). |
372 | 1400 | (void) in_table->getShare()->getTableName(current_table_name); | 1493 | */ |
373 | 1401 | if (current_table_name.compare(old_table_name)) | 1494 | if (static_cast<size_t>(statement->ByteSize()) >= trx_msg_threshold) |
374 | 1402 | { | 1495 | { |
376 | 1403 | finalizeStatementMessage(*statement, in_session); | 1496 | message::DeleteData *current_data= statement->mutable_delete_data(); |
377 | 1497 | |||
378 | 1498 | /* Caller should use this value when adding a new record */ | ||
379 | 1499 | *next_segment_id= current_data->segment_id() + 1; | ||
380 | 1500 | |||
381 | 1501 | current_data->set_end_segment(false); | ||
382 | 1502 | |||
383 | 1503 | /* | ||
384 | 1504 | * Send the trx message to replicators after finalizing the | ||
385 | 1505 | * statement and transaction. This will also set the Transaction | ||
386 | 1506 | * and Statement objects in Session to NULL. | ||
387 | 1507 | */ | ||
388 | 1508 | commitTransactionMessage(in_session); | ||
389 | 1509 | |||
390 | 1510 | /* | ||
391 | 1511 | * Statement and Transaction should now be NULL, so new ones will get | ||
392 | 1512 | * created. We reuse the transaction id since we are segmenting | ||
393 | 1513 | * one transaction. | ||
394 | 1514 | */ | ||
395 | 1404 | statement= in_session->getStatementMessage(); | 1515 | statement= in_session->getStatementMessage(); |
396 | 1516 | transaction= getActiveTransactionMessage(in_session, false); | ||
397 | 1517 | } | ||
398 | 1518 | else | ||
399 | 1519 | { | ||
400 | 1520 | const message::DeleteHeader &delete_header= statement->delete_header(); | ||
401 | 1521 | string old_table_name= delete_header.table_metadata().table_name(); | ||
402 | 1522 | |||
403 | 1523 | string current_table_name; | ||
404 | 1524 | (void) in_table->getShare()->getTableName(current_table_name); | ||
405 | 1525 | if (current_table_name.compare(old_table_name)) | ||
406 | 1526 | { | ||
407 | 1527 | finalizeStatementMessage(*statement, in_session); | ||
408 | 1528 | statement= in_session->getStatementMessage(); | ||
409 | 1529 | } | ||
410 | 1405 | } | 1530 | } |
411 | 1406 | } | 1531 | } |
412 | 1407 | 1532 | ||
413 | 1408 | if (statement == NULL) | 1533 | if (statement == NULL) |
414 | 1409 | { | 1534 | { |
416 | 1410 | message::Transaction *transaction= getActiveTransactionMessage(in_session); | 1535 | /* |
417 | 1536 | * Transaction will be non-NULL only if we had to segment it due to | ||
418 | 1537 | * transaction size above. | ||
419 | 1538 | */ | ||
420 | 1539 | if (transaction == NULL) | ||
421 | 1540 | transaction= getActiveTransactionMessage(in_session); | ||
422 | 1541 | |||
423 | 1411 | /* | 1542 | /* |
424 | 1412 | * Transaction message initialized and set, but no statement created | 1543 | * Transaction message initialized and set, but no statement created |
425 | 1413 | * yet. We construct one and initialize it, here, then return the | 1544 | * yet. We construct one and initialize it, here, then return the |
426 | @@ -1469,10 +1600,11 @@ | |||
427 | 1469 | if (! replication_services.isActive()) | 1600 | if (! replication_services.isActive()) |
428 | 1470 | return; | 1601 | return; |
429 | 1471 | 1602 | ||
431 | 1472 | message::Statement &statement= getDeleteStatement(in_session, in_table); | 1603 | uint32_t next_segment_id; |
432 | 1604 | message::Statement &statement= getDeleteStatement(in_session, in_table, &next_segment_id); | ||
433 | 1473 | 1605 | ||
434 | 1474 | message::DeleteData *data= statement.mutable_delete_data(); | 1606 | message::DeleteData *data= statement.mutable_delete_data(); |
436 | 1475 | data->set_segment_id(1); | 1607 | data->set_segment_id(next_segment_id); |
437 | 1476 | data->set_end_segment(true); | 1608 | data->set_end_segment(true); |
438 | 1477 | message::DeleteRecord *record= data->add_record(); | 1609 | message::DeleteRecord *record= data->add_record(); |
439 | 1478 | 1610 | ||
440 | 1479 | 1611 | ||
441 | === modified file 'drizzled/transaction_services.h' | |||
442 | --- drizzled/transaction_services.h 2010-08-26 15:33:12 +0000 | |||
443 | +++ drizzled/transaction_services.h 2010-08-28 01:13:43 +0000 | |||
444 | @@ -80,27 +80,35 @@ | |||
445 | 80 | /** | 80 | /** |
446 | 81 | * Method which returns the active Transaction message | 81 | * Method which returns the active Transaction message |
447 | 82 | * for the supplied Session. If one is not found, a new Transaction | 82 | * for the supplied Session. If one is not found, a new Transaction |
449 | 83 | * message is allocated, initialized, and returned. | 83 | * message is allocated, initialized, and returned. It is possible that |
450 | 84 | * we may want to NOT increment the transaction id for a new Transaction | ||
451 | 85 | * object (e.g., splitting up Transactions into smaller chunks). The | ||
452 | 86 | * should_inc_trx_id flag controls if we do this. | ||
453 | 84 | * | 87 | * |
455 | 85 | * @param The session processing the transaction | 88 | * @param in_session The session processing the transaction |
456 | 89 | * @param should_inc_trx_id If true, increments the transaction id for a new trx | ||
457 | 86 | */ | 90 | */ |
459 | 87 | message::Transaction *getActiveTransactionMessage(Session *in_session); | 91 | message::Transaction *getActiveTransactionMessage(Session *in_session, |
460 | 92 | bool should_inc_trx_id= true); | ||
461 | 88 | /** | 93 | /** |
462 | 89 | * Method which attaches a transaction context | 94 | * Method which attaches a transaction context |
463 | 90 | * the supplied transaction based on the supplied Session's | 95 | * the supplied transaction based on the supplied Session's |
464 | 91 | * transaction information. This method also ensure the | 96 | * transaction information. This method also ensure the |
465 | 92 | * transaction message is attached properly to the Session object | 97 | * transaction message is attached properly to the Session object |
466 | 93 | * | 98 | * |
469 | 94 | * @param The transaction message to initialize | 99 | * @param in_transaction The transaction message to initialize |
470 | 95 | * @param The Session processing this transaction | 100 | * @param in_session The Session processing this transaction |
471 | 101 | * @param should_inc_trx_id If true, increments the transaction id for a new trx | ||
472 | 96 | */ | 102 | */ |
474 | 97 | void initTransactionMessage(message::Transaction &in_transaction, Session *in_session); | 103 | void initTransactionMessage(message::Transaction &in_transaction, |
475 | 104 | Session *in_session, | ||
476 | 105 | bool should_inc_trx_id); | ||
477 | 98 | /** | 106 | /** |
478 | 99 | * Helper method which finalizes data members for the | 107 | * Helper method which finalizes data members for the |
479 | 100 | * supplied transaction's context. | 108 | * supplied transaction's context. |
480 | 101 | * | 109 | * |
483 | 102 | * @param The transaction message to finalize | 110 | * @param in_transaction The transaction message to finalize |
484 | 103 | * @param The Session processing this transaction | 111 | * @param in_session The Session processing this transaction |
485 | 104 | */ | 112 | */ |
486 | 105 | void finalizeTransactionMessage(message::Transaction &in_transaction, Session *in_session); | 113 | void finalizeTransactionMessage(message::Transaction &in_transaction, Session *in_session); |
487 | 106 | /** | 114 | /** |
488 | @@ -112,9 +120,9 @@ | |||
489 | 112 | /** | 120 | /** |
490 | 113 | * Helper method which initializes a Statement message | 121 | * Helper method which initializes a Statement message |
491 | 114 | * | 122 | * |
495 | 115 | * @param The statement to initialize | 123 | * @param statement The statement to initialize |
496 | 116 | * @param The type of the statement | 124 | * @param in_type The type of the statement |
497 | 117 | * @param The session processing this statement | 125 | * @param in_session The session processing this statement |
498 | 118 | */ | 126 | */ |
499 | 119 | void initStatementMessage(message::Statement &statement, | 127 | void initStatementMessage(message::Statement &statement, |
500 | 120 | message::Statement::Type in_type, | 128 | message::Statement::Type in_type, |
501 | @@ -123,27 +131,29 @@ | |||
502 | 123 | * Finalizes a Statement message and sets the Session's statement | 131 | * Finalizes a Statement message and sets the Session's statement |
503 | 124 | * message to NULL. | 132 | * message to NULL. |
504 | 125 | * | 133 | * |
507 | 126 | * @param The statement to initialize | 134 | * @param statement The statement to initialize |
508 | 127 | * @param The session processing this statement | 135 | * @param in_session The session processing this statement |
509 | 128 | */ | 136 | */ |
510 | 129 | void finalizeStatementMessage(message::Statement &statement, | 137 | void finalizeStatementMessage(message::Statement &statement, |
511 | 130 | Session *in_session); | 138 | Session *in_session); |
512 | 131 | /** Helper method which returns an initialized Statement message for methods | 139 | /** Helper method which returns an initialized Statement message for methods |
513 | 132 | * doing insertion of data. | 140 | * doing insertion of data. |
514 | 133 | * | 141 | * |
517 | 134 | * @param[in] Pointer to the Session doing the processing | 142 | * @param[in] in_session Pointer to the Session doing the processing |
518 | 135 | * @param[in] Pointer to the Table object being inserted into | 143 | * @param[in] in_table Pointer to the Table object being inserted into |
519 | 144 | * @param[out] next_segment_id The next Statement segment id to be used | ||
520 | 136 | */ | 145 | */ |
521 | 137 | message::Statement &getInsertStatement(Session *in_session, | 146 | message::Statement &getInsertStatement(Session *in_session, |
523 | 138 | Table *in_table); | 147 | Table *in_table, |
524 | 148 | uint32_t *next_segment_id); | ||
525 | 139 | 149 | ||
526 | 140 | /** | 150 | /** |
527 | 141 | * Helper method which initializes the header message for | 151 | * Helper method which initializes the header message for |
528 | 142 | * insert operations. | 152 | * insert operations. |
529 | 143 | * | 153 | * |
533 | 144 | * @param[inout] Statement message container to modify | 154 | * @param[in,out] statement Statement message container to modify |
534 | 145 | * @param[in] Pointer to the Session doing the processing | 155 | * @param[in] in_session Pointer to the Session doing the processing |
535 | 146 | * @param[in] Pointer to the Table being inserted into | 156 | * @param[in] in_table Pointer to the Table being inserted into |
536 | 147 | */ | 157 | */ |
537 | 148 | void setInsertHeader(message::Statement &statement, | 158 | void setInsertHeader(message::Statement &statement, |
538 | 149 | Session *in_session, | 159 | Session *in_session, |
539 | @@ -152,24 +162,26 @@ | |||
540 | 152 | * Helper method which returns an initialized Statement | 162 | * Helper method which returns an initialized Statement |
541 | 153 | * message for methods doing updates of data. | 163 | * message for methods doing updates of data. |
542 | 154 | * | 164 | * |
547 | 155 | * @param[in] Pointer to the Session doing the processing | 165 | * @param[in] in_session Pointer to the Session doing the processing |
548 | 156 | * @param[in] Pointer to the Table object being updated | 166 | * @param[in] in_table Pointer to the Table object being updated |
549 | 157 | * @param[in] Pointer to the old data in the record | 167 | * @param[in] old_record Pointer to the old data in the record |
550 | 158 | * @param[in] Pointer to the new data in the record | 168 | * @param[in] new_record Pointer to the new data in the record |
551 | 169 | * @param[out] next_segment_id The next Statement segment id to be used | ||
552 | 159 | */ | 170 | */ |
553 | 160 | message::Statement &getUpdateStatement(Session *in_session, | 171 | message::Statement &getUpdateStatement(Session *in_session, |
554 | 161 | Table *in_table, | 172 | Table *in_table, |
555 | 162 | const unsigned char *old_record, | 173 | const unsigned char *old_record, |
557 | 163 | const unsigned char *new_record); | 174 | const unsigned char *new_record, |
558 | 175 | uint32_t *next_segment_id); | ||
559 | 164 | /** | 176 | /** |
560 | 165 | * Helper method which initializes the header message for | 177 | * Helper method which initializes the header message for |
561 | 166 | * update operations. | 178 | * update operations. |
562 | 167 | * | 179 | * |
568 | 168 | * @param[inout] Statement message container to modify | 180 | * @param[in,out] statement Statement message container to modify |
569 | 169 | * @param[in] Pointer to the Session doing the processing | 181 | * @param[in] in_session Pointer to the Session doing the processing |
570 | 170 | * @param[in] Pointer to the Table being updated | 182 | * @param[in] in_table Pointer to the Table being updated |
571 | 171 | * @param[in] Pointer to the old data in the record | 183 | * @param[in] old_record Pointer to the old data in the record |
572 | 172 | * @param[in] Pointer to the new data in the record | 184 | * @param[in] new_record Pointer to the new data in the record |
573 | 173 | */ | 185 | */ |
574 | 174 | void setUpdateHeader(message::Statement &statement, | 186 | void setUpdateHeader(message::Statement &statement, |
575 | 175 | Session *in_session, | 187 | Session *in_session, |
576 | @@ -180,19 +192,21 @@ | |||
577 | 180 | * Helper method which returns an initialized Statement | 192 | * Helper method which returns an initialized Statement |
578 | 181 | * message for methods doing deletion of data. | 193 | * message for methods doing deletion of data. |
579 | 182 | * | 194 | * |
582 | 183 | * @param[in] Pointer to the Session doing the processing | 195 | * @param[in] in_session Pointer to the Session doing the processing |
583 | 184 | * @param[in] Pointer to the Table object being deleted from | 196 | * @param[in] in_table Pointer to the Table object being deleted from |
584 | 197 | * @param[out] next_segment_id The next Statement segment id to be used | ||
585 | 185 | */ | 198 | */ |
586 | 186 | message::Statement &getDeleteStatement(Session *in_session, | 199 | message::Statement &getDeleteStatement(Session *in_session, |
588 | 187 | Table *in_table); | 200 | Table *in_table, |
589 | 201 | uint32_t *next_segment_id); | ||
590 | 188 | 202 | ||
591 | 189 | /** | 203 | /** |
592 | 190 | * Helper method which initializes the header message for | 204 | * Helper method which initializes the header message for |
593 | 191 | * insert operations. | 205 | * insert operations. |
594 | 192 | * | 206 | * |
598 | 193 | * @param[inout] Statement message container to modify | 207 | * @param[in,out] statement Statement message container to modify |
599 | 194 | * @param[in] Pointer to the Session doing the processing | 208 | * @param[in] in_session Pointer to the Session doing the processing |
600 | 195 | * @param[in] Pointer to the Table being deleted from | 209 | * @param[in] in_table Pointer to the Table being deleted from |
601 | 196 | */ | 210 | */ |
602 | 197 | void setDeleteHeader(message::Statement &statement, | 211 | void setDeleteHeader(message::Statement &statement, |
603 | 198 | Session *in_session, | 212 | Session *in_session, |
604 | @@ -201,22 +215,22 @@ | |||
605 | 201 | * Commits a normal transaction (see above) and pushes the transaction | 215 | * Commits a normal transaction (see above) and pushes the transaction |
606 | 202 | * message out to the replicators. | 216 | * message out to the replicators. |
607 | 203 | * | 217 | * |
609 | 204 | * @param Pointer to the Session committing the transaction | 218 | * @param in_session Pointer to the Session committing the transaction |
610 | 205 | */ | 219 | */ |
611 | 206 | int commitTransactionMessage(Session *in_session); | 220 | int commitTransactionMessage(Session *in_session); |
612 | 207 | /** | 221 | /** |
613 | 208 | * Marks the current active transaction message as being rolled back and | 222 | * Marks the current active transaction message as being rolled back and |
614 | 209 | * pushes the transaction message out to replicators. | 223 | * pushes the transaction message out to replicators. |
615 | 210 | * | 224 | * |
617 | 211 | * @param Pointer to the Session committing the transaction | 225 | * @param in_session Pointer to the Session committing the transaction |
618 | 212 | */ | 226 | */ |
619 | 213 | void rollbackTransactionMessage(Session *in_session); | 227 | void rollbackTransactionMessage(Session *in_session); |
620 | 214 | /** | 228 | /** |
621 | 215 | * Creates a new InsertRecord GPB message and pushes it to | 229 | * Creates a new InsertRecord GPB message and pushes it to |
622 | 216 | * replicators. | 230 | * replicators. |
623 | 217 | * | 231 | * |
626 | 218 | * @param Pointer to the Session which has inserted a record | 232 | * @param in_session Pointer to the Session which has inserted a record |
627 | 219 | * @param Pointer to the Table containing insert information | 233 | * @param in_table Pointer to the Table containing insert information |
628 | 220 | * | 234 | * |
629 | 221 | * Grr, returning "true" here on error because of the cursor | 235 | * Grr, returning "true" here on error because of the cursor |
630 | 222 | * reversed bool return crap...fix that. | 236 | * reversed bool return crap...fix that. |
631 | @@ -226,10 +240,10 @@ | |||
632 | 226 | * Creates a new UpdateRecord GPB message and pushes it to | 240 | * Creates a new UpdateRecord GPB message and pushes it to |
633 | 227 | * replicators. | 241 | * replicators. |
634 | 228 | * | 242 | * |
639 | 229 | * @param Pointer to the Session which has updated a record | 243 | * @param in_session Pointer to the Session which has updated a record |
640 | 230 | * @param Pointer to the Table containing update information | 244 | * @param in_table Pointer to the Table containing update information |
641 | 231 | * @param Pointer to the raw bytes representing the old record/row | 245 | * @param old_record Pointer to the raw bytes representing the old record/row |
642 | 232 | * @param Pointer to the raw bytes representing the new record/row | 246 | * @param new_record Pointer to the raw bytes representing the new record/row |
643 | 233 | */ | 247 | */ |
644 | 234 | void updateRecord(Session *in_session, | 248 | void updateRecord(Session *in_session, |
645 | 235 | Table *in_table, | 249 | Table *in_table, |
646 | @@ -249,8 +263,8 @@ | |||
647 | 249 | * to the Session's active Transaction GPB message for pushing | 263 | * to the Session's active Transaction GPB message for pushing |
648 | 250 | * out to the replicator streams. | 264 | * out to the replicator streams. |
649 | 251 | * | 265 | * |
652 | 252 | * @param[in] Pointer to the Session which issued the statement | 266 | * @param[in] in_session Pointer to the Session which issued the statement |
653 | 253 | * @param[in] message::Schema message describing new schema | 267 | * @param[in] schema message::Schema message describing new schema |
654 | 254 | */ | 268 | */ |
655 | 255 | void createSchema(Session *in_session, const message::Schema &schema); | 269 | void createSchema(Session *in_session, const message::Schema &schema); |
656 | 256 | /** | 270 | /** |
657 | @@ -258,8 +272,8 @@ | |||
658 | 258 | * to the Session's active Transaction GPB message for pushing | 272 | * to the Session's active Transaction GPB message for pushing |
659 | 259 | * out to the replicator streams. | 273 | * out to the replicator streams. |
660 | 260 | * | 274 | * |
663 | 261 | * @param[in] Pointer to the Session which issued the statement | 275 | * @param[in] in_session Pointer to the Session which issued the statement |
664 | 262 | * @param[in] message::Schema message describing new schema | 276 | * @param[in] schema_name message::Schema message describing new schema |
665 | 263 | */ | 277 | */ |
666 | 264 | void dropSchema(Session *in_session, const std::string &schema_name); | 278 | void dropSchema(Session *in_session, const std::string &schema_name); |
667 | 265 | /** | 279 | /** |
668 | @@ -267,8 +281,8 @@ | |||
669 | 267 | * to the Session's active Transaction GPB message for pushing | 281 | * to the Session's active Transaction GPB message for pushing |
670 | 268 | * out to the replicator streams. | 282 | * out to the replicator streams. |
671 | 269 | * | 283 | * |
674 | 270 | * @param[in] Pointer to the Session which issued the statement | 284 | * @param[in] in_session Pointer to the Session which issued the statement |
675 | 271 | * @param[in] message::Table message describing new schema | 285 | * @param[in] table message::Table message describing new schema |
676 | 272 | */ | 286 | */ |
677 | 273 | void createTable(Session *in_session, const message::Table &table); | 287 | void createTable(Session *in_session, const message::Table &table); |
678 | 274 | /** | 288 | /** |
679 | @@ -276,10 +290,10 @@ | |||
680 | 276 | * to the Session's active Transaction GPB message for pushing | 290 | * to the Session's active Transaction GPB message for pushing |
681 | 277 | * out to the replicator streams. | 291 | * out to the replicator streams. |
682 | 278 | * | 292 | * |
687 | 279 | * @param[in] Pointer to the Session which issued the statement | 293 | * @param[in] in_session Pointer to the Session which issued the statement |
688 | 280 | * @param[in] The schema of the table being dropped | 294 | * @param[in] schema_name The schema of the table being dropped |
689 | 281 | * @param[in] The table name of the table being dropped | 295 | * @param[in] table_name The table name of the table being dropped |
690 | 282 | * @param[in] Did the user specify an IF EXISTS clause? | 296 | * @param[in] if_exists Did the user specify an IF EXISTS clause? |
691 | 283 | */ | 297 | */ |
692 | 284 | void dropTable(Session *in_session, | 298 | void dropTable(Session *in_session, |
693 | 285 | const std::string &schema_name, | 299 | const std::string &schema_name, |
694 | @@ -290,8 +304,8 @@ | |||
695 | 290 | * to the Session's active Transaction GPB message for pushing | 304 | * to the Session's active Transaction GPB message for pushing |
696 | 291 | * out to the replicator streams. | 305 | * out to the replicator streams. |
697 | 292 | * | 306 | * |
700 | 293 | * @param[in] Pointer to the Session which issued the statement | 307 | * @param[in] in_session Pointer to the Session which issued the statement |
701 | 294 | * @param[in] The Table being truncated | 308 | * @param[in] in_table The Table being truncated |
702 | 295 | */ | 309 | */ |
703 | 296 | void truncateTable(Session *in_session, Table *in_table); | 310 | void truncateTable(Session *in_session, Table *in_table); |
704 | 297 | /** | 311 | /** |
705 | @@ -303,8 +317,8 @@ | |||
706 | 303 | * on the I_S, etc. Not sure what to do with administrative | 317 | * on the I_S, etc. Not sure what to do with administrative |
707 | 304 | * commands like CHECK TABLE, though.. | 318 | * commands like CHECK TABLE, though.. |
708 | 305 | * | 319 | * |
711 | 306 | * @param Pointer to the Session which issued the statement | 320 | * @param in_session Pointer to the Session which issued the statement |
712 | 307 | * @param Query string | 321 | * @param query Query string |
713 | 308 | */ | 322 | */ |
714 | 309 | void rawStatement(Session *in_session, const std::string &query); | 323 | void rawStatement(Session *in_session, const std::string &query); |
715 | 310 | /* transactions: interface to plugin::StorageEngine functions */ | 324 | /* transactions: interface to plugin::StorageEngine functions */ |
716 | @@ -334,9 +348,9 @@ | |||
717 | 334 | * per statement, and therefore should not need to be idempotent. | 348 | * per statement, and therefore should not need to be idempotent. |
718 | 335 | * Put in assert()s to test this. | 349 | * Put in assert()s to test this. |
719 | 336 | * | 350 | * |
723 | 337 | * @param[in] Session pointer | 351 | * @param[in] session Session pointer |
724 | 338 | * @param[in] Descriptor for the resource which will be participating | 352 | * @param[in] monitored Descriptor for the resource which will be participating |
725 | 339 | * @param[in] Pointer to the TransactionalStorageEngine resource | 353 | * @param[in] engine Pointer to the TransactionalStorageEngine resource |
726 | 340 | */ | 354 | */ |
727 | 341 | void registerResourceForStatement(Session *session, | 355 | void registerResourceForStatement(Session *session, |
728 | 342 | plugin::MonitoredInTransaction *monitored, | 356 | plugin::MonitoredInTransaction *monitored, |
729 | @@ -356,10 +370,10 @@ | |||
730 | 356 | * per statement, and therefore should not need to be idempotent. | 370 | * per statement, and therefore should not need to be idempotent. |
731 | 357 | * Put in assert()s to test this. | 371 | * Put in assert()s to test this. |
732 | 358 | * | 372 | * |
737 | 359 | * @param[in] Session pointer | 373 | * @param[in] session Session pointer |
738 | 360 | * @param[in] Descriptor for the resource which will be participating | 374 | * @param[in] monitored Descriptor for the resource which will be participating |
739 | 361 | * @param[in] Pointer to the TransactionalStorageEngine resource | 375 | * @param[in] engine Pointer to the TransactionalStorageEngine resource |
740 | 362 | * @param[in] Pointer to the XaResourceManager resource manager | 376 | * @param[in] resource_manager Pointer to the XaResourceManager resource manager |
741 | 363 | */ | 377 | */ |
742 | 364 | void registerResourceForStatement(Session *session, | 378 | void registerResourceForStatement(Session *session, |
743 | 365 | plugin::MonitoredInTransaction *monitored, | 379 | plugin::MonitoredInTransaction *monitored, |