MySQL 8.0.40
Source Code Documentation
table_column_iterator.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2019, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
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#ifndef _table_column_iterator_h
26#define _table_column_iterator_h
27
28#include "my_bitmap.h" // MY_BITMAP
29#include "sql/field.h" // Field
30#include "sql/table.h" // TABLE
31
32/**
33 @class Table_columns_view
34
35 This template class acts as a container of table columns and encapsulates and
36 abstracts a `TABLE` object field set iteration logic, by providing an iterator
37 interface implementation.
38
39 The template parameter `ExclusionFilter` is a predicate that takes a `TABLE`
40 reference and a column index and returns whether or not the field should be
41 filtered out, more specifically, a signature compatible with:
42
43 std::function<bool (TABLE const*, size_t)>
44
45 This template class accepts an empty parameter set, which provides an
46 unfiltered container and iterates over all the table columns:
47
48 void print_all_fields(TABLE *table) {
49 Table_columns_view<> fields{table};
50
51 for (auto field : fields) {
52 std::cout << field->field_index << ". " << field << std::endl
53 << std::flush;
54 }
55 }
56
57 The template parameter predicate may take the form of a `operator()`:
58
59 class JSON_fields {
60 public:
61 bool operator()(TABLE const *table, size_t column_index) {
62 return table->field[column_index]->type() != MYSQL_TYPE_JSON;
63 }
64
65 void print_json_fields(TABLE *table) {
66 Table_columns_view<JSON_fields &> fields{table, *this};
67 for (auto field : fields) {
68 std::cout << field->field_index << ". " << field << std::endl
69 << std::flush;
70 }
71 }
72 };
73
74 The template parameter predicate may take the form of a lambda function:
75
76 void print_int_fields(TABLE *table) {
77 Table_columns_view<> fields{
78 table, [](TABLE const *table, size_t column_index) -> bool {
79 return table->field[column_index]->type() != MYSQL_TYPE_INT24;
80 }};
81
82 for (auto field : fields) {
83 std::cout << field->field_index << ". " << field << std::endl
84 << std::flush;
85 }
86 }
87
88 The list of generated columns is kept separately in the `TABLE` class, in
89 the `TABLE::vfield` member. Although we could achieve accurate filtering
90 using the above described methods, as a performance optimization, this
91 class allows applying the filter and iteration directly and exclusively
92 on the generated columns. For that we can use the `VFIELDS_ONLY` option:
93
94 void print_virtual_generated_columns(TABLE *table) {
95 Table_columns_view<> fields{
96 table, [](TABLE const *table, size_t column_index) -> bool {
97 return table->field[column_index]->is_virtual_gcol();
98 },
99 Table_columns_view<>::VFIELDS_ONLY
100 };
101
102 for (auto field : fields) {
103 std::cout << field->field_index << ". " << field << std::endl
104 << std::flush;
105 }
106 }
107 */
108template <typename ExclusionFilter = std::function<bool(TABLE const *, size_t)>>
110 public:
111 /**
112 Alias for the predicate type, for readability purposes.
113 */
114 using filter_fn_type = ExclusionFilter;
115
116 /**
117 Default set of options.
118 */
119 static constexpr unsigned long DEFAULTS = 0;
120 /**
121 Request the view excluding filter to operate `TABLE::vfields` instead
122 of the full set.
123 */
124 static constexpr unsigned long VFIELDS_ONLY = 1;
125
126 /**
127 Empty constructor, only available when the predicate type is a lambda
128 function.
129
130 @param options optional parameter for filtering and iterating
131 options. Options should be combined with `|`. Available
132 options are `VFIELDS_ONLY`.
133 */
134 template <typename U = ExclusionFilter>
136 unsigned long options = 0,
137 typename std::enable_if<std::is_same<
138 U, std::function<bool(TABLE const *, size_t)>>::value>::type * =
139 nullptr);
140 /**
141 Constructor that takes the target `TABLE` object, only available when the
142 predicate type is a lambda function.
143
144 @param table reference to the target TABLE object.
145 @param options optional parameter for filtering and iterating
146 options. Options should be combined with `|`. Available
147 options are `VFIELDS_ONLY`.
148 */
149 template <typename U = ExclusionFilter>
151 TABLE const *table, unsigned long options = 0,
152 typename std::enable_if<std::is_same<
153 U, std::function<bool(TABLE const *, size_t)>>::value>::type * =
154 nullptr);
155 /**
156 Constructor which takes a predicate used to filter this container iteration.
157
158 @param filtering_predicate the predicate to filter this container iteration.
159 @param options optional parameter for filtering and iterating
160 options. Options should be combined with `|`. Available
161 options are `VFIELDS_ONLY`.
162 */
163 Table_columns_view(ExclusionFilter filtering_predicate,
164 unsigned long options = 0);
165 /**
166 Constructor which takes the TABLE object whose field set will be iterated
167 and a predicate used to filter this container iteration.
168
169 @param table reference to the target TABLE object.
170 @param filtering_predicate the predicate to filter this container iteration.
171 @param options optional parameter for filtering and iterating
172 options. Options should be combined with `|`. Available
173 options are `VFIELDS_ONLY`.
174 */
175 Table_columns_view(TABLE const *table, ExclusionFilter filtering_predicate,
176 unsigned long options = 0);
177 /**
178 Destructor for the class.
179 */
180 virtual ~Table_columns_view();
181 /**
182 Setter which initializes the internal reference to the TABLE object whose
183 field set will be iterated over.
184
185 @param rhs reference to the target TABLE object
186
187 @return a reference to this object.
188 */
189 virtual Table_columns_view &set_table(const TABLE *rhs);
190 /**
191 Setter which initializes the internal filtering predicate of type
192 `ExclusionFilter`.
193
194 @param rhs reference to the target filtering predicate `ExclusionFilter`
195
196 @return a reference to this object.
197 */
198 virtual Table_columns_view &set_filter(ExclusionFilter rhs);
199
200 // --> Deleted constructors and methods to remove default move/copy semantics
205 // <--
206
207 /**
208 Iterator class to allow iterating over the replicatable fields in a TABLE
209 object field set. It implements the bidirectional iterator concept.
210
211 In order to fully understand this class implementation, please, check the
212 documentation on the Iterator concept requirements within the C++ standard
213 and the STL definition.
214 */
215 class iterator {
216 public:
217 using difference_type = std::ptrdiff_t;
218 using value_type = Field *;
219 using pointer = Field *;
220 using reference = Field *;
221 using iterator_category = std::bidirectional_iterator_tag;
222 /**
223 Constructor for the iterator. It takes the parent Table_columns_view
224 object and the initial positions for the replicated table and for the
225 local table.
226
227 @param parent reference to the target Table_columns_view object.
228 @param pos initial replicated table field set position.
229 @param col initial local table field set position.
230 */
231 explicit iterator(Table_columns_view &parent, long pos, long col);
232 /**
233 Constructor for the iterator. It takes the parent Table_columns_view
234 object and the initial positions for the replicated table and for the
235 local table. It also includes a translation factor so we can get the
236 iterated position in relation to a different set of columns.
237
238 @note When this iterator is used in the context of a replica that is
239 applying an event, the translation offset represents the number of extra
240 columns that the event has to the left of other columns, which the table
241 does not have (if any). So, for example, when the event has a GIPK column
242 to the left, and the replica does not have that, then the offset is 1.
243
244 @param parent reference to the target Table_columns_view object.
245 @param pos initial replicated table field set position.
246 @param col initial local table field set position.
247 @param translation_offset the translation offset for translated_pos()
248 */
249 explicit iterator(Table_columns_view &parent, long pos, long col,
250 long translation_offset);
251 /**
252 Copy constructor.
253
254 @param rhs object instance we pretend to copy from.
255 */
256 iterator(const iterator &rhs);
257 /**
258 Default destructor
259 */
260 virtual ~iterator() = default;
261 // BASIC ITERATOR METHODS //
262 iterator &operator=(const iterator &rhs);
264 reference operator*() const;
265 // END / BASIC ITERATOR METHODS //
266 // INPUT ITERATOR METHODS //
267 iterator operator++(int);
268 pointer operator->() const;
269 bool operator==(iterator rhs) const;
270 bool operator!=(iterator rhs) const;
271 // END / INPUT ITERATOR METHODS //
272
273 // OUTPUT ITERATOR METHODS //
274 // reference operator*() const; <- already defined
275 // iterator operator++(int); <- already defined
276 // END / OUTPUT ITERATOR METHODS //
277 // FORWARD ITERATOR METHODS //
278 // Enable support for both input and output iterator <- already enabled
279 // END / FORWARD ITERATOR METHODS //
280
281 // BIDIRECTIOANL ITERATOR METHODS //
283 iterator operator--(int);
284 // END / BIDIRECTIOANL ITERATOR METHODS //
285 /**
286 Returns the position this iterator object is pointing to, within the
287 local table field set.
288
289 @return the position this object is pointing to, within the local table
290 field set.
291 */
292 size_t absolute_pos();
293 /**
294 Returns the position this iterator relative to the set of table columns
295 which are not excluded by the associated filters
296
297 @return the position this object is pointing to considering the non
298 filtered columns
299 */
300 size_t filtered_pos();
301 /**
302 Returns the position this iterator object is pointing to, within the
303 replicated table field set plus the translation_offset
304
305 @note When this iterator is used in the context of a replica that is
306 applying an event, use translated_pos to get the position within the
307 event."
308
309 @return the position this object is pointing to, within the replicated
310 table field set adjusted to another frame of reference.
311 */
312 size_t translated_pos();
313
314 friend struct TABLE;
315 friend class Table_columns_view;
316
317 private:
318 /** A reference to the instance we wish to iterate over. */
320 /**
321 The position, relative to the TABLE object, this instance iterator is
322 pointing to.
323 */
325 /**
326 The position, relative to the set of included fields, this instance
327 iterator is pointing to.
328 */
330 /**
331 Translation unit used on top of the iterator filtered position, so
332 we can adjust the position to another frame of reference.
333
334 When this iterator is used in the context of a replica that is applying an
335 event, use translated_pos to get the position within the event. This
336 number should be set to N when the event has N extra columns to the left,
337 which do not exist in the replica table.
338 */
340 };
341
342 /**
343 Computes the total number of fields in the table.
344
345 @return the number of fields in the table.
346 */
347 size_t absolute_size() const;
348 /**
349 Computes the total number of fields after filtering.
350
351 @return the number of fields after filtering.
352 */
353 size_t filtered_size() const;
354 /**
355 Creates an iterator object, pointing at the beginning of the table field
356 set.
357
358 @return an iterator pointing to the beginning of the field set.
359 */
360 virtual iterator begin();
361 /**
362 Creates an iterator object, pointing at the end of the table field set.
363
364 @return an iterator pointing to the end of the field set.
365 */
366 virtual iterator end();
367 /**
368 Returns whether or not the field at `index` is to be excluded from the field
369 set iteration process.
370
371 @param index the index of the field to test for exclusion from iteration.
372
373 @return true if the field is to be excluded from the iteration, false
374 otherwise.
375 */
376 bool is_excluded(size_t index) const;
377 /**
378 Returns the bitmap for the columns from the local table set that are to be
379 included in the replicated row.
380
381 @return a bitmap indicating which columns from the local table are to be
382 included in the replicated row.
383 */
385 /**
386 Returns the bitmap for the columns from the local table set that are to be
387 excluded from the replicated row.
388
389 @return a bitmap indicating which columns from the local table are to be
390 excluded from the replicated row.
391 */
393 /**
394 Takes a bitmap object, as received from the replication channel and
395 translates it to a bitmap that matches the local TABLE object.
396
397 @param[in] source the bitmap as received from the replication channel
398 @param[out] destination the bitmap that matches the local TABLE format
399
400 @return this object reference (for chaining purposes).
401 */
403 MY_BITMAP &destination);
404
405 /**
406 For the absolute position on the table that equals the given position given
407 as a parameter, return the translated position.
408
409 @param source the position in the local table
410
411 @return the translated position within the local table.
412 */
413 size_t translate_position(size_t source);
414
415 /**
416 Returns the iterator for the (absolute) position in the table.
417
418 @param absolute_pos the position in the local table
419
420 @return the iterator for the position, if found
421 */
422 iterator find_by_absolute_pos(size_t absolute_pos);
423
424 protected:
425 /**
426 Initializes the internal included and excluded fields bitmaps. After each
427 member is set, this method should be invoked in order to remake the bitmaps.
428
429 @return this object reference (for chaining purposes).
430 */
432
433 private:
434 /**
435 The TABLE object reference which contains the field set to be iterated over.
436 */
437 TABLE const *m_table{nullptr};
438 /**
439 ExclusionFiltering predicate to be invoked when determining if a column is
440 to be included in the iteration.
441 */
442 ExclusionFilter m_filtering_predicate;
443 /** Number of columns to include in iteration. */
445 /**
446 Bitmap that holds the information about which columns from the local table
447 are to be included in the replicated row.
448 */
450 /**
451 Bitmap that holds the information about which columns from the local table
452 are to be excluded from the replicated row.
453 */
455 /**
456 Set of options to apply to view behaviour
457 */
458 unsigned long m_options{0};
459
460 /**
461 Default filtering predicate.
462 */
463 static bool default_filter(TABLE const *table, size_t column_index);
464};
465
466template <typename F>
467template <typename U>
469 unsigned long options,
470 typename std::enable_if<std::is_same<
471 U, std::function<bool(TABLE const *, size_t)>>::value>::type *)
475}
476
477template <typename F>
478template <typename U>
480 TABLE const *table, unsigned long options,
481 typename std::enable_if<std::is_same<
482 U, std::function<bool(TABLE const *, size_t)>>::value>::type *)
486 .set_table(table);
487}
488
489template <typename F>
491 unsigned long options)
492 : Table_columns_view{nullptr, filtering_predicate, options} {}
493
494template <typename F>
496 F filtering_predicate,
497 unsigned long options)
498 : m_filtering_predicate{filtering_predicate}, m_options{options} {
499 this->set_filter(filtering_predicate) //
500 .set_table(target);
501}
502
503template <typename F>
507}
508
509template <typename F>
511 this->m_table = rhs;
512 this->init_fields_bitmaps();
513 return (*this);
514}
515
516template <typename F>
518 this->m_filtering_predicate = rhs;
519 this->init_fields_bitmaps();
520 return (*this);
521}
522
523template <typename F>
525 if (this->m_table == nullptr) return 0;
526 return this->m_table->s->fields;
527}
528
529template <typename F>
531 return this->m_filtered_size;
532}
533
534template <typename F>
536 typename Table_columns_view<F>::iterator to_return{*this, -1, -1};
537 ++to_return;
538 return to_return;
539}
540
541template <typename F>
543 typename Table_columns_view<F>::iterator to_return{
544 *this, static_cast<long>(this->absolute_size()),
545 static_cast<long>(this->filtered_size())};
546 return to_return;
547}
548
549template <typename F>
550bool Table_columns_view<F>::is_excluded(size_t index) const {
551 return bitmap_is_set(&this->m_excluded_fields_bitmap, index);
552}
553
554template <typename F>
556 return this->m_included_fields_bitmap;
557}
558
559template <typename F>
561 return this->m_excluded_fields_bitmap;
562}
563
564template <typename F>
566 MY_BITMAP &source, MY_BITMAP &destination) {
567 if (this->m_table == nullptr) return (*this);
568 if (source.bitmap == nullptr) return (*this);
569
570 bitmap_init(&destination, nullptr, this->m_table->s->fields);
571
572 for (auto it = begin(); it != end(); ++it) {
573 size_t source_pos = it.translated_pos();
574 size_t abs_pos = it.absolute_pos();
575 if (source_pos >= source.n_bits) break;
576 if (bitmap_is_set(&source, static_cast<uint>(source_pos))) {
577 bitmap_set_bit(&destination, static_cast<uint>(abs_pos));
578 }
579 }
580
581 return (*this);
582}
583
584template <typename F>
587 return std::find_if(begin(), end(), [absolute_pos](auto it) {
588 return it->field_index() == absolute_pos;
589 });
590}
591
592template <typename F>
594 for (auto it = begin(); it != end(); ++it) {
595 size_t abs_pos = it.absolute_pos();
596 if (abs_pos == orig_pos) return it.translated_pos();
597 }
598 return orig_pos;
599}
600
601template <typename F>
603 if (this->m_table == nullptr) return (*this);
604
608 this->m_table->s->fields);
610 this->m_table->s->fields);
611
612 this->m_filtered_size = 0;
613 if ((this->m_options & VFIELDS_ONLY) == VFIELDS_ONLY) {
615 for (auto fld = this->m_table->vfield; *fld != nullptr; ++fld) {
616 auto idx = (*fld)->field_index();
617 if (!this->m_filtering_predicate(this->m_table, idx)) {
620 ++this->m_filtered_size;
621 }
622 }
623 } else {
624 for (size_t idx = 0; idx != this->m_table->s->fields; ++idx) {
625 if (this->m_filtering_predicate(this->m_table, idx)) {
627 } else {
629 ++this->m_filtered_size;
630 }
631 }
632 }
633 return (*this);
634}
635
636template <typename F>
638 return false;
639}
640
641template <typename F>
643 long absolute_pos, long filtered_pos)
644 : m_parent{&parent},
645 m_absolute_pos{absolute_pos},
646 m_filtered_pos{filtered_pos},
647 m_translation_offset{0} {}
648
649template <typename F>
651 long absolute_pos, long filtered_pos,
652 long translation_offset)
653 : m_parent{&parent},
654 m_absolute_pos{absolute_pos},
655 m_filtered_pos{filtered_pos},
656 m_translation_offset{translation_offset} {}
657
658template <typename F>
660 (*this) = rhs;
661}
662
663template <typename F>
667 this->m_parent = rhs.m_parent;
668 this->m_absolute_pos = rhs.m_absolute_pos;
669 this->m_filtered_pos = rhs.m_filtered_pos;
670 this->m_translation_offset = rhs.m_translation_offset;
671 return (*this);
672}
673
674template <typename F>
677 if (this->m_parent->m_table != nullptr &&
678 this->m_absolute_pos !=
679 static_cast<long>(this->m_parent->absolute_size())) {
680 do {
681 ++this->m_absolute_pos;
682 } while (this->m_absolute_pos !=
683 static_cast<long>(this->m_parent->absolute_size()) &&
684 this->m_parent->is_excluded(this->m_absolute_pos));
685 ++this->m_filtered_pos;
686 }
687 return (*this);
688}
689
690template <typename F>
693 if (this->m_parent->m_table != nullptr &&
694 this->m_absolute_pos !=
695 static_cast<long>(this->m_parent->absolute_size())) {
696 return this->m_parent->m_table->field[this->m_absolute_pos];
697 }
698 return nullptr;
699}
700
701template <typename F>
704 typename Table_columns_view<F>::iterator to_return = (*this);
705 ++(*this);
706 return to_return;
707}
708
709template <typename F>
712 return this->operator*();
713}
714
715template <typename F>
718 return this->m_absolute_pos == rhs.m_absolute_pos &&
719 this->m_parent->m_table == rhs.m_parent->m_table;
720}
721
722template <typename F>
725 return !((*this) == rhs);
726}
727
728template <typename F>
731 if (this->m_parent->m_table != nullptr && this->m_absolute_pos != 0) {
732 do {
733 --this->m_absolute_pos;
734 } while (this->m_absolute_pos != 0 &&
735 this->m_parent->is_excluded(this->m_absolute_pos));
736 --this->m_filtered_pos;
737 }
738 return (*this);
739}
740
741template <typename F>
744 typename Table_columns_view<F>::iterator to_return = (*this);
745 --(*this);
746 return to_return;
747}
748
749template <typename F>
751 return static_cast<size_t>(this->m_absolute_pos);
752}
753
754template <typename F>
756 return static_cast<size_t>(this->m_filtered_pos);
757}
758
759template <typename F>
761 return static_cast<size_t>(this->m_filtered_pos + this->m_translation_offset);
762}
763
764#endif // _table_column_iterator_h
Definition: field.h:575
Iterator class to allow iterating over the replicatable fields in a TABLE object field set.
Definition: table_column_iterator.h:215
iterator & operator--()
Definition: table_column_iterator.h:730
reference operator*() const
Definition: table_column_iterator.h:692
std::ptrdiff_t difference_type
Definition: table_column_iterator.h:217
long m_filtered_pos
The position, relative to the set of included fields, this instance iterator is pointing to.
Definition: table_column_iterator.h:329
iterator(Table_columns_view &parent, long pos, long col)
Constructor for the iterator.
Definition: table_column_iterator.h:642
bool operator!=(iterator rhs) const
Definition: table_column_iterator.h:723
size_t absolute_pos()
Returns the position this iterator object is pointing to, within the local table field set.
Definition: table_column_iterator.h:750
iterator & operator++()
Definition: table_column_iterator.h:676
bool operator==(iterator rhs) const
Definition: table_column_iterator.h:716
iterator & operator=(const iterator &rhs)
Definition: table_column_iterator.h:665
Table_columns_view const * m_parent
A reference to the instance we wish to iterate over.
Definition: table_column_iterator.h:319
long m_translation_offset
Translation unit used on top of the iterator filtered position, so we can adjust the position to anot...
Definition: table_column_iterator.h:339
std::bidirectional_iterator_tag iterator_category
Definition: table_column_iterator.h:221
pointer operator->() const
Definition: table_column_iterator.h:711
size_t translated_pos()
Returns the position this iterator object is pointing to, within the replicated table field set plus ...
Definition: table_column_iterator.h:760
virtual ~iterator()=default
Default destructor.
long m_absolute_pos
The position, relative to the TABLE object, this instance iterator is pointing to.
Definition: table_column_iterator.h:324
size_t filtered_pos()
Returns the position this iterator relative to the set of table columns which are not excluded by the...
Definition: table_column_iterator.h:755
This template class acts as a container of table columns and encapsulates and abstracts a TABLE objec...
Definition: table_column_iterator.h:109
static constexpr unsigned long VFIELDS_ONLY
Request the view excluding filter to operate TABLE::vfields instead of the full set.
Definition: table_column_iterator.h:124
Table_columns_view(unsigned long options=0, typename std::enable_if< std::is_same< U, std::function< bool(TABLE const *, size_t)> >::value >::type *=nullptr)
Empty constructor, only available when the predicate type is a lambda function.
Definition: table_column_iterator.h:468
MY_BITMAP & get_included_fields_bitmap()
Returns the bitmap for the columns from the local table set that are to be included in the replicated...
Definition: table_column_iterator.h:555
virtual ~Table_columns_view()
Destructor for the class.
Definition: table_column_iterator.h:504
virtual Table_columns_view & set_table(const TABLE *rhs)
Setter which initializes the internal reference to the TABLE object whose field set will be iterated ...
Definition: table_column_iterator.h:510
ExclusionFilter filter_fn_type
Alias for the predicate type, for readability purposes.
Definition: table_column_iterator.h:114
bool is_excluded(size_t index) const
Returns whether or not the field at index is to be excluded from the field set iteration process.
Definition: table_column_iterator.h:550
virtual iterator end()
Creates an iterator object, pointing at the end of the table field set.
Definition: table_column_iterator.h:542
size_t m_filtered_size
Number of columns to include in iteration.
Definition: table_column_iterator.h:444
virtual iterator begin()
Creates an iterator object, pointing at the beginning of the table field set.
Definition: table_column_iterator.h:535
Table_columns_view & translate_bitmap(MY_BITMAP &source, MY_BITMAP &destination)
Takes a bitmap object, as received from the replication channel and translates it to a bitmap that ma...
Definition: table_column_iterator.h:565
virtual Table_columns_view & set_filter(ExclusionFilter rhs)
Setter which initializes the internal filtering predicate of type ExclusionFilter.
Definition: table_column_iterator.h:517
Table_columns_view(Table_columns_view &&rhs)=delete
MY_BITMAP & get_excluded_fields_bitmap()
Returns the bitmap for the columns from the local table set that are to be excluded from the replicat...
Definition: table_column_iterator.h:560
Table_columns_view(ExclusionFilter filtering_predicate, unsigned long options=0)
Constructor which takes a predicate used to filter this container iteration.
MY_BITMAP m_included_fields_bitmap
Bitmap that holds the information about which columns from the local table are to be included in the ...
Definition: table_column_iterator.h:449
iterator find_by_absolute_pos(size_t absolute_pos)
Returns the iterator for the (absolute) position in the table.
Definition: table_column_iterator.h:586
TABLE const * m_table
The TABLE object reference which contains the field set to be iterated over.
Definition: table_column_iterator.h:437
size_t translate_position(size_t source)
For the absolute position on the table that equals the given position given as a parameter,...
Definition: table_column_iterator.h:593
Table_columns_view & operator=(Table_columns_view &&rhs)=delete
Table_columns_view & operator=(const Table_columns_view &rhs)=delete
Table_columns_view & init_fields_bitmaps()
Initializes the internal included and excluded fields bitmaps.
Definition: table_column_iterator.h:602
static bool default_filter(TABLE const *table, size_t column_index)
Default filtering predicate.
Definition: table_column_iterator.h:637
size_t absolute_size() const
Computes the total number of fields in the table.
Definition: table_column_iterator.h:524
static constexpr unsigned long DEFAULTS
Default set of options.
Definition: table_column_iterator.h:119
ExclusionFilter m_filtering_predicate
ExclusionFiltering predicate to be invoked when determining if a column is to be included in the iter...
Definition: table_column_iterator.h:442
Table_columns_view(TABLE const *table, ExclusionFilter filtering_predicate, unsigned long options=0)
Constructor which takes the TABLE object whose field set will be iterated and a predicate used to fil...
MY_BITMAP m_excluded_fields_bitmap
Bitmap that holds the information about which columns from the local table are to be excluded from th...
Definition: table_column_iterator.h:454
unsigned long m_options
Set of options to apply to view behaviour.
Definition: table_column_iterator.h:458
size_t filtered_size() const
Computes the total number of fields after filtering.
Definition: table_column_iterator.h:530
Table_columns_view(const Table_columns_view &rhs)=delete
int field_index(const char *field_name)
Definition: rules_table_service.cc:152
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
static void bitmap_set_all(MY_BITMAP *map)
Definition: my_bitmap.h:128
static bool bitmap_is_set(const MY_BITMAP *map, uint bit)
Definition: my_bitmap.h:95
bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits)
Definition: my_bitmap.cc:140
static void bitmap_clear_bit(MY_BITMAP *map, uint bit)
Definition: my_bitmap.h:90
void bitmap_free(MY_BITMAP *map)
Definition: my_bitmap.cc:158
static void bitmap_set_bit(MY_BITMAP *map, uint bit)
Definition: my_bitmap.h:80
Definition: options.cc:49
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42
required string type
Definition: replication_group_member_actions.proto:34
Definition: my_bitmap.h:43
my_bitmap_map * bitmap
Definition: my_bitmap.h:44
uint fields
Definition: table.h:841
Definition: table.h:1399
Field ** vfield
Pointer to generated columns.
Definition: table.h:1498
TABLE_SHARE * s
Definition: table.h:1400
unsigned int uint
Definition: uca9-dump.cc:75
Definition: dtoa.cc:594