diff options
Diffstat (limited to 'storage/tokudb/ha_tokudb.cc')
-rw-r--r-- | storage/tokudb/ha_tokudb.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 87c544c93e3..7fca80c28df 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -1774,7 +1774,7 @@ int ha_tokudb::initialize_share(const char* name, int mode) { // initialize cardinality info from the status dictionary share->n_rec_per_key = tokudb::compute_total_key_parts(table_share); - share->rec_per_key = (uint64_t *) tokudb_my_realloc(share->rec_per_key, share->n_rec_per_key * sizeof (uint64_t), MYF(MY_FAE)); + share->rec_per_key = (uint64_t *) tokudb_my_realloc(share->rec_per_key, share->n_rec_per_key * sizeof (uint64_t), MYF(MY_FAE + MY_ALLOW_ZERO_PTR)); error = tokudb::get_card_from_status(share->status_block, txn, share->n_rec_per_key, share->rec_per_key); if (error) { for (uint i = 0; i < share->n_rec_per_key; i++) @@ -6037,6 +6037,9 @@ int ha_tokudb::extra(enum ha_extra_function operation) { case HA_EXTRA_NO_IGNORE_NO_KEY: using_ignore_no_key = false; break; + case HA_EXTRA_NOT_USED: + case HA_EXTRA_PREPARE_FOR_RENAME: + break; // must do nothing and return 0 default: break; } @@ -6282,7 +6285,11 @@ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) { int error = 0; tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); - DBUG_ASSERT(trx); + if (!trx) { + error = create_tokudb_trx_data_instance(&trx); + if (error) { goto cleanup; } + thd_set_ha_data(thd, tokudb_hton, trx); + } /* note that trx->stmt may have been already initialized as start_stmt() |