Fix moving foreign key definition on Windows (bug #851950).
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2003-12-11 Michal Cihar <imreallyaway@cihar.com>
|
||||||
|
* libraries/export/sql.php: Fix moving foreign key definition on Windows
|
||||||
|
(bug #851950).
|
||||||
|
|
||||||
2003-12-11 Marc Delisle <lem9@users.sourceforge.net>
|
2003-12-11 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* tbl_replace.php: missing number of rows for Affected rows
|
* tbl_replace.php: missing number of rows for Affected rows
|
||||||
and Inserted rows; wrong message for insert ids
|
and Inserted rows; wrong message for insert ids
|
||||||
|
@@ -209,7 +209,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
|
|||||||
. (($use_backquotes) ? PMA_backquote($tmpres[0]) : $tmpres[0])
|
. (($use_backquotes) ? PMA_backquote($tmpres[0]) : $tmpres[0])
|
||||||
. substr($tmpres[1], $pos);
|
. substr($tmpres[1], $pos);
|
||||||
$tmpres[1] = str_replace("\n", $crlf, $tmpres[1]);
|
$tmpres[1] = str_replace("\n", $crlf, $tmpres[1]);
|
||||||
if (preg_match_all('((,\n[\s]*(CONSTRAINT|FOREIGN[\s]*KEY)[^\n,]+)+)', $tmpres[1], $regs)) {
|
if (preg_match_all('((,\r?\n[\s]*(CONSTRAINT|FOREIGN[\s]*KEY)[^\r\n,]+)+)', $tmpres[1], $regs)) {
|
||||||
if (!isset($sql_constraints)) {
|
if (!isset($sql_constraints)) {
|
||||||
if (isset($GLOBALS['no_constraints_comments'])) {
|
if (isset($GLOBALS['no_constraints_comments'])) {
|
||||||
$sql_constraints = '';
|
$sql_constraints = '';
|
||||||
@@ -223,9 +223,9 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
|
|||||||
$sql_constraints .= $crlf .'#' . $crlf .'# ' . $GLOBALS['strConstraintsForTable'] . ' ' . PMA_backquote($table) . $crlf . '#' . $crlf;
|
$sql_constraints .= $crlf .'#' . $crlf .'# ' . $GLOBALS['strConstraintsForTable'] . ' ' . PMA_backquote($table) . $crlf . '#' . $crlf;
|
||||||
}
|
}
|
||||||
$sql_constraints .= 'ALTER TABLE ' . PMA_backquote($table) . $crlf
|
$sql_constraints .= 'ALTER TABLE ' . PMA_backquote($table) . $crlf
|
||||||
. preg_replace('/(,\n|^)([\s]*)(CONSTRAINT|FOREIGN[\s]*KEY)/', '\1\2ADD \3', substr($regs[0][0], 2))
|
. preg_replace('/(,\r?\n|^)([\s]*)(CONSTRAINT|FOREIGN[\s]*KEY)/', '\1\2ADD \3', substr($regs[0][0], 2))
|
||||||
. ";\n";
|
. ";\n";
|
||||||
$tmpres[1] = preg_replace('((,\n[\s]*(CONSTRAINT|FOREIGN[\s]*KEY)[^\n,]+)+)', '', $tmpres[1]);
|
$tmpres[1] = preg_replace('((,\r?\n[\s]*(CONSTRAINT|FOREIGN[\s]*KEY)[^\r\n,]+)+)', '', $tmpres[1]);
|
||||||
}
|
}
|
||||||
$schema_create .= $tmpres[1];
|
$schema_create .= $tmpres[1];
|
||||||
}
|
}
|
||||||
@@ -515,4 +515,4 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} // end of the 'PMA_exportData()' function
|
} // end of the 'PMA_exportData()' function
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user