summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Mathew <jacob.mathew@mariadb.com>2017-02-13 17:18:56 -0800
committerJacob Mathew <jacob.mathew@mariadb.com>2017-03-16 14:21:28 -0700
commit7c152ac68a7993bca99ef23e073b0a0974b087a1 (patch)
treeb05bb4590b8c4ddc16daee6ef7f2198e4e974824
parente1f0f0dd06d5e6f606c962b09ab0f6c0f1197955 (diff)
downloadmariadb-git-MDEV-11115.tar.gz
MDEV-11115 CHECK constraints are not shown in I_S.TABLE_CONSTRAINTSMDEV-11115
Add CHECK constraints to I_S.TABLE_CONSTRAINTS.
-rw-r--r--sql/sql_show.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 58fc2edc6f2..ed369f9b6fe 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -6375,6 +6375,19 @@ static int get_schema_constraints_record(THD *thd, TABLE_LIST *tables,
}
}
+ // Table check constraints
+ for ( uint i = 0; i < show_table->s->table_check_constraints; i++ )
+ {
+ Virtual_column_info *check = show_table->s->check_constraints[ i ];
+
+ if ( store_constraints( thd, table, db_name, table_name, check->name.str,
+ check->name.length,
+ STRING_WITH_LEN( "CHECK" ) ) )
+ {
+ DBUG_RETURN( 1 );
+ }
+ }
+
show_table->file->get_foreign_key_list(thd, &f_key_list);
FOREIGN_KEY_INFO *f_key_info;
List_iterator_fast<FOREIGN_KEY_INFO> it(f_key_list);