diff --git a/mysql-test/main/features.result b/mysql-test/main/features.result index f31a6672549..beab7fb946f 100644 --- a/mysql-test/main/features.result +++ b/mysql-test/main/features.result @@ -3,6 +3,7 @@ set sql_mode=""; flush status; show status like "feature%"; Variable_name Value +Feature_application_time_periods 0 Feature_check_constraint 0 Feature_custom_aggregate_functions 0 Feature_delay_key_write 0 diff --git a/mysql-test/suite/period/r/create.result b/mysql-test/suite/period/r/create.result index 427d9605afe..7f06a433ad2 100644 --- a/mysql-test/suite/period/r/create.result +++ b/mysql-test/suite/period/r/create.result @@ -93,4 +93,7 @@ t CREATE TABLE `t` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert t values (2, '2001-01-01', '2001-01-01'); ERROR 23000: CONSTRAINT `mytime_1` failed for `test`.`t` +show status like "Feature_application_time_periods"; +Variable_name Value +Feature_application_time_periods 6 create or replace database test; diff --git a/mysql-test/suite/period/t/create.test b/mysql-test/suite/period/t/create.test index 45f934bf133..c55f8fe31f7 100644 --- a/mysql-test/suite/period/t/create.test +++ b/mysql-test/suite/period/t/create.test @@ -77,4 +77,6 @@ show create table t; --error ER_CONSTRAINT_FAILED insert t values (2, '2001-01-01', '2001-01-01'); +show status like "Feature_application_time_periods"; + create or replace database test; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e28ec64089e..bfa03aa57c1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7666,6 +7666,7 @@ SHOW_VAR status_vars[]= { {"Feature_locale", (char*) offsetof(STATUS_VAR, feature_locale), SHOW_LONG_STATUS}, {"Feature_subquery", (char*) offsetof(STATUS_VAR, feature_subquery), SHOW_LONG_STATUS}, {"Feature_system_versioning", (char*) offsetof(STATUS_VAR, feature_system_versioning), SHOW_LONG_STATUS}, + {"Feature_application_time_periods", (char*) offsetof(STATUS_VAR, feature_application_time_periods), SHOW_LONG_STATUS}, {"Feature_timezone", (char*) offsetof(STATUS_VAR, feature_timezone), SHOW_LONG_STATUS}, {"Feature_trigger", (char*) offsetof(STATUS_VAR, feature_trigger), SHOW_LONG_STATUS}, {"Feature_window_functions", (char*) offsetof(STATUS_VAR, feature_window_functions), SHOW_LONG_STATUS}, diff --git a/sql/sql_class.h b/sql/sql_class.h index 25a9ca8e935..cd4626ebc4e 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -862,6 +862,8 @@ typedef struct system_status_var ulong feature_locale; /* +1 when LOCALE is set */ ulong feature_subquery; /* +1 when subqueries are used */ ulong feature_system_versioning; /* +1 opening a table WITH SYSTEM VERSIONING */ + ulong feature_application_time_periods; + /* +1 opening a table with application-time period */ ulong feature_timezone; /* +1 when XPATH is used */ ulong feature_trigger; /* +1 opening a table with triggers */ ulong feature_xml; /* +1 when XPATH is used */ diff --git a/sql/table.cc b/sql/table.cc index 061a23527c2..f605ebf9d31 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2108,6 +2108,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (init_period_from_extra2(&period, pos, end)) goto err; + status_var_increment(thd->status_var.feature_application_time_periods); } for (i=0 ; i < share->fields; i++, strpos+=field_pack_length, field_ptr++)