Skip to content

Commit 610ec19

Browse files
FooBarriorvuvova
authored andcommitted
MDEV-17320 add Feature_application_time_periods status variable
Closes #1225
1 parent 5fc6ad9 commit 610ec19

File tree

6 files changed

+10
-0
lines changed

6 files changed

+10
-0
lines changed

mysql-test/main/features.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set sql_mode="";
33
flush status;
44
show status like "feature%";
55
Variable_name Value
6+
Feature_application_time_periods 0
67
Feature_check_constraint 0
78
Feature_custom_aggregate_functions 0
89
Feature_delay_key_write 0

mysql-test/suite/period/r/create.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,7 @@ t CREATE TABLE `t` (
9393
) ENGINE=MyISAM DEFAULT CHARSET=latin1
9494
insert t values (2, '2001-01-01', '2001-01-01');
9595
ERROR 23000: CONSTRAINT `mytime_1` failed for `test`.`t`
96+
show status like "Feature_application_time_periods";
97+
Variable_name Value
98+
Feature_application_time_periods 6
9699
create or replace database test;

mysql-test/suite/period/t/create.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,6 @@ show create table t;
7777
--error ER_CONSTRAINT_FAILED
7878
insert t values (2, '2001-01-01', '2001-01-01');
7979

80+
show status like "Feature_application_time_periods";
81+
8082
create or replace database test;

sql/mysqld.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7666,6 +7666,7 @@ SHOW_VAR status_vars[]= {
76667666
{"Feature_locale", (char*) offsetof(STATUS_VAR, feature_locale), SHOW_LONG_STATUS},
76677667
{"Feature_subquery", (char*) offsetof(STATUS_VAR, feature_subquery), SHOW_LONG_STATUS},
76687668
{"Feature_system_versioning", (char*) offsetof(STATUS_VAR, feature_system_versioning), SHOW_LONG_STATUS},
7669+
{"Feature_application_time_periods", (char*) offsetof(STATUS_VAR, feature_application_time_periods), SHOW_LONG_STATUS},
76697670
{"Feature_timezone", (char*) offsetof(STATUS_VAR, feature_timezone), SHOW_LONG_STATUS},
76707671
{"Feature_trigger", (char*) offsetof(STATUS_VAR, feature_trigger), SHOW_LONG_STATUS},
76717672
{"Feature_window_functions", (char*) offsetof(STATUS_VAR, feature_window_functions), SHOW_LONG_STATUS},

sql/sql_class.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,8 @@ typedef struct system_status_var
862862
ulong feature_locale; /* +1 when LOCALE is set */
863863
ulong feature_subquery; /* +1 when subqueries are used */
864864
ulong feature_system_versioning; /* +1 opening a table WITH SYSTEM VERSIONING */
865+
ulong feature_application_time_periods;
866+
/* +1 opening a table with application-time period */
865867
ulong feature_timezone; /* +1 when XPATH is used */
866868
ulong feature_trigger; /* +1 opening a table with triggers */
867869
ulong feature_xml; /* +1 when XPATH is used */

sql/table.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,6 +2108,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
21082108

21092109
if (init_period_from_extra2(&period, pos, end))
21102110
goto err;
2111+
status_var_increment(thd->status_var.feature_application_time_periods);
21112112
}
21122113

21132114
for (i=0 ; i < share->fields; i++, strpos+=field_pack_length, field_ptr++)

0 commit comments

Comments
 (0)