From d8b9a0b28caa7e19849f84721a58f76c4b3e161f Mon Sep 17 00:00:00 2001 From: ayusun Date: Thu, 16 May 2013 20:52:50 +0530 Subject: [PATCH 1/2] creating database while exporting at database level --- export.php | 3 +++ libraries/plugins/export/ExportSql.class.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/export.php b/export.php index 90064006ae..0e994ff848 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 ca17a2d617..4481013721 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); @@ -1873,4 +1873,4 @@ class ExportSql extends ExportPlugin return true; } // end of the 'exportData()' function -} \ No newline at end of file +} From a13b1f41f563f1a12fbcdcc2c4ec9906e90100c3 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 20 May 2013 08:10:42 -0400 Subject: [PATCH 2/2] ChangeLog entry for Missing CREATE DATABASE statement when exporting at database level --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 30e02f6600..c087497ec4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,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