diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-07-25 22:15:05 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-08-27 16:59:13 +0200 |
commit | eac7e57529756a2a7f6c269775323323f7b2c706 (patch) | |
tree | 79d8d68360d6513bcca531931e47a6fd546d7736 | |
parent | 7450cb7f69db801c48f806748e666c393b8d6b81 (diff) | |
download | mariadb-git-eac7e57529756a2a7f6c269775323323f7b2c706.tar.gz |
Feature_check_constraint status variable
-rw-r--r-- | mysql-test/r/features.result | 7 | ||||
-rw-r--r-- | mysql-test/t/features.test | 8 | ||||
-rw-r--r-- | sql/mysqld.cc | 3 | ||||
-rw-r--r-- | sql/sql_class.h | 3 | ||||
-rw-r--r-- | sql/table.cc | 1 |
5 files changed, 19 insertions, 3 deletions
diff --git a/mysql-test/r/features.result b/mysql-test/r/features.result index 52650d118b3..615ab2368d9 100644 --- a/mysql-test/r/features.result +++ b/mysql-test/r/features.result @@ -3,6 +3,7 @@ set sql_mode=""; flush status; show status like "feature%"; Variable_name Value +Feature_check_constraint 0 Feature_delay_key_write 0 Feature_dynamic_columns 0 Feature_fulltext 0 @@ -158,3 +159,9 @@ drop table t1; show status like "feature_delay_key_write"; Variable_name Value Feature_delay_key_write 2 +create table t1 (a int check (a > 5)); +create table t2 (b int, constraint foo check (b < 10)); +drop table t1, t2; +show status like "feature_check_constraint"; +Variable_name Value +Feature_check_constraint 2 diff --git a/mysql-test/t/features.test b/mysql-test/t/features.test index 225ab40b361..63e923a772b 100644 --- a/mysql-test/t/features.test +++ b/mysql-test/t/features.test @@ -130,3 +130,11 @@ insert into t1 values(2); drop table t1; show status like "feature_delay_key_write"; + +# +# Feature CHECK CONSTRAINT +# +create table t1 (a int check (a > 5)); +create table t2 (b int, constraint foo check (b < 10)); +drop table t1, t2; +show status like "feature_check_constraint"; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index fa8f143335d..9b5fcbddd6c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -530,7 +530,7 @@ ulong extra_max_connections; uint max_digest_length= 0; ulong slave_retried_transactions; ulonglong slave_skipped_errors; -ulong feature_files_opened_with_delayed_keys; +ulong feature_files_opened_with_delayed_keys= 0, feature_check_constraint= 0; ulonglong denied_connections; my_decimal decimal_zero; @@ -8390,6 +8390,7 @@ SHOW_VAR status_vars[]= { {"Empty_queries", (char*) offsetof(STATUS_VAR, empty_queries), SHOW_LONG_STATUS}, {"Executed_events", (char*) &executed_events, SHOW_LONG_NOFLUSH }, {"Executed_triggers", (char*) offsetof(STATUS_VAR, executed_triggers), SHOW_LONG_STATUS}, + {"Feature_check_constraint", (char*) &feature_check_constraint, SHOW_LONG }, {"Feature_delay_key_write", (char*) &feature_files_opened_with_delayed_keys, SHOW_LONG }, {"Feature_dynamic_columns", (char*) offsetof(STATUS_VAR, feature_dynamic_columns), SHOW_LONG_STATUS}, {"Feature_fulltext", (char*) offsetof(STATUS_VAR, feature_fulltext), SHOW_LONG_STATUS}, diff --git a/sql/sql_class.h b/sql/sql_class.h index 6e71adf023a..b40af4a0937 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -823,8 +823,7 @@ typedef struct system_status_var Global status variables */ -extern ulong feature_files_opened_with_delayed_keys; - +extern ulong feature_files_opened_with_delayed_keys, feature_check_constraint; void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var); diff --git a/sql/table.cc b/sql/table.cc index ab9a1c07172..9225b9d4f11 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2306,6 +2306,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, bitmap_count= 1; if (share->table_check_constraints) { + feature_check_constraint++; if (!(share->check_set= (MY_BITMAP*) alloc_root(&share->mem_root, sizeof(*share->check_set)))) goto err; |