patch #2961540 Do not export data of MERGE table

This commit is contained in:
Marc Delisle
2010-03-05 12:44:34 +00:00
parent 5d96387808
commit d47fce3ee3
3 changed files with 13 additions and 4 deletions

View File

@@ -55,6 +55,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- bug #2953050 [export] export VIEW as SQL includes INSERT statement
- bug #2942032 [core] Cannot detect PmaAbsoluteUri correctly on Windows
- bug #2961609 [auth] Potential information disclosure at login page
- patch #2961540 [export] Do not export data of MERGE table,
thanks to Dieter Adriaenssens - ruleant
3.3.0.0 (not yet released)
+ rfe #2308632 [edit] Use hex for (var)binary fields,

View File

@@ -438,7 +438,8 @@ if ($export_type == 'server') {
break 3;
}
}
if (isset($GLOBALS[$what . '_data']) && ! $is_view) {
// if this is a view or a merge table, don't export data
if (isset($GLOBALS[$what . '_data']) && !($is_view || (strcasecmp(PMA_Table::sGetStatusInfo($current_db, $table, 'Engine'),'MRG_MYISAM') == 0))) {
$local_query = 'SELECT * FROM ' . PMA_backquote($current_db) . '.' . PMA_backquote($table);
if (!PMA_exportData($current_db, $table, $crlf, $err_url, $local_query)) {
break 3;
@@ -486,7 +487,8 @@ if ($export_type == 'server') {
break 2;
}
}
if (isset($GLOBALS[$what . '_data']) && ! $is_view) {
// if this is a view or a merge table, don't export data
if (isset($GLOBALS[$what . '_data']) && !($is_view || (strcasecmp(PMA_Table::sGetStatusInfo($db, $table, 'Engine'),'MRG_MYISAM') == 0))) {
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) {
break 2;
@@ -534,7 +536,9 @@ if ($export_type == 'server') {
}
// If this is an export of a single view, we have to export data;
// for example, a PDF report
if (isset($GLOBALS[$what . '_data'])) {
// if it is a merge table, no data is exported
$is_merge = ! PMA_Table::isView($db, $table) && (strcasecmp(PMA_Table::sGetStatusInfo($db, $table, 'Engine'),'MRG_MYISAM') == 0);
if (isset($GLOBALS[$what . '_data']) && ! $is_merge) {
if (!empty($sql_query)) {
// only preg_replace if needed
if (!empty($add_query)) {

View File

@@ -104,7 +104,10 @@ echo PMA_pluginGetJavascript($export_list);
//]]>
</script>
<?php if (strlen($table) && ! isset($num_tables)) { ?>
<?php
$is_merge = ! PMA_Table::isView($db, $table) && (strcasecmp(PMA_Table::sGetStatusInfo($db, $table, 'Engine'),'MRG_MYISAM') == 0);
if (strlen($table) && ! isset($num_tables) && ! $is_merge) {
?>
<div class="formelementrow">
<?php
echo '<input type="radio" name="allrows" value="0" id="radio_allrows_0" checked="checked" />';