mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
#3213 fix the store_lock function (pattern after innodb's storage_lock function) refs[t:3213]
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@27607 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
af26debfc9
commit
623f50ae0c
1 changed files with 17 additions and 17 deletions
|
@ -5561,24 +5561,24 @@ THR_LOCK_DATA **ha_tokudb::store_lock(THD * thd, THR_LOCK_DATA ** to, enum thr_l
|
|||
if (tokudb_debug & TOKUDB_DEBUG_LOCK) {
|
||||
TOKUDB_TRACE("%s lock_type=%d cmd=%d\n", __FUNCTION__, lock_type, thd_sql_command(thd));
|
||||
}
|
||||
if (get_create_index_online(thd) &&
|
||||
thd_sql_command(thd)== SQLCOM_CREATE_INDEX
|
||||
)
|
||||
{
|
||||
rw_rdlock(&share->num_DBs_lock);
|
||||
if (share->num_DBs == (table->s->keys + test(hidden_primary_key))) {
|
||||
lock_type = TL_WRITE_ALLOW_WRITE;
|
||||
|
||||
if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) {
|
||||
// if creating a hot index
|
||||
if (get_create_index_online(thd) && thd_sql_command(thd)== SQLCOM_CREATE_INDEX) {
|
||||
rw_rdlock(&share->num_DBs_lock);
|
||||
if (share->num_DBs == (table->s->keys + test(hidden_primary_key))) {
|
||||
lock_type = TL_WRITE_ALLOW_WRITE;
|
||||
}
|
||||
lock.type = lock_type;
|
||||
rw_unlock(&share->num_DBs_lock);
|
||||
} else {
|
||||
// If we are not doing a LOCK TABLE, then allow multiple writers
|
||||
if ((lock_type >= TL_WRITE_CONCURRENT_INSERT && lock_type <= TL_WRITE) &&
|
||||
!thd->in_lock_tables && thd_sql_command(thd) != SQLCOM_TRUNCATE && !thd_tablespace_op(thd)) {
|
||||
lock_type = TL_WRITE_ALLOW_WRITE;
|
||||
}
|
||||
lock.type = lock_type;
|
||||
}
|
||||
lock.type = lock_type;
|
||||
rw_unlock(&share->num_DBs_lock);
|
||||
}
|
||||
else if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) {
|
||||
/* If we are not doing a LOCK TABLE, then allow multiple writers */
|
||||
if ((lock_type >= TL_WRITE_CONCURRENT_INSERT && lock_type <= TL_WRITE) &&
|
||||
!thd->in_lock_tables && thd_sql_command(thd) != SQLCOM_TRUNCATE && !thd_tablespace_op(thd)) {
|
||||
lock_type = TL_WRITE_ALLOW_WRITE;
|
||||
}
|
||||
lock.type = lock_type;
|
||||
}
|
||||
*to++ = &lock;
|
||||
if (tokudb_debug & TOKUDB_DEBUG_LOCK)
|
||||
|
|
Loading…
Reference in a new issue