MCPcopy Create free account
hub / github.com/MariaDB/server / hlindex_lock

Method hlindex_lock

sql/sql_base.cc:10169–10197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10167}
10168
10169int TABLE::hlindex_lock(uint nr)
10170{
10171 DBUG_ASSERT(s->hlindexes() == 1);
10172 DBUG_ASSERT(nr == s->keys);
10173 DBUG_ASSERT(hlindex);
10174 if (hlindex->in_use == in_use)
10175 return 0;
10176 hlindex->use_all_columns();
10177
10178 THR_LOCK_DATA *lock_data;
10179 DBUG_ASSERT(hlindex->file->lock_count() <= 1);
10180 hlindex->file->store_lock(in_use, &lock_data, reginfo.lock_type);
10181
10182 int res= hlindex->file->ha_external_lock(in_use,
10183 reginfo.lock_type < TL_FIRST_WRITE ? F_RDLCK : F_WRLCK);
10184 if (res == 0)
10185 hlindex->in_use= in_use; // mark in use for this query
10186 if (hlindex->file->lock_count() > 0)
10187 {
10188 /*
10189 This code is here mostly for Aria. It requires start_trans() call
10190 to handle transaction logging.
10191 */
10192 if (res == 0 && !s->tmp_table && lock_data->lock->start_trans)
10193 lock_data->lock->start_trans(lock_data->status_param);
10194 lock_data->type= TL_UNLOCK;
10195 }
10196 return res;
10197}
10198
10199int TABLE::open_hlindexes_for_write()
10200{

Callers 2

ha_checkMethod · 0.80
ha_truncateMethod · 0.80

Calls 5

hlindexesMethod · 0.80
use_all_columnsMethod · 0.80
ha_external_lockMethod · 0.80
lock_countMethod · 0.45
store_lockMethod · 0.45

Tested by

no test coverage detected