MySQL 9.0.0
Source Code Documentation
|
#include <sys/types.h>
#include "mem_root_deque.h"
#include "my_alloc.h"
#include "my_sqlcommand.h"
#include "my_table_map.h"
#include "sql/query_result.h"
#include "sql/sql_cmd_dml.h"
#include "sql/sql_list.h"
#include "sql/thr_malloc.h"
Go to the source code of this file.
Classes | |
class | Query_result_update |
class | Sql_cmd_update |
Functions | |
bool | records_are_comparable (const TABLE *table) |
True if the table's input and output record buffers are comparable using compare_records(TABLE*). More... | |
bool | compare_records (const TABLE *table) |
Compares the input and output record buffers of the table to see if a row has changed. More... | |
bool | should_switch_to_multi_table_if_subqueries (const THD *thd, const Query_block *select, const Table_ref *table_list) |
Decides if a single-table UPDATE/DELETE statement should switch to the multi-table code path, if there are subqueries which might benefit from semijoin or subquery materialization, and if no feature specific to the single-table path are used. More... | |
table_map | GetImmediateUpdateTable (const JOIN *join, bool single_target) |
Find out which of the target tables can be updated immediately while scanning. More... | |
bool | FinalizeOptimizationForUpdate (JOIN *join) |
Makes the TABLE and handler objects ready for being used in an UPDATE statement. More... | |
unique_ptr_destroy_only< RowIterator > | CreateUpdateRowsIterator (THD *thd, MEM_ROOT *mem_root, JOIN *join, unique_ptr_destroy_only< RowIterator > source) |
Creates an UpdateRowsIterator which updates the rows returned by the given "source" iterator. More... | |
bool compare_records | ( | const TABLE * | table | ) |
Compares the input and output record buffers of the table to see if a row has changed.
The algorithm iterates over updated columns and if they are nullable compares NULL bits in the buffer before comparing actual data. Special care must be taken to compare only the relevant NULL bits and mask out all others as they may be undefined. The storage engine will not and should not touch them.
table | The table to evaluate. |
unique_ptr_destroy_only< RowIterator > CreateUpdateRowsIterator | ( | THD * | thd, |
MEM_ROOT * | mem_root, | ||
JOIN * | join, | ||
unique_ptr_destroy_only< RowIterator > | source | ||
) |
Creates an UpdateRowsIterator which updates the rows returned by the given "source" iterator.
bool FinalizeOptimizationForUpdate | ( | JOIN * | join | ) |
Makes the TABLE and handler objects ready for being used in an UPDATE statement.
Called at the beginning of each execution.
join | The top-level JOIN object of the UPDATE operation. |
Find out which of the target tables can be updated immediately while scanning.
This is used by the old optimizer after the plan has been created. The hypergraph optimizer does not use this function, as it makes the decision about immediate update during planning, not after planning.
join | The top-level JOIN object of the UPDATE statement. |
single_target | True if the UPDATE statement has exactly one target table. |
bool records_are_comparable | ( | const TABLE * | table | ) |
True if the table's input and output record buffers are comparable using compare_records(TABLE*).
bool should_switch_to_multi_table_if_subqueries | ( | const THD * | thd, |
const Query_block * | qb, | ||
const Table_ref * | table_list | ||
) |
Decides if a single-table UPDATE/DELETE statement should switch to the multi-table code path, if there are subqueries which might benefit from semijoin or subquery materialization, and if no feature specific to the single-table path are used.
thd | Thread handler |
qb | Query block |
table_list | Table to modify |