MySQL 8.4.3
Source Code Documentation
Query_result_materialize Class Referencefinal

Query_result_materialize – a mediator between a cursor query and the protocol. More...

Inheritance diagram for Query_result_materialize:
[legend]

Public Member Functions

 Query_result_materialize (Query_result *result_arg)
 
 ~Query_result_materialize () override
 
void set_result (Query_result *result_arg)
 
bool check_supports_cursor () const override
 Check if this query result set supports cursors. More...
 
bool prepare (THD *thd, const mem_root_deque< Item * > &list, Query_expression *u) override
 Perform preparation specific to the query expression or DML statement. More...
 
bool start_execution (THD *thd) override
 Prepare for execution of the query expression or DML statement. More...
 
bool send_result_set_metadata (THD *thd, const mem_root_deque< Item * > &list, uint flags) override
 
void cleanup () override
 Cleanup after this execution. More...
 
Server_side_cursorcursor () const override
 
- Public Member Functions inherited from Query_result_union
 Query_result_union ()
 
bool prepare (THD *thd, const mem_root_deque< Item * > &list, Query_expression *u) override
 Perform preparation specific to the query expression or DML statement. More...
 
virtual bool postponed_prepare (THD *thd, const mem_root_deque< Item * > &types)
 Do prepare() if preparation has been postponed until column type information is computed (used by Query_result_union_direct). More...
 
bool send_data (THD *thd, const mem_root_deque< Item * > &items) override
 
bool send_eof (THD *thd) override
 
virtual bool flush ()
 
void cleanup () override
 Cleanup after this execution. More...
 
bool reset () override
 Reset and empty the temporary table that stores the materialized query result. More...
 
bool create_result_table (THD *thd, const mem_root_deque< Item * > &column_types, bool is_distinct, ulonglong options, const char *alias, bool bit_fields_as_long, bool create_table, Query_term_set_op *op=nullptr)
 Create a temporary table to store the result of a query expression (used, among others, when materializing a UNION DISTINCT). More...
 
uint get_hidden_field_count () const
 
bool skip_create_table () const
 
void set_limit (ha_rows limit_rows) override
 Set an effective LIMIT for the number of rows coming out of a materialized temporary table used for implementing INTERSECT or EXCEPT: informs TableScanIterator::TableScanIterator how many rows to read from the materialized table. More...
 
- Public Member Functions inherited from Query_result_interceptor
 Query_result_interceptor ()
 
uint field_count (const mem_root_deque< Item * > &) const override
 
- Public Member Functions inherited from Query_result
 Query_result ()
 
virtual ~Query_result ()=default
 
virtual bool needs_file_privilege () const
 
virtual bool change_query_result (THD *, Query_result *)
 Change wrapped Query_result. More...
 
virtual bool need_explain_interceptor () const
 
virtual bool create_table_for_query_block (THD *)
 Create table, only needed to support CREATE TABLE ... SELECT. More...
 
virtual void abort_result_set (THD *)
 
virtual bool use_protocol_adapter () const
 
virtual bool use_protocol_wrapper () const
 

Private Attributes

Materialized_cursorm_cursor {nullptr}
 The materialized cursor associated with this result. More...
 
Query_resultm_result
 The query result supplied by the caller (PS or SP) More...
 

Additional Inherited Members

- Public Attributes inherited from Query_result_union
TABLEtable
 
- Public Attributes inherited from Query_result
ha_rows estimated_rowcount
 Number of records estimated in this result. More...
 
double estimated_cost
 Cost to execute the subquery which produces this result. More...
 
- Protected Attributes inherited from Query_result_union
Temp_table_param tmp_table_param
 
- Protected Attributes inherited from Query_result
Query_expressionunit
 

Detailed Description

Query_result_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 memory table, and inserts all rows into it. If the table is in the Heap engine and if it reaches maximum Heap table size, it's converted to a disk-based temporary table. Later this table is used to create a Materialized_cursor.

Constructor & Destructor Documentation

◆ Query_result_materialize()

Query_result_materialize::Query_result_materialize ( Query_result result_arg)
inline

◆ ~Query_result_materialize()

Query_result_materialize::~Query_result_materialize ( )
inlineoverride

Member Function Documentation

◆ check_supports_cursor()

bool Query_result_materialize::check_supports_cursor ( ) const
inlineoverridevirtual

Check if this query result set supports cursors.

Returns
false if success, true if error

Reimplemented from Query_result.

◆ cleanup()

void Query_result_materialize::cleanup ( void  )
inlineoverridevirtual

Cleanup after this execution.

Completes the execution and resets object before next execution of a prepared statement/stored procedure.

Reimplemented from Query_result.

◆ cursor()

Server_side_cursor * Query_result_materialize::cursor ( ) const
inlineoverridevirtual
Returns
server side cursor, if associated with query result

Reimplemented from Query_result.

◆ prepare()

bool Query_result_materialize::prepare ( THD ,
const mem_root_deque< Item * > &  ,
Query_expression u 
)
overridevirtual

Perform preparation specific to the query expression or DML statement.

Returns
false if success, true if error

Reimplemented from Query_result.

◆ send_result_set_metadata()

bool Query_result_materialize::send_result_set_metadata ( THD thd,
const mem_root_deque< Item * > &  list,
uint  flags 
)
overridevirtual

Reimplemented from Query_result_interceptor.

◆ set_result()

void Query_result_materialize::set_result ( Query_result result_arg)
inline

◆ start_execution()

bool Query_result_materialize::start_execution ( THD )
overridevirtual

Prepare for execution of the query expression or DML statement.

Generally, this will have an implementation only for outer-most Query_block objects, such as data change statements (for preparation of the target table(s)) or dump statements (for preparation of target file).

Returns
false if success, true if error

Reimplemented from Query_result.

Member Data Documentation

◆ m_cursor

Materialized_cursor* Query_result_materialize::m_cursor {nullptr}
private

The materialized cursor associated with this result.

◆ m_result

Query_result* Query_result_materialize::m_result
private

The query result supplied by the caller (PS or SP)


The documentation for this class was generated from the following file: