From e8daa41885b50094285f82f2a95e882b3dcab153 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 5 Oct 2015 09:47:45 +0200 Subject: [PATCH] typos in comments, minor stylistic edits --- sql/group_by_handler.cc | 8 ++------ sql/group_by_handler.h | 10 +++------- sql/handler.h | 2 +- sql/sql_select.cc | 12 +++++++----- sql/sql_select.h | 5 +++++ storage/sequence/sequence.cc | 2 +- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/sql/group_by_handler.cc b/sql/group_by_handler.cc index db03ce9196b..ba798967d34 100644 --- a/sql/group_by_handler.cc +++ b/sql/group_by_handler.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2014, SkySQL Ab & MariaDB Foundation + Copyright (c) 2014, 2015 SkySQL Ab & MariaDB Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,10 +21,6 @@ upper level. */ -#ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation -#endif - #include "sql_priv.h" #include "sql_select.h" @@ -45,7 +41,7 @@ int group_by_handler::execute(JOIN *join) ha_rows max_limit; ha_rows *reset_limit= 0; Item **reset_item= 0; - DBUG_ENTER("group_by_handler"); + DBUG_ENTER("group_by_handler::execute"); if ((err= init_scan())) goto error; diff --git a/sql/group_by_handler.h b/sql/group_by_handler.h index 425e1440d17..e2d7c7396e0 100644 --- a/sql/group_by_handler.h +++ b/sql/group_by_handler.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2014, SkySQL Ab & MariaDB Foundation + Copyright (c) 2014, 2015 SkySQL Ab & MariaDB Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,8 +28,6 @@ SELECT a,count(*) as sum FROM t1 where b > 10 group by a, order by sum; SELECT a,count(*) FROM t1,t2; SELECT a, (select sum(*) from t2 where t1.a=t2.a) from t2; - - See https://mariadb.atlassian.net/browse/MDEV-6080 for more information. */ class JOIN; @@ -46,10 +44,6 @@ public: Item *where, *having; handlerton *ht; /* storage engine of this handler */ - /* - Bit's of things the storage engine can do for this query. - Should be initialized on object creation. - */ /* Temporary table where all results should be stored in record[0] */ TABLE *table; @@ -90,6 +84,8 @@ public: } /* + Bits of things the storage engine can do for this query. + Should be initialized on object creation. Result data is sorted by the storage engine according to order_by (if it exists) else according to the group_by. If this is not specified, MariaDB will store the result set into the temporary table and sort the diff --git a/sql/handler.h b/sql/handler.h index 674b58aacd7..a0c9855cfde 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1264,7 +1264,7 @@ struct handlerton the summary / group by query. If the storage engine can't do that, return NULL. - This is only called for SELECT's where all tables are from the same + The server guaranteeds that all tables in the list belong to this storage engine. */ group_by_handler *(*create_group_by)(THD *thd, SELECT_LEX *select_lex, diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 3690df815ac..86738350f50 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -760,7 +760,7 @@ JOIN::prepare(Item ***rref_pointer_array, TABLE_LIST *tbl; List_iterator_fast li(select_lex->leaf_tables); /* - If all tables comes from the same storage engine, one_storge_engine will + If all tables comes from the same storage engine, one_storage_engine will be set to point to the handlerton of this engine. */ one_storage_engine= 0; @@ -1118,7 +1118,8 @@ JOIN::optimize_inner() conds && conds->walk(&Item::exists2in_processor, 0, (uchar *)thd)) DBUG_RETURN(1); /* -TODO: make view to decide if it is possible to write to WHERE directly or make Semi-Joins able to process ON condition if it is possible + TODO + make view to decide if it is possible to write to WHERE directly or make Semi-Joins able to process ON condition if it is possible for (TABLE_LIST *tbl= tables_list; tbl; tbl= tbl->next_local) { if (tbl->on_expr && @@ -1969,8 +1970,8 @@ TODO: make view to decide if it is possible to write to WHERE directly or make S } storage_handler_for_group_by->store_data_in_temp_table= need_tmp; /* - If there is not specified ORDER BY, we should sort things according - to the group_by + If no ORDER BY clause was specified explicitly, we should sort things + according to the group_by */ if (!order) order= group_list; @@ -17861,7 +17862,8 @@ do_select(JOIN *join,List *fields,TABLE *table,Procedure *procedure) /* Setup HAVING to work with fields in temporary table */ join->set_items_ref_array(join->items1); /* The storage engine will take care of the group by query result */ - DBUG_RETURN(join->storage_handler_for_group_by->execute(join)); + int res= join->storage_handler_for_group_by->execute(join); + DBUG_RETURN(res); } if (table) diff --git a/sql/sql_select.h b/sql/sql_select.h index 4e77d5b6008..4f07a51788a 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -1011,6 +1011,11 @@ public: */ uint top_join_tab_count; uint send_group_parts; + /* + This counts how many times do_select() was invoked for this JOIN. + It's used to restrict Pushdown_query::execute() only to the first + do_select() invocation. + */ uint do_select_call_count; /* True if the query has GROUP BY. diff --git a/storage/sequence/sequence.cc b/storage/sequence/sequence.cc index d6e1ed7412a..f11aee6bddc 100644 --- a/storage/sequence/sequence.cc +++ b/storage/sequence/sequence.cc @@ -462,7 +462,7 @@ int ha_seq_group_by_handler::next_row() List_iterator_fast it(*fields); Item_sum *item_sum; Sequence_share *seqs= ((ha_seq*) table_list->table->file)->seqs; - DBUG_ENTER("ha_seq_group_by_handler"); + DBUG_ENTER("ha_seq_group_by_handler::next_row"); /* Check if this is the first call to the function. If not, we have already