mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
Changed some unneccessary calls to current_thd() into table->in_use
This commit is contained in:
parent
aca57a3d2d
commit
c77c58bb2d
5 changed files with 84 additions and 57 deletions
|
|
@ -81,7 +81,7 @@ int ha_myisammrg::close(void)
|
|||
|
||||
int ha_myisammrg::write_row(byte * buf)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_write_count,&LOCK_status);
|
||||
statistic_increment(table->in_use->status_var.ha_write_count,&LOCK_status);
|
||||
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
|
||||
table->timestamp_field->set_time();
|
||||
if (table->next_number_field && buf == table->record[0])
|
||||
|
|
@ -91,7 +91,7 @@ int ha_myisammrg::write_row(byte * buf)
|
|||
|
||||
int ha_myisammrg::update_row(const byte * old_data, byte * new_data)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_update_count,&LOCK_status);
|
||||
statistic_increment(table->in_use->status_var.ha_update_count,&LOCK_status);
|
||||
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
|
||||
table->timestamp_field->set_time();
|
||||
return myrg_update(file,old_data,new_data);
|
||||
|
|
@ -99,14 +99,15 @@ int ha_myisammrg::update_row(const byte * old_data, byte * new_data)
|
|||
|
||||
int ha_myisammrg::delete_row(const byte * buf)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_delete_count,&LOCK_status);
|
||||
statistic_increment(table->in_use->status_var.ha_delete_count,&LOCK_status);
|
||||
return myrg_delete(file,buf);
|
||||
}
|
||||
|
||||
int ha_myisammrg::index_read(byte * buf, const byte * key,
|
||||
uint key_len, enum ha_rkey_function find_flag)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_read_key_count,&LOCK_status);
|
||||
statistic_increment(table->in_use->status_var.ha_read_key_count,
|
||||
&LOCK_status);
|
||||
int error=myrg_rkey(file,buf,active_index, key, key_len, find_flag);
|
||||
table->status=error ? STATUS_NOT_FOUND: 0;
|
||||
return error;
|
||||
|
|
@ -115,7 +116,8 @@ int ha_myisammrg::index_read(byte * buf, const byte * key,
|
|||
int ha_myisammrg::index_read_idx(byte * buf, uint index, const byte * key,
|
||||
uint key_len, enum ha_rkey_function find_flag)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_read_key_count,&LOCK_status);
|
||||
statistic_increment(table->in_use->status_var.ha_read_key_count,
|
||||
&LOCK_status);
|
||||
int error=myrg_rkey(file,buf,index, key, key_len, find_flag);
|
||||
table->status=error ? STATUS_NOT_FOUND: 0;
|
||||
return error;
|
||||
|
|
@ -123,7 +125,8 @@ int ha_myisammrg::index_read_idx(byte * buf, uint index, const byte * key,
|
|||
|
||||
int ha_myisammrg::index_read_last(byte * buf, const byte * key, uint key_len)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_read_key_count,&LOCK_status);
|
||||
statistic_increment(table->in_use->status_var.ha_read_key_count,
|
||||
&LOCK_status);
|
||||
int error=myrg_rkey(file,buf,active_index, key, key_len,
|
||||
HA_READ_PREFIX_LAST);
|
||||
table->status=error ? STATUS_NOT_FOUND: 0;
|
||||
|
|
@ -132,7 +135,8 @@ int ha_myisammrg::index_read_last(byte * buf, const byte * key, uint key_len)
|
|||
|
||||
int ha_myisammrg::index_next(byte * buf)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_read_next_count,&LOCK_status);
|
||||
statistic_increment(table->in_use->status_var.ha_read_next_count,
|
||||
&LOCK_status);
|
||||
int error=myrg_rnext(file,buf,active_index);
|
||||
table->status=error ? STATUS_NOT_FOUND: 0;
|
||||
return error;
|
||||
|
|
@ -140,7 +144,8 @@ int ha_myisammrg::index_next(byte * buf)
|
|||
|
||||
int ha_myisammrg::index_prev(byte * buf)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_read_prev_count,&LOCK_status);
|
||||
statistic_increment(table->in_use->status_var.ha_read_prev_count,
|
||||
&LOCK_status);
|
||||
int error=myrg_rprev(file,buf, active_index);
|
||||
table->status=error ? STATUS_NOT_FOUND: 0;
|
||||
return error;
|
||||
|
|
@ -148,7 +153,7 @@ int ha_myisammrg::index_prev(byte * buf)
|
|||
|
||||
int ha_myisammrg::index_first(byte * buf)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_read_first_count,
|
||||
statistic_increment(table->in_use->status_var.ha_read_first_count,
|
||||
&LOCK_status);
|
||||
int error=myrg_rfirst(file, buf, active_index);
|
||||
table->status=error ? STATUS_NOT_FOUND: 0;
|
||||
|
|
@ -157,7 +162,8 @@ int ha_myisammrg::index_first(byte * buf)
|
|||
|
||||
int ha_myisammrg::index_last(byte * buf)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_read_last_count,&LOCK_status);
|
||||
statistic_increment(table->in_use->status_var.ha_read_last_count,
|
||||
&LOCK_status);
|
||||
int error=myrg_rlast(file, buf, active_index);
|
||||
table->status=error ? STATUS_NOT_FOUND: 0;
|
||||
return error;
|
||||
|
|
@ -167,7 +173,8 @@ int ha_myisammrg::index_next_same(byte * buf,
|
|||
const byte *key __attribute__((unused)),
|
||||
uint length __attribute__((unused)))
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_read_next_count,&LOCK_status);
|
||||
statistic_increment(table->in_use->status_var.ha_read_next_count,
|
||||
&LOCK_status);
|
||||
int error=myrg_rnext_same(file,buf);
|
||||
table->status=error ? STATUS_NOT_FOUND: 0;
|
||||
return error;
|
||||
|
|
@ -180,7 +187,7 @@ int ha_myisammrg::rnd_init(bool scan)
|
|||
|
||||
int ha_myisammrg::rnd_next(byte *buf)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_read_rnd_next_count,
|
||||
statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
|
||||
&LOCK_status);
|
||||
int error=myrg_rrnd(file, buf, HA_OFFSET_ERROR);
|
||||
table->status=error ? STATUS_NOT_FOUND: 0;
|
||||
|
|
@ -189,7 +196,8 @@ int ha_myisammrg::rnd_next(byte *buf)
|
|||
|
||||
int ha_myisammrg::rnd_pos(byte * buf, byte *pos)
|
||||
{
|
||||
statistic_increment(current_thd->status_var.ha_read_rnd_count,&LOCK_status);
|
||||
statistic_increment(table->in_use->status_var.ha_read_rnd_count,
|
||||
&LOCK_status);
|
||||
int error=myrg_rrnd(file, buf, ha_get_ptr(pos,ref_length));
|
||||
table->status=error ? STATUS_NOT_FOUND: 0;
|
||||
return error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue