Skip to content

Commit eac7e57

Browse files
committed
Feature_check_constraint status variable
1 parent 7450cb7 commit eac7e57

File tree

5 files changed

+19
-3
lines changed

5 files changed

+19
-3
lines changed

mysql-test/r/features.result

Lines changed: 7 additions & 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_check_constraint 0
67
Feature_delay_key_write 0
78
Feature_dynamic_columns 0
89
Feature_fulltext 0
@@ -158,3 +159,9 @@ drop table t1;
158159
show status like "feature_delay_key_write";
159160
Variable_name Value
160161
Feature_delay_key_write 2
162+
create table t1 (a int check (a > 5));
163+
create table t2 (b int, constraint foo check (b < 10));
164+
drop table t1, t2;
165+
show status like "feature_check_constraint";
166+
Variable_name Value
167+
Feature_check_constraint 2

mysql-test/t/features.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,11 @@ insert into t1 values(2);
130130
drop table t1;
131131

132132
show status like "feature_delay_key_write";
133+
134+
#
135+
# Feature CHECK CONSTRAINT
136+
#
137+
create table t1 (a int check (a > 5));
138+
create table t2 (b int, constraint foo check (b < 10));
139+
drop table t1, t2;
140+
show status like "feature_check_constraint";

sql/mysqld.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ ulong extra_max_connections;
530530
uint max_digest_length= 0;
531531
ulong slave_retried_transactions;
532532
ulonglong slave_skipped_errors;
533-
ulong feature_files_opened_with_delayed_keys;
533+
ulong feature_files_opened_with_delayed_keys= 0, feature_check_constraint= 0;
534534
ulonglong denied_connections;
535535
my_decimal decimal_zero;
536536

@@ -8390,6 +8390,7 @@ SHOW_VAR status_vars[]= {
83908390
{"Empty_queries", (char*) offsetof(STATUS_VAR, empty_queries), SHOW_LONG_STATUS},
83918391
{"Executed_events", (char*) &executed_events, SHOW_LONG_NOFLUSH },
83928392
{"Executed_triggers", (char*) offsetof(STATUS_VAR, executed_triggers), SHOW_LONG_STATUS},
8393+
{"Feature_check_constraint", (char*) &feature_check_constraint, SHOW_LONG },
83938394
{"Feature_delay_key_write", (char*) &feature_files_opened_with_delayed_keys, SHOW_LONG },
83948395
{"Feature_dynamic_columns", (char*) offsetof(STATUS_VAR, feature_dynamic_columns), SHOW_LONG_STATUS},
83958396
{"Feature_fulltext", (char*) offsetof(STATUS_VAR, feature_fulltext), SHOW_LONG_STATUS},

sql/sql_class.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,7 @@ typedef struct system_status_var
823823
Global status variables
824824
*/
825825

826-
extern ulong feature_files_opened_with_delayed_keys;
827-
826+
extern ulong feature_files_opened_with_delayed_keys, feature_check_constraint;
828827

829828
void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var);
830829

sql/table.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,6 +2306,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
23062306
bitmap_count= 1;
23072307
if (share->table_check_constraints)
23082308
{
2309+
feature_check_constraint++;
23092310
if (!(share->check_set= (MY_BITMAP*)
23102311
alloc_root(&share->mem_root, sizeof(*share->check_set))))
23112312
goto err;

0 commit comments

Comments
 (0)