diff --git a/ChangeLog b/ChangeLog index 48ced4111..6337a873c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA thanks to Martin Stricker - martinstricker - bug #2186823 [core] bad session.save_path not detected - bug #2202709 [core] Re-login causes PMA to forget current table name +- bug #2280904 [export] do not include view name in export 3.1.0.0 (not yet released) + [auth] Support for Swekey hardware authentication, diff --git a/libraries/export/sql.php b/libraries/export/sql.php index 0780db202..ec5085f49 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -244,13 +244,13 @@ function PMA_exportHeader() // so that a utility like the mysql client can interpret // the file correctly if (isset($GLOBALS['charset_of_file']) && isset($mysql_charset_map[$GLOBALS['charset_of_file']])) { - // $cfg['AllowAnywhereRecoding'] was true so we got a charset from + // $cfg['AllowAnywhereRecoding'] was true so we got a charset from // the export dialog $set_names = $mysql_charset_map[$GLOBALS['charset_of_file']]; } else { // by default we use the connection charset - $set_names = $mysql_charset_map[$GLOBALS['charset']]; - } + $set_names = $mysql_charset_map[$GLOBALS['charset']]; + } $head .= $crlf . '/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;' . $crlf . '/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;' . $crlf @@ -350,7 +350,7 @@ function PMA_exportDBFooter($db) } if ($procedure_names) { - $text .= + $text .= PMA_exportComment() . PMA_exportComment($GLOBALS['strProcedures']) . PMA_exportComment(); @@ -358,13 +358,13 @@ function PMA_exportDBFooter($db) foreach($procedure_names as $procedure_name) { if (! empty($GLOBALS['sql_drop_table'])) { $text .= 'DROP PROCEDURE IF EXISTS ' . PMA_backquote($procedure_name) . $delimiter . $crlf; - } + } $text .= PMA_DBI_get_definition($db, 'PROCEDURE', $procedure_name) . $delimiter . $crlf . $crlf; } } if ($function_names) { - $text .= + $text .= PMA_exportComment() . PMA_exportComment($GLOBALS['strFunctions']) . PMA_exportComment(); @@ -372,13 +372,13 @@ function PMA_exportDBFooter($db) foreach($function_names as $function_name) { if (! empty($GLOBALS['sql_drop_table'])) { $text .= 'DROP FUNCTION IF EXISTS ' . PMA_backquote($function_name) . $delimiter . $crlf; - } + } $text .= PMA_DBI_get_definition($db, 'FUNCTION', $function_name) . $delimiter . $crlf . $crlf; } } if ($event_names) { - $text .= + $text .= PMA_exportComment() . PMA_exportComment($GLOBALS['strEvents']) . PMA_exportComment(); @@ -386,7 +386,7 @@ function PMA_exportDBFooter($db) foreach($event_names as $event_name) { if (! empty($GLOBALS['sql_drop_table'])) { $text .= 'DROP EVENT ' . PMA_backquote($event_name) . $delimiter . $crlf; - } + } $text .= PMA_DBI_get_definition($db, 'EVENT', $event_name) . $delimiter . $crlf . $crlf; } } @@ -442,7 +442,7 @@ function PMA_getTableDefStandIn($db, $view, $crlf) { * @param string the end of line sequence * @param string the url to go back in case of error * @param boolean whether to include creation/update/check dates - * @param boolean whether to add semicolon and end-of-line at the end + * @param boolean whether to add semicolon and end-of-line at the end * * @return string resulting schema * @@ -518,7 +518,12 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false, $a // Note: SHOW CREATE TABLE, at least in MySQL 5.1.23, does not // produce a displayable result for the default value of a BIT // field, nor does the mysqldump command. See MySQL bug 35796 - $result = PMA_DBI_try_query('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table)); + /* + * We have to select database and not use database name in SHOW CREATE, + * otherwise CREATE statement can include database name. + */ + PMA_DBI_select_db($db); + $result = PMA_DBI_try_query('SHOW CREATE TABLE ' . PMA_backquote($table)); // an error can happen, for example the table is crashed $tmp_error = PMA_DBI_getError(); if ($tmp_error) { @@ -844,7 +849,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) // a possible error: the table has crashed $tmp_error = PMA_DBI_getError(); if ($tmp_error) { - return PMA_exportOutputHandler(PMA_exportComment($GLOBALS['strInUse'] . ' (' . $tmp_error . ')')); + return PMA_exportOutputHandler(PMA_exportComment($GLOBALS['strInUse'] . ' (' . $tmp_error . ')')); } if ($result != FALSE) {