MySQL 8.0.30
Source Code Documentation
basic_row_iterators.h
Go to the documentation of this file.
1#ifndef SQL_ITERATORS_BASIC_ROW_ITERATORS_H_
2#define SQL_ITERATORS_BASIC_ROW_ITERATORS_H_
3
4/* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License, version 2.0,
8 as published by the Free Software Foundation.
9
10 This program is also distributed with certain software (including
11 but not limited to OpenSSL) that is licensed under separate terms,
12 as designated in a particular file or component or in included license
13 documentation. The authors of MySQL hereby grant you an additional
14 permission to link the program and your derivative works with the
15 separately licensed software that they have included with MySQL.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License, version 2.0, for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
25
26/**
27 @file
28 Row iterators that scan a single table without reference to other tables
29 or iterators.
30 */
31
32#include <assert.h>
33#include <sys/types.h>
34
35#include "mem_root_deque.h"
36#include "my_base.h"
37#include "my_inttypes.h"
39#include "sql/mem_root_array.h"
40
41class Filesort_info;
42class Item;
43class JOIN;
44class Sort_result;
45class THD;
46struct IO_CACHE;
47struct TABLE;
48
49/**
50 Scan a table from beginning to end.
51
52 This is the most basic access method of a table using rnd_init,
53 ha_rnd_next and rnd_end. No indexes are used.
54 */
55class TableScanIterator final : public TableRowIterator {
56 public:
57 // “expected_rows” is used for scaling the record buffer.
58 // If zero or less, no record buffer will be set up.
59 //
60 // "examined_rows", if not nullptr, is incremented for each successful Read().
61 TableScanIterator(THD *thd, TABLE *table, double expected_rows,
62 ha_rows *examined_rows);
63 ~TableScanIterator() override;
64
65 bool Init() override;
66 int Read() override;
67
68 private:
70 const double m_expected_rows;
72};
73
74/** Perform a full index scan along an index. */
75template <bool Reverse>
76class IndexScanIterator final : public TableRowIterator {
77 public:
78 // use_order must be set to true if you actually need to get the records
79 // back in index order. It can be set to false if you wish to scan
80 // using the index (e.g. for an index-only scan of the entire table),
81 // but do not actually care about the order. In particular, partitioned
82 // tables can use this to deliver more efficient scans.
83 //
84 // “expected_rows” is used for scaling the record buffer.
85 // If zero or less, no record buffer will be set up.
86 //
87 // The pushed condition can be nullptr.
88 //
89 // "examined_rows", if not nullptr, is incremented for each successful Read().
90 IndexScanIterator(THD *thd, TABLE *table, int idx, bool use_order,
91 double expected_rows, ha_rows *examined_rows);
92 ~IndexScanIterator() override;
93
94 bool Init() override;
95 int Read() override;
96
97 private:
99 const int m_idx;
100 const bool m_use_order;
101 const double m_expected_rows;
103 bool m_first = true;
104};
105
106// Readers relating to reading sorted data (from filesort).
107//
108// Filesort will produce references to the records sorted; these
109// references can be stored in memory or in a temporary file.
110//
111// The temporary file is normally used when the references doesn't fit into
112// a properly sized memory buffer. For most small queries the references
113// are stored in the memory buffer.
114//
115// The temporary file is also used when performing an update where a key is
116// modified.
117
118/**
119 Fetch the records from a memory buffer.
120
121 This method is used when table->sort.addon_field is allocated.
122 This is allocated for most SELECT queries not involving any BLOB's.
123 In this case the records are fetched from a memory buffer.
124 */
125template <bool Packed_addon_fields>
126class SortBufferIterator final : public RowIterator {
127 public:
128 // "examined_rows", if not nullptr, is incremented for each successful Read().
129 // The table is used solely for NULL row flags.
131 Filesort_info *sort, Sort_result *sort_result,
132 ha_rows *examined_rows);
133 ~SortBufferIterator() override;
134
135 bool Init() override;
136 int Read() override;
137 void UnlockRow() override {}
138 void SetNullRowFlag(bool) override {
139 // Handled by SortingIterator.
140 assert(false);
141 }
142
143 private:
144 // NOTE: No m_record -- unpacks directly into each Field's field->ptr.
150};
151
152/**
153 Fetch the record IDs from a memory buffer, but the records themselves from
154 the table on disk.
155
156 Used when the above (comment on SortBufferIterator) is not true, UPDATE,
157 DELETE and so forth and SELECT's involving large BLOBs. It is also used for
158 the result of Unique, which returns row IDs in the same format as filesort.
159 In this case the record data is fetched from the handler using the saved
160 reference using the rnd_pos handler call.
161 */
163 public:
164 // Ownership here is suboptimal: Takes only partial ownership of
165 // "sort_result", so it must be alive for as long as the RowIterator is.
166 // However, it _does_ free the buffers within on destruction.
167 //
168 // The pushed condition can be nullptr.
169 //
170 // "examined_rows", if not nullptr, is incremented for each successful Read().
172 Sort_result *sort_result,
173 bool ignore_not_found_rows, bool has_null_flags,
174 ha_rows *examined_rows);
176 bool Init() override;
177 int Read() override;
178 void SetNullRowFlag(bool) override {
179 // Handled by SortingIterator.
180 assert(false);
181 }
182 void UnlockRow() override {}
183
184 private:
189 uchar *m_cache_pos = nullptr, *m_cache_end = nullptr;
192};
193
194/**
195 Fetch the records from a tempoary file.
196
197 There used to be a comment here saying “should obviously not really happen
198 other than in strange configurations”, but especially with packed addons
199 and InnoDB (where fetching rows needs a primary key lookup), it's not
200 necessarily suboptimal compared to e.g. SortBufferIndirectIterator.
201 */
202template <bool Packed_addon_fields>
203class SortFileIterator final : public RowIterator {
204 public:
205 // Takes ownership of tempfile.
206 // The table is used solely for NULL row flags.
208 Filesort_info *sort, ha_rows *examined_rows);
209 ~SortFileIterator() override;
210
211 bool Init() override { return false; }
212 int Read() override;
213 void UnlockRow() override {}
214 void SetNullRowFlag(bool) override {
215 // Handled by SortingIterator.
216 assert(false);
217 }
218
219 private:
226};
227
228/**
229 Fetch the record IDs from a temporary file, then the records themselves from
230 the table on disk.
231
232 Same as SortBufferIndirectIterator except that references are fetched
233 from temporary file instead of from a memory buffer. So first the record IDs
234 are read from file, then those record IDs are used to look up rows in the
235 table.
236 */
238 public:
239 // Takes ownership of tempfile.
240 //
241 // The pushed condition can be nullptr.
242 //
243 // "examined_rows", if not nullptr, is incremented for each successful Read().
245 IO_CACHE *tempfile, bool ignore_not_found_rows,
246 bool has_null_flags, ha_rows *examined_rows);
247 ~SortFileIndirectIterator() override;
248
249 bool Init() override;
250 int Read() override;
251 void SetNullRowFlag(bool) override {
252 // Handled by SortingIterator.
253 assert(false);
254 }
255 void UnlockRow() override {}
256
257 private:
261 uchar *m_ref_pos = nullptr;
264
266};
267
268// Used when the plan is const, ie. is known to contain a single row
269// (and all values have been read in advance, so we don't need to read
270// a single table).
271class FakeSingleRowIterator final : public RowIterator {
272 public:
273 // "examined_rows", if not nullptr, is incremented for each successful Read().
275 : RowIterator(thd), m_examined_rows(examined_rows) {}
276
277 bool Init() override {
278 m_has_row = true;
279 return false;
280 }
281
282 int Read() override {
283 if (m_has_row) {
284 m_has_row = false;
285 if (m_examined_rows != nullptr) {
287 }
288 return 0;
289 } else {
290 return -1;
291 }
292 }
293
294 void SetNullRowFlag(bool is_null_row [[maybe_unused]]) override {
295 assert(!is_null_row);
296 }
297
298 void UnlockRow() override {}
299
300 private:
303};
304
305/**
306 An iterator for unqualified COUNT(*) (ie., no WHERE, no join conditions,
307 etc.), taking a special fast path in the handler. It returns a single row,
308 much like FakeSingleRowIterator; however, unlike said iterator, it actually
309 does the counting in Read() instead of expecting all fields to already be
310 filled out.
311 */
313 public:
315 : RowIterator(thd), m_join(join) {}
316
317 bool Init() override {
318 m_has_row = true;
319 return false;
320 }
321
322 int Read() override;
323
324 void SetNullRowFlag(bool) override { assert(false); }
325
326 void UnlockRow() override {}
327
328 private:
330 JOIN *const m_join;
331};
332
333/**
334 A simple iterator that takes no input and produces zero output rows.
335 Used when the optimizer has figured out ahead of time that a given table
336 can produce no output (e.g. SELECT ... WHERE 2+2 = 5).
337
338 The iterator can optionally have an array of the tables that are pruned away
339 from the join tree by this iterator. It is only required when the iterator is
340 on the inner side of an outer join, in which case it needs it in order to
341 NULL-complement the rows in SetNullRowFlag().
342 */
343class ZeroRowsIterator final : public RowIterator {
344 public:
346
347 bool Init() override { return false; }
348
349 int Read() override { return -1; }
350
351 void SetNullRowFlag(bool is_null_row) override;
352
353 void UnlockRow() override {}
354
355 private:
357};
358
359/**
360 Like ZeroRowsIterator, but produces a single output row, since there are
361 aggregation functions present and no GROUP BY. E.g.,
362
363 SELECT SUM(f1) FROM t1 WHERE 2+2 = 5;
364
365 should produce a single row, containing only the value NULL.
366 */
368 public:
369 // "examined_rows", if not nullptr, is incremented for each successful Read().
371 : RowIterator(thd), m_join(join), m_examined_rows(examined_rows) {}
372
373 bool Init() override {
374 m_has_row = true;
375 return false;
376 }
377
378 int Read() override;
379
380 void SetNullRowFlag(bool) override { assert(false); }
381
382 void UnlockRow() override {}
383
384 private:
386 JOIN *const m_join;
388};
389
390/**
391 FollowTailIterator is a special version of TableScanIterator that is used
392 as part of WITH RECURSIVE queries. It is designed to read from a temporary
393 table at the same time as MaterializeIterator writes to the same table,
394 picking up new records in the order they come in -- it follows the tail,
395 much like the UNIX tool “tail -f”.
396
397 Furthermore, when materializing a recursive query expression consisting of
398 multiple query blocks, MaterializeIterator needs to run each block several
399 times until convergence. (For a single query block, one iteration suffices,
400 since the iterator sees new records as they come in.) Each such run, the
401 recursive references should see only rows that were added since the last
402 iteration, even though Init() is called anew. FollowTailIterator is thus
403 different from TableScanIterator in that subsequent calls to Init() do not
404 move the cursor back to the start.
405
406 In addition, FollowTailIterator implements the WITH RECURSIVE iteration limit.
407 This is not specified in terms of Init() calls, since one run can encompass
408 many iterations. Instead, it keeps track of the number of records in the table
409 at the start of iteration, and when it has read all of those records, the next
410 iteration is deemed to have begun. If the iteration counter is above the
411 user-set limit, it raises an error to stop runaway queries with infinite
412 recursion.
413 */
415 public:
416 // "examined_rows", if not nullptr, is incremented for each successful Read().
417 FollowTailIterator(THD *thd, TABLE *table, double expected_rows,
418 ha_rows *examined_rows);
419 ~FollowTailIterator() override;
420
421 bool Init() override;
422 int Read() override;
423
424 /**
425 Signal where we can expect to find the number of generated rows for this
426 materialization (this points into the MaterializeIterator's data).
427
428 This must be called when we start materializing the CTE,
429 before Init() runs.
430 */
431 void set_stored_rows_pointer(ha_rows *stored_rows) {
432 m_stored_rows = stored_rows;
433 }
434
435 /**
436 Signal to the iterator that the underlying table was closed and replaced
437 with an InnoDB table with the same data, due to a spill-to-disk
438 (e.g. the table used to be MEMORY and now is InnoDB). This is
439 required so that Read() can continue scanning from the right place.
440 Called by MaterializeIterator::MaterializeRecursive().
441 */
443
444 private:
445 bool m_inited = false;
447 const double m_expected_rows;
452
453 // Points into MaterializeIterator's data; set by BeginMaterialization() only.
455};
456
457/**
458 TableValueConstructor is the iterator for the table value constructor case of
459 a query_primary (i.e. queries of the form VALUES row_list; e.g. VALUES ROW(1,
460 10), ROW(2, 20)).
461
462 The iterator is passed the field list of its parent JOIN object, which may
463 contain Item_values_column objects that are created during
464 Query_block::prepare_values(). This is required so that Read() can replace the
465 currently selected row by simply changing the references of Item_values_column
466 objects to the next row.
467
468 The iterator must output multiple rows without being materialized, and does
469 not scan any tables. The indirection of Item_values_column is required, as the
470 executor outputs what is contained in join->fields (either directly, or
471 indirectly through ConvertItemsToCopy), and is thus responsible for ensuring
472 that join->fields contains the correct next row.
473 */
475 public:
477 THD *thd, ha_rows *examined_rows,
478 const mem_root_deque<mem_root_deque<Item *> *> &row_value_list,
479 mem_root_deque<Item *> *join_fields);
480
481 bool Init() override;
482 int Read() override;
483
484 void SetNullRowFlag(bool) override { assert(false); }
485
486 void UnlockRow() override {}
487
488 private:
489 ha_rows *const m_examined_rows{nullptr};
490
491 /// Contains the row values that are part of a VALUES clause. Read() will
492 /// modify contained Item objects during execution by calls to is_null() and
493 /// the required val function to extract its value.
496
497 /// References to the row we currently want to output. When multiple rows must
498 /// be output, this contains Item_values_column objects. In this case, each
499 /// call to Read() will replace its current reference with the next row.
501};
502
503#endif // SQL_ITERATORS_BASIC_ROW_ITERATORS_H_
Definition: basic_row_iterators.h:271
int Read() override
Read a single row.
Definition: basic_row_iterators.h:282
void UnlockRow() override
Definition: basic_row_iterators.h:298
bool m_has_row
Definition: basic_row_iterators.h:301
ha_rows *const m_examined_rows
Definition: basic_row_iterators.h:302
bool Init() override
Initialize or reinitialize the iterator.
Definition: basic_row_iterators.h:277
FakeSingleRowIterator(THD *thd, ha_rows *examined_rows)
Definition: basic_row_iterators.h:274
void SetNullRowFlag(bool is_null_row) override
Mark the current row buffer as containing a NULL row or not, so that if you read from it and the flag...
Definition: basic_row_iterators.h:294
A class wrapping misc buffers used for sorting.
Definition: sql_sort.h:188
FollowTailIterator is a special version of TableScanIterator that is used as part of WITH RECURSIVE q...
Definition: basic_row_iterators.h:414
bool RepositionCursorAfterSpillToDisk()
Signal to the iterator that the underlying table was closed and replaced with an InnoDB table with th...
Definition: basic_row_iterators.cc:382
FollowTailIterator(THD *thd, TABLE *table, double expected_rows, ha_rows *examined_rows)
Definition: basic_row_iterators.cc:243
ha_rows *const m_examined_rows
Definition: basic_row_iterators.h:448
unsigned m_recursive_iteration_count
Definition: basic_row_iterators.h:451
const double m_expected_rows
Definition: basic_row_iterators.h:447
bool Init() override
Initialize or reinitialize the iterator.
Definition: basic_row_iterators.cc:257
bool m_inited
Definition: basic_row_iterators.h:445
uchar *const m_record
Definition: basic_row_iterators.h:446
ha_rows * m_stored_rows
Definition: basic_row_iterators.h:454
ha_rows m_read_rows
Definition: basic_row_iterators.h:449
int Read() override
Read a single row.
Definition: basic_row_iterators.cc:307
void set_stored_rows_pointer(ha_rows *stored_rows)
Signal where we can expect to find the number of generated rows for this materialization (this points...
Definition: basic_row_iterators.h:431
~FollowTailIterator() override
Definition: basic_row_iterators.cc:251
ha_rows m_end_of_current_iteration
Definition: basic_row_iterators.h:450
Perform a full index scan along an index.
Definition: basic_row_iterators.h:76
const int m_idx
Definition: basic_row_iterators.h:99
ha_rows *const m_examined_rows
Definition: basic_row_iterators.h:102
int Read() override
Read a single row.
bool Init() override
Initialize or reinitialize the iterator.
Definition: basic_row_iterators.cc:76
IndexScanIterator(THD *thd, TABLE *table, int idx, bool use_order, double expected_rows, ha_rows *examined_rows)
Definition: basic_row_iterators.cc:57
uchar *const m_record
Definition: basic_row_iterators.h:98
~IndexScanIterator() override
Definition: basic_row_iterators.cc:69
const bool m_use_order
Definition: basic_row_iterators.h:100
const double m_expected_rows
Definition: basic_row_iterators.h:101
bool m_first
Definition: basic_row_iterators.h:103
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:802
Definition: sql_optimizer.h:125
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:421
A context for reading through a single table using a chosen access method: index read,...
Definition: row_iterator.h:81
THD * thd() const
Definition: row_iterator.h:227
Fetch the record IDs from a memory buffer, but the records themselves from the table on disk.
Definition: basic_row_iterators.h:162
uchar * m_cache_end
Definition: basic_row_iterators.h:189
bool m_has_null_flags
Definition: basic_row_iterators.h:191
SortBufferIndirectIterator(THD *thd, Mem_root_array< TABLE * > tables, Sort_result *sort_result, bool ignore_not_found_rows, bool has_null_flags, ha_rows *examined_rows)
Definition: sorting_iterator.cc:309
ha_rows *const m_examined_rows
Definition: basic_row_iterators.h:188
bool m_ignore_not_found_rows
Definition: basic_row_iterators.h:190
void UnlockRow() override
Definition: basic_row_iterators.h:182
bool Init() override
Initialize or reinitialize the iterator.
Definition: sorting_iterator.cc:329
Mem_root_array< TABLE * > m_tables
Definition: basic_row_iterators.h:186
void SetNullRowFlag(bool) override
Mark the current row buffer as containing a NULL row or not, so that if you read from it and the flag...
Definition: basic_row_iterators.h:178
uint m_sum_ref_length
Definition: basic_row_iterators.h:187
Sort_result *const m_sort_result
Definition: basic_row_iterators.h:185
uchar * m_cache_pos
Definition: basic_row_iterators.h:189
~SortBufferIndirectIterator() override
Definition: sorting_iterator.cc:319
int Read() override
Read a single row.
Definition: sorting_iterator.cc:362
Fetch the records from a memory buffer.
Definition: basic_row_iterators.h:126
void UnlockRow() override
Definition: basic_row_iterators.h:137
bool Init() override
Initialize or reinitialize the iterator.
Definition: sorting_iterator.cc:271
unsigned m_unpack_counter
Definition: basic_row_iterators.h:147
Sort_result *const m_sort_result
Definition: basic_row_iterators.h:146
~SortBufferIterator() override
Definition: sorting_iterator.cc:265
int Read() override
Read a result set record from a buffer after sorting.
Definition: sorting_iterator.cc:295
void SetNullRowFlag(bool) override
Mark the current row buffer as containing a NULL row or not, so that if you read from it and the flag...
Definition: basic_row_iterators.h:138
ha_rows *const m_examined_rows
Definition: basic_row_iterators.h:148
SortBufferIterator(THD *thd, Mem_root_array< TABLE * > tables, Filesort_info *sort, Sort_result *sort_result, ha_rows *examined_rows)
Definition: sorting_iterator.cc:255
Mem_root_array< TABLE * > m_tables
Definition: basic_row_iterators.h:149
Filesort_info *const m_sort
Definition: basic_row_iterators.h:145
Fetch the record IDs from a temporary file, then the records themselves from the table on disk.
Definition: basic_row_iterators.h:237
int Read() override
Read a single row.
Definition: sorting_iterator.cc:156
IO_CACHE * m_io_cache
Definition: basic_row_iterators.h:258
~SortFileIndirectIterator() override
Definition: sorting_iterator.cc:96
Mem_root_array< TABLE * > m_tables
Definition: basic_row_iterators.h:260
ha_rows *const m_examined_rows
Definition: basic_row_iterators.h:259
bool m_has_null_flags
Definition: basic_row_iterators.h:263
bool m_ignore_not_found_rows
Definition: basic_row_iterators.h:262
SortFileIndirectIterator(THD *thd, Mem_root_array< TABLE * > tables, IO_CACHE *tempfile, bool ignore_not_found_rows, bool has_null_flags, ha_rows *examined_rows)
Definition: sorting_iterator.cc:86
void UnlockRow() override
Definition: basic_row_iterators.h:255
uint m_sum_ref_length
Definition: basic_row_iterators.h:265
bool Init() override
Initialize or reinitialize the iterator.
Definition: sorting_iterator.cc:105
void SetNullRowFlag(bool) override
Mark the current row buffer as containing a NULL row or not, so that if you read from it and the flag...
Definition: basic_row_iterators.h:251
uchar * m_ref_pos
Definition: basic_row_iterators.h:261
Fetch the records from a tempoary file.
Definition: basic_row_iterators.h:203
int Read() override
Read a result set record from a temporary file after sorting.
Definition: sorting_iterator.cc:228
const uint m_buf_length
Definition: basic_row_iterators.h:221
void UnlockRow() override
Definition: basic_row_iterators.h:213
ha_rows *const m_examined_rows
Definition: basic_row_iterators.h:225
uchar *const m_rec_buf
Definition: basic_row_iterators.h:220
IO_CACHE *const m_io_cache
Definition: basic_row_iterators.h:223
void SetNullRowFlag(bool) override
Mark the current row buffer as containing a NULL row or not, so that if you read from it and the flag...
Definition: basic_row_iterators.h:214
Filesort_info *const m_sort
Definition: basic_row_iterators.h:224
SortFileIterator(THD *thd, Mem_root_array< TABLE * > tables, IO_CACHE *tempfile, Filesort_info *sort, ha_rows *examined_rows)
Definition: sorting_iterator.cc:195
Mem_root_array< TABLE * > m_tables
Definition: basic_row_iterators.h:222
~SortFileIterator() override
Definition: sorting_iterator.cc:207
bool Init() override
Initialize or reinitialize the iterator.
Definition: basic_row_iterators.h:211
Definition: sql_sort.h:155
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:922
Definition: row_iterator.h:233
TABLE * table() const
Definition: row_iterator.h:245
Scan a table from beginning to end.
Definition: basic_row_iterators.h:55
const double m_expected_rows
Definition: basic_row_iterators.h:70
uchar *const m_record
Definition: basic_row_iterators.h:69
ha_rows *const m_examined_rows
Definition: basic_row_iterators.h:71
bool Init() override
Initialize or reinitialize the iterator.
Definition: basic_row_iterators.cc:190
TableScanIterator(THD *thd, TABLE *table, double expected_rows, ha_rows *examined_rows)
Definition: basic_row_iterators.cc:176
~TableScanIterator() override
Definition: basic_row_iterators.cc:184
int Read() override
Read a single row.
Definition: basic_row_iterators.cc:212
TableValueConstructor is the iterator for the table value constructor case of a query_primary (i....
Definition: basic_row_iterators.h:474
const mem_root_deque< mem_root_deque< Item * > * > & m_row_value_list
Contains the row values that are part of a VALUES clause.
Definition: basic_row_iterators.h:494
mem_root_deque< mem_root_deque< Item * > * >::const_iterator m_row_it
Definition: basic_row_iterators.h:495
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:948
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:943
void SetNullRowFlag(bool) override
Mark the current row buffer as containing a NULL row or not, so that if you read from it and the flag...
Definition: basic_row_iterators.h:484
mem_root_deque< Item * > *const m_output_refs
References to the row we currently want to output.
Definition: basic_row_iterators.h:500
TableValueConstructorIterator(THD *thd, ha_rows *examined_rows, const mem_root_deque< mem_root_deque< Item * > * > &row_value_list, mem_root_deque< Item * > *join_fields)
Definition: ref_row_iterators.cc:932
ha_rows *const m_examined_rows
Definition: basic_row_iterators.h:489
void UnlockRow() override
Definition: basic_row_iterators.h:486
An iterator for unqualified COUNT(*) (ie., no WHERE, no join conditions, etc.), taking a special fast...
Definition: basic_row_iterators.h:312
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:874
void UnlockRow() override
Definition: basic_row_iterators.h:326
bool Init() override
Initialize or reinitialize the iterator.
Definition: basic_row_iterators.h:317
UnqualifiedCountIterator(THD *thd, JOIN *join)
Definition: basic_row_iterators.h:314
bool m_has_row
Definition: basic_row_iterators.h:329
void SetNullRowFlag(bool) override
Mark the current row buffer as containing a NULL row or not, so that if you read from it and the flag...
Definition: basic_row_iterators.h:324
JOIN *const m_join
Definition: basic_row_iterators.h:330
Like ZeroRowsIterator, but produces a single output row, since there are aggregation functions presen...
Definition: basic_row_iterators.h:367
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:903
JOIN *const m_join
Definition: basic_row_iterators.h:386
bool m_has_row
Definition: basic_row_iterators.h:385
ha_rows *const m_examined_rows
Definition: basic_row_iterators.h:387
ZeroRowsAggregatedIterator(THD *thd, JOIN *join, ha_rows *examined_rows)
Definition: basic_row_iterators.h:370
void UnlockRow() override
Definition: basic_row_iterators.h:382
bool Init() override
Initialize or reinitialize the iterator.
Definition: basic_row_iterators.h:373
void SetNullRowFlag(bool) override
Mark the current row buffer as containing a NULL row or not, so that if you read from it and the flag...
Definition: basic_row_iterators.h:380
A simple iterator that takes no input and produces zero output rows.
Definition: basic_row_iterators.h:343
bool Init() override
Initialize or reinitialize the iterator.
Definition: basic_row_iterators.h:347
void SetNullRowFlag(bool is_null_row) override
Mark the current row buffer as containing a NULL row or not, so that if you read from it and the flag...
Definition: basic_row_iterators.cc:232
int Read() override
Read a single row.
Definition: basic_row_iterators.h:349
void UnlockRow() override
Definition: basic_row_iterators.h:353
ZeroRowsIterator(THD *thd, Mem_root_array< TABLE * > pruned_tables)
Definition: basic_row_iterators.cc:228
const Mem_root_array< TABLE * > m_pruned_tables
Definition: basic_row_iterators.h:356
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:109
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1139
Some integer typedefs for easier portability.
unsigned char uchar
Definition: my_inttypes.h:51
std::string join(Container cont, const std::string &delim)
join elements of an container into a string separated by a delimiter.
Definition: string.h:150
Definition: my_sys.h:340
Definition: table.h:1394
unsigned int uint
Definition: uca-dump.cc:29