Fix UPDATE export with extended inserts enabled (bug#1482103), fix export type selection.
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$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>
|
2006-05-03 Michal Čihař <michal@cihar.com>
|
||||||
* Documentation.html: Document OpenDocument export and various fixes.
|
* Documentation.html: Document OpenDocument export and various fixes.
|
||||||
|
|
||||||
|
@@ -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
|
// update
|
||||||
$schema_insert = 'UPDATE ';
|
$schema_insert = 'UPDATE ';
|
||||||
if (isset($GLOBALS['sql_ignore'])) {
|
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 ';
|
$schema_insert .= PMA_backquote($table, $sql_use_backquotes) . ' SET ';
|
||||||
} else {
|
} else {
|
||||||
// insert or replace
|
// insert or replace
|
||||||
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'replace') {
|
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'REPLACE') {
|
||||||
$sql_command = 'REPLACE';
|
$sql_command = 'REPLACE';
|
||||||
} else {
|
} else {
|
||||||
$sql_command = 'INSERT';
|
$sql_command = 'INSERT';
|
||||||
@@ -658,7 +658,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// insert ignore?
|
// 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';
|
$insert_delayed .= ' IGNORE';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -677,7 +677,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
|||||||
$replace = array('\0', '\n', '\r', '\Z');
|
$replace = array('\0', '\n', '\r', '\Z');
|
||||||
$current_row = 0;
|
$current_row = 0;
|
||||||
$query_size = 0;
|
$query_size = 0;
|
||||||
if (isset($GLOBALS['sql_extended'])) {
|
if (isset($GLOBALS['sql_extended']) && (!isset($GLOBALS['sql_type']) || $GLOBALS['sql_type'] != 'UPDATE')) {
|
||||||
$separator = ',';
|
$separator = ',';
|
||||||
$schema_insert .= $crlf;
|
$schema_insert .= $crlf;
|
||||||
} else {
|
} else {
|
||||||
@@ -718,7 +718,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
|||||||
} // end for
|
} // end for
|
||||||
|
|
||||||
// should we make update?
|
// 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;
|
$insert_line = $schema_insert;
|
||||||
for ($i = 0; $i < $fields_cnt; $i++) {
|
for ($i = 0; $i < $fields_cnt; $i++) {
|
||||||
|
Reference in New Issue
Block a user