Commit 512c3e5c authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

simplify the delete_all_rows. addresses #969

git-svn-id: file:///svn/mysql/tokudb-engine/src@5237 c7de825b-a66e-492c-adef-691d508d4ae1
parent d08a5790
...@@ -4374,14 +4374,13 @@ ulong ha_tokudb::field_offset(Field *field) { ...@@ -4374,14 +4374,13 @@ ulong ha_tokudb::field_offset(Field *field) {
int ha_tokudb::delete_all_rows() { int ha_tokudb::delete_all_rows() {
TOKUDB_DBUG_ENTER("delete_all_rows"); TOKUDB_DBUG_ENTER("delete_all_rows");
int error = 0; int error = 0;
tokudb_trx_data *trx = (tokudb_trx_data *) thd_data_get(current_thd, tokudb_hton->slot);
// truncate all dictionaries // truncate all dictionaries
uint curr_num_DBs = table->s->keys + test(hidden_primary_key); uint curr_num_DBs = table->s->keys + test(hidden_primary_key);
for (uint i = 0; i < curr_num_DBs; i++) { for (uint i = 0; i < curr_num_DBs; i++) {
DB *db = share->key_file[i]; DB *db = share->key_file[i];
u_int32_t row_count = 0; u_int32_t row_count = 0;
error = db->truncate(db, trx ? trx->stmt : 0, &row_count, 0); error = db->truncate(db, transaction, &row_count, 0);
if (error) if (error)
break; break;
// do something with the row_count? // do something with the row_count?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment