mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
sql_show.cc, handler.h, handler.cc:
Add foreign key defs to SHOW CREATE TABLE
This commit is contained in:
@ -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];
|
||||
|
Reference in New Issue
Block a user