MySQL 8.0.39
Source Code Documentation
Ordering Class Referencefinal

Represents a (potentially interesting) ordering, rollup or (non-rollup) grouping. More...

#include <interesting_orders.h>

Public Types

enum class  Kind : char { kEmpty , kOrder , kRollup , kGroup }
 The kind of ordering that an Ordering instance may represent. More...
 
using Elements = Bounds_checked_array< OrderElement >
 This type hold the individual elements of the ordering. More...
 

Public Member Functions

 Ordering ()
 
 Ordering (Elements elements, Kind kind)
 
 Ordering (const Ordering &other)
 Copy constructor. Only defined explicitly to check Valid(). More...
 
Orderingoperator= (const Ordering &other)
 Assignment operator. Only defined explicitly to check Valid(). More...
 
Ordering Clone (MEM_ROOT *mem_root) const
 Make a copy of *this. Allocate new memory for m_elements from mem_root. More...
 
Kind GetKind () const
 
const ElementsGetElements () const
 
ElementsGetElements ()
 
size_t size () const
 
void Deduplicate ()
 Remove duplicate entries, in-place. More...
 

Private Member Functions

bool Valid () const
 

Private Attributes

Elements m_elements
 The ordering terms. More...
 
Kind m_kind
 The kind of this ordering. More...
 

Friends

bool operator== (const Ordering &a, const Ordering &b)
 Check if 'a' and 'b' has the same kind and contains the same elements. More...
 

Detailed Description

Represents a (potentially interesting) ordering, rollup or (non-rollup) grouping.

Member Typedef Documentation

◆ Elements

This type hold the individual elements of the ordering.

Member Enumeration Documentation

◆ Kind

enum class Ordering::Kind : char
strong

The kind of ordering that an Ordering instance may represent.

Enumerator
kEmpty 

An ordering with no elements.

Such an ordering is not useful in itself, but may appear as an intermediate result.

kOrder 

Specific sequence of m_elements, and specific direction of each element.

Needed for e.g. ORDER BY.

kRollup 

Specific sequence of m_elements, but each element may be ordered in any direction.

Needed for ROLLUP:

kGroup 

Elements may appear in any sequence and may be ordered in any direction.

Needed for GROUP BY (with out ROLLUP), DISCTINCT, semi-join etc.

Constructor & Destructor Documentation

◆ Ordering() [1/3]

Ordering::Ordering ( )
inline

◆ Ordering() [2/3]

Ordering::Ordering ( Elements  elements,
Kind  kind 
)
inline

◆ Ordering() [3/3]

Ordering::Ordering ( const Ordering other)
inline

Copy constructor. Only defined explicitly to check Valid().

Member Function Documentation

◆ Clone()

Ordering Ordering::Clone ( MEM_ROOT mem_root) const
inline

Make a copy of *this. Allocate new memory for m_elements from mem_root.

◆ Deduplicate()

void Ordering::Deduplicate ( )

Remove duplicate entries, in-place.

◆ GetElements() [1/2]

Elements & Ordering::GetElements ( )
inline

◆ GetElements() [2/2]

const Elements & Ordering::GetElements ( ) const
inline

◆ GetKind()

Kind Ordering::GetKind ( ) const
inline

◆ operator=()

Ordering & Ordering::operator= ( const Ordering other)
inline

Assignment operator. Only defined explicitly to check Valid().

◆ size()

size_t Ordering::size ( ) const
inline

◆ Valid()

bool Ordering::Valid ( ) const
private
Returns
true iff *this passes a consistency check.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const Ordering a,
const Ordering b 
)
friend

Check if 'a' and 'b' has the same kind and contains the same elements.

Member Data Documentation

◆ m_elements

Elements Ordering::m_elements
private

The ordering terms.

◆ m_kind

Kind Ordering::m_kind
private

The kind of this ordering.


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