MySQL 9.1.0
Source Code Documentation
ddl::Cursor Struct Referenceabstract

Cursor for reading the data. More...

#include <ddl0impl-cursor.h>

Inheritance diagram for ddl::Cursor:
[legend]

Public Types

using Post_row = std::function< dberr_t()>
 

Public Member Functions

 Cursor (ddl::Context &ctx) noexcept
 Constructor. More...
 
virtual ~Cursor () noexcept
 Destructor. More...
 
virtual void open () noexcept=0
 Open the cursor. More...
 
virtual dberr_t finish (dberr_t err) noexcept
 Do any post processing. More...
 
virtual dict_index_tindex () noexcept=0
 
virtual dberr_t copy_row (size_t thread_id, Row &row) noexcept=0
 Copy the row data, by default only the pointers are copied. More...
 
dberr_t setup_pk_sort (size_t n_uniq) noexcept
 Setup the primary key sort data structures. More...
 
virtual dberr_t scan (Builders &builders) noexcept=0
 Reads clustered index of the table and create temporary file(s) containing the index entries for the indexes to be built. More...
 
virtual bool eof () const noexcept=0
 

Static Public Member Functions

static Cursorcreate_cursor (ddl::Context &ctx) noexcept
 Create a cluster index scan cursor. More...
 

Public Attributes

ddl::Contextm_ctx
 DDL context. More...
 
Scoped_heap m_row_heap {}
 Scoped heap to use for rows. More...
 
Scoped_heap m_tuple_heap {}
 Scoped heap to use for tuple instances. More...
 
dfield_tm_prev_fields {}
 Previous fields. More...
 

Detailed Description

Cursor for reading the data.

Member Typedef Documentation

◆ Post_row

using ddl::Cursor::Post_row = std::function<dberr_t()>

Constructor & Destructor Documentation

◆ Cursor()

ddl::Cursor::Cursor ( ddl::Context ctx)
inlineexplicitnoexcept

Constructor.

Parameters
[in,out]ctxDDL context.

◆ ~Cursor()

virtual ddl::Cursor::~Cursor ( )
inlinevirtualnoexcept

Destructor.

Member Function Documentation

◆ copy_row()

virtual dberr_t ddl::Cursor::copy_row ( size_t  thread_id,
Row row 
)
pure virtualnoexcept

Copy the row data, by default only the pointers are copied.

Parameters
[in]thread_idScan thread ID.
[in,out]rowRow to copy.
Returns
DB_SUCCESS or error code.

Implemented in ddl::Parallel_cursor.

◆ create_cursor()

Cursor * ddl::Cursor::create_cursor ( ddl::Context ctx)
staticnoexcept

Create a cluster index scan cursor.

Parameters
[in,out]ctxDDL context.
Returns
a cursor instance or nullptr (if OOM).

◆ eof()

virtual bool ddl::Cursor::eof ( ) const
pure virtualnoexcept
Returns
true if EOF reached.

Implemented in ddl::Parallel_cursor.

◆ finish()

dberr_t ddl::Cursor::finish ( dberr_t  err)
virtualnoexcept

Do any post processing.

Parameters
[in]errError code.
Returns
DB_SUCCESS or error code.

◆ index()

virtual dict_index_t * ddl::Cursor::index ( )
pure virtualnoexcept
Returns
the index to iterate over.

Implemented in ddl::Parallel_cursor.

◆ open()

virtual void ddl::Cursor::open ( )
pure virtualnoexcept

Open the cursor.

Implemented in ddl::Parallel_cursor.

◆ scan()

virtual dberr_t ddl::Cursor::scan ( Builders builders)
pure virtualnoexcept

Reads clustered index of the table and create temporary file(s) containing the index entries for the indexes to be built.

Parameters
[in,out]buildersMerge buffers to use for reading.
Returns
DB_SUCCESS or error code.

Implemented in ddl::Parallel_cursor.

◆ setup_pk_sort()

dberr_t ddl::Cursor::setup_pk_sort ( size_t  n_uniq)
inlinenoexcept

Setup the primary key sort data structures.

Parameters
[in]n_uniqNumber of columns to make they unique key.
Returns
DB_SUCCESS or error code.

Member Data Documentation

◆ m_ctx

ddl::Context& ddl::Cursor::m_ctx

DDL context.

◆ m_prev_fields

dfield_t* ddl::Cursor::m_prev_fields {}

Previous fields.

◆ m_row_heap

Scoped_heap ddl::Cursor::m_row_heap {}

Scoped heap to use for rows.

◆ m_tuple_heap

Scoped_heap ddl::Cursor::m_tuple_heap {}

Scoped heap to use for tuple instances.


The documentation for this struct was generated from the following files: