![]() |
MySQL 9.2.0
Source Code Documentation
|
#include <sql_update.h>
Public Member Functions | |
Query_result_update (mem_root_deque< Item * > *field_list, mem_root_deque< Item * > *value_list) | |
bool | need_explain_interceptor () const override |
bool | prepare (THD *thd, const mem_root_deque< Item * > &list, Query_expression *u) override |
Perform preparation specific to the query expression or DML statement. More... | |
bool | optimize () |
Set up data structures for multi-table UPDATE. More... | |
bool | start_execution (THD *thd) override |
Prepare for execution of the query expression or DML statement. More... | |
bool | send_data (THD *thd, const mem_root_deque< Item * > &items) override |
bool | do_updates (THD *thd) |
bool | send_eof (THD *thd) override |
void | cleanup () override |
Cleanup after this execution. More... | |
unique_ptr_destroy_only< RowIterator > | create_iterator (THD *thd, MEM_ROOT *mem_root, unique_ptr_destroy_only< RowIterator > source) |
![]() | |
Query_result_interceptor () | |
uint | field_count (const mem_root_deque< Item * > &) const override |
bool | send_result_set_metadata (THD *, const mem_root_deque< Item * > &, uint) override |
![]() | |
Query_result () | |
virtual | ~Query_result ()=default |
virtual bool | needs_file_privilege () const |
virtual bool | export_result_to_object_storage () const |
Returns true if the data has to be exported to object store. More... | |
virtual bool | change_query_result (THD *, Query_result *) |
Change wrapped Query_result. More... | |
virtual bool | create_table_for_query_block (THD *) |
Create table, only needed to support CREATE TABLE ... SELECT. More... | |
virtual bool | check_supports_cursor () const |
Check if this query result set supports cursors. More... | |
virtual void | abort_result_set (THD *) |
virtual bool | reset () |
Cleanup after one execution of the unit, to be ready for a next execution inside the same statement. More... | |
virtual bool | use_protocol_adapter () const |
virtual bool | use_protocol_wrapper () const |
virtual void | set_limit (ha_rows) |
Only overridden (and non-empty) for Query_result_union, q.v. More... | |
virtual Server_side_cursor * | cursor () const |
Private Attributes | |
uint | update_table_count {0} |
Number of tables being updated. More... | |
Table_ref * | update_tables {nullptr} |
Pointer to list of updated tables, linked via 'next_local'. More... | |
TABLE ** | tmp_tables {nullptr} |
Array of references to temporary tables used to store cached updates. More... | |
Temp_table_param * | tmp_table_param {nullptr} |
Array of parameter structs for creation of temporary tables. More... | |
TABLE * | main_table {nullptr} |
The first table in the join operation. More... | |
TABLE * | table_to_update {nullptr} |
In a multi-table update, this is equal to the first table in the join operation (main_table) if that table can be updated on the fly while scanning it. More... | |
const mem_root_deque< Item * > * | fields |
List of pointers to fields to update, in order from statement. More... | |
const mem_root_deque< Item * > * | values |
List of pointers to values to update with, in order from statement. More... | |
mem_root_deque< Item * > ** | fields_for_table |
The fields list decomposed into separate lists per table. More... | |
mem_root_deque< Item * > ** | values_for_table |
The values list decomposed into separate lists per table. More... | |
List< TABLE > | unupdated_check_opt_tables |
List of tables referenced in the CHECK OPTION condition of the updated view excluding the updated table. More... | |
Copy_field * | copy_field {nullptr} |
??? More... | |
COPY_INFO ** | update_operations {nullptr} |
Array of update operations, arranged per updated table. More... | |
Additional Inherited Members | |
![]() | |
ha_rows | estimated_rowcount |
Number of records estimated in this result. More... | |
double | estimated_cost |
Cost to execute the subquery which produces this result. More... | |
![]() | |
Query_expression * | unit |
|
inline |
|
overridevirtual |
Cleanup after this execution.
Completes the execution and resets object before next execution of a prepared statement/stored procedure.
Reimplemented from Query_result.
unique_ptr_destroy_only< RowIterator > Query_result_update::create_iterator | ( | THD * | thd, |
MEM_ROOT * | mem_root, | ||
unique_ptr_destroy_only< RowIterator > | source | ||
) |
bool Query_result_update::do_updates | ( | THD * | thd | ) |
|
inlineoverridevirtual |
Reimplemented from Query_result.
bool Query_result_update::optimize | ( | ) |
Set up data structures for multi-table UPDATE.
IMPLEMENTATION
|
overridevirtual |
Perform preparation specific to the query expression or DML statement.
Reimplemented from Query_result.
|
overridevirtual |
Implements Query_result.
|
overridevirtual |
Implements Query_result.
|
overridevirtual |
Prepare for execution of the query expression or DML statement.
Generally, this will have an implementation only for outer-most Query_block objects, such as data change statements (for preparation of the target table(s)) or dump statements (for preparation of target file).
Reimplemented from Query_result.
|
private |
???
|
private |
List of pointers to fields to update, in order from statement.
|
private |
The fields list decomposed into separate lists per table.
In a multi-table update, this is equal to the first table in the join operation (main_table) if that table can be updated on the fly while scanning it.
It is nullptr
otherwise.
|
private |
Array of parameter structs for creation of temporary tables.
Array of references to temporary tables used to store cached updates.
List of tables referenced in the CHECK OPTION condition of the updated view excluding the updated table.
Array of update operations, arranged per updated table.
For each updated table in the multiple table update statement, a COPY_INFO pointer is present at the table's position in this array.
The array is allocated and populated during Query_result_update::prepare(). The position that each table is assigned is also given here and is stored in the member TABLE::pos_in_table_list::shared. However, this is a publicly available field, so nothing can be trusted about its integrity.
This member is NULL when the Query_result_update is created.
|
private |
Number of tables being updated.
Pointer to list of updated tables, linked via 'next_local'.
|
private |
List of pointers to values to update with, in order from statement.
|
private |
The values list decomposed into separate lists per table.