1
0
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:
heikki@hundin.mysql.fi
2002-03-21 18:05:46 +02:00
parent e90a57aa49
commit 1f142262a1
3 changed files with 18 additions and 5 deletions

View File

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