MySQL  8.0.27
Source Code Documentation
sql_update.h File Reference
#include <sys/types.h>
#include <cstddef>
#include "my_base.h"
#include "my_sqlcommand.h"
#include "sql/query_result.h"
#include "sql/sql_cmd_dml.h"
#include "sql/sql_list.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 outbut 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_LIST *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...
 

Function Documentation

◆ compare_records()

bool compare_records ( const TABLE table)

Compares the input and outbut 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.

Parameters
tableThe table to evaluate.
Returns
true if row has changed.
false otherwise.

◆ records_are_comparable()

bool records_are_comparable ( const TABLE table)

True if the table's input and output record buffers are comparable using compare_records(TABLE*).

◆ should_switch_to_multi_table_if_subqueries()

bool should_switch_to_multi_table_if_subqueries ( const THD thd,
const Query_block select,
const TABLE_LIST 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.

Parameters
thdThread handler
selectQuery block
table_listTable to modify
Returns
true if we should switch