summaryrefslogtreecommitdiff
path: root/sql/sql_type.cc
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2018-08-28 19:45:34 +0300
committerAleksey Midenkov <midenok@gmail.com>2019-09-30 14:05:09 +0300
commit58fdf5b2fa57188deb9dad3412b480049b0fdcb8 (patch)
tree7de90543fb1c1ea0ee01cb29cb9a645265557c74 /sql/sql_type.cc
parentf610529d230f080681b6979880225aebc248bf91 (diff)
downloadmariadb-git-58fdf5b2fa57188deb9dad3412b480049b0fdcb8.tar.gz
MDEV-16144 Default TIMESTAMP clause for SELECT from versioned
1. Removed TIMESTAMP/TRANSACTION unit auto-detection in favor of default TIMESTAMP. Reasons: 1.1. rare practical use and doubtful advantage of such auto-detection; 1.2. it conflicts with MDEV-16226 (TRX_ID-based versioned tables performance improvement). Needless check_unit membership removed. 2. SQL: versioning type handling refactoring Vers_type_handler hierarchy stores versioning properties of type. virtual Type_handler::vers() accesses specialization of Vers_type_handler for specific type. virtual Vers_type_handler::kind() returns versioning kind (timestamp/trx_id). Removed Type_handler::Vers_history_point_check_unit() in favor of Type_handler::vers(). Renames: require_timestamp() -> require_timestamp_error() require_trx_id() -> require_trx_id_error() EDIT by Alexander Barkov (@abarkov): check_sys_fields() moved to Vers_type_handler::check_sys_fields()
Diffstat (limited to 'sql/sql_type.cc')
-rw-r--r--sql/sql_type.cc72
1 files changed, 4 insertions, 68 deletions
diff --git a/sql/sql_type.cc b/sql/sql_type.cc
index 5f37851955e..2289b900460 100644
--- a/sql/sql_type.cc
+++ b/sql/sql_type.cc
@@ -83,6 +83,10 @@ Type_handler_blob_compressed type_handler_blob_compressed;
Type_handler_interval_DDhhmmssff type_handler_interval_DDhhmmssff;
+Vers_type_timestamp vers_type_timestamp;
+Vers_type_trx vers_type_trx;
+
+
class Type_collection_std: public Type_collection
{
@@ -8200,67 +8204,6 @@ bool Type_handler::
}
-/***************************************************************************/
-
-bool Type_handler::Vers_history_point_resolve_unit(THD *thd,
- Vers_history_point *point)
- const
-{
- /*
- Disallow using non-relevant data types in history points.
- Even expressions with explicit TRANSACTION or TIMESTAMP units.
- */
- point->bad_expression_data_type_error(name().ptr());
- return true;
-}
-
-
-bool Type_handler_typelib::
- Vers_history_point_resolve_unit(THD *thd,
- Vers_history_point *point) const
-{
- /*
- ENUM/SET have dual type properties (string and numeric).
- Require explicit CAST to avoid ambiguity.
- */
- point->bad_expression_data_type_error(name().ptr());
- return true;
-}
-
-
-bool Type_handler_general_purpose_int::
- Vers_history_point_resolve_unit(THD *thd,
- Vers_history_point *point) const
-{
- return point->resolve_unit_trx_id(thd);
-}
-
-
-bool Type_handler_bit::
- Vers_history_point_resolve_unit(THD *thd,
- Vers_history_point *point) const
-{
- return point->resolve_unit_trx_id(thd);
-}
-
-
-bool Type_handler_temporal_result::
- Vers_history_point_resolve_unit(THD *thd,
- Vers_history_point *point) const
-{
- return point->resolve_unit_timestamp(thd);
-}
-
-
-bool Type_handler_general_purpose_string::
- Vers_history_point_resolve_unit(THD *thd,
- Vers_history_point *point) const
-{
- return point->resolve_unit_timestamp(thd);
-}
-
-/***************************************************************************/
-
bool Type_handler_null::Item_const_eq(const Item_const *a,
const Item_const *b,
bool binary_cmp) const
@@ -8342,13 +8285,6 @@ Type_handler_hex_hybrid::cast_to_int_type_handler() const
}
-const Type_handler *
-Type_handler_hex_hybrid::type_handler_for_system_time() const
-{
- return &type_handler_ulonglong;
-}
-
-
/***************************************************************************/
bool Type_handler_row::Item_eq_value(THD *thd, const Type_cmp_attributes *attr,