diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2022-03-15 16:28:33 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2022-03-15 16:28:33 +0400 |
commit | 905a453ff78fb998764b6c4e675c6de8a2e2b3f3 (patch) | |
tree | 83ed9844d5dd27e7c43a5120c0720fdb5014c00e /sql/sql_insert.h | |
parent | 086a212d96b7693d1bacf67e3ad14627fb802269 (diff) | |
download | mariadb-git-bb-10.7-mdev-27159-insert-hf.tar.gz |
MDEV-27159 Re-design the upper level of handling DML commands.bb-10.7-mdev-27159-insert-hf
Sql_cmd_insert class introduced.
Diffstat (limited to 'sql/sql_insert.h')
-rw-r--r-- | sql/sql_insert.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sql/sql_insert.h b/sql/sql_insert.h index 80666a81c50..6b2abe41a6c 100644 --- a/sql/sql_insert.h +++ b/sql/sql_insert.h @@ -18,6 +18,7 @@ #include "sql_class.h" /* enum_duplicates */ #include "sql_list.h" +#include "sql_base.h" /* Instead of including sql_lex.h we add this typedef here */ typedef List<Item> List_item; @@ -50,4 +51,35 @@ bool binlog_drop_table(THD *thd, TABLE *table); inline void kill_delayed_threads(void) {} #endif +class Sql_cmd_insert final : public Sql_cmd_dml +{ +public: + Sql_cmd_insert(): + save_protocol(NULL), sel_result(NULL), readbuff(NULL), + table(NULL) {} + + enum_sql_command sql_command_code() const override { return SQLCOM_INSERT; } + + DML_prelocking_strategy *get_dml_prelocking_strategy() + { + return &insert_prelocking_strategy; + } + +protected: + bool precheck(THD *thd) override; + + bool prepare_inner(THD *thd) override; + + bool execute_inner(THD *thd) override; + +private: + DML_prelocking_strategy insert_prelocking_strategy; + Protocol *save_protocol; + select_result *sel_result; + unsigned char *readbuff; + bool was_insert_delayed; + TABLE *table; + uint value_count; + void cleanup(THD *thd, int ret); +}; #endif /* SQL_INSERT_INCLUDED */ |