MySQL 8.4.3
Source Code Documentation
Sql_condition Class Reference

Representation of a SQL condition. More...

#include <sql_error.h>

Public Types

enum  enum_severity_level { SL_NOTE , SL_WARNING , SL_ERROR , SEVERITY_END }
 Enumeration value describing the severity of the condition. More...
 

Public Member Functions

const char * message_text () const
 Get the MESSAGE_TEXT of this condition. More...
 
size_t message_octet_length () const
 Get the MESSAGE_OCTET_LENGTH of this condition. More...
 
const char * returned_sqlstate () const
 Get the RETURNED_SQLSTATE of this condition. More...
 
uint mysql_errno () const
 Get the MYSQL_ERRNO of this condition. More...
 
Sql_condition::enum_severity_level severity () const
 Get the severity level of this condition. More...
 

Private Member Functions

 Sql_condition (MEM_ROOT *mem_root)
 Constructor. More...
 
 Sql_condition (MEM_ROOT *mem_root, uint mysql_errno, const char *returned_sqlstate, Sql_condition::enum_severity_level severity, const char *message_text)
 Constructor. More...
 
 ~Sql_condition ()=default
 Destructor. More...
 
void copy_opt_attributes (const Sql_condition *cond)
 Copy optional condition items attributes. More...
 
void set_message_text (const char *message_text)
 Set the condition message test. More...
 
void set_returned_sqlstate (const char *sqlstate)
 Set the RETURNED_SQLSTATE of this condition. More...
 
void set_class_origins ()
 Set the CLASS_ORIGIN and SUBCLASS_ORIGIN of this condition. More...
 

Private Attributes

String m_class_origin
 SQL CLASS_ORIGIN condition item. More...
 
String m_subclass_origin
 SQL SUBCLASS_ORIGIN condition item. More...
 
String m_constraint_catalog
 SQL CONSTRAINT_CATALOG condition item. More...
 
String m_constraint_schema
 SQL CONSTRAINT_SCHEMA condition item. More...
 
String m_constraint_name
 SQL CONSTRAINT_NAME condition item. More...
 
String m_catalog_name
 SQL CATALOG_NAME condition item. More...
 
String m_schema_name
 SQL SCHEMA_NAME condition item. More...
 
String m_table_name
 SQL TABLE_NAME condition item. More...
 
String m_column_name
 SQL COLUMN_NAME condition item. More...
 
String m_cursor_name
 SQL CURSOR_NAME condition item. More...
 
String m_message_text
 Message text, expressed in the character set implied by –lc-messages. More...
 
uint m_mysql_errno
 MySQL extension, MYSQL_ERRNO condition item. More...
 
char m_returned_sqlstate [SQLSTATE_LENGTH+1]
 SQL RETURNED_SQLSTATE condition item. More...
 
Sql_condition::enum_severity_level m_severity_level
 Severity (error, warning, note) of this condition. More...
 
Sql_conditionm_next_condition
 Pointers for participating in the list of conditions. More...
 
Sql_condition ** m_prev_condition
 
MEM_ROOTm_mem_root
 Memory root to use to hold condition item values. More...
 

Friends

class THD
 
class Diagnostics_area
 
class Sql_cmd_common_signal
 
class Sql_cmd_signal
 
class Sql_cmd_resignal
 
class sp_rcontext
 
class Condition_information_item
 

Detailed Description

Representation of a SQL condition.

A SQL condition can be a completion condition (note, warning), or an exception condition (error, not found).

Member Enumeration Documentation

◆ enum_severity_level

Enumeration value describing the severity of the condition.

Enumerator
SL_NOTE 
SL_WARNING 
SL_ERROR 
SEVERITY_END 

Constructor & Destructor Documentation

◆ Sql_condition() [1/2]

Sql_condition::Sql_condition ( MEM_ROOT mem_root)
private

Constructor.

Parameters
mem_rootMemory root to use for the condition items of this condition.

◆ Sql_condition() [2/2]

Sql_condition::Sql_condition ( MEM_ROOT mem_root,
uint  mysql_errno,
const char *  returned_sqlstate,
Sql_condition::enum_severity_level  severity,
const char *  message_text 
)
private

Constructor.

Parameters
mem_rootMemory root to use for the condition items of this condition.
mysql_errnoMYSQL_ERRNO
returned_sqlstateRETURNED_SQLSTATE
severitySeverity level - error, warning or note.
message_textMESSAGE_TEXT

◆ ~Sql_condition()

Sql_condition::~Sql_condition ( )
privatedefault

Destructor.

Member Function Documentation

◆ copy_opt_attributes()

void Sql_condition::copy_opt_attributes ( const Sql_condition cond)
private

Copy optional condition items attributes.

Parameters
condthe condition to copy.

◆ message_octet_length()

size_t Sql_condition::message_octet_length ( ) const
inline

Get the MESSAGE_OCTET_LENGTH of this condition.

Returns
the length in bytes of the message text.

◆ message_text()

const char * Sql_condition::message_text ( ) const
inline

Get the MESSAGE_TEXT of this condition.

Returns
the message text.

◆ mysql_errno()

uint Sql_condition::mysql_errno ( ) const
inline

Get the MYSQL_ERRNO of this condition.

Returns
the sql error number condition item.

◆ returned_sqlstate()

const char * Sql_condition::returned_sqlstate ( ) const
inline

Get the RETURNED_SQLSTATE of this condition.

Returns
the sql state.

◆ set_class_origins()

void Sql_condition::set_class_origins ( )
private

Set the CLASS_ORIGIN and SUBCLASS_ORIGIN of this condition.

◆ set_message_text()

void Sql_condition::set_message_text ( const char *  message_text)
private

Set the condition message test.

Parameters
message_textMessage text, expressed in the character set derived from the server –lc-messages option

◆ set_returned_sqlstate()

void Sql_condition::set_returned_sqlstate ( const char *  sqlstate)
inlineprivate

Set the RETURNED_SQLSTATE of this condition.

◆ severity()

Sql_condition::enum_severity_level Sql_condition::severity ( ) const
inline

Get the severity level of this condition.

Returns
the severity level condition item.

Friends And Related Function Documentation

◆ Condition_information_item

friend class Condition_information_item
friend

◆ Diagnostics_area

friend class Diagnostics_area
friend

◆ sp_rcontext

friend class sp_rcontext
friend

◆ Sql_cmd_common_signal

friend class Sql_cmd_common_signal
friend

◆ Sql_cmd_resignal

friend class Sql_cmd_resignal
friend

◆ Sql_cmd_signal

friend class Sql_cmd_signal
friend

◆ THD

friend class THD
friend

Member Data Documentation

◆ m_catalog_name

String Sql_condition::m_catalog_name
private

SQL CATALOG_NAME condition item.

◆ m_class_origin

String Sql_condition::m_class_origin
private

SQL CLASS_ORIGIN condition item.

◆ m_column_name

String Sql_condition::m_column_name
private

SQL COLUMN_NAME condition item.

◆ m_constraint_catalog

String Sql_condition::m_constraint_catalog
private

SQL CONSTRAINT_CATALOG condition item.

◆ m_constraint_name

String Sql_condition::m_constraint_name
private

SQL CONSTRAINT_NAME condition item.

◆ m_constraint_schema

String Sql_condition::m_constraint_schema
private

SQL CONSTRAINT_SCHEMA condition item.

◆ m_cursor_name

String Sql_condition::m_cursor_name
private

SQL CURSOR_NAME condition item.

◆ m_mem_root

MEM_ROOT* Sql_condition::m_mem_root
private

Memory root to use to hold condition item values.

◆ m_message_text

String Sql_condition::m_message_text
private

Message text, expressed in the character set implied by –lc-messages.

◆ m_mysql_errno

uint Sql_condition::m_mysql_errno
private

MySQL extension, MYSQL_ERRNO condition item.

◆ m_next_condition

Sql_condition* Sql_condition::m_next_condition
private

Pointers for participating in the list of conditions.

◆ m_prev_condition

Sql_condition** Sql_condition::m_prev_condition
private

◆ m_returned_sqlstate

char Sql_condition::m_returned_sqlstate[SQLSTATE_LENGTH+1]
private

SQL RETURNED_SQLSTATE condition item.

This member is always NUL terminated.

◆ m_schema_name

String Sql_condition::m_schema_name
private

SQL SCHEMA_NAME condition item.

◆ m_severity_level

Sql_condition::enum_severity_level Sql_condition::m_severity_level
private

Severity (error, warning, note) of this condition.

◆ m_subclass_origin

String Sql_condition::m_subclass_origin
private

SQL SUBCLASS_ORIGIN condition item.

◆ m_table_name

String Sql_condition::m_table_name
private

SQL TABLE_NAME condition item.


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