diff --git a/ChangeLog b/ChangeLog index 50fbb1e09..a86e320e8 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-12-11 Michal Cihar + * libraries/export/sql.php: Fix moving foreign key definition on Windows + (bug #851950). + 2003-12-11 Marc Delisle * tbl_replace.php: missing number of rows for Affected rows and Inserted rows; wrong message for insert ids diff --git a/libraries/export/sql.php b/libraries/export/sql.php index 622bfee01..3a2c1d7a1 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -209,7 +209,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false) . (($use_backquotes) ? PMA_backquote($tmpres[0]) : $tmpres[0]) . substr($tmpres[1], $pos); $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($GLOBALS['no_constraints_comments'])) { $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 .= '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"; - $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]; } @@ -515,4 +515,4 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) return TRUE; } // end of the 'PMA_exportData()' function -?> \ No newline at end of file +?>