MySQL  8.0.27
Source Code Documentation
records.h
Go to the documentation of this file.
1 #ifndef SQL_RECORDS_H
2 #define SQL_RECORDS_H
3 /* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License, version 2.0,
7  as published by the Free Software Foundation.
8 
9  This program is also distributed with certain software (including
10  but not limited to OpenSSL) that is licensed under separate terms,
11  as designated in a particular file or component or in included license
12  documentation. The authors of MySQL hereby grant you an additional
13  permission to link the program and your derivative works with the
14  separately licensed software that they have included with MySQL.
15 
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License, version 2.0, for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
24 
25 #include <sys/types.h>
26 #include <memory>
27 #include <string>
28 
29 #include "my_alloc.h"
30 #include "my_base.h"
33 #include "sql/ref_row_iterators.h"
34 #include "sql/row_iterator.h"
35 #include "sql/sorting_iterator.h"
36 
37 class QEP_TAB;
38 class THD;
39 struct AccessPath;
40 struct TABLE;
41 struct POSITION;
42 
45  TABLE_LIST *table_ref, POSITION *position,
46  bool count_examined_rows);
47 
48 /**
49  Creates an iterator for the given table, then calls Init() on the resulting
50  iterator. Unlike create_table_iterator(), this can create iterators for sort
51  buffer results (which are set in the TABLE object during query execution).
52  Returns nullptr on failure.
53  */
55  THD *thd, TABLE *table, QUICK_SELECT_I *quick, TABLE_LIST *table_ref,
56  POSITION *position, bool ignore_not_found_rows, bool count_examined_rows);
57 
58 /**
59  A short form for when there's no range scan, recursive CTEs or cost
60  information; just a unique_result or a simple table scan. Normally, you should
61  prefer just instantiating an iterator yourself -- this is for legacy use only.
62  */
64  THD *thd, TABLE *table, bool ignore_not_found_rows,
65  bool count_examined_rows) {
66  return init_table_iterator(thd, table, nullptr, nullptr, nullptr,
67  ignore_not_found_rows, count_examined_rows);
68 }
69 
70 #endif /* SQL_RECORDS_H */
Row iterators that scan a single table without reference to other tables or iterators.
Definition: sql_executor.h:256
Definition: range_optimizer.h:221
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:821
A composite row iterator is one that takes in one or more existing iterators and processes their rows...
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
std::unique_ptr< T, Destroy_only< T > > unique_ptr_destroy_only
std::unique_ptr, but only destroying.
Definition: my_alloc.h:464
This file includes constants used by all storage engines.
static bool quick
Definition: mysql.cc:154
AccessPath * create_table_access_path(THD *thd, TABLE *table, QUICK_SELECT_I *quick, TABLE_LIST *table_ref, POSITION *position, bool count_examined_rows)
create_table_access_path is used to scan by using a number of different methods.
Definition: records.cc:156
unique_ptr_destroy_only< RowIterator > init_table_iterator(THD *thd, TABLE *table, QUICK_SELECT_I *quick, TABLE_LIST *table_ref, POSITION *position, bool ignore_not_found_rows, bool count_examined_rows)
Creates an iterator for the given table, then calls Init() on the resulting iterator.
Definition: records.cc:175
Access paths are a query planning structure that correspond 1:1 to iterators, in that an access path ...
Definition: access_path.h:176
A position of table within a join order.
Definition: sql_select.h:350
JOIN_TAB * table
Definition: sql_select.h:435
Definition: table.h:2694
Definition: table.h:1394