Merge branch 'master' into plugins-and-OOP

This commit is contained in:
Alex Marin 2012-08-07 09:42:28 +03:00
commit b06eca517f
29 changed files with 2216 additions and 1254 deletions

View File

@ -43,6 +43,7 @@ VerboseMultiSubmit, ReplaceHelpImg
+ Add Ajax support to Fast filter in order to search the term in all database tables
- bug #3535015 [navi] DbFilter, TableFilter clear button hidden on Chrome
+ rfe #3528994 [interface] Allow wrapping possibly long values in replication-status table
+ [interface] Autoselect username input on cookie login page
3.5.3.0 (not yet released)
- bug #3539044 [interface] Browse mode "Show" button gives blank page if no results anymore
@ -55,6 +56,12 @@ VerboseMultiSubmit, ReplaceHelpImg
- bug #3547825 [edit] BLOB download no longer works
- bug #3541966 [config] Error in generated configuration arrray
- bug #3553551 [GUI] Invalid HTML code in multi submits confirmation form
- [interface] Designer sometimes places tables on the top menu
- bug #3546277 [core] Call to undefined function __() when config file has wrong permissions
- bug #3540922 [edit] Error searching table with many fields
3.5.2.1 (2012-08-03)
- [security] Fixed local path disclosure vulnerability, see PMASA-2012-3
3.5.2.0 (2012-07-07)
- bug #3521416 [interface] JS error when editing index
@ -164,11 +171,11 @@ VerboseMultiSubmit, ReplaceHelpImg
+ patch #3303195 [interface] Checkbox to have SQL input remain
- patch #3472899 [export] Fixed CSV escape for the export
- patch #3475424 [import] Fixed CSV escape for the import
- bug #3482734 [interface] No warning on syntax error in search form
- bug #3482734 [interface] No warning on syntax error in search form
- bug #3423717 [core] Improved detection of SSL connection
+ FULLTEXT support for InnoDB, starting with MySQL 5.6.4
- bug #3497151 [interface] Duplicate inline query edit box
- bug #3504567 [mime] Description of the transformation missing in the tooltip
- bug #3504567 [mime] Description of the transformation missing in the tooltip
3.4.11.0 (2012-04-14)
- bug #3486970 [import] Exception on XML import

View File

@ -18,6 +18,11 @@
require_once 'libraries/common.inc.php';
require_once 'libraries/mysql_charsets.lib.php';
/**
* functions implementation for this script
*/
require_once 'libraries/operations.lib.php';
// add a javascript file for jQuery functions to handle Ajax actions
$response = PMA_Response::getInstance();
$header = $response->getHeader();
@ -25,76 +30,27 @@ $scripts = $header->getScripts();
$scripts->addFile('db_operations.js');
$common_functions = PMA_CommonFunctions::getInstance();
/**
* Sets globals from $_REQUEST (we're using GET on ajax, POST otherwise)
*/
$request_params = array(
'add_constraints',
'comment',
'create_database_before_copying',
'db_collation',
'db_copy',
'db_rename',
'drop_if_exists',
'newname',
'sql_auto_increment',
'submitcollation',
'switch_to_new',
'what'
);
foreach ($request_params as $one_request_param) {
if (isset($_REQUEST[$one_request_param])) {
$GLOBALS[$one_request_param] = $_REQUEST[$one_request_param];
}
}
/**
* Rename/move or copy database
*/
if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
if (strlen($db) && (! empty($_REQUEST['db_rename']) || ! empty($_REQUEST['db_copy']))) {
if (! empty($db_rename)) {
if (! empty($_REQUEST['db_rename'])) {
$move = true;
} else {
$move = false;
}
if (! isset($newname) || ! strlen($newname)) {
if (! isset($_REQUEST['newname']) || ! strlen($_REQUEST['newname'])) {
$message = PMA_Message::error(__('The database name is empty!'));
} else {
$sql_query = ''; // in case target db exists
$_error = false;
if ($move
|| (isset($create_database_before_copying)
&& $create_database_before_copying)
|| (isset($_REQUEST['create_database_before_copying'])
&& $_REQUEST['create_database_before_copying'])
) {
// lower_case_table_names=1 `DB` becomes `db`
if (! PMA_DRIZZLE) {
$lower_case_table_names = PMA_DBI_fetch_value(
'SHOW VARIABLES LIKE "lower_case_table_names"', 0, 1
);
if ($lower_case_table_names === '1') {
$newname = PMA_strtolower($newname);
}
}
$local_query = 'CREATE DATABASE ' . $common_functions->backquote($newname);
if (isset($db_collation)) {
$local_query .= ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation);
}
$local_query .= ';';
$sql_query = $local_query;
// save the original db name because Tracker.class.php which
// may be called under PMA_DBI_query() changes $GLOBALS['db']
// for some statements, one of which being CREATE DATABASE
$original_db = $db;
PMA_DBI_query($local_query);
$db = $original_db;
unset($original_db);
// rebuild the database list because PMA_Table::moveCopy
// checks in this list if the target db exists
$GLOBALS['pma']->databases->build();
$sql_query = PMA_getSqlQueryAndCreateDbBeforeCopy();
}
// here I don't use DELIMITER because it's not part of the
@ -103,37 +59,12 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
// to avoid selecting alternatively the current and new db
// we would need to modify the CREATE definitions to qualify
// the db name
$procedure_names = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE');
if ($procedure_names) {
foreach ($procedure_names as $procedure_name) {
PMA_DBI_select_db($db);
$tmp_query = PMA_DBI_get_definition($db, 'PROCEDURE', $procedure_name);
// collect for later display
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
PMA_DBI_select_db($newname);
PMA_DBI_query($tmp_query);
}
}
$function_names = PMA_DBI_get_procedures_or_functions($db, 'FUNCTION');
if ($function_names) {
foreach ($function_names as $function_name) {
PMA_DBI_select_db($db);
$tmp_query = PMA_DBI_get_definition($db, 'FUNCTION', $function_name);
// collect for later display
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
PMA_DBI_select_db($newname);
PMA_DBI_query($tmp_query);
}
}
PMA_runProcedureAndFunctionDefinitions($db);
// go back to current db, just in case
PMA_DBI_select_db($db);
$GLOBALS['sql_constraints_query_full_db'] = array();
$tables_full = PMA_DBI_get_tables_full($db);
$views = array();
require_once "libraries/plugin_interface.lib.php";
// remove all foreign key constraints, otherwise we can get errors
@ -145,173 +76,43 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
'single_table' => isset($single_table)
)
);
foreach ($tables_full as $each_table => $tmp) {
$sql_constraints = '';
$sql_drop_foreign_keys = '';
$sql_structure = $export_sql_plugin->getTableDef(
$db, $each_table, "\n", '', false, false
$GLOBALS['sql_constraints_query_full_db'] =
PMA_getSqlConstraintsQueryForFullDb(
$tables_full, $export_sql_plugin, $move, $db
);
if ($move && ! empty($sql_drop_foreign_keys)) {
PMA_DBI_query($sql_drop_foreign_keys);
}
// keep the constraint we just dropped
if (! empty($sql_constraints)) {
$GLOBALS['sql_constraints_query_full_db'][] = $sql_constraints;
}
}
unset($sql_constraints, $sql_drop_foreign_keys, $sql_structure);
foreach ($tables_full as $each_table => $tmp) {
// to be able to rename a db containing views,
// first all the views are collected and a stand-in is created
// the real views are created after the tables
if (PMA_Table::isView($db, $each_table)) {
$views[] = $each_table;
// Create stand-in definition to resolve view dependencies
$sql_view_standin = $export_sql_plugin->getTableDefStandIn(
$db, $each_table, "\n"
);
PMA_DBI_select_db($newname);
PMA_DBI_query($sql_view_standin);
$GLOBALS['sql_query'] .= "\n" . $sql_view_standin;
}
}
$views = PMA_getViewsAndCreateSqlViewStandIn(
$tables_full, $export_sql_plugin, $db
);
foreach ($tables_full as $each_table => $tmp) {
// skip the views; we have creted stand-in definitions
if (PMA_Table::isView($db, $each_table)) {
continue;
}
$back = $sql_query;
$sql_query = '';
// value of $what for this table only
$this_what = $what;
// do not copy the data from a Merge table
// note: on the calling FORM, 'data' means 'structure and data'
if (PMA_Table::isMerge($db, $each_table)) {
if ($this_what == 'data') {
$this_what = 'structure';
}
if ($this_what == 'dataonly') {
$this_what = 'nocopy';
}
}
if ($this_what != 'nocopy') {
// keep the triggers from the original db+table
// (third param is empty because delimiters are only intended
// for importing via the mysql client or our Import feature)
$triggers = PMA_DBI_get_triggers($db, $each_table, '');
if (! PMA_Table::moveCopy(
$db, $each_table, $newname, $each_table,
isset($this_what) ? $this_what : 'data',
$move, 'db_copy'
)) {
$_error = true;
// $sql_query is filled by PMA_Table::moveCopy()
$sql_query = $back . $sql_query;
break;
}
// apply the triggers to the destination db+table
if ($triggers) {
PMA_DBI_select_db($newname);
foreach ($triggers as $trigger) {
PMA_DBI_query($trigger['create']);
$GLOBALS['sql_query'] .= "\n" . $trigger['create'] . ';';
}
unset($trigger);
}
unset($triggers);
// this does not apply to a rename operation
if (isset($GLOBALS['add_constraints'])
&& ! empty($GLOBALS['sql_constraints_query'])
) {
$GLOBALS['sql_constraints_query_full_db'][] = $GLOBALS['sql_constraints_query'];
unset($GLOBALS['sql_constraints_query']);
}
}
// $sql_query is filled by PMA_Table::moveCopy()
$sql_query = $back . $sql_query;
} // end (foreach)
unset($each_table);
list($sql_query, $_error) = PMA_getSqlQueryForCopyTable(
$tables_full, $sql_query, $move, $db
);
// handle the views
if (! $_error) {
// temporarily force to add DROP IF EXIST to CREATE VIEW query,
// to remove stand-in VIEW that was created earlier
if (isset($GLOBALS['drop_if_exists'])) {
$temp_drop_if_exists = $GLOBALS['drop_if_exists'];
}
$GLOBALS['drop_if_exists'] = 'true';
foreach ($views as $view) {
if (! PMA_Table::moveCopy($db, $view, $newname, $view, 'structure', $move, 'db_copy')) {
$_error = true;
break;
}
}
unset($GLOBALS['drop_if_exists']);
if (isset($temp_drop_if_exists)) {
// restore previous value
$GLOBALS['drop_if_exists'] = $temp_drop_if_exists;
unset($temp_drop_if_exists);
}
$_error = PMA_handleTheViews($views, $move, $db);
}
unset($view, $views);
unset($views);
// now that all tables exist, create all the accumulated constraints
if (! $_error && count($GLOBALS['sql_constraints_query_full_db']) > 0) {
PMA_DBI_select_db($newname);
foreach ($GLOBALS['sql_constraints_query_full_db'] as $one_query) {
PMA_DBI_query($one_query);
// and prepare to display them
$GLOBALS['sql_query'] .= "\n" . $one_query;
}
unset($GLOBALS['sql_constraints_query_full_db'], $one_query);
PMA_createAllAccumulatedConstraints();
}
if (! PMA_DRIZZLE && PMA_MYSQL_INT_VERSION >= 50100) {
// here DELIMITER is not used because it's not part of the
// language; each statement is sent one by one
// to avoid selecting alternatively the current and new db
// we would need to modify the CREATE definitions to qualify
// the db name
$event_names = PMA_DBI_fetch_result(
'SELECT EVENT_NAME FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \''
. $common_functions->sqlAddSlashes($db, true) . '\';'
);
if ($event_names) {
foreach ($event_names as $event_name) {
PMA_DBI_select_db($db);
$tmp_query = PMA_DBI_get_definition($db, 'EVENT', $event_name);
// collect for later display
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
PMA_DBI_select_db($newname);
PMA_DBI_query($tmp_query);
}
}
PMA_runEventDefinitionsForDb($db);
}
// go back to current db, just in case
PMA_DBI_select_db($db);
// Duplicate the bookmarks for this db (done once for each db)
if (! $_error && $db != $newname) {
$get_fields = array('user', 'label', 'query');
$where_fields = array('dbase' => $db);
$new_fields = array('dbase' => $newname);
PMA_Table::duplicateInfo(
'bookmarkwork', 'bookmark', $get_fields,
$where_fields, $new_fields
);
}
PMA_duplicateBookmarks($_error, $db);
if (! $_error && $move) {
/**
* cleanup pmadb stuff for this db
@ -326,21 +127,21 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
$message = PMA_Message::success(__('Database %1$s has been renamed to %2$s'));
$message->addParam($db);
$message->addParam($newname);
$message->addParam($_REQUEST['newname']);
} elseif (! $_error) {
$message = PMA_Message::success(__('Database %1$s has been copied to %2$s'));
$message->addParam($db);
$message->addParam($newname);
$message->addParam($_REQUEST['newname']);
}
$reload = true;
/* Change database to be used */
if (! $_error && $move) {
$db = $newname;
$db = $_REQUEST['newname'];
} elseif (! $_error) {
if (isset($switch_to_new) && $switch_to_new == 'true') {
if (isset($_REQUEST['switch_to_new']) && $_REQUEST['switch_to_new'] == 'true') {
$GLOBALS['PMA_Config']->setCookie('pma_switch_to_new', 'true');
$db = $newname;
$db = $_REQUEST['newname'];
} else {
$GLOBALS['PMA_Config']->setCookie('pma_switch_to_new', '');
}
@ -359,7 +160,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
$response = PMA_Response::getInstance();
$response->isSuccess($message->isSuccess());
$response->addJSON('message', $message);
$response->addJSON('newname', $newname);
$response->addJSON('newname', $_REQUEST['newname']);
$response->addJSON(
'sql_query',
$common_functions->getMessage(null, $sql_query)
@ -368,7 +169,6 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
}
}
/**
* Settings for relations stuff
*/
@ -380,7 +180,7 @@ $cfgRelation = PMA_getRelationsParam();
* (must be done before displaying the menu tabs)
*/
if (isset($_REQUEST['comment'])) {
PMA_setDbComment($db, $comment);
PMA_setDbComment($db, $_REQUEST['comment']);
}
/**
@ -402,7 +202,7 @@ if (empty($is_info)) {
}
}
$db_collation = PMA_getDbCollation($db);
$_REQUEST['db_collation'] = PMA_getDbCollation($db);
$is_information_schema = PMA_is_system_schema($db);
if (!$is_information_schema) {
@ -410,237 +210,69 @@ if (!$is_information_schema) {
/**
* database comment
*/
?>
<div class="operations_half_width">
<form method="post" action="db_operations.php">
<?php echo PMA_generate_common_hidden_inputs($db); ?>
<fieldset>
<legend>
<?php
if ($cfg['PropertiesIconic']) {
echo '<img class="icon ic_b_comment" src="themes/dot.gif" alt="" />';
}
echo __('Database comment: ');
?>
</legend>
<input type="text" name="comment" class="textfield" size="30"
value="<?php
echo htmlspecialchars(PMA_getDBComment($db)); ?>" />
</fieldset>
<fieldset class="tblFooters">
<input type="submit" value="<?php echo __('Go'); ?>" />
</fieldset>
</form>
</div>
<?php
$response->addHTML(PMA_getHtmlForDatabaseComment($db));
}
?>
<div class="operations_half_width">
<?php include 'libraries/display_create_table.lib.php'; ?>
</div>
<?php
$response->addHTML('<div class="operations_half_width">');
ob_start();
include 'libraries/display_create_table.lib.php';
$content = ob_get_contents();
ob_end_clean();
$response->addHTML($content);
$response->addHTML('</div>');
/**
* rename database
*/
if ($db != 'mysql') {
?>
<div class="operations_half_width">
<form id="rename_db_form" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax" ' : ''); ?>method="post" action="db_operations.php"
onsubmit="return emptyFormElements(this, 'newname')">
<?php
if (isset($db_collation)) {
echo '<input type="hidden" name="db_collation" value="' . $db_collation
.'" />' . "\n";
if ($db != 'mysql') {
$response->addHTML(PMA_getHtmlForRenameDatabase($db));
}
?>
<input type="hidden" name="what" value="data" />
<input type="hidden" name="db_rename" value="true" />
<?php echo PMA_generate_common_hidden_inputs($db); ?>
<fieldset>
<legend>
<?php
if ($cfg['PropertiesIconic']) {
echo $common_functions->getImage('b_edit.png');
}
echo __('Rename database to') . ':';
?>
</legend>
<input id="new_db_name" type="text" name="newname" size="30" class="textfield" value="" />
</fieldset>
<fieldset class="tblFooters">
<input id="rename_db_input" type="submit" value="<?php echo __('Go'); ?>" />
</fieldset>
</form>
</div>
<?php
} // end if
// Drop link if allowed
// Don't even try to drop information_schema. You won't be able to. Believe me. You won't.
// Don't allow to easily drop mysql database, RFE #1327514.
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase'])
&& ! $db_is_information_schema
&& (PMA_DRIZZLE || $db != 'mysql')
) {
?>
<div class="operations_half_width">
<fieldset class="caution">
<legend><?php
if ($cfg['PropertiesIconic']) {
echo $common_functions->getImage('b_deltbl.png');
}
echo __('Remove database');
?></legend>
<ul>
<?php
$this_sql_query = 'DROP DATABASE ' . $common_functions->backquote($GLOBALS['db']);
$this_url_params = array(
'sql_query' => $this_sql_query,
'back' => 'db_operations.php',
'goto' => 'main.php',
'reload' => '1',
'purge' => '1',
'message_to_show' => sprintf(__('Database %s has been dropped.'), htmlspecialchars($common_functions->backquote($db))),
'db' => null,
);
?>
<li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="drop_db_anchor"' : ''); ?>>
<?php echo __('Drop the database (DROP)'); ?></a>
<?php echo $common_functions->showMySQLDocu('SQL-Syntax', 'DROP_DATABASE'); ?>
</li>
</ul>
</fieldset>
</div>
<?php
}
/**
* Copy database
*/
?>
<div class="operations_half_width clearfloat">
<form id="copy_db_form" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax" ' : ''); ?>method="post" action="db_operations.php"
onsubmit="return emptyFormElements(this, 'newname')">
<?php
if (isset($db_collation)) {
echo '<input type="hidden" name="db_collation" value="' . $db_collation
.'" />' . "\n";
}
echo '<input type="hidden" name="db_copy" value="true" />' . "\n";
echo PMA_generate_common_hidden_inputs($db);
?>
<fieldset>
<legend>
<?php
if ($cfg['PropertiesIconic']) {
echo $common_functions->getImage('b_edit.png');
}
echo __('Copy database to') . ':';
$drop_clause = 'DROP TABLE / DROP VIEW';
?>
</legend>
<input type="text" name="newname" size="30" class="textfield" value="" /><br />
<?php
$choices = array(
'structure' => __('Structure only'),
'data' => __('Structure and data'),
'dataonly' => __('Data only'));
echo $common_functions->getRadioFields(
'what', $choices, 'data', true
);
unset($choices);
?>
<input type="checkbox" name="create_database_before_copying" value="1"
id="checkbox_create_database_before_copying"
checked="checked" />
<label for="checkbox_create_database_before_copying">
<?php echo __('CREATE DATABASE before copying'); ?></label><br />
<input type="checkbox" name="drop_if_exists" value="true"
id="checkbox_drop" />
<label for="checkbox_drop"><?php echo sprintf(__('Add %s'), $drop_clause); ?></label><br />
<input type="checkbox" name="sql_auto_increment" value="1" checked="checked"
id="checkbox_auto_increment" />
<label for="checkbox_auto_increment">
<?php echo __('Add AUTO_INCREMENT value'); ?></label><br />
<input type="checkbox" name="add_constraints" value="1"
id="checkbox_constraints" />
<label for="checkbox_constraints">
<?php echo __('Add constraints'); ?></label><br />
<?php
unset($drop_clause);
if (isset($_COOKIE)
&& isset($_COOKIE['pma_switch_to_new'])
&& $_COOKIE['pma_switch_to_new'] == 'true'
// Drop link if allowed
// Don't even try to drop information_schema. You won't be able to. Believe me. You won't.
// Don't allow to easily drop mysql database, RFE #1327514.
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase'])
&& ! $db_is_information_schema
&& (PMA_DRIZZLE || $db != 'mysql')
) {
$pma_switch_to_new = 'true';
$response->addHTML(PMA_getHtmlForDropDatabaseLink($db));
}
?>
<input type="checkbox" name="switch_to_new" value="true"
id="checkbox_switch"
<?php echo ((isset($pma_switch_to_new) && $pma_switch_to_new == 'true') ? ' checked="checked"' : ''); ?>
/>
<label for="checkbox_switch"><?php echo __('Switch to copied database'); ?></label>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" name="submit_copy" value="<?php echo __('Go'); ?>" />
</fieldset>
</form>
</div>
<?php
/**
* Copy database
*/
$response->addHTML(PMA_getHtmlForCopyDatabase($db));
/**
* Change database charset
*/
echo '<div class="operations_half_width"><form id="change_db_charset_form" ';
if ($GLOBALS['cfg']['AjaxEnable']) {
echo ' class="ajax" ';
}
echo 'method="post" action="db_operations.php">'
. PMA_generate_common_hidden_inputs($db, $table)
. '<fieldset>' . "\n"
. ' <legend>';
if ($cfg['PropertiesIconic']) {
echo $common_functions->getImage('s_asci.png');
}
echo ' <label for="select_db_collation">' . __('Collation') . ':</label>' . "\n"
. ' </legend>' . "\n"
. PMA_generateCharsetDropdownBox(
PMA_CSDROPDOWN_COLLATION, 'db_collation',
'select_db_collation', $db_collation, false, 3
)
. '</fieldset>'
. '<fieldset class="tblFooters">'
. ' <input type="submit" name="submitcollation"'
. ' value="' . __('Go') . '" />' . "\n"
. '</fieldset>' . "\n"
. '</form></div>' . "\n";
$response->addHTML(PMA_getHtmlForChangeDatabaseCharset($db, $table));
if ($num_tables > 0
&& ! $cfgRelation['allworks']
&& $cfg['PmaNoRelation_DisableWarning'] == false
) {
$message = PMA_Message::notice(__('The phpMyAdmin configuration storage has been deactivated. To find out why click %shere%s.'));
$message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', false);
$message = PMA_Message::notice(
__('The phpMyAdmin configuration storage has been deactivated. To find out why click %shere%s.')
);
$message->addParam(
'<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">',
false
);
$message->addParam('</a>', false);
/* Show error if user has configured something, notice elsewhere */
if (!empty($cfg['Servers'][$server]['pmadb'])) {
$message->isError(true);
}
echo '<div class="operations_full_width">';
$message->display();
echo '</div>';
$response->addHTML('<div class="operations_full_width">');
$response->addHTML($message->getDisplay());
$response->addHTML('</div>');
} // end if
} // end if (!$is_information_schema)
// not sure about displaying the PDF dialog in case db is information_schema
if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
<!-- Work on PDF Pages -->
<?php
if ($cfgRelation['pdfwork'] && $num_tables > 0) {
// We only show this if we find something in the new pdf_pages table
$test_query = '
SELECT *
FROM ' . $common_functions->backquote($GLOBALS['cfgRelation']['db'])
@ -651,11 +283,7 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
/*
* Export Relational Schema View
*/
echo '<div class="operations_full_width"><fieldset><a href="schema_edit.php?' . $url_query . '">';
if ($cfg['PropertiesIconic']) {
echo $common_functions->getImage('b_edit.png');
}
echo __('Edit or export relational schema') . '</a></fieldset></div>';
$response->addHTML(PMA_getHtmlForExportRelationalSchemaView($url_query));
} // end if
?>

View File

@ -3871,5 +3871,7 @@ $(function () {
* Reveal the login form to users with JS enabled
*/
$(function () {
$('.js-show').show();
var $loginform = $('#loginform');
$loginform.find('.js-show').show();
$loginform.find('#input_username').select();
});

View File

@ -52,7 +52,39 @@ $(function() {
PMA_prepareForAjaxRequest($search_form);
$.post($search_form.attr('action'), $search_form.serialize(), function(data) {
var values = {};
$search_form.find(':input').each(function() {
var $input = $(this);
if ($input.attr('type') == 'checkbox' || $input.attr('type') == 'radio') {
if ($input.is(':checked')) {
values[this.name] = $input.val();
}
} else {
values[this.name] = $input.val();
}
});
var columnCount = $('select[name="columnsToDisplay[]"] option').length;
// Submit values only for the columns that have a search criteria
for (var a = 0; a < columnCount; a++) {
if (values['criteriaValues[' + a + ']'] == '') {
delete values['criteriaValues[' + a + ']'];
delete values['criteriaColumnOperators[' + a + ']'];
delete values['criteriaColumnNames[' + a + ']'];
delete values['criteriaColumnTypes[' + a + ']'];
delete values['criteriaColumnCollations[' + a + ']'];
}
}
// If all columns are selected, use a single parameter to indicate that
if (values['columnsToDisplay[]'] != null) {
if (values['columnsToDisplay[]'].length == columnCount) {
delete values['columnsToDisplay[]'];
values['displayAllColumns'] = true;
}
} else {
values['displayAllColumns'] = true;
}
$.post($search_form.attr('action'), values, function(data) {
PMA_ajaxRemoveMessage($msgbox);
if (data.success == true) {
// found results

View File

@ -634,8 +634,6 @@ class PMA_Config
$this->checkPmaAbsoluteUri();
$this->checkFontsize();
$this->checkPermissions();
// Handling of the collation must be done after merging of $cfg
// (from config.inc.php) so that $cfg['DefaultConnectionCollation']
// can have an effect. Note that the presence of collation

View File

@ -2789,6 +2789,7 @@ class PMA_DisplayResults
$vertical_display = $this->__get('_vertical_display');
// Check whether the field needs to display with syntax highlighting
if ($this->_isNeedToSytaxHighlight($meta->name)
&& (trim($row[$i]) != '')
) {
@ -2811,7 +2812,7 @@ class PMA_DisplayResults
'_', '/',
$this->sytax_highlighting_column_info[strtolower($this->__get('_db'))][strtolower($this->__get('_table'))][strtolower($meta->name)][2]
);
}
// Check for the predefined fields need to show as link in schemas
@ -3042,7 +3043,6 @@ class PMA_DisplayResults
return false;
}
/**
* Check whether the field needs to be link
*
@ -3644,6 +3644,7 @@ class PMA_DisplayResults
if ((PMA_strlen($column) > $GLOBALS['cfg']['LimitChars'])
&& ($_SESSION['tmp_user_values']['display_text'] == self::DISPLAY_PARTIAL_TEXT)
&& ! $this->_isNeedToSytaxHighlight(strtolower($meta->name))
) {
$column = PMA_substr($column, 0, $GLOBALS['cfg']['LimitChars'])
. '...';

View File

@ -136,7 +136,7 @@ class PMA_Response
* Returns true or false depending on whether
* we are servicing an ajax request
*
* @return void
* @return bool
*/
public function isAjax()
{

View File

@ -319,7 +319,6 @@ class PMA_Table
static public function sGetStatusInfo($db, $table, $info = null,
$force_read = false, $disable_error = false
) {
if (! empty($_SESSION['is_multi_query'])) {
$disable_error = true;
}

View File

@ -103,7 +103,6 @@ class PMA_TableSearch
* @param string $db Database name
* @param string $table Table name
* @param string $searchType Whether normal or zoom search
*
*/
public function __construct($db, $table, $searchType)
{
@ -134,6 +133,7 @@ class PMA_TableSearch
* Gets all the columns of a table along with their types, collations
* and whether null or not.
*
* @return void
*/
private function _loadTableInfo()
{
@ -445,38 +445,34 @@ EOT;
*/
private function _getEnumWhereClause($criteriaValues, $func_type)
{
$where = '';
$common_functions = PMA_CommonFunctions::getInstance();
if (! empty($criteriaValues)) {
if (! is_array($criteriaValues)) {
$criteriaValues = explode(',', $criteriaValues);
}
$enum_selected_count = count($criteriaValues);
if ($func_type == '=' && $enum_selected_count > 1) {
$func_type = 'IN';
$parens_open = '(';
$parens_close = ')';
} elseif ($func_type == '!=' && $enum_selected_count > 1) {
$func_type = 'NOT IN';
$parens_open = '(';
$parens_close = ')';
} else {
$parens_open = '';
$parens_close = '';
}
$enum_where = '\''
. $common_functions->sqlAddSlashes($criteriaValues[0]) . '\'';
for ($e = 1; $e < $enum_selected_count; $e++) {
$enum_where .= ', \''
. $common_functions->sqlAddSlashes($criteriaValues[$e]) . '\'';
}
$where = ' ' . $func_type . ' ' . $parens_open
. $enum_where . $parens_close;
if (! is_array($criteriaValues)) {
$criteriaValues = explode(',', $criteriaValues);
}
return $where;
$enum_selected_count = count($criteriaValues);
if ($func_type == '=' && $enum_selected_count > 1) {
$func_type = 'IN';
$parens_open = '(';
$parens_close = ')';
} elseif ($func_type == '!=' && $enum_selected_count > 1) {
$func_type = 'NOT IN';
$parens_open = '(';
$parens_close = ')';
} else {
$parens_open = '';
$parens_close = '';
}
$enum_where = '\''
. $common_functions->sqlAddSlashes($criteriaValues[0]) . '\'';
for ($e = 1; $e < $enum_selected_count; $e++) {
$enum_where .= ', \''
. $common_functions->sqlAddSlashes($criteriaValues[$e]) . '\'';
}
return ' ' . $func_type . ' ' . $parens_open
. $enum_where . $parens_close;
}
/**
@ -564,7 +560,7 @@ EOT;
$criteriaValues = '';
$where = $backquoted_name . ' ' . $func_type;
} elseif (strncasecmp($types, 'enum', 4) == 0) {
} elseif (strncasecmp($types, 'enum', 4) == 0 && ! empty($criteriaValues)) {
$where = $backquoted_name;
$where .= $this->_getEnumWhereClause($criteriaValues, $func_type);
@ -643,10 +639,9 @@ EOT;
if (isset($_POST['zoom_submit'])) {
$sql_query .= '* ';
} else {
$sql_query .= (count($_POST['columnsToDisplay'])
== count($_POST['criteriaColumnNames'])
$sql_query .= ! empty($_POST['displayAllColumns'])
? '* '
: implode(', ', $this->getCommonFunctions()->backquote($_POST['columnsToDisplay'])));
: implode(', ', $this->getCommonFunctions()->backquote($_POST['columnsToDisplay']));
} // end if
$sql_query .= ' FROM ' . $this->getCommonFunctions()->backquote($_POST['table']);

View File

@ -568,6 +568,8 @@ if ($GLOBALS['text_dir'] == 'ltr') {
* check for errors occurred while loading configuration
* this check is done here after loading language files to present errors in locale
*/
$GLOBALS['PMA_Config']->checkPermissions();
if ($GLOBALS['PMA_Config']->error_config_file) {
$error = '[strong]' . __('Failed to read configuration file') . '[/strong]'
. '[br][br]'

View File

@ -743,6 +743,33 @@ function PMA_DBI_get_tables_full($database, $table = false,
}
}
/**
* Get VIEWs in a particular database
*
* @param string $db Database name to look in
*
* @return array $views Set of VIEWs inside the database
*/
function PMA_DBI_getVirtualTables($db)
{
$tables_full = PMA_DBI_get_tables_full($db);
$views = array();
foreach ($tables_full as $table=>$tmp) {
if (PMA_Table::isView($db, $table)) {
$views[] = $table;
}
}
return $views;
}
/**
* returns array with databases containing extended infos about them
*

View File

@ -8,6 +8,8 @@ if (! defined('PHPMYADMIN')) {
exit;
}
require_once 'libraries/transformations.lib.php';
$common_functions = PMA_CommonFunctions::getInstance();
$request_params = array(
@ -137,6 +139,7 @@ if (! empty($submit_mult)
}
} // end if
$views = PMA_DBI_getVirtualTables($db);
/**
* Displays the confirmation form if required
@ -487,6 +490,15 @@ if (!empty($submit_mult) && !empty($what)) {
PMA_DBI_select_db($db);
}
$result = PMA_DBI_query($a_query);
if ($query_type == 'drop_db') {
PMA_clearTransformations($selected[$i]);
} elseif ($query_type == 'drop_tbl') {
PMA_clearTransformations($db, $selected[$i]);
} else if ($query_type == 'drop_fld') {
PMA_clearTransformations($db, $table ,$selected[$i]);
}
} // end if
} // end for

1392
libraries/operations.lib.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1732,7 +1732,7 @@ function PMA_getStandardLinks($conditional_class)
* @return array $extra_data
*/
function PMA_getExtraDataForAjaxBehavior($password, $link_export, $sql_query,
$link_edit, $dbname_is_wildcard
$link_edit, $dbname_is_wildcard, $hostname, $username
) {
if (strlen($sql_query)) {
$extra_data['sql_query']
@ -1745,16 +1745,16 @@ function PMA_getExtraDataForAjaxBehavior($password, $link_export, $sql_query,
*/
$new_user_string = '<tr>'."\n"
. '<td> <input type="checkbox" name="selected_usr[]" id="checkbox_sel_users_"'
. 'value="'
. htmlspecialchars($_REQUEST['username'])
. '&amp;#27;' . htmlspecialchars($_REQUEST['hostname']) . '" />'
. 'value="'
. htmlspecialchars($username)
. '&amp;#27;' . htmlspecialchars($hostname) . '" />'
. '</td>' . "\n"
. '<td><label for="checkbox_sel_users_">'
. (empty($_REQUEST['username'])
? '<span style="color: #FF0000">' . __('Any') . '</span>'
: htmlspecialchars($_REQUEST['username']) ) . '</label></td>' . "\n"
. '<td>' . htmlspecialchars($_REQUEST['hostname']) . '</td>' . "\n";
: htmlspecialchars($username) ) . '</label></td>' . "\n"
. '<td>' . htmlspecialchars($hostname) . '</td>' . "\n";
$new_user_string .= '<td>';
if (! empty($password) || isset($_POST['pma_pw'])) {
@ -1781,15 +1781,15 @@ function PMA_getExtraDataForAjaxBehavior($password, $link_export, $sql_query,
$new_user_string .= '<td>'
. sprintf($link_edit,
urlencode($_REQUEST['username']),
urlencode($_REQUEST['hostname']),
urlencode($username),
urlencode($hostname),
'', ''
)
. '</td>' . "\n";
$new_user_string .= '<td>'
. sprintf($link_export,
urlencode($_REQUEST['username']),
urlencode($_REQUEST['hostname']),
urlencode($username),
urlencode($hostname),
(isset($_GET['initial']) ? $_GET['initial'] : '')
)
. '</td>' . "\n";
@ -1802,7 +1802,7 @@ function PMA_getExtraDataForAjaxBehavior($password, $link_export, $sql_query,
* Generate the string for this alphabet's initial, to update the user
* pagination
*/
$new_user_initial = strtoupper(substr($_REQUEST['username'], 0, 1));
$new_user_initial = strtoupper(substr($username, 0, 1));
$new_user_initial_string = '<a href="server_privileges.php?'
. $GLOBALS['url_query'] . '&initial=' . $new_user_initial .'">'
. $new_user_initial . '</a>';

161
libraries/tbl_views.lib.php Normal file
View File

@ -0,0 +1,161 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Set of functions related to applying transformations for VIEWs
*
* @package PhpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Get the column details of VIEW with its original references
*
* @param string $sql_query SQL for original resource
* @param array $view_columns Columns of VIEW if defined new column names
*
* @return array $column_map Details of VIEW columns
*/
function PMA_getColumnMap($sql_query, $view_columns)
{
$column_map = array();
// Select query which give results for VIEW
$real_source_result = PMA_DBI_try_query($sql_query);
if ($real_source_result !== false) {
$real_source_fields_meta = PMA_DBI_get_fields_meta($real_source_result);
if (count($real_source_fields_meta) > 0) {
for ($i=0; $i<count($real_source_fields_meta); $i++) {
$map = array();
$map['table_name'] = $real_source_fields_meta[$i]->table;
$map['refering_column'] = $real_source_fields_meta[$i]->name;
if (count($view_columns) > 1) {
$map['real_column'] = $view_columns[$i];
}
$column_map[] = $map;
}
}
}
unset($real_source_result);
return $column_map;
}
/**
* Get existing data on tranformations applyed for
* columns in a particular table
*
* @param string $db Database name looking for
*
* @return mysqli_result Result of executed SQL query
*/
function PMA_getExistingTranformationData($db)
{
$common_functions = PMA_CommonFunctions::getInstance();
$cfgRelation = PMA_getRelationsParam();
// Get the existing transformation details of the same database
// from pma_column_info table
$pma_transformation_sql = 'SELECT * FROM '
. $common_functions->backquote($cfgRelation['db']) . '.'
. $common_functions->backquote($cfgRelation['column_info'])
. ' WHERE `db_name` = \''
. $common_functions->sqlAddSlashes($db) . '\'';
return PMA_DBI_try_query($pma_transformation_sql);
}
/**
* Get SQL query for store new transformation details of a VIEW
*
* @param mysqli_result $pma_tranformation_data Result set of SQL execution
* @param array $column_map Details of VIEW columns
* @param string $view_name Name of the VIEW
* @param string $db Database name of the VIEW
*
* @return string $new_transformations_sql SQL query for new tranformations
*/
function PMA_getNewTransformationDataSql(
$pma_tranformation_data, $column_map, $view_name, $db
) {
$common_functions = PMA_CommonFunctions::getInstance();
$cfgRelation = PMA_getRelationsParam();
// Need to store new transformation details for VIEW
$new_transformations_sql = 'INSERT INTO '
. $common_functions->backquote($cfgRelation['db']) . '.'
. $common_functions->backquote($cfgRelation['column_info'])
. ' (`db_name`, `table_name`, `column_name`, `comment`, '
. '`mimetype`, `transformation`, `transformation_options`)'
. ' VALUES ';
$column_count = 0;
$add_comma = false;
while ($data_row = PMA_DBI_fetch_assoc($pma_tranformation_data)) {
foreach ($column_map as $column) {
if ($data_row['table_name'] == $column['table_name']
&& $data_row['column_name'] == $column['refering_column']
) {
$new_transformations_sql .= $add_comma ? ', ' : '';
$new_transformations_sql .= '('
. '\'' . $db . '\', '
. '\'' . $view_name . '\', '
. '\'';
$new_transformations_sql .= (isset($column['real_column']))
? $column['real_column']
: $column['refering_column'];
$new_transformations_sql .= '\', '
. '\'' . $data_row['comment'] . '\', '
. '\'' . $data_row['mimetype'] . '\', '
. '\'' . $data_row['transformation'] . '\', '
. '\''
. $common_functions->sqlAddSlashes(
$data_row['transformation_options']
)
. '\')';
$add_comma = true;
$column_count++;
break;
}
}
if ($column_count == count($column_map)) {
break;
}
}
return ($column_count > 0) ? $new_transformations_sql : '';
}
?>

View File

@ -365,4 +365,46 @@ function PMA_transformation_global_html_replace($buffer, $options = array())
$return = str_replace("[__BUFFER__]", $buffer, $options['string']);
return $return;
}
/**
* Delete related transformation details
* after deleting database. table or column
*
* @param string $db Database name
* @param string $table Table name
* @param string $column Column name
*
* @return boolean State of the query execution
*/
function PMA_clearTransformations($db, $table = '', $column = '')
{
$common_functions = PMA_CommonFunctions::getInstance();
$cfgRelation = PMA_getRelationsParam();
$delete_sql = 'DELETE FROM '
. $common_functions->backquote($cfgRelation['db']) . '.'
. $common_functions->backquote($cfgRelation['column_info'])
. ' WHERE ';
if (($column != '') && ($table != '')) {
$delete_sql .= '`db_name` = \'' . $db . '\' AND '
. '`table_name` = \'' . $table . '\' AND '
. '`column_name` = \'' . $column . '\' ';
} else if ($table != '') {
$delete_sql .= '`db_name` = \'' . $db . '\' AND '
. '`table_name` = \'' . $table . '\' ';
} else {
$delete_sql .= '`db_name` = \'' . $db . '\' ';
}
return PMA_DBI_try_query($delete_sql);
}
?>

View File

@ -48,27 +48,27 @@ $scripts->addFile('pmd/ajax.js');
$scripts->addFile('pmd/history.js');
$scripts->addFile('pmd/move.js');
$scripts->addFile('pmd/iecanvas.js', true);
$scripts->addCode('
var server = "' . PMA_escapeJsString($server) . '";
$scripts->addCode(
'var server = "' . PMA_escapeJsString($server) . '";
var db = "' . PMA_escapeJsString($db) . '";
var token = "' . PMA_escapeJsString($token) . '";
');
var token = "' . PMA_escapeJsString($token) . '";'
);
if (isset($_REQUEST['query'])) {
$scripts->addCode('
$(function() {
$(".trigger").click(function() {
$(".panel").toggle("fast");
$(this).toggleClass("active");
return false;
});
});
');
$scripts->addCode(
'$(function() {
$(".trigger").click(function() {
$(".panel").toggle("fast");
$(this).toggleClass("active");
return false;
});
});'
);
}
$scripts->addCode('
$(function() {
$scripts->addCode(
'$(function() {
Main();
});
');
});'
);
$scripts->addCode($script_tabs);
$scripts->addCode($script_contr);
$scripts->addCode($script_display_field);
@ -78,55 +78,66 @@ require 'libraries/db_info.inc.php';
?>
<div class="pmd_header" id="top_menu">
<a href="#"
onclick="Show_left_menu(document.getElementById('key_Show_left_menu')); return false" class="M_butt first" target="_self">
<img id='key_Show_left_menu' title="<?php echo __('Show/Hide left menu'); ?>"
alt="v" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2_m.png'); ?>" /></a>
<a href="#" onclick="Save2(); return false"
class="M_butt" target="_self"
><img title="<?php echo __('Save position') ?>"
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/save.png'); ?>" alt=""
/></a><a href="#" onclick="Start_table_new(); return false"
class="M_butt" target="_self"
><img title="<?php echo __('Create table')?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/table.png'); ?>" alt=""
/></a><a href="#" onclick="Start_relation(); return false"
class="M_butt" id="rel_button" target="_self"
><img title="<?php echo __('Create relation') ?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/relation.png'); ?>" alt=""
/></a><a href="#" onclick="Start_display_field(); return false"
class="M_butt" id="display_field_button" target="_self"
><img title="<?php echo __('Choose column to display') ?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/display_field.png'); ?>" alt=""
/></a><a href="#" onclick="location.reload(); return false"
class="M_butt" target="_self"
><img title="<?php echo __('Reload'); ?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/reload.png'); ?>" alt=""
/></a><a href="Documentation.html#faq6_31" target="documentation"
class="M_butt" target="_self"
><img title="<?php echo __('Help'); ?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/help.png'); ?>" alt=""
/></a><img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt=""
/><a href="#" onclick="Angular_direct(); return false"
class="M_butt" id="angular_direct_button" target="_self"
><img title="<?php echo __('Angular links') . ' / ' . __('Direct links'); ?>"
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/ang_direct.png'); ?>" alt=""
/></a><a href="#" onclick="Grid(); return false"
class="M_butt" id="grid_button" target="_self"
><img title="<?php echo __('Snap to grid') ?>" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/grid.png'); ?>" alt=""
/></a><img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt=""
/><a href="#"
onclick="Small_tab_all(document.getElementById('key_SB_all')); return false" class="M_butt" target="_self"
><img id='key_SB_all' title="<?php echo __('Small/Big All'); ?>" alt="v"
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>"
/></a>
<a href="#" onclick="Small_tab_invert(); return false" class="M_butt" target="_self" >
<img title="<?php echo __('Toggle small/big'); ?>" alt="key" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bottom.png'); ?>" />
<a href="#" onclick="Show_left_menu(document.getElementById('key_Show_left_menu')); return false"
class="M_butt first" target="_self">
<img id='key_Show_left_menu' title="<?php echo __('Show/Hide left menu'); ?>" alt="v"
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2_m.png'); ?>" />
</a>
<a href="#" onclick="Relation_lines_invert(); return false" class="M_butt" target="_self" >
<img title="<?php echo __('Toggle relation lines'); ?>" alt="key" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/toggle_lines.png'); ?>" />
<a href="#" onclick="Save2(); return false" class="M_butt" target="_self">
<img title="<?php echo __('Save position') ?>" alt=""
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/save.png'); ?>" />
</a>
<a href="#" onclick="Start_table_new(); return false"
class="M_butt" target="_self">
<img title="<?php echo __('Create table')?>" alt=""
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/table.png'); ?>" />
</a>
<a href="#" onclick="Start_relation(); return false" class="M_butt" id="rel_button" target="_self">
<img title="<?php echo __('Create relation') ?>" alt=""
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/relation.png'); ?>" />
</a>
<a href="#" onclick="Start_display_field(); return false"
class="M_butt" id="display_field_button" target="_self">
<img title="<?php echo __('Choose column to display') ?>" alt=""
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/display_field.png'); ?>" />
</a>
<a href="#" onclick="location.reload(); return false" class="M_butt" target="_self">
<img title="<?php echo __('Reload'); ?>" alt=""
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/reload.png'); ?>" />
</a>
<a href="Documentation.html#faq6_31" target="documentation" class="M_butt" target="_self">
<img title="<?php echo __('Help'); ?>" alt=""
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/help.png'); ?>" />
</a>
<img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
<a href="#" onclick="PDF_save(); return false"
class="M_butt" target="_self"
><img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/pdf.png'); ?>" alt="key" width="20" height="20"
title="<?php echo __('Import/Export coordinates for PDF schema'); ?>" /></a
>
<a href="#" onclick="Angular_direct(); return false"
class="M_butt" id="angular_direct_button" target="_self">
<img title="<?php echo __('Angular links') . ' / ' . __('Direct links'); ?>" alt=""
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/ang_direct.png'); ?>" />
</a>
<a href="#" onclick="Grid(); return false" class="M_butt" id="grid_button" target="_self">
<img title="<?php echo __('Snap to grid') ?>"
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/grid.png'); ?>" alt="" />
</a>
<img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
<a href="#" onclick="Small_tab_all(document.getElementById('key_SB_all')); return false"
class="M_butt" target="_self">
<img id='key_SB_all' title="<?php echo __('Small/Big All'); ?>" alt="v"
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>" />
</a>
<a href="#" onclick="Small_tab_invert(); return false" class="M_butt" target="_self" >
<img title="<?php echo __('Toggle small/big'); ?>" alt="key"
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bottom.png'); ?>" />
</a>
<a href="#" onclick="Relation_lines_invert(); return false" class="M_butt" target="_self" >
<img title="<?php echo __('Toggle relation lines'); ?>" alt="key"
src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/toggle_lines.png'); ?>" />
</a>
<img class="M_bord" src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/bord.png'); ?>" alt="" />
<a href="#" onclick="PDF_save(); return false" class="M_butt" target="_self">
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/pdf.png'); ?>" alt="key"
width="20" height="20" title="<?php echo __('Import/Export coordinates for PDF schema'); ?>" />
</a>
<?php
if (isset($_REQUEST['query'])) {
echo '<a href="#" onclick="build_query(\'SQL Query on Database\', 0)" onmousedown="return false;"
@ -136,10 +147,11 @@ if (isset($_REQUEST['query'])) {
echo '"/></a>';
}
?>
<a href="#"
onclick="Top_menu_right(document.getElementById('key_Left_Right')); return false" class="M_butt last" target="_self">
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/2rightarrow_m.png'); ?>" id="key_Left_Right" alt=">"
title="<?php echo __('Move Menu'); ?>" /></a>
<a href="#" onclick="Top_menu_right(document.getElementById('key_Left_Right')); return false"
class="M_butt last" target="_self">
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/2rightarrow_m.png'); ?>"
id="key_Left_Right" alt=">" title="<?php echo __('Move Menu'); ?>" />
</a>
</div>
<form action="" method="post" name="form1">
@ -217,9 +229,9 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
<table id="<?php echo $t_n_url ?>" cellpadding="0" cellspacing="0" class="pmd_tab"
style="position: absolute;
left: <?php
echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["X"] : rand(180, 800); ?>px;
echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["X"] : rand(20, 700); ?>px;
top: <?php
echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y"] : rand(30, 500); ?>px;
echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y"] : rand(90, 550); ?>px;
visibility: <?php
echo ! isset($tab_pos[$t_n]) || $tab_pos[$t_n]["H"]
? "visible"

View File

@ -13974,6 +13974,12 @@ msgstr "{concurrent_insert} està establert a 0"
#~ msgid "PHP array"
#~ msgstr "matriu PHP"
#~ msgid "PDF"
#~ msgstr "PDF"
#~ msgid "PHP array"
#~ msgstr "matriu PHP"
#~ msgid ""
#~ "No description is available for this transformation.<br />Please ask the "
#~ "author what %s does."

View File

@ -8,15 +8,16 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.0.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2012-07-27 10:40+0200\n"
"PO-Revision-Date: 2012-07-04 20:30+0200\n"
"Last-Translator: Hunar kirkuk <huner.kurdish@gmail.com>\n"
"Language-Team: none\n"
"PO-Revision-Date: 2012-08-04 12:39+0200\n"
"Last-Translator: renwar kurd <renwarkurd@yahoo.com>\n"
"Language-Team: Kurdish Sorani "
"<http://l10n.cihar.com/projects/phpmyadmin/master/ckb/>\n"
"Language: ckb\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.1\n"
"X-Generator: Weblate 1.2\n"
#: browse_foreigners.php:36 browse_foreigners.php:60 js/messages.php:354
#: libraries/DisplayResults.class.php:794
@ -39,6 +40,8 @@ msgid ""
"parent window, or your browser's security settings are configured to block "
"cross-window updates."
msgstr ""
"ئەمو پەڕەیە ناتوانرێت تازە بکرێتەوە، لەوانەیە پەڕە کۆنەکەت داخستبێت، یان "
"ڕێکخستنی پاراستنی وێبگەڕەکەت وا ڕیکخراوە کە ڕی لە تازەکردنەوە بگریت"
#: browse_foreigners.php:168 libraries/CommonFunctions.class.php:3387
#: libraries/CommonFunctions.class.php:3394
@ -376,7 +379,7 @@ msgstr ""
#: db_operations.php:658
msgid "Edit or export relational schema"
msgstr ""
msgstr "دەستکاری کردن یان هەناردنی پەیوەندی نەخشە"
#: db_printview.php:100 db_tracking.php:82 db_tracking.php:190
#: libraries/Menu.class.php:201 libraries/config/messages.inc.php:514
@ -447,7 +450,7 @@ msgstr "دەبێت لانیکەم ١ خانە هەڵبژێریت بۆ پیشان
#: db_qbe.php:59
#, php-format
msgid "Switch to %svisual builder%s"
msgstr ""
msgstr "گۆڕین بۆ %svisual builder%s"
#: db_search.php:30 libraries/plugins/auth/AuthenticationConfig.class.php:80
#: libraries/plugins/auth/AuthenticationConfig.class.php:95
@ -514,7 +517,7 @@ msgstr "سەرجەم"
#: db_structure.php:638 libraries/StorageEngine.class.php:352
#, php-format
msgid "%s is the default storage engine on this MySQL server."
msgstr ""
msgstr "%s بیرگەی بزوێنەری سەرەکیە لەسەر ڕاژەکاری MySQL"
#: db_structure.php:686 db_structure.php:698 db_structure.php:699
#: libraries/DisplayResults.class.php:4851
@ -568,7 +571,7 @@ msgstr "بەتاڵ"
#: server_databases.php:302 tbl_structure.php:149 tbl_structure.php:150
#: tbl_structure.php:581
msgid "Drop"
msgstr ""
msgstr "فڕیدان"
#: db_structure.php:711 tbl_operations.php:632
msgid "Check table"
@ -604,7 +607,7 @@ msgstr "فەرهەنگی زانیاریەکان"
#: db_tracking.php:76
msgid "Tracked tables"
msgstr ""
msgstr "شوێنکەوتەی خشتە"
#: db_tracking.php:81 libraries/Menu.class.php:178
#: libraries/config/messages.inc.php:508
@ -659,7 +662,7 @@ msgstr "پیشاندان"
#: db_tracking.php:98 js/messages.php:34
msgid "Delete tracking data for this table"
msgstr ""
msgstr "سڕینەوە داتا شوێنکەوتووەکان لەم خشتەیەدا"
#: db_tracking.php:120 tbl_tracking.php:675 tbl_tracking.php:733
msgid "active"
@ -675,7 +678,7 @@ msgstr "وەشانەکان"
#: db_tracking.php:138 tbl_tracking.php:481 tbl_tracking.php:753
msgid "Tracking report"
msgstr ""
msgstr "ڕاپۆرتە شوێنکەتووەکان"
#: db_tracking.php:139 tbl_tracking.php:282 tbl_tracking.php:755
msgid "Structure snapshot"
@ -683,7 +686,7 @@ msgstr ""
#: db_tracking.php:185
msgid "Untracked tables"
msgstr ""
msgstr "خشتە شوێن نەکەوتوەکان"
#: db_tracking.php:204 tbl_structure.php:680
msgid "Track table"

142
po/da.po
View File

@ -4,15 +4,15 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.0.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2012-07-27 10:40+0200\n"
"PO-Revision-Date: 2012-07-23 04:24+0200\n"
"PO-Revision-Date: 2012-08-05 02:30+0200\n"
"Last-Translator: Aputsiaq Niels Janussen <aj@isit.gl>\n"
"Language-Team: danish <da@li.org>\n"
"Language-Team: Danish <http://l10n.cihar.com/projects/phpmyadmin/master/da/>\n"
"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.1\n"
"X-Generator: Weblate 1.2\n"
#: browse_foreigners.php:36 browse_foreigners.php:60 js/messages.php:354
#: libraries/DisplayResults.class.php:794
@ -3450,24 +3450,32 @@ msgid ""
"A variable-length (%s) string, the effective maximum length is subject to "
"the maximum row size"
msgstr ""
"En streng med variabel længde (%s). Den effektive, maksimale længde er "
"subjektet for din maksimale rækkestørrelse"
#: libraries/Types.class.php:333
msgid ""
"A TEXT column with a maximum length of 255 (2^8 - 1) characters, stored with "
"a one-byte prefix indicating the length of the value in bytes"
msgstr ""
"En TEXT-kolonne med en maksimal længde på 255 (2^8 - 1) tegn, lagret med et "
"præfiks på én byte, der indikerer længden af værdien i bytes"
#: libraries/Types.class.php:335 libraries/Types.class.php:731
msgid ""
"A TEXT column with a maximum length of 65,535 (2^16 - 1) characters, stored "
"with a two-byte prefix indicating the length of the value in bytes"
msgstr ""
"En TEXT-kolonne med en maksimal længde på 65.535 (2^16 - 1) tegn, lagret med "
"et præfiks på to bytes, der indikerer længden af værdien i bytes"
#: libraries/Types.class.php:337
msgid ""
"A TEXT column with a maximum length of 16,777,215 (2^24 - 1) characters, "
"stored with a three-byte prefix indicating the length of the value in bytes"
msgstr ""
"En TEXT-kolonne med en maksimal længde på 16.777.215 (2^24 - 1) tegn, lagret "
"med et præfiks på tre bytes, der indikerer længden af værdien i bytes"
#: libraries/Types.class.php:339
msgid ""
@ -3475,12 +3483,17 @@ msgid ""
"characters, stored with a four-byte prefix indicating the length of the "
"value in bytes"
msgstr ""
"En TEXT-kolonne med en maksimal længde på 4.294.967.295 (2^32 - 1) tegn, "
"lagret med et præfiks på fire bytes, der indikerer længden af værdien i "
"bytes"
#: libraries/Types.class.php:341
msgid ""
"Similar to the CHAR type, but stores binary byte strings rather than non-"
"binary character strings"
msgstr ""
"Ligner CHAR-typen, men lagrer binære byte-strenge i stedet for ikkebinære "
"tegnstrenge"
#: libraries/Types.class.php:343
msgid ""
@ -3527,10 +3540,12 @@ msgid ""
"An enumeration, chosen from the list of up to 65,535 values or the special "
"'' error value"
msgstr ""
"En optælling, udvalgt fra listen med op til 65.535 værdier eller den særlige "
"''-fejlværdi"
#: libraries/Types.class.php:355
msgid "A single value chosen from a set of up to 64 members"
msgstr ""
msgstr "En enkelt værdi udvalgt fra et sæt på op til 64 medlemmer"
#: libraries/Types.class.php:357
msgid "A type that can store a geometry of any type"
@ -4035,6 +4050,8 @@ msgid ""
"Defines the minimum size for input fields generated for CHAR and VARCHAR "
"columns"
msgstr ""
"Definerer den mindste størrelse på input-felter som genereres for CHAR- og "
"VARCHAR-kolonner"
#: libraries/config/messages.inc.php:37
msgid "Minimum size for input field"
@ -4045,6 +4062,8 @@ msgid ""
"Defines the maximum size for input fields generated for CHAR and VARCHAR "
"columns"
msgstr ""
"Definerer den maksimale størrelse på input-felter som genereres for CHAR- og "
"VARCHAR-kolonner"
#: libraries/config/messages.inc.php:39
msgid "Maximum size for input field"
@ -5377,6 +5396,8 @@ msgid ""
"An alternate host to hold the configuration storage; leave blank to use the "
"already defined host"
msgstr ""
"En alternativ vært til lageropbevaring af konfiguration; lad stå tom for at "
"benytte den vært som allerede er defineret"
#: libraries/config/messages.inc.php:388
msgid "Control host"
@ -5460,6 +5481,8 @@ msgid ""
"Limits number of table preferences which are stored in database, the oldest "
"records are automatically removed"
msgstr ""
"Begrænser antallet af tabel-præferencer som lagres i databasen. De ældte "
"poster fjernes automatisk"
#: libraries/config/messages.inc.php:405
msgid "Maximal number of table preferences to store"
@ -5846,6 +5869,7 @@ msgstr "Vis SQL-forespørgsler"
msgid ""
"Defines whether the query box should stay on-screen after its submission"
msgstr ""
"Definerer som forespørgselsboksen skal forblive på siden efter indsendelse"
#: libraries/config/messages.inc.php:480 libraries/sql_query_form.lib.php:377
msgid "Retain query box"
@ -6193,7 +6217,7 @@ msgstr "Serveren svarer ikke."
#: libraries/database_interface.lib.php:1997
msgid "Please check privileges of directory containing database."
msgstr ""
msgstr "Tjek venligst privilegier for mappen som indeholder databasen."
#: libraries/database_interface.lib.php:2006
msgid "Details..."
@ -6896,7 +6920,7 @@ msgstr "Relaterede links"
#: libraries/engines/pbxt.lib.php:137
msgid "The PrimeBase XT Blog by Paul McCullagh"
msgstr ""
msgstr "Bloggen The PrimeBase XT af Paul McCullagh"
#: libraries/gis_visualization.lib.php:135
msgid "No data found for GIS visualization."
@ -8523,7 +8547,6 @@ msgid "Trigger name"
msgstr "Triggernavn"
#: libraries/rte/rte_triggers.lib.php:334
#, fuzzy
#| msgid "Time"
msgctxt "Trigger action time"
msgid "Time"
@ -9490,7 +9513,7 @@ msgstr "Datalager"
#: libraries/tbl_properties.inc.php:871
msgid "PARTITION definition"
msgstr ""
msgstr "PARTITION-definition"
#: libraries/user_preferences.inc.php:29
msgid "Manage your settings"
@ -11289,7 +11312,6 @@ msgid "Using the monitor:"
msgstr "Brug af monitor:"
#: server_status.php:1704
#, fuzzy
#| msgid ""
#| "Ok, you are good to go! Once you click 'Start monitor' your browser will "
#| "refresh all displayed charts in a regular interval. You may add charts "
@ -11300,10 +11322,10 @@ msgid ""
"may add charts and change the refresh rate under 'Settings', or remove any "
"chart using the cog icon on each respective chart."
msgstr ""
"Når du klikker på 'Start monitor' vil din browser opdatere alle viste "
"diagrammer regelmæssigt. Du kan tilføje diagrammer og ændre "
"opdateringsfrekvensen under 'Indstilinger' eller fjerne diagrammer ved at "
"bruge ikonet cog på det relevante diagram. "
"Din browser vil opdatere alle viste diagrammer i et regelmæssigt interval. "
"Du kan tilføje diagrammer og ændre opdateringsfrekvensen under "
"'Indstillinger', eller fjerne hvilket som helst diagram ved at bruge ikonet "
"cog på det relevante diagram."
#: server_status.php:1706
msgid ""
@ -11855,10 +11877,10 @@ msgstr ""
"dette system."
#: setup/lib/index.lib.php:344
#, fuzzy
#| msgid "You should use SSL connections if your web server supports it."
msgid "You should use SSL connections if your database server supports it."
msgstr "Du bør bruge en SSL-forbindelse, hvis din webserver understøtter det. "
msgstr ""
"Du bør bruge SSL-forbindelser, hvis din database-server understøtter det."
#: setup/lib/index.lib.php:359
msgid "You should use mysqli for performance reasons."
@ -11928,39 +11950,34 @@ msgid "The columns have been moved successfully."
msgstr "De valgte brugere er blevet korrekt slettet."
#: tbl_chart.php:83
#, fuzzy
#| msgid "Bar"
msgctxt "Chart type"
msgid "Bar"
msgstr "Søjle"
msgstr "Bjælke"
#: tbl_chart.php:85
#, fuzzy
#| msgid "Column"
msgctxt "Chart type"
msgid "Column"
msgstr "Kolonnenavn"
msgstr "Kolonne"
#: tbl_chart.php:87
#, fuzzy
#| msgid "Line"
msgctxt "Chart type"
msgid "Line"
msgstr "Linje"
#: tbl_chart.php:89
#, fuzzy
#| msgid "Spline"
msgctxt "Chart type"
msgid "Spline"
msgstr "Spline"
#: tbl_chart.php:92
#, fuzzy
#| msgid "Pie"
msgctxt "Chart type"
msgid "Pie"
msgstr "Lagkage"
msgstr "Cirkel"
#: tbl_chart.php:96
msgid "Stacked"
@ -11997,7 +12014,7 @@ msgstr "Y-værdier"
#: tbl_create.php:31
#, php-format
msgid "Table %s already exists!"
msgstr ""
msgstr "Tabellen %s eksisterer allerede!"
#: tbl_create.php:230
#, php-format
@ -12061,10 +12078,9 @@ msgid "Add index"
msgstr "Tilføj indeks"
#: tbl_indexes.php:194
#, fuzzy
#| msgid "Edit mode"
msgid "Edit index"
msgstr "Redigeringstilstand"
msgstr "Redigér indeks"
#: tbl_indexes.php:206
msgid "Index name:"
@ -12202,10 +12218,9 @@ msgid "Check referential integrity:"
msgstr "Check reference-integriteten:"
#: tbl_printview.php:66
#, fuzzy
#| msgid "Show tables"
msgid "Showing tables"
msgstr "Vis tabeller"
msgstr "Viser tabeller"
#: tbl_printview.php:294 tbl_structure.php:833
msgid "Space usage"
@ -12855,10 +12870,10 @@ msgstr ""
"sekund."
#: libraries/advisory_rules.txt:160
#, fuzzy, php-format
#, php-format
#| msgid "Query cache efficiency (%)"
msgid "Query cache efficiency (%%)"
msgstr "Effektivitet (%) af forespørgselsmellemlager "
msgstr "Effektiviteten af forespørgselsmellemlager (%%)"
#: libraries/advisory_rules.txt:163
msgid "Query cache not running efficiently, it has a low hit rate."
@ -12962,7 +12977,7 @@ msgstr ""
"og check resultatet."
#: libraries/advisory_rules.txt:186
#, fuzzy, php-format
#, php-format
#| msgid ""
#| "The ratio of removed queries to inserted queries is %s%%. The lower this "
#| "value is, the better (This rules firing limit: 0.1%)"
@ -12971,7 +12986,7 @@ msgid ""
"value is, the better (This rules firing limit: 0.1%%)"
msgstr ""
"Andelen af fjernede forespørgsler til indsatte forespørgsler er %s%%. Jo "
"mindre denne værdi er des bedre. (Denne regel aktiveres ved 0,1%)"
"mindre denne værdi er des bedre. (Denne regels aktiveringsgrænse: 0.1%%)"
#: libraries/advisory_rules.txt:188
msgid "Query cache max size"
@ -13079,7 +13094,6 @@ msgid "There are lots of rows being sorted."
msgstr "Der er mange rækker, der sorteres."
#: libraries/advisory_rules.txt:222
#, fuzzy
#| msgid ""
#| "there is nothing wrong with a high amount of row sorting, you might t to "
#| "e sure that the queries which require a lot of sorting use exed fields "
@ -13090,9 +13104,10 @@ msgid ""
"indexed columns in the ORDER BY clause, as this will result in much faster "
"sorting"
msgstr ""
"Selvom der intet er galt med en stor del rækkesorteringer, så bør "
"forespørgsler, som har brug for meget sortering bruge indekserede felter i "
"ORDER BY, da dette vil resultere i en meget hurtigere sortering."
"Selvom der intet er galt med en stor del rækkesorteringer, så bør du "
"eventuelt sikre, at forespørgsler som kræver meget sortering bruger "
"indekserede kolonner i klausulen ORDER BY, da dette vil resultere i en meget "
"hurtigere sortering"
#: libraries/advisory_rules.txt:223
#, php-format
@ -13108,7 +13123,6 @@ msgid "There are too many joins without indexes."
msgstr "Der er for mange joins uden indeks."
#: libraries/advisory_rules.txt:230
#, fuzzy
#| msgid ""
#| "eans that joins are doing full table scans. Adding indexes for the lds ng "
#| "used in the join conditions will greatly speed up table joins"
@ -13117,8 +13131,8 @@ msgid ""
"columns being used in the join conditions will greatly speed up table joins"
msgstr ""
"Dette betyder, at joins foretager en fuld tabelskanning. Oprettelse af "
"indeks for felter, der bruges i join-betingelserne vil forøge hastigheden af "
"joins."
"indeks for kolonner, der bruges i join-betingelserne vil forøge hastigheden "
"af tabel-joins"
#: libraries/advisory_rules.txt:231
#, php-format
@ -13274,7 +13288,6 @@ msgid "Temp disk rate"
msgstr "Frekvens af midlertidig disk"
#: libraries/advisory_rules.txt:273
#, fuzzy
#| msgid ""
#| "sing {max_heap_table_size} and {tmp_table_size} might help. However e "
#| "porary tables are always being written to disk, independent of value of "
@ -13296,12 +13309,12 @@ msgstr ""
"skrives nogle midlertidige tabeller altid til disk uafhængig af disse "
"variable. For at undgå disse skal man omskrive sine forespørgsler for at "
"undgå disse betingelser (inden for en midlertidig tabel: Tilstedeværelse af "
"BLOB eller TEXT felter eller et felt større end 512 bytes) som nævnt i <a "
"href=\"http://dev.mysql.com/doc/refman/5.5/en/internal-temporary-tables.html"
"\">MySQL Documentation</a>"
"BLOB eller TEXT-kolonne eller en kolonne større end 512 bytes) som nævnt i "
"<a href=\"http://dev.mysql.com/doc/refman/5.5/en/internal-temporary-"
"tables.html\">MySQL Documentation</a>"
#: libraries/advisory_rules.txt:274
#, fuzzy, php-format
#, php-format
#| msgid ""
#| "f temporay tables being written to disk: %s, this value should be s than "
#| "er hour"
@ -13309,8 +13322,8 @@ msgid ""
"Rate of temporary tables being written to disk: %s, this value should be "
"less than 1 per hour"
msgstr ""
"Frekvens af midlertidige tabeller skrevet til disk: %s. Denne værdi bør være "
"mindre end 1 pr time"
"Frekvens af midlertidige tabeller som skrives til disk: %s. Denne værdi bør "
"være mindre end 1 pr time"
#: libraries/advisory_rules.txt:289
msgid "MyISAM key buffer size"
@ -13355,24 +13368,24 @@ msgstr ""
"indeks der bruges."
#: libraries/advisory_rules.txt:301
#, fuzzy, php-format
#, php-format
#| msgid ""
#| "max %% MyISAM key buffer ever used: %s, this value should be above 95%%"
msgid ""
"max %% MyISAM key buffer ever used: %s%%, this value should be above 95%%"
msgstr ""
"maksimal %% MyISAM nøglebuffer nogensinde brugt: %s. Denne værdi bør være "
"over 95%%"
"maksimal %% MyISAM-nøglebuffer som nogensinde bruges: %s%%. Denne værdi bør "
"være over 95%%"
#: libraries/advisory_rules.txt:304
msgid "Percentage of MyISAM key buffer used"
msgstr "Procentdel brugt af MyISAM nøglebuffer"
#: libraries/advisory_rules.txt:309
#, fuzzy, php-format
#, php-format
#| msgid "%% MyISAM key buffer used: %s, this value should be above 95%%"
msgid "%% MyISAM key buffer used: %s%%, this value should be above 95%%"
msgstr "%% MyISAM nøglebuffer brugt: %s. Denne værdi bør være over 95%%"
msgstr "%% MyISAM-nøglebuffer som bruges: %s%%. Denne værdi bør være over 95%%"
#: libraries/advisory_rules.txt:311
msgid "Percentage of index reads from memory"
@ -13692,7 +13705,7 @@ msgstr ""
"buffer poolen."
#: libraries/advisory_rules.txt:433
#, fuzzy, php-format
#, php-format
#| msgid ""
#| "ally one a system with a lot of writes to InnoDB tables you should "
#| "odb_log_file_size to 25%% of {innodb_buffer_pool_size}. However bigger s "
@ -13714,12 +13727,13 @@ msgid ""
"fine. See also <a href=\"http://mysqldatabaseadministration.blogspot."
"com/2007/01/increase-innodblogfilesize-proper-way.html\">this blog entry</a>"
msgstr ""
"Særligt på et system med mange skrivninger til InnoDB tabeller bør "
"innodb_log_file_size sættes til 25%% af{innodb_buffer_pool_size}. Dog jo "
"Særligt på et system med mange skrivninger til InnoDB-tabeller bør "
"innodb_log_file_size sættes til 25%% af {innodb_buffer_pool_size}. Dog jo "
"større værdi, jo længere er genoprettelsestiden ved databasenedbrud. Derfor "
"bør værdien ikke være højere end 256 MiB. Bemærk, at man ikke bare kan ændre "
"denne værdi. Man skal lukke serveren ned, fjerne InnoDB logfiler, sætte den "
"nye værdi i my.cnf, starte serveren og checke logfiler for fejl. Se også <a "
"denne værdi. Man skal lukke serveren ned, fjerne InnoDB-logfiler, sætte den "
"nye værdi i my.cnf, starte serveren og tjekke at alt gik fint i "
"fejlloggene. Se også <a "
"href=\"http://mysqldatabaseadministration.blogspot.com/2007/01/increase-"
"innodblogfilesize-proper-way.html\">dette blogindlæg</a>"
@ -13741,7 +13755,7 @@ msgid "The InnoDB log file size is inadequately large."
msgstr "InnoDB logfilen er utilstrækkelig stor."
#: libraries/advisory_rules.txt:440
#, fuzzy, php-format
#, php-format
#| msgid ""
#| "usually sufficient to set innodb_log_file_size to 25%% of the size "
#| "nodb_buffer_pool_size}. A very innodb_log_file_size slows down the overy "
@ -13767,17 +13781,17 @@ msgstr ""
"størrelsen af {innodb_buffer_pool_size}. En meget høj innodb_log_file_size "
"reducerer genoprettelsestiden betydeligt efter et databasenedbrud. Se også "
"<a href=\"http://www.mysqlperformanceblog.com/2006/07/03/choosing-proper-"
"innodb_log_file_size/\">denne artikel</a>.Man skal lukke serveren ned, "
"fjerne InnoDB logfiler, sætte den nye værdi i my.cnf, starte serveren og "
"checke logfiler for fejl. Se også <a href=\"http://"
"mysqldatabaseadministration.blogspot.com/2007/01/increase-innodblogfilesize-"
"proper-way.html\">dette blogindlæg</a>"
"innodb_log_file_size/\">denne artikel</a>.Man skal lukke serveren ned, fjerne "
"InnoDB-logfiler, sætte den nye værdi i my.cnf, starte serveren og tjekke at "
"alt gik godt i fejllogene. Se også <a "
"href=\"http://mysqldatabaseadministration.blogspot.com/2007/01/increase-"
"innodblogfilesize-proper-way.html\">dette blogindlæg</a>"
#: libraries/advisory_rules.txt:441
#, fuzzy, php-format
#, php-format
#| msgid "Your absolute InnoD log size is %s MiB"
msgid "Your absolute InnoDB log size is %s MiB"
msgstr "Din absolutte InnoDB logstørrelse er %s MiB"
msgstr "Din absolutte InnoDB-logstørrelse er %s MiB"
#: libraries/advisory_rules.txt:443
msgid "InnoDB buffer pool size"

View File

@ -4,15 +4,15 @@ msgstr ""
"Project-Id-Version: phpMyAdmin-docs 4.0.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2012-07-27 10:40+0200\n"
"PO-Revision-Date: 2012-07-13 00:19+0200\n"
"Last-Translator: Maxi Lampert <maxilampert@yahoo.de>\n"
"Language-Team: none\n"
"PO-Revision-Date: 2012-08-06 09:31+0200\n"
"Last-Translator: J. M. <me@mynetx.net>\n"
"Language-Team: German <http://l10n.cihar.com/projects/phpmyadmin/master/de/>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.1\n"
"X-Generator: Weblate 1.2\n"
#: browse_foreigners.php:36 browse_foreigners.php:60 js/messages.php:354
#: libraries/DisplayResults.class.php:794
@ -2539,7 +2539,7 @@ msgstr "Operationen"
#: libraries/CommonFunctions.class.php:3506
#: libraries/sql_query_form.lib.php:473 prefs_manage.php:245
msgid "Browse your computer:"
msgstr "Durchsuchen Sie ihren Computer:"
msgstr "Durchsuchen Sie Ihren Computer:"
#: libraries/CommonFunctions.class.php:3534
#, php-format

View File

@ -289,6 +289,7 @@ msgstr "Databasen er uten navn!"
#: db_operations.php:327
#, php-format
#| msgid "Database %s has been renamed to %s"
msgid "Database %1$s has been renamed to %2$s"
msgstr "Databasen %1$s har endret navn til %2$s"

View File

@ -4,15 +4,16 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.0.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2012-07-27 10:40+0200\n"
"PO-Revision-Date: 2012-07-27 17:50+0200\n"
"PO-Revision-Date: 2012-08-03 20:24+0200\n"
"Last-Translator: Burak Yavuz <hitowerdigit@hotmail.com>\n"
"Language-Team: turkish <tr@li.org>\n"
"Language-Team: Turkish "
"<http://l10n.cihar.com/projects/phpmyadmin/master/tr/>\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 1.1\n"
"X-Generator: Weblate 1.2\n"
#: browse_foreigners.php:36 browse_foreigners.php:60 js/messages.php:354
#: libraries/DisplayResults.class.php:794
@ -1600,7 +1601,7 @@ msgstr "Kullanılan değişken / formül"
#: js/messages.php:227
msgid "Test"
msgstr "Sınama"
msgstr "Deneme"
#: js/messages.php:232 pmd_general.php:417 pmd_general.php:454
#: pmd_general.php:574 pmd_general.php:622 pmd_general.php:698
@ -13223,7 +13224,7 @@ msgstr "tmp_table_size 'a karşı max_heap_table_size"
#: libraries/advisory_rules.txt:258
msgid "tmp_table_size and max_heap_table_size are not the same."
msgstr "tmp_table_size ve max_heap_table_size aynı şey değildir."
msgstr "tmp_table_size ve max_heap_table_size aynı değiller."
#: libraries/advisory_rules.txt:259
msgid ""

View File

@ -4,15 +4,16 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 4.0.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2012-07-27 10:40+0200\n"
"PO-Revision-Date: 2012-07-23 19:45+0200\n"
"PO-Revision-Date: 2012-08-04 06:39+0200\n"
"Last-Translator: shanyan baishui <Siramizu@gmail.com>\n"
"Language-Team: chinese_simplified <zh_CN@li.org>\n"
"Language-Team: Chinese (China) "
"<http://l10n.cihar.com/projects/phpmyadmin/master/zh_CN/>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 1.1\n"
"X-Generator: Weblate 1.2\n"
#: browse_foreigners.php:36 browse_foreigners.php:60 js/messages.php:354
#: libraries/DisplayResults.class.php:794
@ -1877,7 +1878,7 @@ msgstr "点击下箭头以设置显示的字段"
msgid ""
"This table does not contain a unique column. Features related to the grid "
"edit, checkbox, Edit, Copy and Delete links may not work after saving."
msgstr ""
msgstr "该表没有唯一字段。单元格编辑、复选框、编辑、复制和删除链接相关功能可能无法正常使用。"
#: js/messages.php:356
msgid ""
@ -3650,7 +3651,7 @@ msgstr "您应升级到 %s %s 或更高版本。"
#: libraries/common.inc.php:1076
msgid "GLOBALS overwrite attempt"
msgstr ""
msgstr "企图覆盖 GLOBALS"
#: libraries/common.inc.php:1083
msgid "possible exploit"
@ -12364,10 +12365,9 @@ msgid "Query caching method"
msgstr "查询缓存模式"
#: libraries/advisory_rules.txt:156
#, fuzzy
#| msgid "Query caching method"
msgid "Suboptimal caching method."
msgstr "查询缓存模式"
msgstr "最佳缓存模式。"
#: libraries/advisory_rules.txt:157
msgid ""
@ -12449,6 +12449,10 @@ msgid ""
"using this formula: (query_cache_size - qcache_free_memory) / "
"qcache_queries_in_cache"
msgstr ""
"大量碎片很可能会增加 Qcache_lowmem_prunes 。这可能由 {query_cache_size} "
"过小而导致大量查询缓存低内存清理。刷新查询缓存 (可能锁住查询缓存很长时间) 可以临时解决这个问题。仔细调整 "
"{query_cache_min_res_unit} 到一个更小的值将会有所帮助,如您可以使用下列公式来计算并设置您查询缓存大小平均值: (查询缓存大小 "
"- 查询缓存剩余大小) / 查询缓存中的查询数量"
#: libraries/advisory_rules.txt:179
#, php-format
@ -12459,25 +12463,23 @@ msgid ""
msgstr ""
#: libraries/advisory_rules.txt:181
#, fuzzy
#| msgid "Query cache used"
msgid "Query cache low memory prunes"
msgstr "已用查询缓存"
msgstr "查询缓存低内存清理"
#: libraries/advisory_rules.txt:184
#, fuzzy
#| msgid "The amount of free memory for query cache."
msgid ""
"Cached queries are removed due to low query cache memory from the query "
"cache."
msgstr "查询缓存中空闲的内存总数。"
msgstr "在查询缓存内存过低时会清理已缓存的查询。"
#: libraries/advisory_rules.txt:185
msgid ""
"You might want to increase {query_cache_size}, however keep in mind that the "
"overhead of maintaining the cache is likely to increase with its size, so do "
"this in small increments and monitor the results."
msgstr ""
msgstr "您可能需要增加 {query_cache_size},但请注意增加它可能会导致的维护开销,所以请慢慢增加并观察结果。"
#: libraries/advisory_rules.txt:186
#, php-format
@ -12494,7 +12496,7 @@ msgstr "查询缓存最大值"
msgid ""
"The query cache size is above 128 MiB. Big query caches may cause "
"significant overhead that is required to maintain the cache."
msgstr ""
msgstr "查询缓存超过 128 MB 。过大的查询缓存可能会引起额外的维护开销。"
#: libraries/advisory_rules.txt:192
msgid ""
@ -12514,7 +12516,7 @@ msgstr "查询缓存结果最小大小"
#: libraries/advisory_rules.txt:198
msgid ""
"The max size of the result set in the query cache is the default of 1 MiB."
msgstr ""
msgstr "查询缓存结果最大大小已设为默认值 1 MB 。"
#: libraries/advisory_rules.txt:199
msgid ""
@ -12527,6 +12529,9 @@ msgid ""
"(often invalidated due to table updates) increasing {query_cache_limit} "
"might reduce efficiency."
msgstr ""
"修改 {query_cache_limit} (通常是增加) 可能提升效率。该变量决定可能要插入到查询缓存中查询结果的最大大小。若多数超过 1 MB "
"的查询结果能很好的缓存 (多读、少写) 则增加 {query_cache_limit} 将会提升效率。若多数超过 1 MB 的查询结果不能很好的缓存 "
"(通常因为表更新而失效) 增加 {query_cache_limit} 将会降低效率。"
#: libraries/advisory_rules.txt:200
msgid "query_cache_limit is set to 1 MiB"
@ -12671,13 +12676,13 @@ msgid ""
msgstr "这说明很多查询都需要全表扫描。请在合适的地方添加索引。"
#: libraries/advisory_rules.txt:252
#, fuzzy, php-format
#, php-format
#| msgid ""
#| "Rate of reading fixed position average: %s, this value should be less "
#| "than 1 per hour"
msgid ""
"Rate of reading next table row: %s, this value should be less than 1 per hour"
msgstr "固定位置读取率: %s该值应低于 1 每小时"
msgstr "下一行读取率: %s该值应低于 1 每小时"
#: libraries/advisory_rules.txt:255
msgid "tmp_table_size vs. max_heap_table_size"
@ -12693,7 +12698,7 @@ msgid ""
"value of either to determine the maximum size of in-memory tables. So if you "
"wish to increase the in-memory table limit you will have to increase the "
"other value as well."
msgstr ""
msgstr "若您故意改变了其中一个值: 服务器使用较低的值来确定内存表的最大大小。如果您想增加内存表的大小您应该同时修改另一个值。"
#: libraries/advisory_rules.txt:260
#, php-format
@ -12720,6 +12725,10 @@ msgid ""
"mentioned in the beginning of an <a href=\"http://www.facebook.com/note.php?"
"note_id=10150111255065841&comments\">Article by the Pythian Group</a>"
msgstr ""
"增加 {max_heap_table_size} 和 {tmp_table_size} "
"可能会有帮助。但有些临时表总是会写入硬盘,和这些变量无关。要避免这些,您需要重写您的查询来避免 <a href=\"http://www.facebook"
".com/note.php?note_id=10150111255065841&comments\">Pythian "
"小组的文章</a>开头所提到的这些条件 (临时表内: 具有 BLOB 或 TEXT 字段或具有大于 512 字节的字段)"
#: libraries/advisory_rules.txt:267
#, php-format
@ -12742,15 +12751,19 @@ msgid ""
"mentioned in the <a href=\"http://dev.mysql.com/doc/refman/5.5/en/internal-"
"temporary-tables.html\">MySQL Documentation</a>"
msgstr ""
"增加 {max_heap_table_size} 和 {tmp_table_size} "
"可能会有帮助。但有些临时表总是会写入硬盘,和这些变量无关。要避免这些,您需要重写您的查询来避免 <a "
"href=\"http://dev.mysql.com/doc/refman/5.5/en/internal-temporary-"
"tables.html\">MySQL 文档</a>中所提到的这些条件 (临时表内: 具有 BLOB 或 TEXT 字段或具有大于 512 字节的字段)"
#: libraries/advisory_rules.txt:274
#, fuzzy, php-format
#, php-format
#| msgid ""
#| "Temporary tables average: %s, this value should be less than 1 per hour."
msgid ""
"Rate of temporary tables being written to disk: %s, this value should be "
"less than 1 per hour"
msgstr "临时表创建率: %s该值应低于 1 每小时"
msgstr "临时表硬盘写入率: %s该值应低于 1 每小时"
#: libraries/advisory_rules.txt:289
msgid "MyISAM key buffer size"
@ -12771,36 +12784,35 @@ msgid "key_buffer_size is 0"
msgstr "key_buffer_size 为 0"
#: libraries/advisory_rules.txt:296
#, fuzzy, php-format
#, php-format
#| msgid "Sort buffer size"
msgid "Max %% MyISAM key buffer ever used"
msgstr "排序缓存大小"
msgstr "最大 %% MyISAM 索引缓存从未使用"
#: libraries/advisory_rules.txt:299 libraries/advisory_rules.txt:307
#, fuzzy, php-format
#, php-format
#| msgid "Sort buffer size"
msgid "MyISAM key buffer (index cache) %% used is low."
msgstr "排序缓存大小"
msgstr "MyISAM 索引缓存 %% 使用率低。"
#: libraries/advisory_rules.txt:300 libraries/advisory_rules.txt:308
msgid ""
"You may need to decrease the size of {key_buffer_size}, re-examine your "
"tables to see if indexes have been removed, or examine queries and "
"expectations about what indexes are being used."
msgstr ""
msgstr "您可能需要减小 {key_buffer_size} 的大小,重新检查您的表是否删除了索引或检查查询期望使用的索引。"
#: libraries/advisory_rules.txt:301
#, fuzzy, php-format
#, php-format
#| msgid "Sort buffer size"
msgid ""
"max %% MyISAM key buffer ever used: %s%%, this value should be above 95%%"
msgstr "排序缓存大小"
msgstr "最大 %% MyISAM 索引缓存从未使用: %s%%,该值应高于 95%%"
#: libraries/advisory_rules.txt:304
#, fuzzy
#| msgid "Sort buffer size"
msgid "Percentage of MyISAM key buffer used"
msgstr "排序缓存大小"
msgstr "MyISAM 索引缓存使用百分比"
#: libraries/advisory_rules.txt:309
#, php-format
@ -13022,6 +13034,8 @@ msgid ""
"source-of-aborted_connects/\">This article</a> might help you track down the "
"source."
msgstr ""
"连接通常因为无法被授权而中止。<a href=\"http://www.mysqlperformanceblog.com/2008/08/23/how-"
"to-track-down-the-source-of-aborted_connects/\">这篇文章</a>对您追踪来源可能有所帮助。"
#: libraries/advisory_rules.txt:397
#, php-format
@ -13033,12 +13047,12 @@ msgid "Rate of aborted connections"
msgstr "已中止连接的比例"
#: libraries/advisory_rules.txt:404
#, fuzzy, php-format
#, php-format
#| msgid ""
#| "Aborted client rate is at %s, this value should be less than 1 per hour"
msgid ""
"Aborted connections rate is at %s, this value should be less than 1 per hour"
msgstr "客户端取消率为 %s值应低于 1 每小时"
msgstr "已中止连接率为 %s值应低于 1 每小时"
#: libraries/advisory_rules.txt:406
msgid "Percentage of aborted clients"
@ -13098,7 +13112,7 @@ msgid ""
msgstr "InnoDB 日志文件大小不合适,此关系到 InnoDB 缓冲池。"
#: libraries/advisory_rules.txt:433
#, fuzzy, php-format
#, php-format
#| msgid ""
#| "It is usually sufficient to set innodb_log_file_size to 25%% of the size "
#| "of {innodb_buffer_pool_size}. A very big innodb_log_file_size slows down "
@ -13120,13 +13134,11 @@ msgid ""
"fine. See also <a href=\"http://mysqldatabaseadministration.blogspot."
"com/2007/01/increase-innodblogfilesize-proper-way.html\">this blog entry</a>"
msgstr ""
"通常将 innodb_log_file_size 设置为 {innodb_buffer_pool_size} 的 25%% 已经足"
"够。过大的 innodb_log_file_size 将会严重减慢数据库崩溃后的恢复时间。参见<a "
"href=\"http://www.mysqlperformanceblog.com/2006/07/03/choosing-proper-"
"innodb_log_file_size/\">这篇文章</a>。您首先需要关闭服务器,移除 InnoDB 日志"
"文件,然后在 my.cnf 中设置新的值,最后启动服务器,并检查错误日志确定一切都正"
"常。参见<a href=\"http://mysqldatabaseadministration.blogspot.com/2007/01/"
"increase-innodblogfilesize-proper-way.html\">这篇博客</a>"
"在一个 InnoDB 表写入很多的系统上您应该将 innodb_log_file_size 设为 {innodb_buffer_pool_size} 的 "
"25%% 。因为该值越大,当数据库崩溃时恢复的时间就越长,所以该值不应高于 256 MB 。请注意您不能简单的修改该变量的值。您需要关闭服务器,删除 "
"InnoDB 日志文件,在 my.cnf 中设置新的值,启动服务器,一切正常后再检查错误日志。参见<a "
"href=\"http://mysqldatabaseadministration.blogspot.com/2007/01/increase-"
"innodblogfilesize-proper-way.html\">这篇博客</a>"
#: libraries/advisory_rules.txt:434
#, php-format
@ -13200,6 +13212,8 @@ msgid ""
"perfectly adequate for your system if you don't have much InnoDB tables or "
"other services running on the same machine."
msgstr ""
"您当前的 InnoDB 缓冲池使用了内存的 %s%% 。此规则在您分配少于 60%% 时被触发,然而这也可能因为您没有太多 InnoDB "
"表所以这样足够或者服务器上还运行了其它服务。"
#: libraries/advisory_rules.txt:452
msgid "MyISAM concurrent inserts"
@ -13215,6 +13229,9 @@ msgid ""
"writers for a given table. See also <a href=\"http://dev.mysql.com/doc/"
"refman/5.5/en/concurrent-inserts.html\">MySQL Documentation</a>"
msgstr ""
"设置 {concurrent_insert} 为 1 可以减少在相同表上的读取和写入冲突。参见 <a "
"href=\"http://dev.mysql.com/doc/refman/5.5/en/concurrent-inserts.html\">MySQL "
"文档</a>"
#: libraries/advisory_rules.txt:457
msgid "concurrent_insert is set to 0"

View File

@ -384,10 +384,12 @@ if ($GLOBALS['is_ajax_request']
if (isset($password)) {
$isPass = true;
}
$extra_data = PMA_getExtraDataForAjaxBehavior(
$isPass, $link_export,
(isset($sql_query) ? $sql_query : ''),
$link_edit, $dbname_is_wildcard
$link_edit, $dbname_is_wildcard,
$hostname, $username
);
if ($message instanceof PMA_Message) {

57
sql.php
View File

@ -766,6 +766,34 @@ if (isset($GLOBALS['show_as_php']) || ! empty($GLOBALS['validatequery'])) {
// No rows returned -> move back to the calling page
if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) {
// Delete related tranformation information
if (!empty($analyzed_sql[0]['querytype'])
&& (($analyzed_sql[0]['querytype'] == 'ALTER')
|| ($analyzed_sql[0]['querytype'] == 'DROP'))
) {
require_once 'libraries/transformations.lib.php';
if ($analyzed_sql[0]['querytype'] == 'ALTER') {
if (stripos($analyzed_sql[0]['unsorted_query'], 'DROP') !== false) {
$drop_column = PMA_getColumnNameInColumnDropSql(
$analyzed_sql[0]['unsorted_query']
);
if ($drop_column != '') {
PMA_clearTransformations($db, $table, $drop_column);
}
}
} else if (($analyzed_sql[0]['querytype'] == 'DROP') && ($table != '')) {
PMA_clearTransformations($db, $table);
}
}
if ($is_delete) {
$message = PMA_Message::deleted_rows($num_rows);
} elseif ($is_insert) {
@ -1472,5 +1500,34 @@ function PMA_getSqlWithLimitClause($full_sql_query, $analyzed_sql, $sql_limit_to
return $analyzed_sql[0]['section_before_limit'] . "\n"
. $sql_limit_to_append . $analyzed_sql[0]['section_after_limit'];
}
/**
* Get column name from a drop SQL statement
*
* @param string $sql SQL query
*
* @return string $drop_column Name of the column
*/
function PMA_getColumnNameInColumnDropSql($sql)
{
$tmpArray1 = explode('DROP', $sql);
$str_to_check = trim($tmpArray1[1]);
if (stripos($str_to_check, 'COLUMN') !== false) {
$tmpArray2 = explode('COLUMN', $str_to_check);
$str_to_check = trim($tmpArray2[1]);
}
$tmpArray3 = explode(' ', $str_to_check);
$str_to_check = trim($tmpArray3[0]);
$drop_column = str_replace(';', '', trim($str_to_check));
$drop_column = str_replace('`', '', $drop_column);
return $drop_column;
}
?>

View File

@ -10,6 +10,11 @@
*/
require_once 'libraries/common.inc.php';
/**
* functions implementation for this script
*/
require_once 'libraries/operations.lib.php';
$pma_table = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
$common_functions = PMA_CommonFunctions::getInstance();
@ -197,21 +202,20 @@ if (isset($_REQUEST['submitoptions'])) {
* Reordering the table has been requested by the user
*/
if (isset($_REQUEST['submitorderby']) && ! empty($_REQUEST['order_field'])) {
$sql_query = '
ALTER TABLE ' . $common_functions->backquote($GLOBALS['table']) . '
ORDER BY ' . $common_functions->backquote(urldecode($_REQUEST['order_field']));
if (isset($_REQUEST['order_order']) && $_REQUEST['order_order'] === 'desc') {
$sql_query .= ' DESC';
}
$sql_query .= ';';
$result = PMA_DBI_query($sql_query);
list($sql_query, $result) = PMA_getQueryAndResultForReorderingTable();
} // end if
/**
* A partition operation has been requested by the user
*/
if (isset($_REQUEST['submit_partition']) && ! empty($_REQUEST['partition_operation'])) {
$sql_query = 'ALTER TABLE ' . $common_functions->backquote($GLOBALS['table']) . ' ' . $_REQUEST['partition_operation'] . ' PARTITION ' . $_REQUEST['partition_name'] . ';';
if (isset($_REQUEST['submit_partition'])
&& ! empty($_REQUEST['partition_operation'])
) {
$sql_query = 'ALTER TABLE '
. $common_functions->backquote($GLOBALS['table']) . ' '
. $_REQUEST['partition_operation']
. ' PARTITION '
. $_REQUEST['partition_name'] . ';';
$result = PMA_DBI_query($sql_query);
} // end if
@ -271,71 +275,16 @@ $columns = PMA_DBI_get_columns($GLOBALS['db'], $GLOBALS['table']);
/**
* Displays the page
*/
?>
<!-- Order the table -->
<div class="operations_half_width">
<form method="post" id="alterTableOrderby" action="tbl_operations.php" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?>>
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
<fieldset id="fieldset_table_order">
<legend><?php echo __('Alter table order by'); ?></legend>
<select name="order_field">
<?php
foreach ($columns as $fieldname) {
echo ' <option value="' . htmlspecialchars($fieldname['Field']) . '">'
. htmlspecialchars($fieldname['Field']) . '</option>' . "\n";
}
unset($columns);
?>
</select> <?php echo __('(singly)'); ?>
<select name="order_order">
<option value="asc"><?php echo __('Ascending'); ?></option>
<option value="desc"><?php echo __('Descending'); ?></option>
</select>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" name="submitorderby" value="<?php echo __('Go'); ?>" />
</fieldset>
</form>
</div>
/**
* Order the table
*/
echo PMA_getHtmlForOrderTheTable($columns);
<!-- Move table -->
<div class="operations_half_width">
<form method="post" action="tbl_operations.php"
onsubmit="return emptyFormElements(this, 'new_name')">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
<input type="hidden" name="reload" value="1" />
<input type="hidden" name="what" value="data" />
<fieldset id="fieldset_table_rename">
<legend><?php echo __('Move table to (database<b>.</b>table):'); ?></legend>
<?php if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) {
?>
<input type="text" maxlength="100" size="30" name="target_db" value="<?php echo htmlspecialchars($GLOBALS['db']); ?>"/>
<?php
} else {
?>
<select name="target_db">
<?php echo $GLOBALS['pma']->databases->getHtmlOptions(true, false); ?>
</select>
<?php
} // end if
?>
&nbsp;<strong>.</strong>&nbsp;
<input type="text" size="20" name="new_name" onfocus="this.select()"
value="<?php echo htmlspecialchars($GLOBALS['table']); ?>" /><br />
<?php
// starting with MySQL 5.0.24, SHOW CREATE TABLE includes the AUTO_INCREMENT
// next value but users can decide if they want it or not for the operation
?>
<input type="checkbox" name="sql_auto_increment" value="1" id="checkbox_auto_increment_mv" checked="checked" />
<label for="checkbox_auto_increment_mv"><?php echo __('Add AUTO_INCREMENT value'); ?></label><br />
</fieldset>
<fieldset class="tblFooters">
<input type="submit" name="submit_move" value="<?php echo __('Go'); ?>" />
</fieldset>
</form>
</div>
/**
* Move table
*/
echo PMA_getHtmlForMoveTable();
<?php
if (strstr($show_comment, '; InnoDB free') === false) {
if (strstr($show_comment, 'InnoDB free') === false) {
// only user entered comment
@ -356,464 +305,77 @@ if (strstr($show_comment, '; InnoDB free') === false) {
// Here should be version check for InnoDB, however it is supported
// in >5.0.4, >4.1.12 and >4.0.11, so I decided not to
// check for version
?>
<!-- Table options -->
<div class="operations_half_width clearfloat">
<form method="post" action="tbl_operations.php">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
<input type="hidden" name="reload" value="1" />
<fieldset>
<legend><?php echo __('Table options'); ?></legend>
<table>
<!-- Change table name -->
<tr><td><?php echo __('Rename table to'); ?></td>
<td><input type="text" size="20" name="new_name" onfocus="this.select()"
value="<?php echo htmlspecialchars($GLOBALS['table']); ?>" />
</td>
</tr>
<!-- Table comments -->
<tr><td><?php echo __('Table comments'); ?></td>
<td><input type="text" name="comment" maxlength="60" size="30"
value="<?php echo htmlspecialchars($comment); ?>" onfocus="this.select()" />
<input type="hidden" name="prev_comment" value="<?php echo htmlspecialchars($comment); ?>" />
</td>
</tr>
<!-- Storage engine -->
<tr><td><?php echo __('Storage Engine'); ?>
<?php echo $common_functions->showMySQLDocu('Storage_engines', 'Storage_engines'); ?>
</td>
<td><?php echo PMA_StorageEngine::getHtmlSelect('new_tbl_storage_engine', null, $tbl_storage_engine); ?>
</td>
</tr>
<!-- Table character set -->
<tr><td><?php echo __('Collation'); ?></td>
<td><?php echo PMA_generateCharsetDropdownBox(
PMA_CSDROPDOWN_COLLATION,
'tbl_collation', null, $tbl_collation, false, 3
); ?>
</td>
</tr>
<?php
if ($is_myisam_or_aria || $is_isam) {
?>
<tr>
<td><label for="new_pack_keys">PACK_KEYS</label></td>
<td><select name="new_pack_keys" id="new_pack_keys">
<option value="DEFAULT" <?php
if ($pack_keys == 'DEFAULT') {
echo 'selected="selected"';
} ?>>DEFAULT</option>
<option value="0" <?php
if ($pack_keys == '0') {
echo 'selected="selected"';
} ?>>0</option>
<option value="1" <?php
if ($pack_keys == '1') {
echo 'selected="selected"';
} ?>>1</option>
</select>
</td>
</tr>
<?php
} // end if (MYISAM|ISAM)
if ($is_myisam_or_aria) {
?>
<tr><td><label for="new_checksum">CHECKSUM</label></td>
<td><input type="checkbox" name="new_checksum" id="new_checksum"
value="1"
<?php echo (isset($checksum) && $checksum == 1)
? ' checked="checked"'
: ''; ?> />
</td>
</tr>
<tr><td><label for="new_delay_key_write">DELAY_KEY_WRITE</label></td>
<td><input type="checkbox" name="new_delay_key_write" id="new_delay_key_write"
value="1"
<?php echo (isset($delay_key_write) && $delay_key_write == 1)
? ' checked="checked"'
: ''; ?> />
</td>
</tr>
<?php
} // end if (MYISAM)
if ($is_aria) {
?>
<tr><td><label for="new_transactional">TRANSACTIONAL</label></td>
<td><input type="checkbox" name="new_transactional" id="new_transactional"
value="1"
<?php echo (isset($transactional) && $transactional == 1)
? ' checked="checked"'
: ''; ?> />
</td>
</tr>
<tr><td><label for="new_page_checksum">PAGE_CHECKSUM</label></td>
<td><input type="checkbox" name="new_page_checksum" id="new_page_checksum"
value="1"
<?php echo (isset($page_checksum) && $page_checksum == 1)
? ' checked="checked"'
: ''; ?> />
</td>
</tr>
<?php
} // end if (ARIA)
if (isset($auto_increment) && strlen($auto_increment) > 0
&& ($is_myisam_or_aria || $is_innodb || $is_pbxt)
) {
?>
<tr><td><label for="auto_increment_opt">AUTO_INCREMENT</label></td>
<td><input type="text" name="new_auto_increment" id="auto_increment_opt"
value="<?php echo $auto_increment; ?>" /></td>
</tr>
<?php
} // end if (MYISAM|INNODB)
// the outer array is for engines, the inner array contains the dropdown
// option values as keys then the dropdown option labels
$possible_row_formats = array(
'ARIA' => array(
'FIXED' => 'FIXED',
'DYNAMIC' => 'DYNAMIC',
'PAGE' => 'PAGE'
),
'MARIA' => array(
'FIXED' => 'FIXED',
'DYNAMIC' => 'DYNAMIC',
'PAGE' => 'PAGE'
),
'MYISAM' => array(
'FIXED' => 'FIXED',
'DYNAMIC' => 'DYNAMIC'
),
'PBXT' => array(
'FIXED' => 'FIXED',
'DYNAMIC' => 'DYNAMIC'
),
'INNODB' => array(
'COMPACT' => 'COMPACT',
'REDUNDANT' => 'REDUNDANT')
echo PMA_getTableOptionDiv(
$comment, $tbl_collation, $tbl_storage_engine,
$is_myisam_or_aria, $is_isam, $pack_keys,
$auto_increment,
(empty($delay_key_write) ? '0' : '1'),
((isset($transactional) && $transactional == '0') ? '0' : '1'),
((isset($page_checksum)) ? $page_checksum : ''),
$is_innodb, $is_pbxt, $is_aria
);
$innodb_engine_plugin = PMA_StorageEngine::getEngine('innodb');
$innodb_plugin_version = $innodb_engine_plugin->getInnodbPluginVersion();
if (!empty($innodb_plugin_version)) {
$innodb_file_format = $innodb_engine_plugin->getInnodbFileFormat();
} else {
$innodb_file_format = '';
}
if ('Barracuda' == $innodb_file_format && $innodb_engine_plugin->supportsFilePerTable()) {
$possible_row_formats['INNODB']['DYNAMIC'] = 'DYNAMIC';
$possible_row_formats['INNODB']['COMPRESSED'] = 'COMPRESSED';
}
unset($innodb_engine_plugin, $innodb_plugin_version, $innodb_file_format);
/**
* Copy table
*/
echo PMA_getHtmlForCopytable();
// for MYISAM there is also COMPRESSED but it can be set only by the
// myisampack utility, so don't offer here the choice because if we
// try it inside an ALTER TABLE, MySQL (at least in 5.1.23-maria)
// does not return a warning
// (if the table was compressed, it can be seen on the Structure page)
echo '<br class="clearfloat"/>';
if (isset($possible_row_formats[$tbl_storage_engine])) {
$current_row_format = strtoupper($showtable['Row_format']);
echo '<tr><td><label for="new_row_format">ROW_FORMAT</label></td>';
echo '<td>';
echo $common_functions->getDropdown(
'new_row_format', $possible_row_formats[$tbl_storage_engine],
$current_row_format, 'new_row_format'
/**
* Table maintenance
*/
echo PMA_getHtmlForTableMaintenance($is_myisam_or_aria, $is_innodb,
$is_berkeleydb, $url_params
);
unset($possible_row_formats, $current_row_format);
echo '</td>';
echo '</tr>';
}
?>
</table>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" name="submitoptions" value="<?php echo __('Go'); ?>" />
</fieldset>
</form>
</div>
<!-- Copy table -->
<div class="operations_half_width">
<form method="post" action="tbl_operations.php" name="copyTable" id="copyTable" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?>
onsubmit="return emptyFormElements(this, 'new_name')">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
<input type="hidden" name="reload" value="1" />
<fieldset>
<legend><?php echo __('Copy table to (database<b>.</b>table):'); ?></legend>
<?php if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) {
?>
<input type="text" maxlength="100" size="30" name="target_db" value="<?php echo htmlspecialchars($GLOBALS['db']); ?>"/>
<?php
} else {
?>
<select name="target_db">
<?php echo $GLOBALS['pma']->databases->getHtmlOptions(true, false); ?>
</select>
<?php
} // end if
?>
&nbsp;<strong>.</strong>&nbsp;
<input type="text" size="20" name="new_name" onfocus="this.select()" value="<?php echo htmlspecialchars($GLOBALS['table']); ?>"/><br />
<?php
$choices = array(
'structure' => __('Structure only'),
'data' => __('Structure and data'),
'dataonly' => __('Data only'));
echo $common_functions->getRadioFields('what', $choices, 'data', true);
unset($choices);
?>
<input type="checkbox" name="drop_if_exists" value="true" id="checkbox_drop" />
<label for="checkbox_drop"><?php echo sprintf(__('Add %s'), 'DROP TABLE'); ?></label><br />
<input type="checkbox" name="sql_auto_increment" value="1" id="checkbox_auto_increment_cp" />
<label for="checkbox_auto_increment_cp"><?php echo __('Add AUTO_INCREMENT value'); ?></label><br />
<?php
// display "Add constraints" choice only if there are
// foreign keys
if (PMA_getForeigners($GLOBALS['db'], $GLOBALS['table'], '', 'foreign')) {
?>
<input type="checkbox" name="add_constraints" value="1" id="checkbox_constraints" />
<label for="checkbox_constraints"><?php echo __('Add constraints'); ?></label><br />
<?php
} // endif
if (isset($_COOKIE['pma_switch_to_new'])
&& $_COOKIE['pma_switch_to_new'] == 'true'
) {
$pma_switch_to_new = 'true';
}
?>
<input type="checkbox" name="switch_to_new" value="true"
id="checkbox_switch"<?php echo
isset($pma_switch_to_new) && $pma_switch_to_new == 'true'
? ' checked="checked"'
: ''; ?> />
<label for="checkbox_switch"><?php echo __('Switch to copied table'); ?></label>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" name="submit_copy" value="<?php echo __('Go'); ?>" />
</fieldset>
</form>
</div>
<br class="clearfloat"/>
<div class="operations_half_width">
<fieldset>
<legend><?php echo __('Table maintenance'); ?></legend>
<ul id="tbl_maintenance" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?>>
<?php
// Note: BERKELEY (BDB) is no longer supported, starting with MySQL 5.1
if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
if ($is_myisam_or_aria || $is_innodb) {
$this_url_params = array_merge(
$url_params,
array(
'sql_query' => 'CHECK TABLE ' . $common_functions->backquote($GLOBALS['table']),
'table_maintenance' => 'Go',
)
);
?>
<li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Check table'); ?></a>
<?php echo $common_functions->showMySQLDocu('MySQL_Database_Administration', 'CHECK_TABLE'); ?>
</li>
<?php
}
if ($is_innodb) {
$this_url_params = array_merge(
$url_params,
array('sql_query' => 'ALTER TABLE ' . $common_functions->backquote($GLOBALS['table']) . ' ENGINE = InnoDB;')
);
?>
<li><a class='maintain_action' href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Defragment table'); ?></a>
<?php echo $common_functions->showMySQLDocu('Table_types', 'InnoDB_File_Defragmenting'); ?>
</li>
<?php
}
if ($is_myisam_or_aria || $is_berkeleydb) {
$this_url_params = array_merge(
$url_params,
array(
'sql_query' => 'ANALYZE TABLE ' . $common_functions->backquote($GLOBALS['table']),
'table_maintenance' => 'Go',
)
);
?>
<li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Analyze table'); ?></a>
<?php echo $common_functions->showMySQLDocu('MySQL_Database_Administration', 'ANALYZE_TABLE');?>
</li>
<?php
}
if ($is_myisam_or_aria && !PMA_DRIZZLE) {
$this_url_params = array_merge(
$url_params,
array(
'sql_query' => 'REPAIR TABLE ' . $common_functions->backquote($GLOBALS['table']),
'table_maintenance' => 'Go',
)
);
?>
<li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Repair table'); ?></a>
<?php echo $common_functions->showMySQLDocu('MySQL_Database_Administration', 'REPAIR_TABLE'); ?>
</li>
<?php
}
if (($is_myisam_or_aria || $is_innodb || $is_berkeleydb) && !PMA_DRIZZLE) {
$this_url_params = array_merge(
$url_params,
array(
'sql_query' => 'OPTIMIZE TABLE ' . $common_functions->backquote($GLOBALS['table']),
'table_maintenance' => 'Go',
)
);
?>
<li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Optimize table'); ?></a>
<?php echo $common_functions->showMySQLDocu('MySQL_Database_Administration', 'OPTIMIZE_TABLE'); ?>
</li>
<?php
}
} // end MYISAM or BERKELEYDB case
$this_url_params = array_merge(
$url_params,
array(
'sql_query' => 'FLUSH TABLE ' . $common_functions->backquote($GLOBALS['table']),
'message_to_show' => sprintf(
__('Table %s has been flushed'),
htmlspecialchars($GLOBALS['table'])
),
'reload' => 1,
)
);
?>
<li><a class='maintain_action' href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Flush the table (FLUSH)'); ?></a>
<?php echo $common_functions->showMySQLDocu('MySQL_Database_Administration', 'FLUSH'); ?>
</li>
</ul>
</fieldset>
</div>
<?php if (! (isset($db_is_information_schema) && $db_is_information_schema)) { ?>
<div class="operations_half_width">
<fieldset class="caution">
<legend><?php echo __('Delete data or table'); ?></legend>
<ul>
<?php
if (! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_schema)) {
$this_sql_query = 'TRUNCATE TABLE ' . $common_functions->backquote($GLOBALS['table']);
$this_url_params = array_merge(
$url_params,
array(
'sql_query' => $this_sql_query,
'goto' => 'tbl_structure.php',
'reload' => '1',
'message_to_show' => sprintf(__('Table %s has been emptied'), htmlspecialchars($table)),
)
);
?>
<li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="truncate_tbl_anchor" class="ajax"' : ''); ?>>
<?php echo __('Empty the table (TRUNCATE)'); ?></a>
<?php echo $common_functions->showMySQLDocu('SQL-Syntax', 'TRUNCATE_TABLE'); ?>
</li>
<?php
}
if (! (isset($db_is_information_schema) && $db_is_information_schema)) {
$this_sql_query = 'DROP TABLE ' . $common_functions->backquote($GLOBALS['table']);
$this_url_params = array_merge(
$url_params,
array(
'sql_query' => $this_sql_query,
'goto' => 'db_operations.php',
'reload' => '1',
'purge' => '1',
'message_to_show' => sprintf(($tbl_is_view ? __('View %s has been dropped') : __('Table %s has been dropped')), htmlspecialchars($table)),
// table name is needed to avoid running
// PMA_relationsCleanupDatabase() on the whole db later
'table' => $GLOBALS['table'],
)
$truncate_table_url_params = array();
$drop_table_url_params = array();
if (! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_schema)) {
$this_sql_query = 'TRUNCATE TABLE ' . $common_functions->backquote($GLOBALS['table']);
$truncate_table_url_params = array_merge(
$url_params,
array(
'sql_query' => $this_sql_query,
'goto' => 'tbl_structure.php',
'reload' => '1',
'message_to_show' => sprintf(__('Table %s has been emptied'), htmlspecialchars($table)),
)
);
}
if (! (isset($db_is_information_schema) && $db_is_information_schema)) {
$this_sql_query = 'DROP TABLE ' . $common_functions->backquote($GLOBALS['table']);
$drop_table_url_params = array_merge(
$url_params,
array(
'sql_query' => $this_sql_query,
'goto' => 'db_operations.php',
'reload' => '1',
'purge' => '1',
'message_to_show' => sprintf(($tbl_is_view ? __('View %s has been dropped') : __('Table %s has been dropped')), htmlspecialchars($table)),
// table name is needed to avoid running
// PMA_relationsCleanupDatabase() on the whole db later
'table' => $GLOBALS['table'],
)
);
}
echo PMA_getHtmlForDeleteDataOrTable($truncate_table_url_params,
$drop_table_url_params
);
?>
<li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="drop_tbl_anchor"' : ''); ?>>
<?php echo __('Delete the table (DROP)'); ?></a>
<?php echo $common_functions->showMySQLDocu('SQL-Syntax', 'DROP_TABLE'); ?>
</li>
<?php
}
?>
</ul>
</fieldset>
</div>
<?php
}
?>
<br class="clearfloat">
<?php if (PMA_Partition::havePartitioning()) {
echo '<br class="clearfloat">';
if (PMA_Partition::havePartitioning()) {
$partition_names = PMA_Partition::getPartitionNames($db, $table);
// show the Partition maintenance section only if we detect a partition
if (! is_null($partition_names[0])) {
?>
<div class="operations_half_width">
<form method="post" action="tbl_operations.php">
<?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
<fieldset>
<legend><?php echo __('Partition maintenance'); ?></legend>
<?php
$html_select = '<select name="partition_name">' . "\n";
foreach ($partition_names as $one_partition) {
$one_partition = htmlspecialchars($one_partition);
$html_select .= '<option value="' . $one_partition . '">' . $one_partition . '</option>' . "\n";
}
$html_select .= '</select>' . "\n";
printf(__('Partition %s'), $html_select);
unset($partition_names, $one_partition, $html_select);
$choices = array(
'ANALYZE' => __('Analyze'),
'CHECK' => __('Check'),
'OPTIMIZE' => __('Optimize'),
'REBUILD' => __('Rebuild'),
'REPAIR' => __('Repair'));
echo $common_functions->getRadioFields('partition_operation', $choices, '', false);
unset($choices);
echo $common_functions->showMySQLDocu('partitioning_maintenance', 'partitioning_maintenance');
// I'm not sure of the best way to display that; this link does
// not depend on the Go button
$this_url_params = array_merge(
$url_params,
array(
'sql_query' => 'ALTER TABLE ' . $common_functions->backquote($GLOBALS['table']) . ' REMOVE PARTITIONING;'
)
);
?>
<br /><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Remove partitioning'); ?></a>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" name="submit_partition" value="<?php echo __('Go'); ?>" />
</fieldset>
</form>
</div>
<?php
} // end if
echo PMA_getHtmlForPartitionMaintenance($partition_names, $url_params);
} // end if
} // end if
unset($partition_names);
// Referential integrity check
// The Referential integrity check was intended for the non-InnoDB
@ -826,48 +388,7 @@ if ($cfgRelation['relwork'] && ! $is_innodb) {
$foreign = PMA_getForeigners($GLOBALS['db'], $GLOBALS['table']);
if ($foreign) {
?>
<!-- Referential integrity check -->
<div class="operations_half_width">
<fieldset>
<legend><?php echo __('Check referential integrity:'); ?></legend>
<ul>
<?php
echo "\n";
foreach ($foreign AS $master => $arr) {
$join_query = 'SELECT ' . $common_functions->backquote($GLOBALS['table']) . '.* FROM '
. $common_functions->backquote($GLOBALS['table']) . ' LEFT JOIN '
. $common_functions->backquote($arr['foreign_table']);
if ($arr['foreign_table'] == $GLOBALS['table']) {
$foreign_table = $GLOBALS['table'] . '1';
$join_query .= ' AS ' . $common_functions->backquote($foreign_table);
} else {
$foreign_table = $arr['foreign_table'];
}
$join_query .= ' ON '
. $common_functions->backquote($GLOBALS['table']) . '.' . $common_functions->backquote($master)
. ' = ' . $common_functions->backquote($foreign_table) . '.' . $common_functions->backquote($arr['foreign_field'])
. ' WHERE '
. $common_functions->backquote($foreign_table) . '.' . $common_functions->backquote($arr['foreign_field'])
. ' IS NULL AND '
. $common_functions->backquote($GLOBALS['table']) . '.' . $common_functions->backquote($master)
. ' IS NOT NULL';
$this_url_params = array_merge(
$url_params,
array('sql_query' => $join_query)
);
echo ' <li>'
. '<a href="sql.php'
. PMA_generate_common_url($this_url_params)
. '">' . $master . '&nbsp;->&nbsp;' . $arr['foreign_table'] . '.' . $arr['foreign_field']
. '</a></li>' . "\n";
} // foreach $foreign
unset($foreign_table, $join_query);
?>
</ul>
</fieldset>
</div>
<?php
echo PMA_getHtmlForReferentialIntegrityCheck($foreign, $url_params);
} // end if ($foreign)
} // end if (!empty($cfg['Server']['relation']))

View File

@ -41,7 +41,7 @@ $table_search = new PMA_TableSearch($db, $table, "normal");
/**
* Not selection yet required -> displays the selection form
*/
if (! isset($_POST['columnsToDisplay']) || $_POST['columnsToDisplay'][0] == '') {
if (! isset($_POST['columnsToDisplay']) && ! isset($_POST['displayAllColumns'])) {
// Gets some core libraries
include_once 'libraries/tbl_common.inc.php';
//$err_url = 'tbl_select.php' . $err_url;

View File

@ -63,6 +63,34 @@ if (isset($_REQUEST['createview'])) {
}
if (PMA_DBI_try_query($sql_query)) {
require_once './libraries/tbl_views.lib.php';
// If different column names defined for VIEW
$view_columns = array();
if (isset($_REQUEST['view']['column_names'])) {
$view_columns = explode(',', $_REQUEST['view']['column_names']);
}
$column_map = PMA_getColumnMap($_REQUEST['view']['as'], $view_columns);
$pma_tranformation_data = PMA_getExistingTranformationData($GLOBALS['db']);
if ($pma_tranformation_data !== false) {
// SQL for store new transformation details of VIEW
$new_transformations_sql = PMA_getNewTransformationDataSql(
$pma_tranformation_data, $column_map, $_REQUEST['view']['name'],
$GLOBALS['db']
);
// Store new transformations
if ($new_transformations_sql != '') {
PMA_DBI_try_query($new_transformations_sql);
}
}
unset($pma_tranformation_data);
if ($GLOBALS['is_ajax_request'] != true) {
$message = PMA_Message::success();
include './' . $cfg['DefaultTabDatabase'];
@ -75,7 +103,9 @@ if (isset($_REQUEST['createview'])) {
)
);
}
exit;
} else {
if ($GLOBALS['is_ajax_request'] != true) {
$message = PMA_Message::rawError(PMA_DBI_getError());