![]() |
MySQL 9.4.0
Source Code Documentation
|
Classes | |
class | Content_tree_node |
class | Key_column_info |
Class to represent each key and column information from JSON duality object. More... | |
class | View_lex_handler |
Class to handle view Lex. More... | |
Enumerations | |
enum | Duality_view_tags : int { DVT_INVALID = 0 , DVT_INSERT = 1 , DVT_UPDATE = 2 , DVT_DELETE = 4 , DVT_NOUPDATE = 8 } |
Functions | |
static const char * | get_primary_key_column_name (const Table_ref *table_ref) |
Returns primary key name given table. More... | |
static Field * | get_field_for_column (const Table_ref *table_ref, const char *fld_name) |
Get the field instance of a column. More... | |
static bool | set_join_column_index_for_node (Content_tree_node *child_node, Content_tree_node *parent_node, Item_ident *side_ident, bool is_parent) |
Helper function to set join column index for a given node. More... | |
static bool | prepare_join_condition (THD *thd, Query_block *sl, Content_tree_node *node) |
Helper function to prepare join condition for sub-object. More... | |
static bool | prepare_content_tree_node (THD *thd, Content_tree_node *node) |
Content_tree_node * | prepare_content_tree (THD *thd, LEX *view_lex) |
Constructs the content tree for given JSON duality view. More... | |
void | destroy_content_tree (Content_tree_node *root) |
Deletes the content tree for given JSON duality view. More... | |
static bool | validate_view_syntax (THD *thd, Query_expression *qe, const char *object_name, bool root_query) |
Performs syntax validation of a given JSON DUALITY VIEW. More... | |
static bool | meets_relationship_rules (Content_tree_node *node) |
Performs validation of below semantic rules: More... | |
static bool | is_column_with_unsupported_type_projected (Content_tree_node *node) |
Performs validation of below semantic rules: More... | |
static bool | meets_all_semantic_rules (Content_tree_node *node, std::map< std::string, Mem_root_array< Key_column_info > * > &table_columns_map) |
Apply duality view create rules. More... | |
static bool | validate_view_semantics (Content_tree_node *root, std::map< std::string, Mem_root_array< Key_column_info > * > &table_columns_map) |
Performs semantic validation of a given JSON DUALITY VIEW. More... | |
bool | is_prepare_required (THD *thd, Table_ref *table_ref) |
Check if duality view prepared is required. More... | |
bool | prepare (THD *thd, Table_ref *table_ref) |
Performs Syntax validation, parepares metadata tree and performs Semantic validation of a given JSON DUALITY VIEW. More... | |
bool | jdv_prepare_insert (THD *, const Table_ref *, Sql_cmd_insert_base *) |
bool | jdv_prepare_update (THD *, const Table_ref *, bool) |
bool | jdv_prepare_delete (THD *, const Table_ref *, bool) |
bool | jdv_insert (THD *, const Table_ref *, const mem_root_deque< List_item * > &) |
Entry point called from sql_insert.cc, bool Sql_cmd_insert_values::execute_inner(THD *thd);. More... | |
bool | jdv_update (THD *, const Table_ref *, const mem_root_deque< Item * > *, const mem_root_deque< Item * > *, ulonglong *) |
Entry point called from sql_update.cc bool Sql_cmd_update::update_single_table(THD *thd);. More... | |
bool | jdv_delete (THD *, const Table_ref *, ulonglong *) |
Entry point called from sql_delete.cc, bool Sql_cmd_delete::delete_from_single_table(THD *thd);. More... | |
void | get_i_s_properties (Content_tree_node *root, const char *i_s_view_name, String *properties) |
Get the requested properies for the JSON duality view represented by the submitted content tree root. More... | |
void | append_identifier (std::string *sbuf, std::string_view id, String *bufp) |
Append an identifier to a string using backtick quotes. More... | |
void | append_identifier (std::string *sbuf, std::string_view id) |
Append an identifier to a string using backtick quotes using a String on the stack as buffer. More... | |
Variables | |
constexpr std::size_t | VOID_COLUMN_INDEX |
enum jdv::Duality_view_tags : int |
void jdv::append_identifier | ( | std::string * | sbuf, |
std::string_view | id | ||
) |
Append an identifier to a string using backtick quotes using a String on the stack as buffer.
void jdv::append_identifier | ( | std::string * | sbuf, |
std::string_view | id, | ||
String * | bufp | ||
) |
Append an identifier to a string using backtick quotes.
Pointer to String to use as buffer passed in.
void jdv::destroy_content_tree | ( | Content_tree_node * | root | ) |
Deletes the content tree for given JSON duality view.
[in] | root | Root object of content tree |
|
static |
Get the field instance of a column.
[in] | table_ref | Table_ref instance of a table. |
[in] | fld_name | Field name. |
void jdv::get_i_s_properties | ( | Content_tree_node * | root, |
const char * | i_s_view_name, | ||
String * | properties | ||
) |
Get the requested properies for the JSON duality view represented by the submitted content tree root.
The i_s_view_name will imply which properties are requested. The properties are filled into a JSON document which is serialized into a string returned to the UDF invoked from the view, and is used there to join with the JSON duality view name retrieved from the DD tables.
root | Content tree root. |
i_s_view_name | Name of the I_S view. |
properties | String containing the requested properties. |
|
static |
Returns primary key name given table.
[in] | table_ref | Table_ref instance of a table. current THD |
|
static |
Performs validation of below semantic rules:
[in] | node | current node of metadata tree |
true | in case if unsupported column is projected |
Check if duality view prepared is required.
thd | Thread handle. |
table_ref | Table_ref* object for given JSON duality view. |
Entry point called from sql_delete.cc, bool Sql_cmd_delete::delete_from_single_table(THD *thd);.
bool jdv::jdv_insert | ( | THD * | , |
const Table_ref * | , | ||
const mem_root_deque< List_item * > & | |||
) |
Entry point called from sql_insert.cc, bool Sql_cmd_insert_values::execute_inner(THD *thd);.
bool jdv::jdv_prepare_insert | ( | THD * | , |
const Table_ref * | , | ||
Sql_cmd_insert_base * | |||
) |
bool jdv::jdv_update | ( | THD * | , |
const Table_ref * | , | ||
const mem_root_deque< Item * > * | , | ||
const mem_root_deque< Item * > * | , | ||
ulonglong * | |||
) |
Entry point called from sql_update.cc bool Sql_cmd_update::update_single_table(THD *thd);.
|
static |
Apply duality view create rules.
[in] | node | current object of metadata tree |
[in,out] | table_columns_map | map of table name to column projections |
true | in case of success, false in case of failure |
|
static |
Performs validation of below semantic rules:
Rule: If child object is a singleton descendent, then primary key column of a child object's table should part of a join condition. If child is a nested descendent, then primary key column of a parent object should be part of a join condition.
[in] | node | Current content tree node. |
true | in case of success, false in case of failure. |
Performs Syntax validation, parepares metadata tree and performs Semantic validation of a given JSON DUALITY VIEW.
[in] | thd | Current THD object |
[in,out] | table_ref | Table_ref* object for given JSON DUALITY VIEW |
false | in case of success, true in case of failure |
Content_tree_node * jdv::prepare_content_tree | ( | THD * | thd, |
LEX * | view_lex | ||
) |
Constructs the content tree for given JSON duality view.
[in] | thd | THD context. |
[in] | view_lex | LEX* object for the current query |
|
static |
|
static |
Helper function to prepare join condition for sub-object.
thd | Thread Handle. |
sl | Sub-object's query block. |
node | Content tree node for a sub-object. |
|
static |
Helper function to set join column index for a given node.
child_node | Content_tree_node object representing the current node |
parent_node | Content_tree_node object representing the parent node |
side_ident | Item_ident object representing one side of equality condition |
is_parent | specifies whether current node is to be processed or parent |
|
static |
Performs semantic validation of a given JSON DUALITY VIEW.
[in] | root | Object of metadata tree |
[in,out] | table_columns_map | map of table name to column projections |
false | in case of success, true in case of failure |
|
static |
Performs syntax validation of a given JSON DUALITY VIEW.
[in] | thd | Current THD object |
[in] | qe | Root object of metadata tree |
[in] | object_name | key name for sub-objects, "Root Node" for root node |
[in] | root_query | does given qe represent root query expression? |
false | in case of success, true in case of failure |
|
constexpr |