From 563da00428af9360220641c1e6de5afb55466709 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 7 Jun 2001 17:12:04 +0000 Subject: [PATCH] complete table dump --- ChangeLog | 3 +++ lib.inc.php3 | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 301b01cfb..7628ea8c6 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2001-06-07 Marc Delisle + * modify/implement Steve Alberty's patch for complete table dump + 2001-06-06 Armel Fauveau * patch bookmark section in sql.php3 (bug #430628) diff --git a/lib.inc.php3 b/lib.inc.php3 index 6bf638524..7f07c9670 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -478,6 +478,19 @@ function get_table_def($db, $table, $crlf) if(!empty($drop)) $schema_create .= "DROP TABLE IF EXISTS $table;$crlf"; +// Steve Alberty's patch for complete table dump, +// modified by Lem9 to allow older MySQL versions to continue to work + + if(MYSQL_MAJOR_VERSION == "3.23"){ + $result=mysql_query("show create table $db.$table"); + if ($result!=false && mysql_num_rows($result)>0){ + $tmpres=mysql_fetch_array($result); + $tmp=$tmpres[1]; + $schema_create.=str_replace("\n",$crlf,$tmp); + } + return $schema_create; + } + $schema_create .= "CREATE TABLE $table ($crlf"; $result = mysql_query("SHOW FIELDS FROM $db.$table") or mysql_die();