MySQL 8.4.2
Source Code Documentation
Result_set Class Reference

A result set contains the result of a query. More...

#include <protocol_local_v2.h>

Public Member Functions

 Result_set ()
 
 Result_set (List< Row< value_t > > *rows_arg, Row< Column_metadata > *fields, size_t column_count, ulonglong affected_rows, ulonglong last_insert_id)
 
 ~Result_set ()=default
 
Row< value_t > * get_next_row ()
 Get the next row. More...
 
bool is_last_row ()
 Check if the iterator is at the last row. More...
 
ulonglong get_num_affected_rows () const
 Get the num affected row count. More...
 
ulonglong get_last_insert_id () const
 Get the last insert id. More...
 
List< Row< value_t > > * get_rows ()
 Get the list of rows from result set. More...
 
 operator List< Row< value_t > > & ()
 Get reference for rows in results set. More...
 
unsigned int size () const
 Get number for rows in result set. More...
 
Row< Column_metadata > * get_fields ()
 Get the field metadata. More...
 
size_t get_field_count () const
 Get the field count in result set. More...
 
bool has_next ()
 Check if we have more than one result set. More...
 
Result_setget_next ()
 Get the next result set object. More...
 
void set_next (Result_set *ptr)
 Set the current result set pointer. More...
 
void update (List< Row< value_t > > *rows_arg, Row< Column_metadata > *fields, size_t column_count, ulonglong affected_rows, ulonglong last_insert_id)
 Update the members of result set. More...
 

Static Public Member Functions

static void * operator new (size_t size, MEM_ROOT *mem_root, const std::nothrow_t &=std::nothrow) noexcept
 Custom memory allocation for Result set object. More...
 
static void operator delete (void *) noexcept
 
static void operator delete (void *, MEM_ROOT *, const std::nothrow_t &) noexcept
 

Private Member Functions

 Result_set (const Result_set &)=delete
 
Result_setoperator= (Result_set &)=delete
 
 Result_set (const Result_set &&)=delete
 
Result_setoperator= (Result_set &&)=delete
 

Private Attributes

Row< Column_metadata > * m_fields {nullptr}
 
size_t m_column_count {0}
 
List< Row< value_t > > * m_rows {nullptr}
 
List_iterator_fast< Row< value_t > > m_row_iterator
 
Result_setm_next {nullptr}
 
ulonglong m_affected_row {0}
 
ulonglong m_last_insert_id {0}
 

Detailed Description

A result set contains the result of a query.

It is a collection of Rows and its metadata

Constructor & Destructor Documentation

◆ Result_set() [1/4]

Result_set::Result_set ( const Result_set )
privatedelete

◆ Result_set() [2/4]

Result_set::Result_set ( const Result_set &&  )
privatedelete

◆ Result_set() [3/4]

Result_set::Result_set ( )

◆ Result_set() [4/4]

Result_set::Result_set ( List< Row< value_t > > *  rows_arg,
Row< Column_metadata > *  fields,
size_t  column_count,
ulonglong  affected_rows,
ulonglong  last_insert_id 
)

◆ ~Result_set()

Result_set::~Result_set ( )
default

Member Function Documentation

◆ get_field_count()

size_t Result_set::get_field_count ( ) const
inline

Get the field count in result set.

Returns
size_t

◆ get_fields()

Row< Column_metadata > * Result_set::get_fields ( )
inline

Get the field metadata.

Returns
Row<Column_metadata>*

◆ get_last_insert_id()

ulonglong Result_set::get_last_insert_id ( ) const
inline

Get the last insert id.

Returns
uint

◆ get_next()

Result_set * Result_set::get_next ( )
inline

Get the next result set object.

Returns
Result_set*

◆ get_next_row()

Row< value_t > * Result_set::get_next_row ( )
inline

Get the next row.

Returns
void*

◆ get_num_affected_rows()

ulonglong Result_set::get_num_affected_rows ( ) const
inline

Get the num affected row count.

Returns
uint

◆ get_rows()

List< Row< value_t > > * Result_set::get_rows ( )
inline

Get the list of rows from result set.

Returns
List<Row<value_t>>*

◆ has_next()

bool Result_set::has_next ( )
inline

Check if we have more than one result set.

Returns
true
false

◆ is_last_row()

bool Result_set::is_last_row ( )
inline

Check if the iterator is at the last row.

Returns
true
false

◆ operator delete() [1/2]

static void Result_set::operator delete ( void *  )
inlinestaticnoexcept

◆ operator delete() [2/2]

static void Result_set::operator delete ( void *  ,
MEM_ROOT ,
const std::nothrow_t &   
)
inlinestaticnoexcept

◆ operator List< Row< value_t > > &()

Result_set::operator List< Row< value_t > > & ( )
inline

Get reference for rows in results set.

Returns
List<Row<value_t>> &

◆ operator new()

static void * Result_set::operator new ( size_t  size,
MEM_ROOT mem_root,
const std::nothrow_t &  = std::nothrow 
)
inlinestaticnoexcept

Custom memory allocation for Result set object.

Parameters
sizesize of the memory
mem_rootmem root object pointer
Returns
void*

◆ operator=() [1/2]

Result_set & Result_set::operator= ( Result_set &&  )
privatedelete

◆ operator=() [2/2]

Result_set & Result_set::operator= ( Result_set )
privatedelete

◆ set_next()

void Result_set::set_next ( Result_set ptr)
inline

Set the current result set pointer.

Generally used when traversing through all result set.

Parameters
ptrpointer to result set

◆ size()

unsigned int Result_set::size ( ) const
inline

Get number for rows in result set.

Returns
unsigned int

◆ update()

void Result_set::update ( List< Row< value_t > > *  rows_arg,
Row< Column_metadata > *  fields,
size_t  column_count,
ulonglong  affected_rows,
ulonglong  last_insert_id 
)
inline

Update the members of result set.

Member Data Documentation

◆ m_affected_row

ulonglong Result_set::m_affected_row {0}
private

◆ m_column_count

size_t Result_set::m_column_count {0}
private

◆ m_fields

Row<Column_metadata>* Result_set::m_fields {nullptr}
private

◆ m_last_insert_id

ulonglong Result_set::m_last_insert_id {0}
private

◆ m_next

Result_set* Result_set::m_next {nullptr}
private

◆ m_row_iterator

List_iterator_fast<Row<value_t> > Result_set::m_row_iterator
private

◆ m_rows

List<Row<value_t> >* Result_set::m_rows {nullptr}
private

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