diff --git a/ChangeLog b/ChangeLog index 12f94bfeef..06745bbc90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/db_operations.php b/db_operations.php index 8f6d027797..0bdb94f046 100644 --- a/db_operations.php +++ b/db_operations.php @@ -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 */ - ?> -
-
- -
- - '; - } - echo __('Database comment: '); - ?> - - -
-
- -
-
-
- addHTML(PMA_getHtmlForDatabaseComment($db)); } - ?> -
- -
- addHTML('
'); + ob_start(); + include 'libraries/display_create_table.lib.php'; + $content = ob_get_contents(); + ob_end_clean(); + $response->addHTML($content); + $response->addHTML('
'); + /** * rename database */ -if ($db != 'mysql') { - ?> -
-
method="post" action="db_operations.php" - onsubmit="return emptyFormElements(this, 'newname')"> - ' . "\n"; + if ($db != 'mysql') { + $response->addHTML(PMA_getHtmlForRenameDatabase($db)); } - ?> - - - -
- - getImage('b_edit.png'); - } - echo __('Rename database to') . ':'; - ?> - - -
-
- -
-
-
- -
-
- getImage('b_deltbl.png'); -} -echo __('Remove database'); -?> - - -
-
- -
-
method="post" action="db_operations.php" - onsubmit="return emptyFormElements(this, 'newname')"> - ' . "\n"; - } - echo '' . "\n"; - echo PMA_generate_common_hidden_inputs($db); - ?> -
- - getImage('b_edit.png'); - } - echo __('Copy database to') . ':'; - $drop_clause = 'DROP TABLE / DROP VIEW'; - ?> - -
- __('Structure only'), - 'data' => __('Structure and data'), - 'dataonly' => __('Data only')); - echo $common_functions->getRadioFields( - 'what', $choices, 'data', true - ); - unset($choices); -?> - -
- -
- -
- -
- addHTML(PMA_getHtmlForDropDatabaseLink($db)); } - ?> - - /> - -
-
- -
-
-
- addHTML(PMA_getHtmlForCopyDatabase($db)); /** * Change database charset */ - echo '
' - . PMA_generate_common_hidden_inputs($db, $table) - . '
' . "\n" - . ' '; - if ($cfg['PropertiesIconic']) { - echo $common_functions->getImage('s_asci.png'); - } - echo ' ' . "\n" - . ' ' . "\n" - . PMA_generateCharsetDropdownBox( - PMA_CSDROPDOWN_COLLATION, 'db_collation', - 'select_db_collation', $db_collation, false, 3 - ) - . '
' - . '
' - . ' ' . "\n" - . '
' . "\n" - . '
' . "\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('', false); + $message = PMA_Message::notice( + __('The phpMyAdmin configuration storage has been deactivated. To find out why click %shere%s.') + ); + $message->addParam( + '', + false + ); $message->addParam('', false); /* Show error if user has configured something, notice elsewhere */ if (!empty($cfg['Servers'][$server]['pmadb'])) { $message->isError(true); } - echo '
'; - $message->display(); - echo '
'; + $response->addHTML('
'); + $response->addHTML($message->getDisplay()); + $response->addHTML('
'); } // 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) { ?> - - - 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 '
'; - if ($cfg['PropertiesIconic']) { - echo $common_functions->getImage('b_edit.png'); - } - echo __('Edit or export relational schema') . '
'; + $response->addHTML(PMA_getHtmlForExportRelationalSchemaView($url_query)); } // end if ?> diff --git a/js/functions.js b/js/functions.js index e7877e0db2..0f88ac2205 100644 --- a/js/functions.js +++ b/js/functions.js @@ -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(); }); diff --git a/js/tbl_select.js b/js/tbl_select.js index b8c9f386d5..f04b4e3553 100644 --- a/js/tbl_select.js +++ b/js/tbl_select.js @@ -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 diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 01d47aa670..648f4aab5e 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -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 diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 0674115400..d67237f1a5 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -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']) . '...'; diff --git a/libraries/Response.class.php b/libraries/Response.class.php index c341acc614..d10aecb0e0 100644 --- a/libraries/Response.class.php +++ b/libraries/Response.class.php @@ -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() { diff --git a/libraries/Table.class.php b/libraries/Table.class.php index e504746fd5..c6138e55a9 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -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; } diff --git a/libraries/TableSearch.class.php b/libraries/TableSearch.class.php index be354cadea..107efbf712 100644 --- a/libraries/TableSearch.class.php +++ b/libraries/TableSearch.class.php @@ -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']); diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 3190eb7ec6..43f29ea686 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -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]' diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 30b934a697..9902cf1e90 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -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 * diff --git a/libraries/mult_submits.inc.php b/libraries/mult_submits.inc.php index 680db4d2ac..3008805431 100644 --- a/libraries/mult_submits.inc.php +++ b/libraries/mult_submits.inc.php @@ -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 diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php new file mode 100644 index 0000000000..d1196a5b46 --- /dev/null +++ b/libraries/operations.lib.php @@ -0,0 +1,1392 @@ +' + . '
' + . PMA_generate_common_hidden_inputs($db) + . '
' + . ''; + if ($GLOBALS['cfg']['PropertiesIconic']) { + $html_output .= ''; + } + $html_output .= __('Database comment: '); + $html_output .= ''; + $html_output .= '' + . '
'; + $html_output .= '
' + . '' + . '
' + . '
' + . ''; + + return $html_output; +} + +/** + * Get HTML output for rename database + * + * @param $db database name + * + * @return string $html_output + */ +function PMA_getHtmlForRenameDatabase($db) +{ + $html_output = '
' + . '
'; + if (isset($_REQUEST['db_collation'])) { + $html_output .= '' . "\n"; + } + $html_output .= '' + . '' + . PMA_generate_common_hidden_inputs($db) + . '
' + . ''; + + if ($GLOBALS['cfg']['PropertiesIconic']) { + $html_output .= PMA_CommonFunctions::getInstance()->getImage('b_edit.png'); + } + $html_output .= __('Rename database to') . ':' + . ''; + + $html_output .= '' + . '
' + . '
' + . '' + . '
' + . '
' + . '
'; + + return $html_output; +} + +/** + * Get HTML for database drop link + * + * @param $db database name + * + * @return string $html_output + */ +function PMA_getHtmlForDropDatabaseLink($db) +{ + $common_functions = PMA_CommonFunctions::getInstance(); + + $this_sql_query = 'DROP DATABASE ' . $common_functions->backquote($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, + ); + + $html_output = '
' + . '
'; + $html_output .= ''; + if ($GLOBALS['cfg']['PropertiesIconic']) { + $html_output .= $common_functions->getImage('b_deltbl.png'); + } + $html_output .= __('Remove database') + . ''; + $html_output .= '
' + . '
'; + + return $html_output; +} + +/** + * Get HTML snippet for copy database + * + * @param $db database name + * + * @return string $html_output + */ +function PMA_getHtmlForCopyDatabase($db) +{ + $drop_clause = 'DROP TABLE / DROP VIEW'; + $choices = array( + 'structure' => __('Structure only'), + 'data' => __('Structure and data'), + 'dataonly' => __('Data only') + ); + + if (isset($_COOKIE) + && isset($_COOKIE['pma_switch_to_new']) + && $_COOKIE['pma_switch_to_new'] == 'true' + ) { + $pma_switch_to_new = 'true'; + } + + $html_output = '
'; + $html_output .= '
'; + + if (isset($_REQUEST['db_collation'])) { + $html_output .= '' . "\n"; + } + $html_output .= '' . "\n" + . PMA_generate_common_hidden_inputs($db); + $html_output .= '
' + . ''; + + if ($GLOBALS['cfg']['PropertiesIconic']) { + $html_output .= PMA_CommonFunctions::getInstance()->getImage('b_edit.png'); + } + $html_output .= __('Copy database to') . ':' + . '' + . '
' + . PMA_CommonFunctions::getInstance()->getRadioFields( + 'what', $choices, 'data', true + ); + $html_output .= ''; + $html_output .= '
'; + $html_output .= ''; + $html_output .= '
'; + $html_output .= ''; + $html_output .= '
'; + $html_output .= ''; + $html_output .= '
'; + $html_output .= ''; + $html_output .= '' + . '
'; + $html_output .= '
' + . '' + . '
' + . '
' + . '
'; + + return $html_output; +} + +/** + * Get HTML snippet for change database charset + * + * @param $db database name + * @param $table tabel name + * + * @return string $html_output + */ +function PMA_getHtmlForChangeDatabaseCharset($db, $table) +{ + $html_output = '
'; + if ($GLOBALS['cfg']['PropertiesIconic']) { + $html_output .= PMA_CommonFunctions::getInstance()->getImage('s_asci.png'); + } + $html_output .= '' . "\n" + . '' . "\n" + . PMA_generateCharsetDropdownBox( + PMA_CSDROPDOWN_COLLATION, 'db_collation', + 'select_db_collation', + (isset ($_REQUEST['db_collation']) ? $_REQUEST['db_collation'] : ''), + false, 3 + ) + . '' + . '
' + . '' . "\n" + . '
' . "\n" + . '
' . "\n"; + + return $html_output; +} + +/** + * Get HTML snippet for export relational schema view + * + * @param string $url_query + * + * @return string $html_output + */ +function PMA_getHtmlForExportRelationalSchemaView($url_query) +{ + $html_output = '
' + . '
'; + if ($GLOBALS['cfg']['PropertiesIconic']) { + $html_output .= PMA_CommonFunctions::getInstance()->getImage('b_edit.png'); + } + $html_output .= __('Edit or export relational schema') + . '
' + . '
'; + + return $html_output; +} + +/** + * Run the Procedure definitions and function definitions + * + * to avoid selecting alternatively the current and new db + * we would need to modify the CREATE definitions to qualify + * the db name + * + * @param $db database name + */ +function PMA_runProcedureAndFunctionDefinitions($db) +{ + $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($_REQUEST['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($_REQUEST['newname']); + PMA_DBI_query($tmp_query); + } + } +} + +/** + * Get sql query and create database before copy + * + * @return string $sql_query + */ +function PMA_getSqlQueryAndCreateDbBeforeCopy() +{ + // 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') { + $_REQUEST['newname'] = PMA_strtolower($_REQUEST['newname']); + } + } + + $local_query = 'CREATE DATABASE ' + . PMA_CommonFunctions::getInstance()->backquote($_REQUEST['newname']); + if (isset($_REQUEST['db_collation'])) { + $local_query .= ' DEFAULT' + . PMA_generateCharsetQueryPart($_REQUEST['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 = $GLOBALS['db']; + PMA_DBI_query($local_query); + $GLOBALS['db'] = $original_db; + + // rebuild the database list because PMA_Table::moveCopy + // checks in this list if the target db exists + $GLOBALS['pma']->databases->build(); + + return $sql_query; +} + +/** + * remove all foreign key constraints and return sql constraints query for full database + * + * @param array $tables_full array of all tables in given db or dbs + * @param instance $export_sql_plugin export plugin instance + * @param boolean $move whether databse name is empty or not + * @param $db database name + */ +function PMA_getSqlConstraintsQueryForFullDb($tables_full, $export_sql_plugin, $move, $db) +{ + $sql_constraints_query_full_db = array(); + 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 + ); + if ($move && ! empty($sql_drop_foreign_keys)) { + PMA_DBI_query($sql_drop_foreign_keys); + } + // keep the constraint we just dropped + if (! empty($sql_constraints)) { + $sql_constraints_query_full_db[] = $sql_constraints; + } + } + return $sql_constraints_query_full_db; +} + +/** + * Get views as an array and create SQL view stand-in + * + * @param array $tables_full array of all tables in given db or dbs + * @param instance $export_sql_plugin export plugin instance + * @param $db database name + * + * @return array $views + */ +function PMA_getViewsAndCreateSqlViewStandIn($tables_full, $export_sql_plugin, $db) +{ + $views = array(); + 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($_REQUEST['newname']); + PMA_DBI_query($sql_view_standin); + $GLOBALS['sql_query'] .= "\n" . $sql_view_standin; + } + } + return $views; +} + +/** + * Get sql query for copy/rename table and boolean for whether copy/rename or not + * + * @param array $tables_full array of all tables in given db or dbs + * @param string $sql_query sql query for all operations + * @param boolean $move whether databse name is empty or not + * @param $db database name + * + * @return array ($sql_query, $error) + */ +function PMA_getSqlQueryForCopyTable($tables_full, $sql_query, $move, $db) +{ + $error = false; + 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 = $_REQUEST['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, $_REQUEST['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($_REQUEST['newname']); + foreach ($triggers as $trigger) { + PMA_DBI_query($trigger['create']); + $GLOBALS['sql_query'] .= "\n" . $trigger['create'] . ';'; + } + } + + // this does not apply to a rename operation + if (isset($_REQUEST['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; + } + return array($sql_query, $error); +} + +/** + * Run the EVENT definition for selected database + * + * to avoid selecting alternatively the current and new db + * we would need to modify the CREATE definitions to qualify + * the db name + * + * @param $db database name + */ +function PMA_runEventDefinitionsForDb($db) +{ + $event_names = PMA_DBI_fetch_result( + 'SELECT EVENT_NAME FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' + . PMA_CommonFunctions::getInstance()->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($_REQUEST['newname']); + PMA_DBI_query($tmp_query); + } + } +} + +/** + * Handle the views, return the boolean value whether table rename/copy or not + * + * @param array $views views as an array + * @param boolean $move whether databse name is empty or not + * @param $db database name + * + * @return boolean $_error whether table rename/copy or not + */ +function PMA_handleTheViews($views, $move, $db) +{ + $_error = false; + // temporarily force to add DROP IF EXIST to CREATE VIEW query, + // to remove stand-in VIEW that was created earlier + if (isset($_REQUEST['drop_if_exists'])) { + $temp_drop_if_exists = $_REQUEST['drop_if_exists']; + } + $_REQUEST['drop_if_exists'] = 'true'; + + foreach ($views as $view) { + if (! PMA_Table::moveCopy($db, $view, $_REQUEST['newname'], + $view, 'structure', $move, 'db_copy') + ) { + $_error = true; + break; + } + } + unset($_REQUEST['drop_if_exists']); + if (isset($temp_drop_if_exists)) { + // restore previous value + $_REQUEST['drop_if_exists'] = $temp_drop_if_exists; + } + return $_error; +} + +/** + * Create all accumulated constraaints + */ +function PMA_createAllAccumulatedConstraints() +{ + PMA_DBI_select_db($_REQUEST['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']); +} + +/** + * Duplicate the bookmarks for the db (done once for each db) + * + * @param boolean $_error whether table rename/copy or not + * @param string $db database name + */ +function PMA_duplicateBookmarks($_error, $db) +{ + if (! $_error && $db != $_REQUEST['newname']) { + $get_fields = array('user', 'label', 'query'); + $where_fields = array('dbase' => $db); + $new_fields = array('dbase' => $_REQUEST['newname']); + PMA_Table::duplicateInfo( + 'bookmarkwork', 'bookmark', $get_fields, + $where_fields, $new_fields + ); + } +} + +/** + * Get the HTML snippet for order the table + * + * @param type $columns columns array + * + * @return string $html_out + */ +function PMA_getHtmlForOrderTheTable($columns) +{ + $html_output = '
'; + $html_output .= '
'; + $html_output .= PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); + $html_output .= '
' + . '' . __('Alter table order by') . '' + . ' ' . __('(singly)') + . '' + . '
' + . '
' + . '' + . '
' + . '
' + . '
'; + + return $html_output; +} + +/** + * Get the HTML snippet for move table + * + * @return string $html_output + */ +function PMA_getHtmlForMoveTable() +{ + $html_output = '
'; + $html_output .= '
' + . PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); + + $html_output .= '' + . '' + . '
'; + + $html_output .= '' . __('Move table to (database.table):') + . ''; + + if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) { + $html_output .= ''; + } else { + $html_output .= ''; + } + $html_output .= ' . '; + $html_output .= '
'; + + // 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 + + $html_output .= '' + . '
' + . '
'; + + $html_output .= '
' + . '' + . '
' + . '
' + . '
'; + + return $html_output; +} + +/** + * Get the HTML div for Table option + * + * @param string $comment Comment + * @param array $tbl_collation table collation + * @param string $tbl_storage_engine table storage engine + * @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not + * @param boolean $is_isam whether ISAM or not + * @param array $pack_keys pack keys + * @param string $delay_key_write delay key write + * @param string $auto_increment value of auto increment + * @param string $transactional value of transactional + * @param string $page_checksum value of page checksum + * @param boolean $is_innodb whether INNODB or not + * @param boolean $is_pbxt whether PBXT or not + * @param boolean $is_aria whether ARIA or not + * + * @return string $html_output + */ +function PMA_getTableOptionDiv($comment, $tbl_collation, $tbl_storage_engine, + $is_myisam_or_aria, $is_isam, $pack_keys, $auto_increment, $delay_key_write, + $transactional, $page_checksum, $is_innodb, $is_pbxt, $is_aria +) { + $html_output = '
'; + $html_output .= '
'; + $html_output .= PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']) + . ''; + + $html_output .= PMA_getTableOptionFieldset($comment, $tbl_collation, $tbl_storage_engine, + $is_myisam_or_aria, $is_isam, $pack_keys, $delay_key_write, $auto_increment, + $transactional, $page_checksum, $is_innodb, $is_pbxt,$is_aria + ); + + $html_output .= '
' + . '' + . '
' + . '
' + . '
'; + + return $html_output; +} + +/** + * Get HTML fieldset for Table option, it contains HTML table for options + * + * @param string $comment Comment + * @param array $tbl_collation table collation + * @param string $tbl_storage_engine table storage engine + * @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not + * @param boolean $is_isam whether ISAM or not + * @param array $pack_keys pack keys + * @param string $delay_key_write delay key write + * @param string $auto_increment value of auto increment + * @param string $transactional value of transactional + * @param string $page_checksum value of page checksum + * @param boolean $is_innodb whether INNODB or not + * @param boolean $is_pbxt whether PBXT or not + * @param boolean $is_aria whether ARIA or not + * + * @return string $html_output + */ +function PMA_getTableOptionFieldset($comment, $tbl_collation, $tbl_storage_engine, + $is_myisam_or_aria, $is_isam, $pack_keys, $delay_key_write, $auto_increment, + $transactional, $page_checksum, $is_innodb, $is_pbxt, $is_aria +) { + $html_output = '
' + . '' . __('Table options') . ''; + + $html_output .= ''; + //Change table name + $html_output .= '' + . '' + . ''; + + //Table comments + $html_output .= '' + . '' + . ''; + + //Storage engine + $html_output .= '' + . '' + . ''; + + //Table character set + $html_output .= '' + . '' + . ''; + + if ($is_myisam_or_aria || $is_isam) { + $html_output .= '' + . '' + . '' + . ''; + } // end if (MYISAM|ISAM) + + if ($is_myisam_or_aria) { + $html_output .= PMA_getTableRow( + 'new_checksum', + 'CHECKSUM', + $checksum + ); + + $html_output .= PMA_getTableRow( + 'new_delay_key_write', + 'DELAY_KEY_WRITE', + $delay_key_write + ); + } // end if (MYISAM) + + if ($is_aria) { + $html_output .= PMA_getTableRow( + 'new_transactional', + 'TRANSACTIONAL', + $transactional + ); + + $html_output .= PMA_getTableRow( + 'new_page_checksum', + 'PAGE_CHECKSUM', + $page_checksum + ); + } // end if (ARIA) + + if (isset($_REQUEST['auto_increment']) + && strlen($_REQUEST['auto_increment']) > 0 + && ($is_myisam_or_aria || $is_innodb || $is_pbxt) + ) { + $html_output .= '' + . '' + . ' '; + } // end if (MYISAM|INNODB) + + $possible_row_formats = PMA_getPossibleRowFormat(); + + // 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) + + if (isset($possible_row_formats[$tbl_storage_engine])) { + $current_row_format = strtoupper($GLOBALS['showtable']['Row_format']); + $html_output .= '' + . ''; + } + $html_output .= '
' . __('Rename table to') . '' + . '
' . __('Table comments') . '' + . '' + . '
' . __('Storage Engine') + . PMA_CommonFunctions::getInstance()->showMySQLDocu( + 'Storage_engines', 'Storage_engines' + ) + . '' + . PMA_StorageEngine::getHtmlSelect( + 'new_tbl_storage_engine', null, $tbl_storage_engine + ) + . '
' . __('Collation') . '' + . PMA_generateCharsetDropdownBox( + PMA_CSDROPDOWN_COLLATION, + 'tbl_collation', null, $tbl_collation, false, 3 + ) + . '
' + . '
' + . ''; + $html_output .= PMA_CommonFunctions::getInstance()->getDropdown( + 'new_row_format', $possible_row_formats[$tbl_storage_engine], + $current_row_format, 'new_row_format' + ); + $html_output .= '
' + . '
'; + + return $html_output; +} + +/** + * Get the common HTML table row (tr) for new_checksum, new_delay_key_write, + * new_transactional and new_page_checksum + * + * @param string $attribute class, name and id attribute + * @param string $label label value + * @param string $val checksum, delay_key_write, transactional, page_checksum + * + * @return string $html_output + */ +function PMA_getTableRow($attribute, $label, $val) +{ + return '' + . '' + . '' + . ''; +} + +/** + * Get array of possible row formats + * + * @return array $possible_row_formats + */ +function PMA_getPossibleRowFormat() +{ + // 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') + ); + + $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'; + } + + return $possible_row_formats; +} + +/** + * Get HTML div for copy table + * + * @return string $html_output + */ +function PMA_getHtmlForCopytable() +{ + $html_output = '
'; + $html_output .= '
' + . PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']) + . ''; + + $html_output .= '
'; + $html_output .= '' + . __('Copy table to (database.table):') . ''; + + if (count($GLOBALS['pma']->databases) > $GLOBALS['cfg']['MaxDbList']) { + $html_output .= ''; + } else { + $html_output .= ''; + } + $html_output .= ' . '; + $html_output .= '
'; + + $choices = array( + 'structure' => __('Structure only'), + 'data' => __('Structure and data'), + 'dataonly' => __('Data only')); + + $html_output .= PMA_CommonFunctions::getInstance()->getRadioFields( + 'what', $choices, 'data', true + ); + + $html_output .= '' + . '
' + . '' + . '
'; + + // display "Add constraints" choice only if there are + // foreign keys + if (PMA_getForeigners($GLOBALS['db'], $GLOBALS['table'], '', 'foreign')) { + $html_output .= ''; + $html_output .= '
'; + } // endif + + if (isset($_COOKIE['pma_switch_to_new']) + && $_COOKIE['pma_switch_to_new'] == 'true' + ) { + $pma_switch_to_new = 'true'; + } + + $html_output .= ''; + $html_output .= '' + . '
'; + + $html_output .= '
' + . '' + . '
' + . '
' + . '
'; + + return $html_output; +} + +/** + * Get HTML snippet for table maintence + * + * @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not + * @param boolean $is_innodb whether innodb or not + * @param boolean $is_berkeleydb whether berkeleydb or not + * @param array $url_params array of URL parameters + * + * @return string $html_output + */ +function PMA_getHtmlForTableMaintenance( + $is_myisam_or_aria, $is_innodb, $is_berkeleydb, $url_params +) { + $common_functions = PMA_CommonFunctions::getInstance(); + + $html_output = '
'; + $html_output .= '
' + . '' . __('Table maintenance') . ''; + $html_output .= '' + . '
' + . '
'; + + return $html_output; +} + +/** + * Get HTML 'li' having a link of maintain action + * + * @param boolean $is_myisam_or_aria whether MYISAM | ARIA or not + * @param boolean $is_innodb whether innodb or not + * @param array $url_params array of URL parameters + * @param boolean $is_berkeleydb whether berkeleydb or not + * + * @return string $html_output + */ +function PMA_getListofMaintainActionLink($is_myisam_or_aria, + $is_innodb, $url_params, $is_berkeleydb +) { + $common_functions = PMA_CommonFunctions::getInstance(); + $html_output = ''; + + if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { + if ($is_myisam_or_aria || $is_innodb) { + $params = array( + 'sql_query' => 'CHECK TABLE ' + . $common_functions->backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + ); + $html_output .= PMA_getMaintainActionlink( + 'Check table', + $params, + $url_params, + 'CHECK_TABLE' + ); + } + if ($is_innodb) { + $params = array( + 'sql_query' => 'ALTER TABLE ' + . $common_functions->backquote($GLOBALS['table']) + . ' ENGINE = InnoDB;' + ); + $html_output .= PMA_getMaintainActionlink( + 'Defragment table', + $params, + $url_params, + 'InnoDB_File_Defragmenting', + 'Table_types' + ); + } + if ($is_myisam_or_aria || $is_berkeleydb) { + $params = array( + 'sql_query' => 'ANALYZE TABLE ' + . $common_functions->backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + ); + $html_output .= PMA_getMaintainActionlink( + 'Analyze table', + $params, + $url_params, + 'ANALYZE_TABLE' + ); + } + if ($is_myisam_or_aria && !PMA_DRIZZLE) { + $params = array( + 'sql_query' => 'REPAIR TABLE ' + . $common_functions->backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + ); + $html_output .= PMA_getMaintainActionlink( + 'Repair table', + $params, + $url_params, + 'REPAIR_TABLE' + ); + } + if (($is_myisam_or_aria || $is_innodb || $is_berkeleydb) && !PMA_DRIZZLE) { + $params = array( + 'sql_query' => 'OPTIMIZE TABLE ' + . $common_functions->backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + ); + $html_output .= PMA_getMaintainActionlink( + 'Optimize table', + $params, + $url_params, + 'OPTIMIZE_TABLE' + ); + } + } // end MYISAM or BERKELEYDB case + + $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, + ); + + $html_output .= PMA_getMaintainActionlink( + 'Flush the table (FLUSH)', + $params, + $url_params, + 'FLUSH' + ); + + return $html_output; +} + +/** + * Get maintain action HTML link + * + * @param array $params url parameters array + * @param string $link contains name of page/anchor that is being linked + * @param string $chapter chapter of "HTML, one page per chapter" documentation + * + * @return string $html_output + */ +function PMA_getMaintainActionlink($action, $params, $url_params, $link, + $chapter = 'MySQL_Database_Administration' +) { + return '
  • ' + . '' + . __($action) + . '' + . PMA_CommonFunctions::getInstance()->showMySQLDocu( + $chapter, + $link + ) + . '
  • '; +} + +/** + * Get HTML for Delete data or table (truncate table, drop table) + * + * @param array $truncate_table_url_params url parameter array for truncate table + * @param array $drop_table_url_params url parameter array for drop table + * + * @return string $html_output + */ +function PMA_getHtmlForDeleteDataOrTable( + $truncate_table_url_params, + $drop_table_url_params +) { + $html_output = '
    ' + . '
    ' + . '' . __('Delete data or table') . ''; + + $html_output .= '
    '; + + return $html_output; +} + +/** + * Get the HTML link for Truncate table, Drop table and Drop db + * + * @param array $url_params url parameter array for delete data or table + * @param string $syntax TRUNCATE_TABLE or DROP_TABLE or DROP_DATABASE + * @param string $link link to be shown + * + * @return String html output + */ +function PMA_getDeleteDataOrTablelink($url_params, $syntax, $link, $id) +{ + return '
  • ' + . $link . '' + . PMA_CommonFunctions::getInstance()->showMySQLDocu( + 'SQL-Syntax', $syntax + ) + . '
  • '; +} + +/** + * Get HTML snippet for partition maintenance + * + * @param array $partition_names array of partition names for a specific db/table + * @param array $url_params url parameters + * + * @return string $html_output + */ +function PMA_getHtmlForPartitionMaintenance($partition_names, $url_params) +{ + $common_functions = PMA_CommonFunctions::getInstance(); + + $choices = array( + 'ANALYZE' => __('Analyze'), + 'CHECK' => __('Check'), + 'OPTIMIZE' => __('Optimize'), + 'REBUILD' => __('Rebuild'), + 'REPAIR' => __('Repair') + ); + + $html_output = '
    ' + . '
    ' + . PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']) + . '
    ' + . '' . __('Partition maintenance') . ''; + + $html_select = '' . "\n"; + $html_output .= sprintf(__('Partition %s'), $html_select); + + $html_output .= $common_functions->getRadioFields( + 'partition_operation', $choices, '', false + ); + $html_output .= $common_functions->showMySQLDocu( + 'partitioning_maintenance', + 'partitioning_maintenance' + ); + $this_url_params = array_merge( + $url_params, + array( + 'sql_query' => 'ALTER TABLE ' + . $common_functions->backquote($GLOBALS['table']) + . ' REMOVE PARTITIONING;' + ) + ); + $html_output .= '
    ' + . __('Remove partitioning') . ''; + + $html_output .= '
    ' + . '
    ' + . '' + . '
    ' + . '
    ' + . '
    '; + + return $html_output; +} + +/** + * Get the HTML for Referential Integrity check + * + * @param array $foreign all Relations to foreign tables for a given table + * or optionally a given column in a table + * @param array $url_params array of url parameters + * + * @return string $html_output + */ +function PMA_getHtmlForReferentialIntegrityCheck($foreign, $url_params) +{ + $common_functions = PMA_CommonFunctions::getInstance(); + + $html_output = '
    ' + . '
    ' + . '' . __('Check referential integrity:') . ''; + + $html_output .= '
    '; + + return $html_output; +} + +function PMA_getQueryAndResultForReorderingTable() +{ + $common_functions = PMA_CommonFunctions::getInstance(); + + $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); + + return array($sql_query, $result); +} + + +?> diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 1649a8d149..278883b2d7 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -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 = ''."\n" . ' ' + . 'value="' + . htmlspecialchars($username) + . '&#27;' . htmlspecialchars($hostname) . '" />' . '' . "\n" . '' . "\n" - . '' . htmlspecialchars($_REQUEST['hostname']) . '' . "\n"; - + : htmlspecialchars($username) ) . '' . "\n" + . '' . htmlspecialchars($hostname) . '' . "\n"; + $new_user_string .= ''; if (! empty($password) || isset($_POST['pma_pw'])) { @@ -1781,15 +1781,15 @@ function PMA_getExtraDataForAjaxBehavior($password, $link_export, $sql_query, $new_user_string .= '' . sprintf($link_edit, - urlencode($_REQUEST['username']), - urlencode($_REQUEST['hostname']), + urlencode($username), + urlencode($hostname), '', '' ) . '' . "\n"; $new_user_string .= '' . sprintf($link_export, - urlencode($_REQUEST['username']), - urlencode($_REQUEST['hostname']), + urlencode($username), + urlencode($hostname), (isset($_GET['initial']) ? $_GET['initial'] : '') ) . '' . "\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 = '' . $new_user_initial . ''; diff --git a/libraries/tbl_views.lib.php b/libraries/tbl_views.lib.php new file mode 100644 index 0000000000..4b94439e2e --- /dev/null +++ b/libraries/tbl_views.lib.php @@ -0,0 +1,161 @@ + 0) { + + for ($i=0; $itable; + $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 : ''; + +} + + +?> diff --git a/libraries/transformations.lib.php b/libraries/transformations.lib.php index a653570d93..561406e0eb 100644 --- a/libraries/transformations.lib.php +++ b/libraries/transformations.lib.php @@ -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); + +} + ?> diff --git a/pmd_general.php b/pmd_general.php index 2feeb249ac..690107e50a 100644 --- a/pmd_general.php +++ b/pmd_general.php @@ -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'; ?>
    - - v - v - - key + + v - - key + + + + + + + + + + + + + + + + + - key + + + + + + + + + v + + + key + + + key + + + + key + '; } ?> - - > + + > +
    @@ -217,9 +229,9 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) { px; + echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["X"] : rand(20, 700); ?>px; top: px; + echo isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y"] : rand(90, 550); ?>px; visibility: Please ask the " #~ "author what %s does." diff --git a/po/ckb.po b/po/ckb.po index 9bd58a81f8..bf70db52fd 100644 --- a/po/ckb.po +++ b/po/ckb.po @@ -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 \n" -"Language-Team: none\n" +"PO-Revision-Date: 2012-08-04 12:39+0200\n" +"Last-Translator: renwar kurd \n" +"Language-Team: Kurdish Sorani " +"\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" diff --git a/po/da.po b/po/da.po index c1f0767520..1a23a1a72f 100644 --- a/po/da.po +++ b/po/da.po @@ -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 \n" -"Language-Team: danish \n" +"Language-Team: Danish \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 MySQL Documentation" +"BLOB eller TEXT-kolonne eller en kolonne større end 512 bytes) som nævnt i " +"MySQL Documentation" #: 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 this blog entry" 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å dette blogindlæg" @@ -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å " "denne artikel.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å dette blogindlæg" +"innodb_log_file_size/\">denne artikel.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å dette blogindlæg" #: 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" diff --git a/po/de.po b/po/de.po index 629c30b671..a02a114e22 100644 --- a/po/de.po +++ b/po/de.po @@ -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 \n" -"Language-Team: none\n" +"PO-Revision-Date: 2012-08-06 09:31+0200\n" +"Last-Translator: J. M. \n" +"Language-Team: German \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 diff --git a/po/nb.po b/po/nb.po index a2ffbb0d0e..a3b6a47832 100644 --- a/po/nb.po +++ b/po/nb.po @@ -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" diff --git a/po/tr.po b/po/tr.po index 604788fa14..db25d4f013 100644 --- a/po/tr.po +++ b/po/tr.po @@ -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 \n" -"Language-Team: turkish \n" +"Language-Team: Turkish " +"\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 "" diff --git a/po/zh_CN.po b/po/zh_CN.po index ee1862ec52..a6ad4c27a6 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -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 \n" -"Language-Team: chinese_simplified \n" +"Language-Team: Chinese (China) " +"\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 Article by the Pythian Group" msgstr "" +"增加 {max_heap_table_size} 和 {tmp_table_size} " +"可能会有帮助。但有些临时表总是会写入硬盘,和这些变量无关。要避免这些,您需要重写您的查询来避免 Pythian " +"小组的文章开头所提到的这些条件 (临时表内: 具有 BLOB 或 TEXT 字段或具有大于 512 字节的字段)" #: libraries/advisory_rules.txt:267 #, php-format @@ -12742,15 +12751,19 @@ msgid "" "mentioned in the MySQL Documentation" msgstr "" +"增加 {max_heap_table_size} 和 {tmp_table_size} " +"可能会有帮助。但有些临时表总是会写入硬盘,和这些变量无关。要避免这些,您需要重写您的查询来避免 MySQL 文档中所提到的这些条件 (临时表内: 具有 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 might help you track down the " "source." msgstr "" +"连接通常因为无法被授权而中止。这篇文章对您追踪来源可能有所帮助。" #: 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 this blog entry" msgstr "" -"通常将 innodb_log_file_size 设置为 {innodb_buffer_pool_size} 的 25%% 已经足" -"够。过大的 innodb_log_file_size 将会严重减慢数据库崩溃后的恢复时间。参见这篇文章。您首先需要关闭服务器,移除 InnoDB 日志" -"文件,然后在 my.cnf 中设置新的值,最后启动服务器,并检查错误日志确定一切都正" -"常。参见这篇博客" +"在一个 InnoDB 表写入很多的系统上您应该将 innodb_log_file_size 设为 {innodb_buffer_pool_size} 的 " +"25%% 。因为该值越大,当数据库崩溃时恢复的时间就越长,所以该值不应高于 256 MB 。请注意您不能简单的修改该变量的值。您需要关闭服务器,删除 " +"InnoDB 日志文件,在 my.cnf 中设置新的值,启动服务器,一切正常后再检查错误日志。参见这篇博客" #: 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 MySQL Documentation" msgstr "" +"设置 {concurrent_insert} 为 1 可以减少在相同表上的读取和写入冲突。参见 MySQL " +"文档" #: libraries/advisory_rules.txt:457 msgid "concurrent_insert is set to 0" diff --git a/server_privileges.php b/server_privileges.php index 8c4ee4cc6a..26114a00f2 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -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) { diff --git a/sql.php b/sql.php index 5c2344e681..ac2e362823 100644 --- a/sql.php +++ b/sql.php @@ -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; + +} ?> diff --git a/tbl_operations.php b/tbl_operations.php index 66f687cd50..52e22eb36b 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -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 + */ +echo PMA_getHtmlForOrderTheTable($columns); - -
    -
    - - - -
    - .table):'); ?> -databases) > $GLOBALS['cfg']['MaxDbList']) { -?> - - - - -  .  -
    - - -
    -
    -
    - -
    - -
    +/** + * Move table + */ +echo PMA_getHtmlForMoveTable(); -5.0.4, >4.1.12 and >4.0.11, so I decided not to // check for version -?> - -
    -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - && ($is_myisam_or_aria || $is_innodb || $is_pbxt) -) { - ?> - - - - 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 '
    '; -if (isset($possible_row_formats[$tbl_storage_engine])) { - $current_row_format = strtoupper($showtable['Row_format']); - echo ''; - echo ''; - echo ''; -} -?> -
    -
    - -
    - showMySQLDocu('Storage_engines', 'Storage_engines'); ?> - -
    -
    -
    /> -
    /> -
    /> -
    /> -
    '; - 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 '
    - -
    - -
    - - - -
    -
    - onsubmit="return emptyFormElements(this, 'new_name')"> - - -
    - .table):'); ?> -databases) > $GLOBALS['cfg']['MaxDbList']) { -?> - - - - -  .  -
    - __('Structure only'), - 'data' => __('Structure and data'), - 'dataonly' => __('Data only')); - echo $common_functions->getRadioFields('what', $choices, 'data', true); - unset($choices); -?> - - -
    - -
    - - -
    - - /> - -
    -
    - -
    -
    -
    - -
    - -
    -
    - - -
      > - 'CHECK TABLE ' . $common_functions->backquote($GLOBALS['table']), - 'table_maintenance' => 'Go', - ) - ); - ?> -
    • - - showMySQLDocu('MySQL_Database_Administration', 'CHECK_TABLE'); ?> -
    • - 'ALTER TABLE ' . $common_functions->backquote($GLOBALS['table']) . ' ENGINE = InnoDB;') - ); - ?> -
    • - - showMySQLDocu('Table_types', 'InnoDB_File_Defragmenting'); ?> -
    • - 'ANALYZE TABLE ' . $common_functions->backquote($GLOBALS['table']), - 'table_maintenance' => 'Go', - ) - ); - ?> -
    • - - showMySQLDocu('MySQL_Database_Administration', 'ANALYZE_TABLE');?> -
    • - 'REPAIR TABLE ' . $common_functions->backquote($GLOBALS['table']), - 'table_maintenance' => 'Go', - ) - ); - ?> -
    • - - showMySQLDocu('MySQL_Database_Administration', 'REPAIR_TABLE'); ?> -
    • - 'OPTIMIZE TABLE ' . $common_functions->backquote($GLOBALS['table']), - 'table_maintenance' => 'Go', - ) - ); - ?> -
    • - - showMySQLDocu('MySQL_Database_Administration', 'OPTIMIZE_TABLE'); ?> -
    • - 'FLUSH TABLE ' . $common_functions->backquote($GLOBALS['table']), - 'message_to_show' => sprintf( - __('Table %s has been flushed'), - htmlspecialchars($GLOBALS['table']) - ), - 'reload' => 1, - ) -); -?> -
    • - - showMySQLDocu('MySQL_Database_Administration', 'FLUSH'); ?> -
    • -
    -
    -
    - -
    -
    - - -
      -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)), - ) - ); - ?> -
    • > - - showMySQLDocu('SQL-Syntax', 'TRUNCATE_TABLE'); ?> -
    • -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 ); - ?> -
    • > - - showMySQLDocu('SQL-Syntax', 'DROP_TABLE'); ?> -
    • - -
    -
    -
    - -
    -'; + +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])) { - ?> -
    -
    - -
    - -' . "\n"; - foreach ($partition_names as $one_partition) { - $one_partition = htmlspecialchars($one_partition); - $html_select .= '' . "\n"; - } - $html_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;' - ) - ); -?> -
    - -
    -
    - -
    -
    -
    - - -
    -
    - -
      - $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 '
    • ' - . '' . $master . ' -> ' . $arr['foreign_table'] . '.' . $arr['foreign_field'] - . '
    • ' . "\n"; - } // foreach $foreign - unset($foreign_table, $join_query); - ?> -
    -
    -
    - 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; diff --git a/view_create.php b/view_create.php index 2764adb77c..d5644fb275 100644 --- a/view_create.php +++ b/view_create.php @@ -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());