Commit 17fe4eca authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

refs #5726 get upserts working with hot indexing

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@50484 c7de825b-a66e-492c-adef-691d508d4ae1
parent b8e807ba
......@@ -7296,6 +7296,7 @@ bool ha_tokudb::is_auto_inc_singleton(){
}
volatile int ha_tokudb_tokudb_add_index_wait = 0; // debug
volatile int ha_tokudb_build_index_wait = 0; // debug
//
// Internal function called by ha_tokudb::add_index and ha_tokudb::alter_table_phase2
......@@ -7479,6 +7480,8 @@ int ha_tokudb::tokudb_add_index(
thd_progress_init(thd, 1);
#endif
while (ha_tokudb_build_index_wait) sleep(1); // debug
error = indexer->build(indexer);
if (error) { goto cleanup; }
......
......@@ -147,12 +147,19 @@ int ha_tokudb::fast_update(THD *thd, List<Item> &fields, List<Item> &values, Ite
if (fields.elements < 1 || fields.elements != values.elements)
return ENOTSUP; // something is fishy with the parameters
if (thd->is_strict_mode() || !transaction || !check_fast_update(thd, fields, values, conds))
rw_rdlock(&share->num_DBs_lock);
if (share->num_DBs > table->s->keys + test(hidden_primary_key)) // hot index in progress
error = ENOTSUP; // run on the slow path
if (error == 0 && (thd->is_strict_mode() || !transaction || !check_fast_update(thd, fields, values, conds)))
error = ENOTSUP;
if (error == 0)
error = send_update_message(fields, values, conds, transaction);
rw_unlock(&share->num_DBs_lock);
if (error != 0) {
if (get_disable_slow_update(thd))
error = HA_ERR_UNSUPPORTED;
......@@ -617,12 +624,19 @@ int ha_tokudb::upsert(THD *thd, uchar *record, List<Item> &update_fields, List<I
if (update_fields.elements < 1 || update_fields.elements != update_values.elements)
return ENOTSUP; // not an upsert or something is fishy with the parameters
if (thd->is_strict_mode() || !transaction || !check_upsert(thd, update_fields, update_values))
rw_rdlock(&share->num_DBs_lock);
if (share->num_DBs > table->s->keys + test(hidden_primary_key)) // hot index in progress
error = ENOTSUP; // run on the slow path
if (error == 0 && (thd->is_strict_mode() || !transaction || !check_upsert(thd, update_fields, update_values)))
error = ENOTSUP;
if (error == 0)
error = send_upsert_message(thd, record, update_fields, update_values, transaction);
rw_unlock(&share->num_DBs_lock);
if (error != 0) {
if (get_disable_slow_upsert(thd))
error = HA_ERR_UNSUPPORTED;
......
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