1032
1032
Table *in_table)
1034
1034
message::Statement *statement= in_session->getStatementMessage();
1036
* We check to see if the current Statement message is of type INSERT.
1037
* If it is not, we finalize the current Statement and ensure a new
1038
* InsertStatement is created.
1037
* Check the type for the current Statement message, if it is anything
1038
* other then INSERT we need to call finalize, this will ensure a
1039
* new InsertStatement is created. If it is of type INSERT check
1040
* what table the INSERT belongs to, if it is a different table
1041
* call finalize, so a new InsertStatement can be created.
1040
if (statement != NULL &&
1041
statement->type() != message::Statement::INSERT)
1043
if (statement != NULL && statement->type() != message::Statement::INSERT)
1043
1045
finalizeStatementMessage(*statement, in_session);
1044
1046
statement= in_session->getStatementMessage();
1048
else if (statement != NULL)
1050
const message::InsertHeader &insert_header= statement->insert_header();
1051
string old_table_name= insert_header.table_metadata().table_name();
1053
string current_table_name;
1054
(void) in_table->getShare()->getTableName(current_table_name);
1055
if (current_table_name.compare(old_table_name))
1057
finalizeStatementMessage(*statement, in_session);
1058
statement= in_session->getStatementMessage();
1047
1062
if (statement == NULL)
1148
1163
const unsigned char *new_record)
1150
1165
message::Statement *statement= in_session->getStatementMessage();
1152
* We check to see if the current Statement message is of type UPDATE.
1153
* If it is not, we finalize the current Statement and ensure a new
1154
* UpdateStatement is created.
1168
* Check the type for the current Statement message, if it is anything
1169
* other then UPDATE we need to call finalize, this will ensure a
1170
* new UpdateStatement is created. If it is of type UPDATE check
1171
* what table the UPDATE belongs to, if it is a different table
1172
* call finalize, so a new UpdateStatement can be created.
1156
if (statement != NULL &&
1157
statement->type() != message::Statement::UPDATE)
1174
if (statement != NULL && statement->type() != message::Statement::UPDATE)
1159
1176
finalizeStatementMessage(*statement, in_session);
1160
1177
statement= in_session->getStatementMessage();
1179
else if (statement != NULL)
1181
const message::UpdateHeader &update_header= statement->update_header();
1182
string old_table_name= update_header.table_metadata().table_name();
1184
string current_table_name;
1185
(void) in_table->getShare()->getTableName(current_table_name);
1186
if (current_table_name.compare(old_table_name))
1188
finalizeStatementMessage(*statement, in_session);
1189
statement= in_session->getStatementMessage();
1163
1193
if (statement == NULL)
1330
1360
Table *in_table)
1332
1362
message::Statement *statement= in_session->getStatementMessage();
1334
* We check to see if the current Statement message is of type DELETE.
1335
* If it is not, we finalize the current Statement and ensure a new
1336
* DeleteStatement is created.
1365
* Check the type for the current Statement message, if it is anything
1366
* other then DELETE we need to call finalize, this will ensure a
1367
* new DeleteStatement is created. If it is of type DELETE check
1368
* what table the DELETE belongs to, if it is a different table
1369
* call finalize, so a new DeleteStatement can be created.
1338
if (statement != NULL &&
1339
statement->type() != message::Statement::DELETE)
1371
if (statement != NULL && statement->type() != message::Statement::DELETE)
1341
1373
finalizeStatementMessage(*statement, in_session);
1342
1374
statement= in_session->getStatementMessage();
1376
else if (statement != NULL)
1378
const message::DeleteHeader &delete_header= statement->delete_header();
1379
string old_table_name= delete_header.table_metadata().table_name();
1381
string current_table_name;
1382
(void) in_table->getShare()->getTableName(current_table_name);
1383
if (current_table_name.compare(old_table_name))
1385
finalizeStatementMessage(*statement, in_session);
1386
statement= in_session->getStatementMessage();
1345
1390
if (statement == NULL)