diff options
author | Igor Babaev <igor@askmonty.org> | 2022-06-16 23:45:38 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2022-06-16 23:45:38 -0700 |
commit | a2c0e27863e8a875b8fd9f33ca83cc43d24edbf7 (patch) | |
tree | 1bc18fa5416bc8f11745b8d2e744f843a8a27cc0 /sql/sql_base.h | |
parent | 9fe784ff7e56b7b5c182b29819ccc4da5f7b2af7 (diff) | |
download | mariadb-git-bb-10.9-mdev-27159.tar.gz |
MDEV-27159 Re-design the upper level of handling DML commandsbb-10.9-mdev-27159
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.h | 15 |
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. |