diff options
author | Igor Babaev <igor@askmonty.org> | 2022-12-23 20:54:01 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2022-12-23 20:54:01 -0800 |
commit | cea5cdd0eb30444467420f91da10752cbe697d23 (patch) | |
tree | 07a7e87441d5e55d52cf6fcb4ba918c3a04a6c65 /sql/sql_select.h | |
parent | a09612014a827dc3bc09ab50bbb1b6b0b930190e (diff) | |
download | mariadb-git-bb-10.11-MDEV-29971.tar.gz |
MDEV-29971 Re-design the upper level of handling SELECT statementsbb-10.11-MDEV-29971
The initial patch.
All tests from the main test suite passed.
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r-- | sql/sql_select.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h index 48452ce34a9..3574930f357 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -33,6 +33,8 @@ #include "records.h" /* READ_RECORD */ #include "opt_range.h" /* SQL_SELECT, QUICK_SELECT_I */ #include "filesort.h" +#include "sql_base.h" +#include "sql_cmd.h" typedef struct st_join_table JOIN_TAB; /* Values in optimize */ @@ -2516,4 +2518,39 @@ void propagate_new_equalities(THD *thd, Item *cond, bool *is_simplifiable_cond); bool dbug_user_var_equals_str(THD *thd, const char *name, const char *value); + + +class Sql_cmd_select : public Sql_cmd_dml +{ +public: + explicit Sql_cmd_select(select_result *result_arg) + : Sql_cmd_dml(), save_protocol(NULL) + { result= result_arg; } + + enum_sql_command sql_command_code() const override + { + return SQLCOM_SELECT; + } + + DML_prelocking_strategy *get_dml_prelocking_strategy() + { + return &dml_prelocking_strategy; + } + +protected: + + bool precheck(THD *thd) override; + + bool prepare_inner(THD *thd) override; + + bool execute_inner(THD *thd) override; + +private: + /* The prelocking strategy used when opening the used tables */ + DML_prelocking_strategy dml_prelocking_strategy; + + Protocol *save_protocol; +}; + + #endif /* SQL_SELECT_INCLUDED */ |