summaryrefslogtreecommitdiff
path: root/sql/sql_delete.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2022-06-13 15:31:53 -0700
committerIgor Babaev <igor@askmonty.org>2022-06-13 15:31:53 -0700
commit67585abefca3911dd6ebf36824bf352565b883f5 (patch)
treec4a683f21c095e1e09c45540b1761c4778509338 /sql/sql_delete.h
parent31c01a5b28fc59479755cab5098b3d13e55f732b (diff)
downloadmariadb-git-bb-10.7-mdev-27159.tar.gz
MDEV-27159 Re-design the upper level of handling DML commandsbb-10.7-mdev-27159
This is the second commit for the task. This patch allows to execute only single-table and multi-table DELETE statements using the method Sql_cmd_dml::execute(). The code that handles INSERT statements has not been touched. This patch still does not have the final changes to handle UPDATE/DELETE statements. All tests from the main suite passed. With --ps-protocol one test from opt_trace_security returns not the same result. This will be fixed soon.
Diffstat (limited to 'sql/sql_delete.h')
-rw-r--r--sql/sql_delete.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/sql_delete.h b/sql/sql_delete.h
index dabcafb778c..64b882aaa95 100644
--- a/sql/sql_delete.h
+++ b/sql/sql_delete.h
@@ -17,6 +17,9 @@
#define SQL_DELETE_INCLUDED
#include "my_base.h" /* ha_rows */
+#include "sql_class.h" /* enum_duplicates */
+#include "sql_cmd.h" // Sql_cmd_dml
+#include "sql_base.h"
class THD;
struct TABLE_LIST;
@@ -26,12 +29,6 @@ class select_result;
typedef class Item COND;
template <typename T> class SQL_I_List;
-int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds,
- bool *delete_while_scanning);
-bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
- SQL_I_List<ORDER> *order, ha_rows rows,
- ulonglong options, select_result *result);
-
class Sql_cmd_delete final : public Sql_cmd_dml
{
public:
@@ -43,6 +40,11 @@ public:
return multitable ? SQLCOM_DELETE_MULTI : SQLCOM_DELETE;
}
+ DML_prelocking_strategy *get_dml_prelocking_strategy()
+ {
+ return &dml_prelocking_strategy;
+ }
+
protected:
bool precheck(THD *thd) override;
@@ -55,5 +57,6 @@ protected:
bool multitable;
+ DML_prelocking_strategy dml_prelocking_strategy;
};
#endif /* SQL_DELETE_INCLUDED */