summaryrefslogtreecommitdiff
path: root/sql/sql_base.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2022-06-18 00:49:15 -0700
committerIgor Babaev <igor@askmonty.org>2022-06-18 00:49:15 -0700
commit2f09d93bc4054a965178f1a1d953924f09739b56 (patch)
tree7f02ea6d1d7c0e9a41ea6267fe5eac4989a23c55 /sql/sql_base.h
parentd371e35257c45895318c4efbed20e5bfdcc7cee9 (diff)
downloadmariadb-git-bb-10.10-mdev-28883.tar.gz
MDEV-27159 Re-design the upper level of handling DML commandsbb-10.10-mdev-28883
This patch allows to execute only single-table and multi-table UPDATE and DELETE statements using the method Sql_cmd_dml::execute(). The code that handles INSERT statements has not been touched.
Diffstat (limited to 'sql/sql_base.h')
-rw-r--r--sql/sql_base.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/sql_base.h b/sql/sql_base.h
index 06d75596827..370e0f3d005 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -28,6 +28,7 @@ struct Name_resolution_context;
class Open_table_context;
class Open_tables_state;
class Prelocking_strategy;
+class DML_prelocking_strategy;
struct TABLE_LIST;
class THD;
struct handlerton;
@@ -288,6 +289,9 @@ bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags,
bool open_tables_only_view_structure(THD *thd, TABLE_LIST *tables,
bool can_deadlock);
bool open_and_lock_internal_tables(TABLE *table, bool lock);
+bool open_tables_for_query(THD *thd, TABLE_LIST *tables,
+ uint *table_count, uint flags,
+ DML_prelocking_strategy *prelocking_strategy);
bool lock_tables(THD *thd, TABLE_LIST *tables, uint counter, uint flags);
int decide_logging_format(THD *thd, TABLE_LIST *tables);
void close_thread_table(THD *thd, TABLE **table_ptr);
@@ -430,6 +434,17 @@ public:
};
+
+class Multiupdate_prelocking_strategy : public DML_prelocking_strategy
+{
+ bool done;
+ bool has_prelocking_list;
+public:
+ void reset(THD *thd);
+ bool handle_end(THD *thd);
+};
+
+
/**
A strategy for prelocking algorithm to be used for LOCK TABLES
statement.