MySQL 9.4.0
Source Code Documentation
jdv::View_lex_handler Class Reference

Class to handle view Lex. More...

Public Member Functions

 View_lex_handler (THD *thd, Table_ref *view_ref)
 
 View_lex_handler ()=delete
 
 View_lex_handler (const View_lex_handler &)=delete
 
 View_lex_handler (View_lex_handler &&)=delete
 
View_lex_handleroperator= (const View_lex_handler &)=delete
 
View_lex_handleroperator= (View_lex_handler &&)=delete
 
LEXget_view_lex ()
 
 ~View_lex_handler ()
 

Private Attributes

THDm_thd {nullptr}
 Thread Handle. More...
 
Table_refm_view_ref {nullptr}
 Table_ref instance of a duality view. More...
 
LEXm_view_lex {nullptr}
 If view query is re-parsed, then contains LEX instance of a view_query. More...
 
Table_refm_first_table {nullptr}
 Indicates if first table from query tables is unlinked. More...
 
bool m_link_to_local {false}
 

Detailed Description

Class to handle view Lex.

View lex for view query is used to validate the syntax, prepare content tree and for semantic validation. View lex is available at a) THD::lex while creating or altering a duality view, b) Table_ref::view_query() when a view is opened for any operation, c) While executing a Prepared Statement and Stored Program statement, view lex in not available. Hence, it should be re-prepared. This class is responsible for getting lex from the sources listed for duality view validation and content tree preparation.

Constructor & Destructor Documentation

◆ View_lex_handler() [1/4]

jdv::View_lex_handler::View_lex_handler ( THD thd,
Table_ref view_ref 
)
inline

◆ View_lex_handler() [2/4]

jdv::View_lex_handler::View_lex_handler ( )
delete

◆ View_lex_handler() [3/4]

jdv::View_lex_handler::View_lex_handler ( const View_lex_handler )
delete

◆ View_lex_handler() [4/4]

jdv::View_lex_handler::View_lex_handler ( View_lex_handler &&  )
delete

◆ ~View_lex_handler()

jdv::View_lex_handler::~View_lex_handler ( )
inline

Member Function Documentation

◆ get_view_lex()

LEX * jdv::View_lex_handler::get_view_lex ( )
inline

While executing a prepared statement or SP instruction, the first Table_ref instance in the query_tables could be Table_ref instance of a view being created. Unlink it from the view query tables list.

Execute prepared PS and SP statement. For syntax validation of a view query, content tree preparation and sematic validations, AST of a view query is used. While executing PS and SP statement, view is opened but LEX instance for view query is not prepared. PS or SP instruction, contains resolved LEX of a statement. AST for view_query is not available. Hence, re-preparing only AST of a view query here.

At this stage, view_ref->query_tables are already open. Not opening tables for m_view_lex->query_tables here again. But, content_tree references TABLE instance of m_view_lex->query_tables. TABLE instance is referenced only to prepare content tree and validate semantics. Hence, just pointing m_view_lex->query_tables to TABLE referred in view_ref->query_tables.

◆ operator=() [1/2]

View_lex_handler & jdv::View_lex_handler::operator= ( const View_lex_handler )
delete

◆ operator=() [2/2]

View_lex_handler & jdv::View_lex_handler::operator= ( View_lex_handler &&  )
delete

Member Data Documentation

◆ m_first_table

Table_ref* jdv::View_lex_handler::m_first_table {nullptr}
private

Indicates if first table from query tables is unlinked.

◆ m_link_to_local

bool jdv::View_lex_handler::m_link_to_local {false}
private

◆ m_thd

THD* jdv::View_lex_handler::m_thd {nullptr}
private

Thread Handle.

◆ m_view_lex

LEX* jdv::View_lex_handler::m_view_lex {nullptr}
private

If view query is re-parsed, then contains LEX instance of a view_query.

◆ m_view_ref

Table_ref* jdv::View_lex_handler::m_view_ref {nullptr}
private

Table_ref instance of a duality view.


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