diff --git a/ChangeLog b/ChangeLog index 74b0718234..ed19fd9d7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ phpMyAdmin - ChangeLog - bug #3936 Query profiler chart not loading from SQL Query page - bug #3946 Missing CSV import option "Do not abort on INSERT error" - bug #3943 Missing Operations>Table options>AUTO_INCREMENT +- bug Missing CREATE DATABASE statement when exporting at database level 4.0.1.0 (2013-05-14) - bug #3879 Import broken for CSV using LOAD DATA diff --git a/export.php b/export.php index affda8e2c2..c1525e1299 100644 --- a/export.php +++ b/export.php @@ -720,6 +720,9 @@ do { if (! $export_plugin->exportDBHeader($db)) { break; } + if (! $export_plugin->exportDBCreate($db)) { + break; + } if (method_exists($export_plugin, 'exportRoutines') && strpos($GLOBALS['sql_structure_or_data'], 'structure') !== false diff --git a/libraries/plugins/export/ExportSql.class.php b/libraries/plugins/export/ExportSql.class.php index 42c8ac6d27..6865a66719 100644 --- a/libraries/plugins/export/ExportSql.class.php +++ b/libraries/plugins/export/ExportSql.class.php @@ -706,7 +706,7 @@ class ExportSql extends ExportPlugin return false; } } - $create_query = 'CREATE DATABASE ' + $create_query = 'CREATE DATABASE IF NOT EXISTS ' . (isset($GLOBALS['sql_backquotes']) ? PMA_Util::backquoteCompat($db, $compat) : $db); $collation = PMA_getDbCollation($db);