Fix UPDATE export with extended inserts enabled (bug#1482103), fix export type selection.

This commit is contained in:
Michal Čihař
2006-05-05 09:20:17 +00:00
parent 9975cb99f9
commit cd55bb7ccb
2 changed files with 9 additions and 5 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog
$Id$
$Source$
2006-05-05 Michal Čihař <michal@cihar.com>
* libraries/export/sql.php: Fix UPDATE export with extended inserts
enabled (bug#1482103), fix export type selection.
2006-05-03 Michal Čihař <michal@cihar.com>
* Documentation.html: Document OpenDocument export and various fixes.

View File

@@ -635,7 +635,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
}
}
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'update') {
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'UPDATE') {
// update
$schema_insert = 'UPDATE ';
if (isset($GLOBALS['sql_ignore'])) {
@@ -644,7 +644,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
$schema_insert .= PMA_backquote($table, $sql_use_backquotes) . ' SET ';
} else {
// insert or replace
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'replace') {
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'REPLACE') {
$sql_command = 'REPLACE';
} else {
$sql_command = 'INSERT';
@@ -658,7 +658,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
}
// insert ignore?
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'insert' && isset($GLOBALS['sql_ignore'])) {
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'INSERT' && isset($GLOBALS['sql_ignore'])) {
$insert_delayed .= ' IGNORE';
}
@@ -677,7 +677,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
$replace = array('\0', '\n', '\r', '\Z');
$current_row = 0;
$query_size = 0;
if (isset($GLOBALS['sql_extended'])) {
if (isset($GLOBALS['sql_extended']) && (!isset($GLOBALS['sql_type']) || $GLOBALS['sql_type'] != 'UPDATE')) {
$separator = ',';
$schema_insert .= $crlf;
} else {
@@ -718,7 +718,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
} // end for
// should we make update?
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'update') {
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'UPDATE') {
$insert_line = $schema_insert;
for ($i = 0; $i < $fields_cnt; $i++) {