diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2021-09-23 10:00:24 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2021-09-23 10:00:24 +0200 |
commit | c48cf8adf908605c2a20124eace2242d0e292cde (patch) | |
tree | 183ea319ce57d073be1a4505a3a7bfaea7512026 | |
parent | 818efba5bec916b2025602370afc2d7908f0693d (diff) | |
download | mariadb-git-bb-10.2-MDEV-25564.tar.gz |
Myke select number in explain uint (as it is in SELECT_LEX)bb-10.2-MDEV-25564
-rw-r--r-- | sql/sql_explain.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/sql/sql_explain.h b/sql/sql_explain.h index 54ed3c55ee0..7b0c9a0ae3a 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -74,7 +74,7 @@ class Json_writer; *************************************************************************************/ -const int FAKE_SELECT_LEX_ID= (int)UINT_MAX; +const uint FAKE_SELECT_LEX_ID= UINT_MAX; class Explain_query; @@ -108,7 +108,7 @@ public: }; virtual enum explain_node_type get_type()= 0; - virtual int get_select_id()= 0; + virtual uint get_select_id()= 0; /** expression cache statistics @@ -124,17 +124,15 @@ public: /* A node may have children nodes. When a node's explain structure is created, children nodes may not yet have QPFs. This is why we store ids. - - TODO: shoud be unsigned as SELECT_LEX::select_number */ - Dynamic_array<int> children; - void add_child(int select_no) + Dynamic_array<uint> children; + void add_child(uint select_no) { children.append(select_no); } - void remove_child(int select_no) + void remove_child(uint select_no) { - for (int i= 0; i < (int) children.elements(); i++) + for (uint i= 0; i < children.elements(); i++) { if ((children.at(i)) == select_no) { @@ -178,9 +176,9 @@ public: bool add_table(Explain_table_access *tab, Explain_query *query); - int get_select_id() { return select_id; } + uint get_select_id() { return select_id; } - int select_id; + uint select_id; int print_explain(Explain_query *query, select_result_sink *output, uint8 explain_flags, bool is_analyze); @@ -353,7 +351,7 @@ public: enum explain_node_type get_type() { return EXPLAIN_UNION; } - int get_select_id() + uint get_select_id() { DBUG_ASSERT(union_members.elements() > 0); return union_members.at(0); @@ -838,7 +836,7 @@ public: {} virtual enum explain_node_type get_type() { return EXPLAIN_UPDATE; } - virtual int get_select_id() { return 1; /* always root */ } + virtual uint get_select_id() { return 1; /* always root */ } const char *select_type; @@ -918,7 +916,7 @@ public: StringBuffer<64> table_name; enum explain_node_type get_type() { return EXPLAIN_INSERT; } - int get_select_id() { return 1; /* always root */ } + uint get_select_id() { return 1; /* always root */ } int print_explain(Explain_query *query, select_result_sink *output, uint8 explain_flags, bool is_analyze); @@ -945,7 +943,7 @@ public: bool deleting_all_rows; virtual enum explain_node_type get_type() { return EXPLAIN_DELETE; } - virtual int get_select_id() { return 1; /* always root */ } + virtual uint get_select_id() { return 1; /* always root */ } virtual int print_explain(Explain_query *query, select_result_sink *output, uint8 explain_flags, bool is_analyze); |