MySQL  8.0.19
Source Code Documentation
ib_sequence_t Struct Reference

Generate the next autoinc based on a snapshot of the session auto_increment_increment and auto_increment_offset variables. More...

#include <handler0alter.h>

Public Member Functions

 ib_sequence_t (THD *thd, ulonglong start_value, ulonglong max_value)
 
ulonglong operator++ (int) 1
 Postfix increment. More...
 
bool eof () const 1
 Check if the autoinc "sequence" is exhausted. More...
 
ib_sequence_toperator= (const ib_sequence_t &in)
 assignment operator to copy the sequence values More...
 
ulonglong last () const 1
 

Public Attributes

const ulonglong m_max_value
 Maximum calumn value if adding an AUTOINC column else 0. More...
 
ulong m_increment
 Value of auto_increment_increment. More...
 
ulong m_offset
 Value of auto_increment_offset. More...
 
ulonglong m_next_value
 Next value in the sequence. More...
 
bool m_eof
 true if no more values left in the sequence More...
 

Detailed Description

Generate the next autoinc based on a snapshot of the session auto_increment_increment and auto_increment_offset variables.

Assingnment operator would be used during the inplace_alter_table() phase only

Constructor & Destructor Documentation

◆ ib_sequence_t()

ib_sequence_t::ib_sequence_t ( THD thd,
ulonglong  start_value,
ulonglong  max_value 
)
Parameters
thdthe session
start_valuethe lower bound
max_valuethe upper bound (inclusive)

Member Function Documentation

◆ eof()

bool ib_sequence_t::eof ( ) const
inline

Check if the autoinc "sequence" is exhausted.

Returns
true if the sequence is exhausted

◆ last()

ulonglong ib_sequence_t::last ( ) const
inline
Returns
the next value in the sequence

◆ operator++()

ulonglong ib_sequence_t::operator++ ( int  )

Postfix increment.

Returns
the value to insert
the next value to insert

◆ operator=()

ib_sequence_t& ib_sequence_t::operator= ( const ib_sequence_t in)
inline

assignment operator to copy the sequence values

Parameters
insequence to copy from

Member Data Documentation

◆ m_eof

bool ib_sequence_t::m_eof

true if no more values left in the sequence

◆ m_increment

ulong ib_sequence_t::m_increment

Value of auto_increment_increment.

◆ m_max_value

const ulonglong ib_sequence_t::m_max_value

Maximum calumn value if adding an AUTOINC column else 0.

Once we reach the end of the sequence it will be set to ~0.

◆ m_next_value

ulonglong ib_sequence_t::m_next_value

Next value in the sequence.

◆ m_offset

ulong ib_sequence_t::m_offset

Value of auto_increment_offset.


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