mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge branch '10.2' of github.com:MariaDB/server into 10.2-mariarocks
and a few trivial test result updates
This commit is contained in:
@ -2579,6 +2579,8 @@ int handler::ha_rnd_next(uchar *buf)
|
||||
if (!result)
|
||||
{
|
||||
update_rows_read();
|
||||
if (table->vfield && buf == table->record[0])
|
||||
table->update_virtual_fields(VCOL_UPDATE_FOR_READ);
|
||||
increment_statistics(&SSV::ha_read_rnd_next_count);
|
||||
}
|
||||
else if (result == HA_ERR_RECORD_DELETED)
|
||||
@ -2603,7 +2605,11 @@ int handler::ha_rnd_pos(uchar *buf, uchar *pos)
|
||||
{ result= rnd_pos(buf, pos); })
|
||||
increment_statistics(&SSV::ha_read_rnd_count);
|
||||
if (!result)
|
||||
{
|
||||
update_rows_read();
|
||||
if (table->vfield && buf == table->record[0])
|
||||
table->update_virtual_fields(VCOL_UPDATE_FOR_READ);
|
||||
}
|
||||
table->status=result ? STATUS_NOT_FOUND: 0;
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
@ -2622,7 +2628,11 @@ int handler::ha_index_read_map(uchar *buf, const uchar *key,
|
||||
{ result= index_read_map(buf, key, keypart_map, find_flag); })
|
||||
increment_statistics(&SSV::ha_read_key_count);
|
||||
if (!result)
|
||||
{
|
||||
update_index_statistics();
|
||||
if (table->vfield && buf == table->record[0])
|
||||
table->update_virtual_fields(VCOL_UPDATE_FOR_READ);
|
||||
}
|
||||
table->status=result ? STATUS_NOT_FOUND: 0;
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
@ -2649,6 +2659,8 @@ int handler::ha_index_read_idx_map(uchar *buf, uint index, const uchar *key,
|
||||
{
|
||||
update_rows_read();
|
||||
index_rows_read[index]++;
|
||||
if (table->vfield && buf == table->record[0])
|
||||
table->update_virtual_fields(VCOL_UPDATE_FOR_READ);
|
||||
}
|
||||
table->status=result ? STATUS_NOT_FOUND: 0;
|
||||
return result;
|
||||
@ -2666,7 +2678,11 @@ int handler::ha_index_next(uchar * buf)
|
||||
{ result= index_next(buf); })
|
||||
increment_statistics(&SSV::ha_read_next_count);
|
||||
if (!result)
|
||||
{
|
||||
update_index_statistics();
|
||||
if (table->vfield && buf == table->record[0])
|
||||
table->update_virtual_fields(VCOL_UPDATE_FOR_READ);
|
||||
}
|
||||
table->status=result ? STATUS_NOT_FOUND: 0;
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
@ -2683,7 +2699,11 @@ int handler::ha_index_prev(uchar * buf)
|
||||
{ result= index_prev(buf); })
|
||||
increment_statistics(&SSV::ha_read_prev_count);
|
||||
if (!result)
|
||||
{
|
||||
update_index_statistics();
|
||||
if (table->vfield && buf == table->record[0])
|
||||
table->update_virtual_fields(VCOL_UPDATE_FOR_READ);
|
||||
}
|
||||
table->status=result ? STATUS_NOT_FOUND: 0;
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
@ -2699,7 +2719,11 @@ int handler::ha_index_first(uchar * buf)
|
||||
{ result= index_first(buf); })
|
||||
increment_statistics(&SSV::ha_read_first_count);
|
||||
if (!result)
|
||||
{
|
||||
update_index_statistics();
|
||||
if (table->vfield && buf == table->record[0])
|
||||
table->update_virtual_fields(VCOL_UPDATE_FOR_READ);
|
||||
}
|
||||
table->status=result ? STATUS_NOT_FOUND: 0;
|
||||
return result;
|
||||
}
|
||||
@ -2723,7 +2747,11 @@ int handler::ha_index_last(uchar * buf)
|
||||
{ result= index_last(buf); })
|
||||
increment_statistics(&SSV::ha_read_last_count);
|
||||
if (!result)
|
||||
{
|
||||
update_index_statistics();
|
||||
if (table->vfield && buf == table->record[0])
|
||||
table->update_virtual_fields(VCOL_UPDATE_FOR_READ);
|
||||
}
|
||||
table->status=result ? STATUS_NOT_FOUND: 0;
|
||||
return result;
|
||||
}
|
||||
@ -2739,7 +2767,11 @@ int handler::ha_index_next_same(uchar *buf, const uchar *key, uint keylen)
|
||||
{ result= index_next_same(buf, key, keylen); })
|
||||
increment_statistics(&SSV::ha_read_next_count);
|
||||
if (!result)
|
||||
{
|
||||
update_index_statistics();
|
||||
if (table->vfield && buf == table->record[0])
|
||||
table->update_virtual_fields(VCOL_UPDATE_FOR_READ);
|
||||
}
|
||||
table->status=result ? STATUS_NOT_FOUND: 0;
|
||||
return result;
|
||||
}
|
||||
@ -4218,6 +4250,7 @@ handler::check_if_supported_inplace_alter(TABLE *altered_table,
|
||||
Alter_inplace_info::ALTER_COLUMN_OPTION |
|
||||
Alter_inplace_info::CHANGE_CREATE_OPTION |
|
||||
Alter_inplace_info::ALTER_PARTITIONED |
|
||||
Alter_inplace_info::ALTER_VIRTUAL_GCOL_EXPR |
|
||||
Alter_inplace_info::ALTER_RENAME;
|
||||
|
||||
/* Is there at least one operation that requires copy algorithm? */
|
||||
@ -5901,6 +5934,10 @@ static int check_wsrep_max_ws_rows()
|
||||
if (wsrep_max_ws_rows)
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
|
||||
if (!WSREP(thd))
|
||||
return 0;
|
||||
|
||||
thd->wsrep_affected_rows++;
|
||||
if (thd->wsrep_exec_mode != REPL_RECV &&
|
||||
thd->wsrep_affected_rows > wsrep_max_ws_rows)
|
||||
@ -6111,6 +6148,13 @@ void handler::set_lock_type(enum thr_lock_type lock)
|
||||
@note Aborting the transaction does NOT end it, it still has to
|
||||
be rolled back with hton->rollback().
|
||||
|
||||
@note It is safe to abort from one thread (bf_thd) the transaction,
|
||||
running in another thread (victim_thd), because InnoDB's lock_sys and
|
||||
trx_mutex guarantee the necessary protection. However, its not safe
|
||||
to access victim_thd->transaction, because it's not protected from
|
||||
concurrent accesses. And it's an overkill to take LOCK_plugin and
|
||||
iterate the whole installed_htons[] array every time.
|
||||
|
||||
@param bf_thd brute force THD asking for the abort
|
||||
@param victim_thd victim THD to be aborted
|
||||
|
||||
@ -6127,29 +6171,16 @@ int ha_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal)
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
/* Try statement transaction if standard one is not set. */
|
||||
THD_TRANS *trans= (victim_thd->transaction.all.ha_list) ?
|
||||
&victim_thd->transaction.all : &victim_thd->transaction.stmt;
|
||||
|
||||
Ha_trx_info *ha_info= trans->ha_list, *ha_info_next;
|
||||
|
||||
for (; ha_info; ha_info= ha_info_next)
|
||||
handlerton *hton= installed_htons[DB_TYPE_INNODB];
|
||||
if (hton && hton->abort_transaction)
|
||||
{
|
||||
handlerton *hton= ha_info->ht();
|
||||
if (!hton->abort_transaction)
|
||||
{
|
||||
/* Skip warning for binlog & wsrep. */
|
||||
if (hton->db_type != DB_TYPE_BINLOG && hton != wsrep_hton)
|
||||
{
|
||||
WSREP_WARN("Cannot abort transaction.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hton->abort_transaction(hton, bf_thd, victim_thd, signal);
|
||||
}
|
||||
ha_info_next= ha_info->next();
|
||||
hton->abort_transaction(hton, bf_thd, victim_thd, signal);
|
||||
}
|
||||
else
|
||||
{
|
||||
WSREP_WARN("Cannot abort InnoDB transaction");
|
||||
}
|
||||
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user