summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorJacob Mathew <jacob.mathew@mariadb.com>2017-03-28 16:56:18 -0700
committerJacob Mathew <jacob.mathew@mariadb.com>2017-03-29 12:07:33 -0700
commit3c422e60bbee79bb636e65910c26ac193de70a84 (patch)
tree851ab6dddf07680adb7b1367aa746743df10c5ef /sql/sql_show.cc
parent4ebdef2bcd28b641dc49aaef4a8c387442ae06dc (diff)
downloadmariadb-git-bb-10.2-MDEV-11115.tar.gz
MDEV-11115 CHECK constraints are not shown in I_S.TABLE_CONSTRAINTSbb-10.2-MDEV-11115
Added CHECK constraints to I_S.TABLE_CONSTRAINTS. Fixed a bug regarding virtual column definitions whose name is the field name. Added test case: check_constraint_show
Diffstat (limited to 'sql/sql_show.cc')
-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 c45e27a2794..adba7ab4d33 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -6386,6 +6386,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->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);