1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 11.1 into 11.2

This commit is contained in:
Marko Mäkelä
2023-07-26 15:49:24 +03:00
212 changed files with 4735 additions and 2471 deletions

View File

@@ -36,6 +36,7 @@
#include "sql_array.h" /* Dynamic_array<> */
#include "mdl.h"
#include "vers_string.h"
#include "ha_handler_stats.h"
#include "optimizer_costs.h"
#include "sql_analyze_stmt.h" // for Exec_time_tracker
@@ -3161,6 +3162,9 @@ protected:
ha_rows estimation_rows_to_insert;
handler *lookup_handler;
/* Statistics for the query. Updated if handler_stats.in_use is set */
ha_handler_stats active_handler_stats;
void set_handler_stats();
public:
handlerton *ht; /* storage engine of this handler */
OPTIMIZER_COSTS *costs; /* Points to table->share->costs */
@@ -3168,7 +3172,14 @@ public:
uchar *dup_ref; /* Pointer to duplicate row */
uchar *lookup_buffer;
/* General statistics for the table like number of row, file sizes etc */
ha_statistics stats;
/*
Collect query stats here if pointer is != NULL.
This is a pointer because if we do a clone of the handler, we want to
use the original handler for collecting statistics.
*/
ha_handler_stats *handler_stats;
/** MultiRangeRead-related members: */
range_seq_t mrr_iter; /* Iterator to traverse the range sequence */
@@ -3366,8 +3377,8 @@ public:
:table_share(share_arg), table(0),
estimation_rows_to_insert(0),
lookup_handler(this),
ht(ht_arg), costs(0), ref(0), lookup_buffer(NULL), end_range(NULL),
implicit_emptied(0),
ht(ht_arg), costs(0), ref(0), lookup_buffer(NULL), handler_stats(NULL),
end_range(NULL), implicit_emptied(0),
mark_trx_read_write_done(0),
check_table_binlog_row_based_done(0),
check_table_binlog_row_based_result(0),
@@ -5047,6 +5058,22 @@ public:
{
check_table_binlog_row_based_done= 0;
}
virtual void handler_stats_updated() {}
inline void ha_handler_stats_reset()
{
handler_stats= &active_handler_stats;
active_handler_stats.reset();
active_handler_stats.active= 1;
handler_stats_updated();
}
inline void ha_handler_stats_disable()
{
handler_stats= 0;
active_handler_stats.active= 0;
handler_stats_updated();
}
private:
/* Cache result to avoid extra calls */
inline void mark_trx_read_write()
@@ -5407,6 +5434,7 @@ public:
}
bool log_not_redoable_operation(const char *operation);
protected:
Handler_share *get_ha_share_ptr();
void set_ha_share_ptr(Handler_share *arg_ha_share);