![]() |
MySQL 9.7.0
Source Code Documentation
|
Forward declaration. More...
#include <row_proxy.h>
Public Types | |
| using | Type_info_t = Row_proxy_type_info< Typecode_tp, typecode_end_tp, column_count_tp > |
Public Member Functions | |
| Row_proxy (const typename Type_info_t::Row_view_definition_t &row_proxy_definition) | |
| Construct a new Row_proxy for rows in a table whose schema is described by the given Type_info_t::Row_view_definition_t. More... | |
| void | clear () |
| Make the proxy be a view over an "empty" row, which has NULL in all nullable fields and 0/"" in non-nullable fields. More... | |
| void | set_row (const typename Type_info_t::Row_t &row) |
| Make the proxy be a view over the given row. More... | |
| void | copy_field (int index, PSI_field *target) const |
| Copy the value of the given field of the current row to the target. More... | |
Private Attributes | |
| const Type_info_t::Row_view_definition_t & | m_row_proxy_definition |
| Array where the Nth entry is the definition of the Nth column. More... | |
| const Type_info_t::Field_t * | m_field_by_typecode [Type_info_t::typecode_end] |
| Current map from m_type code to row value. More... | |
Forward declaration.
Fills values in fields in a table row, using an Array_view<Field<Typecode_tp>> as data source (in namespace mysql::abi_helpers), for a given enum type Typecode_tp.
This does not copy or allocate data; internally it only holds fixed-size arrays that map column numbers to type codes in the enum type, and in turn each type code to a field in the row. Using this information, when queried with a column index and a PSI_field, it fills the PSI_field with the correct value from the source data.
The object is meant to be reused for multiple queries to the same table. At construction time, it creates the map associating column number with type code, and for each row the user gives, it recreates the map from type codes to field data.
| Typecode_tp | enum type that identifies each column, used in the template argument of Field. |
| typecode_end_tp | enum item whose numeric value is greater than the largest enum value that represents a field in a packet. |
| column_count_tp | The number of columns in the table. |
| using Row_proxy< Typecode_tp, typecode_end_tp, column_count_tp >::Type_info_t = Row_proxy_type_info<Typecode_tp, typecode_end_tp, column_count_tp> |
|
inline |
Construct a new Row_proxy for rows in a table whose schema is described by the given Type_info_t::Row_view_definition_t.
| row_proxy_definition | Description of table definition and packet layout. This is an std::array with column_count_tp elements, each representing a table column. Each element has three members: the typecode of the packet where the field value is found; the typecode of the packet holding a boolean that indicates whether the value is NULL; and the SQL data type. |
|
inline |
Make the proxy be a view over an "empty" row, which has NULL in all nullable fields and 0/"" in non-nullable fields.
|
inline |
Copy the value of the given field of the current row to the target.
| index | The column index. |
| target | Opaque pointer (PSI_field *) to the target field. |
If more types are needed, see e.g. plugin/replication_observers_example/src/binlog/service/iterator/tests/pfs.cc
|
inline |
Make the proxy be a view over the given row.
| row | Object holding values for all fields in this row. |
|
private |
Current map from m_type code to row value.
|
private |
Array where the Nth entry is the definition of the Nth column.