MySQL 8.4.2
Source Code Documentation
sql_delete.h File Reference
#include "my_sqlcommand.h"
#include "my_table_map.h"
#include "sql/sql_cmd_dml.h"

Go to the source code of this file.

Classes

class  Sql_cmd_delete
 

Functions

table_map GetImmediateDeleteTables (const JOIN *join, table_map delete_tables)
 Find out which of the delete target tables can be deleted from immediately while scanning. More...
 
bool CheckSqlSafeUpdate (THD *thd, const JOIN *join)
 Checks if the sql_safe_updates option is enabled, and raises an error and returns true if the statement is likely to delete or update a large number of rows. More...
 

Function Documentation

◆ CheckSqlSafeUpdate()

bool CheckSqlSafeUpdate ( THD thd,
const JOIN join 
)

Checks if the sql_safe_updates option is enabled, and raises an error and returns true if the statement is likely to delete or update a large number of rows.

Specifically, it raises an error if there is a full table scan or full index scan of one of the tables deleted from, and there is no LIMIT clause.

◆ GetImmediateDeleteTables()

table_map GetImmediateDeleteTables ( const JOIN join,
table_map  delete_tables 
)

Find out which of the delete target tables can be deleted from 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 delete during planning, not after planning.