MySQL 9.0.0
Source Code Documentation
|
Column description for JSON_TABLE function. More...
#include <table_function.h>
Public Member Functions | |
Json_table_column (enum_jt_column type) | |
Json_table_column (enum_jt_column col_type, Item *path, Json_on_response_type on_err, Item *error_default, Json_on_response_type on_miss, Item *missing_default) | |
Json_table_column (Item *path, List< Json_table_column > *cols) | |
~Json_table_column () | |
void | cleanup () |
bool | fill_column (Table_function_json *table_function, jt_skip_reason *skip) |
Fill a json table column. More... | |
Public Member Functions inherited from Create_field | |
size_t | max_display_width_in_codepoints () const |
size_t | max_display_width_in_bytes () const |
size_t | pack_length (bool dont_override=false) const |
size_t | key_length () const |
bool | explicit_display_width () const |
void | set_max_display_width_from_create_field (const Create_field &create_field) |
Set the maximum display width based on another Create_field. More... | |
Create_field () | |
Create_field (Field *field, Field *orig_field) | |
Constructs a column definition from an object representing an actual column. More... | |
Create_field * | clone (MEM_ROOT *mem_root) const |
bool | is_gcol () const |
bool | is_virtual_gcol () const |
void | init_for_tmp_table (enum_field_types sql_type_arg, uint32 max_length, uint32 decimals, bool is_nullable, bool is_unsigned, uint pack_length_override, const char *field_name="") |
Init for a tmp table field. More... | |
bool | init (THD *thd, const char *field_name, enum_field_types type, const char *length, const char *decimals, uint type_modifier, Item *default_value, Item *on_update_value, const LEX_CSTRING *comment, const char *change, List< String > *interval_list, const CHARSET_INFO *cs, bool has_explicit_collation, uint uint_geom_type, Value_generator *gcol_info, Value_generator *default_val_expr, std::optional< gis::srid_t > srid, dd::Column::enum_hidden_type hidden, bool is_array=false) |
Initialize a column definition object. More... | |
ha_storage_media | field_storage_type () const |
column_format_type | column_format () const |
Public Attributes | |
enum_jt_column | m_jtc_type |
Column type. More... | |
Json_on_response_type | m_on_error {Json_on_response_type::IMPLICIT} |
Type of ON ERROR clause. More... | |
Json_on_response_type | m_on_empty {Json_on_response_type::IMPLICIT} |
Type of ON EMPTY clause. More... | |
Item * | m_default_empty_string {nullptr} |
Default value string for ON EMPTY clause. More... | |
Json_wrapper | m_default_empty_json |
Parsed JSON for default value of ON MISSING clause. More... | |
Item * | m_default_error_string {nullptr} |
Default value string for ON ERROR clause. More... | |
Json_wrapper | m_default_error_json |
Parsed JSON string for ON ERROR clause. More... | |
List< Json_table_column > * | m_nested_columns {nullptr} |
List of nested columns, valid only for NESTED PATH. More... | |
Item * | m_path_string {nullptr} |
Nested path. More... | |
Json_path | m_path_json {key_memory_JSON} |
parsed nested path More... | |
JT_data_source * | m_jds_elt {nullptr} |
An element in table function's data source array. More... | |
JT_data_source * | m_child_jds_elt {nullptr} |
Element in table function's data source array to feed data to child nodes. More... | |
Json_table_column * | m_next_nested {nullptr} |
Next sibling NESTED PATH. More... | |
Json_table_column * | m_prev_nested {nullptr} |
Previous sibling NESTED PATH. More... | |
int | m_field_idx {-1} |
Index of field in the result table. More... | |
Public Attributes inherited from Create_field | |
dd::Column::enum_hidden_type | hidden |
const char * | field_name |
const char * | change |
Name of column modified by ALTER TABLE's CHANGE/MODIFY COLUMN clauses, NULL for columns added. More... | |
const char * | after {nullptr} |
LEX_CSTRING | comment |
Item * | constant_default |
The declared default value, if any, otherwise NULL. More... | |
enum_field_types | sql_type |
uint | decimals |
uint | flags {0} |
uchar | auto_flags {Field::NONE} |
Bitmap of flags indicating if field value should be auto-generated by default and/or on update, and in which way. More... | |
TYPELIB * | interval |
List< String > | interval_list |
const CHARSET_INFO * | charset |
bool | is_explicit_collation |
Field::geometry_type | geom_type |
Field * | field |
uint | offset |
bool | is_nullable |
Indicate whether column is nullable, zerofill or unsigned. More... | |
bool | is_zerofill |
bool | is_unsigned |
bool | treat_bit_as_char |
Indicates that storage engine doesn't support optimized BIT field storage. More... | |
uint | pack_length_override {0} |
Row based replication code sometimes needs to create ENUM and SET fields with pack length which doesn't correspond to number of elements in interval TYPELIB. More... | |
Value_generator * | gcol_info {nullptr} |
bool | stored_in_db |
Value_generator * | m_default_val_expr {nullptr} |
Holds the expression to be used to generate default values. More... | |
std::optional< gis::srid_t > | m_srid |
bool | is_array {false} |
LEX_CSTRING | m_engine_attribute = EMPTY_CSTR |
LEX_CSTRING | m_secondary_engine_attribute = EMPTY_CSTR |
Column description for JSON_TABLE function.
|
inlineexplicit |
|
inline |
|
inline |
Json_table_column::~Json_table_column | ( | ) |
|
inline |
bool Json_table_column::fill_column | ( | Table_function_json * | table_function, |
jt_skip_reason * | skip | ||
) |
Fill a json table column.
Fills a column with data, according to specification in JSON_TABLE. This function handles all kinds of columns: Ordinality) just saves the counter into the column's field Path) extracts value, saves it to the column's field and handles ON ERROR/ON EMPTY clauses Exists) checks the path existence and saves either 1 or 0 into result field Nested path) matches the path expression against data source. If there're matches, this function sets NESTED PATH's iterator over those matches and resets ordinality counter.
[in] | table_function | the JSON table function |
[out] | skip | true <=> it's a NESTED PATH node and its path expression didn't return any matches or a previous sibling NESTED PATH clause still producing records, thus all columns of this NESTED PATH node should be skipped |
JT_data_source* Json_table_column::m_child_jds_elt {nullptr} |
Element in table function's data source array to feed data to child nodes.
Valid only for NESTED PATH.
Json_wrapper Json_table_column::m_default_empty_json |
Parsed JSON for default value of ON MISSING clause.
Json_wrapper Json_table_column::m_default_error_json |
Parsed JSON string for ON ERROR clause.
int Json_table_column::m_field_idx {-1} |
Index of field in the result table.
JT_data_source* Json_table_column::m_jds_elt {nullptr} |
An element in table function's data source array.
enum_jt_column Json_table_column::m_jtc_type |
Column type.
List<Json_table_column>* Json_table_column::m_nested_columns {nullptr} |
List of nested columns, valid only for NESTED PATH.
Json_table_column* Json_table_column::m_next_nested {nullptr} |
Next sibling NESTED PATH.
Json_on_response_type Json_table_column::m_on_empty {Json_on_response_type::IMPLICIT} |
Type of ON EMPTY clause.
Json_on_response_type Json_table_column::m_on_error {Json_on_response_type::IMPLICIT} |
Type of ON ERROR clause.
Json_path Json_table_column::m_path_json {key_memory_JSON} |
parsed nested path
Json_table_column* Json_table_column::m_prev_nested {nullptr} |
Previous sibling NESTED PATH.