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

Merge branch '11.4' into 11.8

This commit is contained in:
Sergei Golubchik
2025-07-28 20:16:25 +02:00
380 changed files with 11138 additions and 2776 deletions

View File

@@ -21,72 +21,6 @@
#include "probes_mysql.h"
#include "sql_parse.h" // mysql_execute_command
/****************************************************************************
Declarations.
****************************************************************************/
/**
Materialized_cursor -- an insensitive materialized server-side
cursor. The result set of this cursor is saved in a temporary
table at open. The cursor itself is simply an interface for the
handler of the temporary table.
*/
class Materialized_cursor: public Server_side_cursor
{
MEM_ROOT main_mem_root;
/* A fake unit to supply to select_send when fetching */
SELECT_LEX_UNIT fake_unit;
TABLE *table;
List<Item> item_list;
ulong fetch_limit;
ulong fetch_count;
bool is_rnd_inited;
public:
Materialized_cursor(select_result *result, TABLE *table);
int send_result_set_metadata(THD *thd, List<Item> &send_result_set_metadata);
bool is_open() const override { return table != 0; }
int open(JOIN *join __attribute__((unused))) override;
void fetch(ulong num_rows) override;
void close() override;
bool export_structure(THD *thd, Row_definition_list *defs) override
{
return table->export_structure(thd, defs);
}
~Materialized_cursor() override;
void on_table_fill_finished();
};
/**
Select_materialize -- a mediator between a cursor query and the
protocol. In case we were not able to open a non-materialzed
cursor, it creates an internal temporary HEAP table, and insert
all rows into it. When the table reaches max_heap_table_size,
it's converted to a MyISAM table. Later this table is used to
create a Materialized_cursor.
*/
class Select_materialize: public select_unit
{
select_result *result; /**< the result object of the caller (PS or SP) */
public:
Materialized_cursor *materialized_cursor;
Select_materialize(THD *thd_arg, select_result *result_arg):
select_unit(thd_arg), result(result_arg), materialized_cursor(0) {}
bool send_result_set_metadata(List<Item> &list, uint flags) override;
bool send_eof() override { return false; }
bool view_structure_only() const override
{
return result->view_structure_only();
}
};
/**************************************************************************/
/**
Attempt to open a materialized cursor.