Improved the way the import destination is decided upon.

This commit is contained in:
Derek Schaefer
2009-09-02 17:28:35 +00:00
parent d545682b62
commit c261b73045
2 changed files with 16 additions and 4 deletions

View File

@@ -262,13 +262,14 @@ for ($i = 0; $i < $len; ++$i) {
/* Set database name to the currently selected one, if applicable */ /* Set database name to the currently selected one, if applicable */
if (strlen($db)) { if (strlen($db)) {
$db_name = $db; $db_name = $db;
$options = array('create_db' => false);
} else { } else {
$db_name = 'ODS_DB'; $db_name = 'ODS_DB';
$options = NULL;
} }
/* Non-applicable parameters */ /* Non-applicable parameters */
$create = NULL; $create = NULL;
$options = NULL;
/* Created and execute necessary SQL statements from data */ /* Created and execute necessary SQL statements from data */
PMA_buildSQL($db_name, $tables, $analyses, $create, $options); PMA_buildSQL($db_name, $tables, $analyses, $create, $options);

View File

@@ -278,11 +278,22 @@ if ($data_present) {
* array $options = an associative array of options * array $options = an associative array of options
*/ */
/* Set database collation/charset */ /* Set database name to the currently selected one, if applicable */
$options = array( if (strlen($db)) {
/* Override the database name in the XML file, if one is selected */
$db_name = $db;
$options = array('create_db' => false);
} else {
if ($db_name === NULL) {
$db_name = 'XML_DB';
}
/* Set database collation/charset */
$options = array(
'db_collation' => $collation, 'db_collation' => $collation,
'db_charset' => $charset, 'db_charset' => $charset,
); );
}
/* Created and execute necessary SQL statements from data */ /* Created and execute necessary SQL statements from data */
PMA_buildSQL($db_name, $tables, $analyses, $create, $options); PMA_buildSQL($db_name, $tables, $analyses, $create, $options);