support FULLTEXT in table copy or dump

This commit is contained in:
Marc Delisle
2001-05-11 20:15:48 +00:00
parent 8e3f1e20cf
commit 48872783fc
2 changed files with 15 additions and 4 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2001-05-11 Marc Delisle <lem9@users.sourceforge.net>
* support FULLTEXT in table copy or dump
2001-05-11 Armel Fauveau <armel.fauveau@globalis-ms.com> 2001-05-11 Armel Fauveau <armel.fauveau@globalis-ms.com>
* Added a "delete" option in the phpMyBookmark patch (Olivier Mueller) * Added a "delete" option in the phpMyBookmark patch (Olivier Mueller)

View File

@@ -449,9 +449,13 @@ function get_table_def($db, $table, $crlf)
$result = mysql_db_query($db, "SHOW KEYS FROM $table") or mysql_die(); $result = mysql_db_query($db, "SHOW KEYS FROM $table") or mysql_die();
while($row = mysql_fetch_array($result)) while($row = mysql_fetch_array($result))
{ {
$kname=$row['Key_name']; $kname=$row['Key_name'];
$comment=$row['Comment'];
if(($kname != "PRIMARY") && ($row['Non_unique'] == 0)) if(($kname != "PRIMARY") && ($row['Non_unique'] == 0))
$kname="UNIQUE|$kname"; $kname="UNIQUE|$kname";
if($comment=="FULLTEXT")
$kname="FULLTEXT|$kname";
if(!isset($index[$kname])) if(!isset($index[$kname]))
$index[$kname] = array(); $index[$kname] = array();
$index[$kname][] = $row['Column_name']; $index[$kname][] = $row['Column_name'];
@@ -461,11 +465,15 @@ function get_table_def($db, $table, $crlf)
{ {
$schema_create .= ",$crlf"; $schema_create .= ",$crlf";
if($x == "PRIMARY") if($x == "PRIMARY")
$schema_create .= " PRIMARY KEY (" . implode($columns, ", ") . ")"; $schema_create .= " PRIMARY KEY (";
elseif (substr($x,0,6) == "UNIQUE") elseif (substr($x,0,6) == "UNIQUE")
$schema_create .= " UNIQUE ".substr($x,7)." (" . implode($columns, ", ") . ")"; $schema_create .= " UNIQUE " .substr($x,7)." (";
elseif (substr($x,0,8) == "FULLTEXT")
$schema_create .= " FULLTEXT ".substr($x,9)." (";
else else
$schema_create .= " KEY $x (" . implode($columns, ", ") . ")"; $schema_create .= " KEY $x (";
$schema_create .= implode($columns,", ") . ")";
} }
$schema_create .= "$crlf)"; $schema_create .= "$crlf)";