summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorheikki@hundin.mysql.fi <>2002-03-21 18:05:46 +0200
committerheikki@hundin.mysql.fi <>2002-03-21 18:05:46 +0200
commit1f142262a13f9da7a897d2becc544adfd537ba9c (patch)
tree2e79ab83c9a30a8858f0d5f27d76c46801cfc860 /sql/sql_show.cc
parente90a57aa49c79d75cabef38c764b5f81ba0288dc (diff)
downloadmariadb-git-1f142262a13f9da7a897d2becc544adfd537ba9c.tar.gz
sql_show.cc, handler.h, handler.cc:
Add foreign key defs to SHOW CREATE TABLE
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 6ae7eeb41d3..018b43b11c8 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -889,9 +889,21 @@ store_create_info(THD *thd, TABLE *table, String *packet)
}
packet->append(')');
}
- packet->append("\n)", 2);
handler *file = table->file;
+
+ /* Get possible foreign key definitions stored in InnoDB and append them
+ to the CREATE TABLE statement */
+
+ char* for_str = file->get_foreign_key_create_info();
+
+ if (for_str) {
+ packet->append(for_str, strlen(for_str));
+
+ file->free_foreign_key_create_info(for_str);
+ }
+
+ packet->append("\n)", 2);
packet->append(" TYPE=", 6);
packet->append(file->table_type());
char buff[128];