MySQL 8.3.0
Source Code Documentation
field_common_properties.h File Reference

This file contains basic method for field types. More...

#include "field_types.h"

Go to the source code of this file.

Functions

bool is_integer_type (enum_field_types type)
 Tests if field type is an integer. More...
 
bool is_numeric_type (enum_field_types type)
 Tests if field type is a numeric type. More...
 
bool is_string_type (enum_field_types type)
 Tests if field type is a string type. More...
 
bool is_temporal_type (enum_field_types type)
 Tests if field type is temporal, i.e. More...
 
bool is_temporal_type_with_time (enum_field_types type)
 Tests if field type is temporal and has time part, i.e. More...
 
bool is_temporal_type_with_date (enum_field_types type)
 Tests if field type is temporal and has date part, i.e. More...
 
bool is_temporal_type_with_date_and_time (enum_field_types type)
 Tests if field type is temporal and has date and time parts, i.e. More...
 
bool is_timestamp_type (enum_field_types type)
 Recognizer for concrete data type (called real_type for some reason), returning true if it is one of the TIMESTAMP types. More...
 
bool has_signedess_information_type (enum_field_types type)
 Test if the field type contains information on being signed/unsigned. More...
 

Detailed Description

This file contains basic method for field types.

Note
This file can be imported from both the server and tools like mysqlbinlog, hence its simplicity

Function Documentation

◆ has_signedess_information_type()

bool has_signedess_information_type ( enum_field_types  type)
inline

Test if the field type contains information on being signed/unsigned.

This includes numeric but also YEAR that still contains sign modifiers even if ignored.

Parameters
typeField type, as returned by field->type()
Returns
true if the type contains info on being signed/unsigned

◆ is_integer_type()

bool is_integer_type ( enum_field_types  type)
inline

Tests if field type is an integer.

Parameters
typeField type, as returned by field->type()
Returns
true if integer type, false otherwise

◆ is_numeric_type()

bool is_numeric_type ( enum_field_types  type)
inline

Tests if field type is a numeric type.

Parameters
typeField type, as returned by field->type()
Returns
true if numeric type, false otherwise

◆ is_string_type()

bool is_string_type ( enum_field_types  type)
inline

Tests if field type is a string type.

Parameters
typeField type, as returned by field->type()
Returns
true if string type, false otherwise

◆ is_temporal_type()

bool is_temporal_type ( enum_field_types  type)
inline

Tests if field type is temporal, i.e.

represents DATE, TIME, DATETIME, TIMESTAMP or YEAR types in SQL.

Parameters
typeField type, as returned by field->type().
Return values
trueIf field type is temporal
falseIf field type is not temporal

◆ is_temporal_type_with_date()

bool is_temporal_type_with_date ( enum_field_types  type)
inline

Tests if field type is temporal and has date part, i.e.

represents DATE, DATETIME or TIMESTAMP types in SQL.

Parameters
typeField type, as returned by field->type().
Return values
trueIf field type is temporal type with date part.
falseIf field type is not temporal type with date part.

◆ is_temporal_type_with_date_and_time()

bool is_temporal_type_with_date_and_time ( enum_field_types  type)
inline

Tests if field type is temporal and has date and time parts, i.e.

represents DATETIME or TIMESTAMP types in SQL.

Parameters
typeField type, as returned by field->type().
Return values
trueIf field type is temporal type with date and time parts.
falseIf field type is not temporal type with date and time parts.

◆ is_temporal_type_with_time()

bool is_temporal_type_with_time ( enum_field_types  type)
inline

Tests if field type is temporal and has time part, i.e.

represents TIME, DATETIME or TIMESTAMP types in SQL.

Parameters
typeField type, as returned by field->type().
Return values
trueIf field type is temporal type with time part.
falseIf field type is not temporal type with time part.

◆ is_timestamp_type()

bool is_timestamp_type ( enum_field_types  type)
inline

Recognizer for concrete data type (called real_type for some reason), returning true if it is one of the TIMESTAMP types.