MySQL  8.0.17
Source Code Documentation
PT_union Class Reference

#include <parse_tree_nodes.h>

Inheritance diagram for PT_union:
PT_query_expression_body Parse_tree_node_tmpl< Context >

Public Member Functions

 PT_union (PT_query_expression *lhs, const POS &lhs_pos, bool is_distinct, PT_query_primary *rhs)
 
virtual void set_containing_qe (PT_query_expression *qe)
 
virtual bool contextualize (Parse_context *pc)
 A SELECT_LEX_UNIT has to be built in a certain order: First the SELECT_LEX representing the left-hand side of the union is built ("contextualized",) then the right hand side, and lastly the "fake" SELECT_LEX is built and made the "current" one. More...
 
virtual bool is_union () const
 
virtual bool has_into_clause () const
 
- Public Member Functions inherited from Parse_tree_node_tmpl< Context >
virtual ~Parse_tree_node_tmpl ()
 
bool is_contextualized () const
 
virtual bool contextualize (Context *pc)
 Do all context-sensitive things and mark the node as contextualized. More...
 
virtual bool contextualize_ (Context *)
 
Intermediate version of the contextualize() function More...
 
void error (Context *pc, const POS &pos) const
 syntax_error() function replacement for deferred reporting of syntax errors More...
 
void error (Context *pc, const POS &pos, const char *msg) const
 syntax_error() function replacement for deferred reporting of syntax errors More...
 
void errorf (Context *pc, const POS &pos, const char *format,...) const
 syntax_error() function replacement for deferred reporting of syntax errors More...
 

Private Attributes

PT_query_expressionm_lhs
 
POS m_lhs_pos
 
bool m_is_distinct
 
PT_query_primarym_rhs
 
PT_into_destinationm_into
 
PT_query_expressionm_containing_qe
 

Additional Inherited Members

- Public Types inherited from Parse_tree_node_tmpl< Context >
typedef Context context_t
 
- Static Public Member Functions inherited from Parse_tree_node_tmpl< Context >
static void * operator new (size_t size, MEM_ROOT *mem_root, const std::nothrow_t &arg=std::nothrow) noexcept
 
static void operator delete (void *ptr, size_t size)
 
static void operator delete (void *, MEM_ROOT *, const std::nothrow_t &) noexcept
 
- Protected Member Functions inherited from Parse_tree_node_tmpl< Context >
 Parse_tree_node_tmpl ()
 

Constructor & Destructor Documentation

◆ PT_union()

PT_union::PT_union ( PT_query_expression lhs,
const POS lhs_pos,
bool  is_distinct,
PT_query_primary rhs 
)
inline

Member Function Documentation

◆ contextualize()

bool PT_union::contextualize ( Parse_context pc)
virtual

A SELECT_LEX_UNIT has to be built in a certain order: First the SELECT_LEX representing the left-hand side of the union is built ("contextualized",) then the right hand side, and lastly the "fake" SELECT_LEX is built and made the "current" one.

Only then can the order and limit clauses be contextualized, because they are attached to the fake SELECT_LEX. This is a bit unnatural, as these clauses belong to the surrounding <query expression>, not the <query expression body> which is the union (and represented by this class). For this reason, the PT_query_expression is expected to call set_containing_qe(this) on this object, so that during this contextualize() call, a call to contextualize_order_and_limit() can be made at just the right time.

◆ has_into_clause()

virtual bool PT_union::has_into_clause ( ) const
inlinevirtual

◆ is_union()

virtual bool PT_union::is_union ( ) const
inlinevirtual

◆ set_containing_qe()

virtual void PT_union::set_containing_qe ( PT_query_expression qe)
inlinevirtual

Reimplemented from PT_query_expression_body.

Member Data Documentation

◆ m_containing_qe

PT_query_expression* PT_union::m_containing_qe
private

◆ m_into

PT_into_destination* PT_union::m_into
private

◆ m_is_distinct

bool PT_union::m_is_distinct
private

◆ m_lhs

PT_query_expression* PT_union::m_lhs
private

◆ m_lhs_pos

POS PT_union::m_lhs_pos
private

◆ m_rhs

PT_query_primary* PT_union::m_rhs
private

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