summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorAnel Husakovic <anel@mariadb.org>2021-03-16 12:03:41 +0100
committerAnel Husakovic <anel@mariadb.org>2021-03-16 19:02:16 +0100
commit825c0e2abefb4c20c9f5378f55871cc34fbc83f9 (patch)
tree9e6b528157ce3014176f1925e35dc2c26d4a5cdf /sql/sql_show.cc
parent8cbada87f05be0dac0c53b1bc4c305af6c00fb1b (diff)
downloadmariadb-git-825c0e2abefb4c20c9f5378f55871cc34fbc83f9.tar.gz
MDEV-24601: INFORMATION_SCHEMA doesn't differentiate between column and table-level CHECK constraints
- Reviewed by: wlad@mariadb.com
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 7acbc73bc3b..72662ef25e7 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -6932,10 +6932,14 @@ static int get_check_constraints_record(THD *thd, TABLE_LIST *tables,
table->field[0]->store(STRING_WITH_LEN("def"), system_charset_info);
table->field[3]->store(check->name.str, check->name.length,
system_charset_info);
+ const char *tmp_buff;
+ tmp_buff= (check->get_vcol_type() == VCOL_CHECK_FIELD ?
+ "Column" : "Table");
+ table->field[4]->store(tmp_buff, strlen(tmp_buff), system_charset_info);
/* Make sure the string is empty between each print. */
str.length(0);
check->print(&str);
- table->field[4]->store(str.ptr(), str.length(), system_charset_info);
+ table->field[5]->store(str.ptr(), str.length(), system_charset_info);
if (schema_table_store_record(thd, table))
DBUG_RETURN(1);
}
@@ -9508,6 +9512,7 @@ ST_FIELD_INFO check_constraints_fields_info[]=
Column("CONSTRAINT_SCHEMA", Name(), NOT_NULL, OPEN_FULL_TABLE),
Column("TABLE_NAME", Name(), NOT_NULL, OPEN_FULL_TABLE),
Column("CONSTRAINT_NAME", Name(), NOT_NULL, OPEN_FULL_TABLE),
+ Column("LEVEL", Varchar(6),NOT_NULL, OPEN_FULL_TABLE),
Column("CHECK_CLAUSE", Longtext(MAX_FIELD_VARCHARLENGTH),
NOT_NULL, OPEN_FULL_TABLE),
CEnd()
@@ -9524,7 +9529,7 @@ extern ST_FIELD_INFO optimizer_trace_info[];
} //namespace Show
/*
- Description of ST_FIELD_INFO in table.h
+ Description of ST_FIELD_INFO in sql_i_s.h
Make sure that the order of schema_tables and enum_schema_tables are the same.