MySQL 8.0.39
Source Code Documentation
Query_result Class Referenceabstract

#include <query_result.h>

Inheritance diagram for Query_result:
[legend]

Public Member Functions

 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 prepare (THD *, const mem_root_deque< Item * > &, Query_expression *u)
 Perform preparation specific to the query expression or DML statement. More...
 
virtual bool start_execution (THD *)
 Prepare for execution of the query expression or DML statement. More...
 
virtual bool create_table_for_query_block (THD *)
 Create table, only needed to support CREATE TABLE ... SELECT. More...
 
virtual uint field_count (const mem_root_deque< Item * > &fields) const
 
virtual bool send_result_set_metadata (THD *thd, const mem_root_deque< Item * > &list, uint flags)=0
 
virtual bool send_data (THD *thd, const mem_root_deque< Item * > &items)=0
 
virtual bool send_eof (THD *thd)=0
 
virtual bool check_supports_cursor () const
 Check if this query result set supports cursors. More...
 
virtual void abort_result_set (THD *)
 
virtual bool reset ()
 Cleanup after one execution of the unit, to be ready for a next execution inside the same statement. More...
 
virtual void cleanup ()
 Cleanup after this execution. More...
 
virtual bool is_interceptor () const
 Checks if this Query_result intercepts and transforms the result set. More...
 
virtual void set_limit (ha_rows)
 Only overridden (and non-empty) for Query_result_union, q.v. More...
 
virtual Server_side_cursorcursor () const
 

Public Attributes

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

Query_expressionunit
 

Constructor & Destructor Documentation

◆ Query_result()

Query_result::Query_result ( )
inline

◆ ~Query_result()

virtual Query_result::~Query_result ( )
virtualdefault

Member Function Documentation

◆ abort_result_set()

virtual void Query_result::abort_result_set ( THD )
inlinevirtual

◆ change_query_result()

virtual bool Query_result::change_query_result ( THD ,
Query_result  
)
inlinevirtual

Change wrapped Query_result.

Replace the wrapped query result object with new_result and call prepare() on new_result.

This base class implementation doesn't wrap other Query_results.

Return values
falseSuccess
trueError

Reimplemented in Query_result_union_direct.

◆ check_supports_cursor()

virtual bool Query_result::check_supports_cursor ( ) const
inlinevirtual

Check if this query result set supports cursors.

Returns
false if success, true if error

Reimplemented in Query_result_send, Query_result_to_file, Query_dumpvar, Query_result_materialize, Query_result_do, and Query_result_union_direct.

◆ cleanup()

virtual void Query_result::cleanup ( )
inlinevirtual

Cleanup after this execution.

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

Reimplemented in Query_result_max_min_subquery, Query_result_explain, Query_result_send, Query_result_to_file, Query_result_export, Query_dumpvar, Query_result_materialize, Query_result_do, Query_result_insert, Query_result_union_direct, Query_result_union, and Query_result_update.

◆ create_table_for_query_block()

virtual bool Query_result::create_table_for_query_block ( THD )
inlinevirtual

Create table, only needed to support CREATE TABLE ... SELECT.

Reimplemented in Query_result_create.

◆ cursor()

virtual Server_side_cursor * Query_result::cursor ( ) const
inlinevirtual
Returns
server side cursor, if associated with query result

Reimplemented in Query_result_materialize.

◆ field_count()

uint Query_result::field_count ( const mem_root_deque< Item * > &  fields) const
virtual

◆ is_interceptor()

virtual bool Query_result::is_interceptor ( ) const
inlinevirtual

Checks if this Query_result intercepts and transforms the result set.

Returns
true if it is an interceptor, false otherwise

Reimplemented in Query_result_interceptor.

◆ need_explain_interceptor()

virtual bool Query_result::need_explain_interceptor ( ) const
inlinevirtual
Returns
true if an interceptor object is needed for EXPLAIN

Reimplemented in anonymous_namespace{sql_delete.cc}::Query_result_delete, Query_result_insert, and Query_result_update.

◆ needs_file_privilege()

virtual bool Query_result::needs_file_privilege ( ) const
inlinevirtual

Reimplemented in Query_result_to_file.

◆ prepare()

virtual bool Query_result::prepare ( THD ,
const mem_root_deque< Item * > &  ,
Query_expression u 
)
inlinevirtual

Perform preparation specific to the query expression or DML statement.

Returns
false if success, true if error

Reimplemented in Query_result_explain, Query_result_export, Query_result_dump, Query_dumpvar, sp_cursor::Query_fetch_into_spvars, Query_result_materialize, Query_result_insert, Query_result_create, Query_result_union, and Query_result_update.

◆ reset()

virtual bool Query_result::reset ( void  )
inlinevirtual

Cleanup after one execution of the unit, to be ready for a next execution inside the same statement.

Returns
true if error

Reimplemented in Query_result_union.

◆ send_data()

◆ send_eof()

◆ send_result_set_metadata()

virtual bool Query_result::send_result_set_metadata ( THD thd,
const mem_root_deque< Item * > &  list,
uint  flags 
)
pure virtual

◆ set_limit()

virtual void Query_result::set_limit ( ha_rows  )
inlinevirtual

Only overridden (and non-empty) for Query_result_union, q.v.

Reimplemented in Query_result_union.

◆ start_execution()

virtual bool Query_result::start_execution ( THD )
inlinevirtual

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 in Query_result_explain, Query_result_export, Query_result_dump, Query_result_materialize, Query_result_insert, Query_result_create, Query_result_union_direct, and Query_result_update.

Member Data Documentation

◆ estimated_cost

double Query_result::estimated_cost

Cost to execute the subquery which produces this result.

Valid only for materialized derived tables/views.

◆ estimated_rowcount

ha_rows Query_result::estimated_rowcount

Number of records estimated in this result.

Valid only for materialized derived tables/views.

◆ unit

Query_expression* Query_result::unit
protected

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