1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-11115 CHECK constraints are not shown in I_S.TABLE_CONSTRAINTS

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
This commit is contained in:
Jacob Mathew
2017-03-28 16:56:18 -07:00
parent 4ebdef2bcd
commit 3c422e60bb
4 changed files with 42 additions and 0 deletions

View File

@ -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);