diff --git a/ChangeLog b/ChangeLog index bd9c1decab..5f7320da3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,7 +25,7 @@ phpMyAdmin - ChangeLog - [core] Dropped support for PHP 5.2. + rfe #487 and rfe #1405 Find and Replacing column wise + rfe #1373 Use same create view dialog for editing a view -+ rfe #316 Configurable menus; allow user groups with customized menus per group ++ rfe #316 Configurable menus; allow user groups with customized menus per group- bug #4024 Editing field a record is selected by makes pma load forever 4.0.5.0 (not yet released) - bug #3977 Not detected configuration storage diff --git a/db_qbe.php b/db_qbe.php index 940758cccf..003b2fe033 100644 --- a/db_qbe.php +++ b/db_qbe.php @@ -11,6 +11,9 @@ */ require_once 'libraries/common.inc.php'; require_once 'libraries/DBQbe.class.php'; +require_once 'libraries/bookmark.lib.php'; +require_once 'libraries/sql.lib.php'; + $response = PMA_Response::getInstance(); // Gets the relation settings @@ -25,8 +28,15 @@ if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) { $message_to_display = true; } else { $goto = 'db_sql.php'; - include 'sql.php'; - exit; + + // Parse and analyze the query + require_once 'libraries/parse_analyze.inc.php'; + + PMA_executeQueryAndSendQueryResponse( + $analyzed_sql_results, false, $_REQUEST['db'], null, null, null, null, + false, null, null, null, null, $goto, $pmaThemeImage, null, null, null, + $sql_query, null, null + ); } } diff --git a/import_status.php b/import_status.php index 9b79f3fff6..f2e661ce24 100644 --- a/import_status.php +++ b/import_status.php @@ -63,24 +63,11 @@ if (defined('SESSIONUPLOAD')) { } } -/** - * Sets globals from $_GET - */ -$get_params = array( - 'message', - 'id' -); -foreach ($get_params as $one_get_param) { - if (isset($_GET[$one_get_param])) { - $GLOBALS[$one_get_param] = $_GET[$one_get_param]; - } -} - // AJAX requests can't be cached! PMA_noCacheHeader(); -// $GLOBALS["message"] is used for asking for an import message -if (isset($GLOBALS["message"]) && $GLOBALS["message"]) { +// $_GET["message"] is used for asking for an import message +if (isset($_GET["message"]) && $_GET["message"]) { header('Content-type: text/html'); @@ -100,6 +87,6 @@ if (isset($GLOBALS["message"]) && $GLOBALS["message"]) { echo ''."\n"; } else { - PMA_importAjaxStatus($GLOBALS["id"]); + PMA_importAjaxStatus($_GET["id"]); } ?> diff --git a/js/chart.js b/js/chart.js index 895d051d9b..dcd08cc2ae 100644 --- a/js/chart.js +++ b/js/chart.js @@ -170,7 +170,7 @@ var ColumnType = { }; /******************************************************************************* - * JQPlot specifc code + * JQPlot specific code ******************************************************************************/ /** diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js index c093fea83a..9da93e2e39 100644 --- a/js/server_status_monitor.js +++ b/js/server_status_monitor.js @@ -1201,6 +1201,19 @@ AJAX.registerOnload('server_status_monitor.js', function () { settings.axes.yaxis.tickOptions = { formatter: $.jqplot.byteFormatter(1) // KiB }; + } else if (settings.title === PMA_messages.strQuestions + || settings.title === PMA_messages.strConnections + ) { + settings.axes.yaxis.tickOptions = { + formatter: function(format, val) { + if (Math.abs(val) >= 1000000) + return $.jqplot.sprintf("%.3g M", val/1000000); + else if (Math.abs(val) >= 1000) + return $.jqplot.sprintf("%.3g k", val/1000); + else + return $.jqplot.sprintf("%d", val); + } + }; } settings.series = chartObj.series; diff --git a/js/sql.js b/js/sql.js index e561ba5bf5..18c26d4296 100644 --- a/js/sql.js +++ b/js/sql.js @@ -364,7 +364,7 @@ AJAX.registerOnload('sql.js', function () { $("#resultsForm.ajax .mult_submit[value=edit]").live('click', function (event) { event.preventDefault(); - /*Check whether atleast one row is selected for change*/ + /*Check whether at least one row is selected*/ if ($("#table_results tbody tr, #table_results tbody tr td").hasClass("marked")) { var $div = $('
'); @@ -426,6 +426,17 @@ AJAX.registerOnload('sql.js', function () { } }); + /** + * Checks whether at least one row is selected for deletion or export + */ + $("#resultsForm.ajax .mult_submit[value=delete]," + + "#resultsForm.ajax .mult_submit[value=export]").live('click', function (event) { + /*Check whether at least one row is selected*/ + if (!$("#table_results tbody tr, #table_results tbody tr td").hasClass("marked")) { + event.preventDefault(); + PMA_ajaxShowMessage(PMA_messages.strNoRowSelected); + } + }); /** * Click action for "Go" button in ajax dialog insertForm -> insertRowTable */ diff --git a/js/tbl_zoom_plot_jqplot.js b/js/tbl_zoom_plot_jqplot.js index 17aba65970..fe7dcf35f3 100644 --- a/js/tbl_zoom_plot_jqplot.js +++ b/js/tbl_zoom_plot_jqplot.js @@ -362,7 +362,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () { // other } else { // type explicitly identified - if (sqlTypes[key] !== null) { + if (sqlTypes[key] != null) { if (sqlTypes[key] == 'bit') { sql_query += "b'" + value + "', "; } @@ -376,6 +376,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () { } } } + // remove two extraneous characters ', ' sql_query = sql_query.substring(0, sql_query.length - 2); sql_query += ' WHERE ' + PMA_urldecode(searchedData[searchedDataKey].where_clause); diff --git a/libraries/Advisor.class.php b/libraries/Advisor.class.php index 438340f1ec..f7d537197c 100644 --- a/libraries/Advisor.class.php +++ b/libraries/Advisor.class.php @@ -304,11 +304,14 @@ class Advisor */ private function _ruleExprEvaluateVariable($matches) { - return isset($this->variables[$matches[1]]) - ? (is_numeric($this->variables[$matches[1]]) - ? $this->variables[$matches[1]] - : '"'.$this->variables[$matches[1]].'"') - : $matches[1]; + if (! isset($this->variables[$matches[1]])) { + return $matches[1]; + } + if (is_numeric($this->variables[$matches[1]])) { + return $this->variables[$matches[1]]; + } else { + return '\'' . addslashes($this->variables[$matches[1]]) . '\''; + } } /** diff --git a/libraries/advisory_rules.txt b/libraries/advisory_rules.txt index 3ffa1d9faf..354791c12b 100644 --- a/libraries/advisory_rules.txt +++ b/libraries/advisory_rules.txt @@ -200,8 +200,8 @@ rule 'Query cache max size' [!fired('Query cache disabled')] Current query cache size: %s | implode(' ',ADVISOR_formatByteDown(value, 2, 2)) rule 'Query cache min result size' [!fired('Query cache disabled')] - value == 1024*1024 query_cache_limit + value == 1024*1024 The max size of the result set in the query cache is the default of 1 MiB. Changing {query_cache_limit} (usually by increasing) may increase efficiency. This variable determines the maximum size a query result may have to be inserted into the query cache. If there are many query results above 1 MiB that are well cacheable (many reads, little writes) then increasing {query_cache_limit} will increase efficiency. Whereas in the case of many query results being above 1 MiB that are not very well cacheable (often invalidated due to table updates) increasing {query_cache_limit} might reduce efficiency. query_cache_limit is set to 1 MiB diff --git a/libraries/core.lib.php b/libraries/core.lib.php index e5766e51e4..fe26d3f2f3 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -55,7 +55,7 @@ function PMA_ifSetOr(&$var, $default = null, $type = 'similar') * $type can be: * - false : no type checking * - 'scalar' : whether type of $var is integer, float, string or boolean - * - 'numeric' : whether type of $var is any number repesentation + * - 'numeric' : whether type of $var is any number representation * - 'length' : whether type of $var is scalar with a string length > 0 * - 'similar' : whether type of $var is similar to type of $compare * - 'equal' : whether type of $var is identical to type of $compare diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index 9e25525437..7d85b369b3 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -380,7 +380,7 @@ function PMA_getSqlQueryAndCreateDbBeforeCopy() // Set the SQL mode to NO_AUTO_VALUE_ON_ZERO to prevent MySQL from creating // export statements it cannot import $sql_set_mode = "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'"; - PMA_DBI_query($sql_set_mode); + $GLOBALS['dbi']->query($sql_set_mode); // rebuild the database list because PMA_Table::moveCopy // checks in this list if the target db exists @@ -428,7 +428,7 @@ function PMA_getSqlConstraintsQueryForFullDb( * * @param array $tables_full array of all tables in given db or dbs * @param object $export_sql_plugin export plugin instance - * @param strin $db database name + * @param string $db database name * * @return array $views */ diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index e2ea325f7b..bbb7f90a8f 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -15,7 +15,7 @@ if (!defined('PHPMYADMIN')) { * @param string $sql SQL query * @param array $databases array with all databases * - * @return strin $db new database name + * @return string $db new database name */ function PMA_getNewDatabase($sql, $databases) { @@ -1028,6 +1028,9 @@ function PMA_addBookmark($pmaAbsoluteUri, $goto) exit; } else { // go back to sql.php to redisplay query; do not use & in this case: + /** + * @todo In which scenario does this happen? + */ PMA_sendHeaderLocation( $pmaAbsoluteUri . $goto . '&label=' . $_POST['bkm_fields']['bkm_label'] @@ -2013,6 +2016,7 @@ function PMA_sendQueryResponseForResultsReturned($result, $justBrowsing, // value of a transformed field, show it here if (isset($_REQUEST['grid_edit']) && $_REQUEST['grid_edit'] == true) { PMA_sendResponseForGridEdit($result); + // script has exited at this point } // Gets the list of fields properties @@ -2249,7 +2253,7 @@ function PMA_executeQueryAndSendQueryResponse($analyzed_sql_results, $query_type, $sql_query, $selected, $complete_query ) { // Include PMA_Index class for use in PMA_DisplayResults class - include './libraries/Index.class.php'; + include_once './libraries/Index.class.php'; include 'libraries/DisplayResults.class.php'; diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php index b99ba814be..c7fe15b7ce 100644 --- a/libraries/sqlparser.lib.php +++ b/libraries/sqlparser.lib.php @@ -3041,5 +3041,18 @@ function PMA_SQP_getParserDataMap() 'PMA_SQPdata_column_type' => $PMA_SQPdata_column_type, ); } +/** + * Get Parser analyze Map from parse_analyze_inc.php + * + * @param array $sql_query The SQL string + * @param array $db Current DB + * + * @return Array analyze Map from parse_analyze_inc.php + */ +function PMA_SQP_getParserAnalyzeMap($sql_query, $db) +{ + include 'libraries/parse_analyze.inc.php'; + return $analyzed_sql_results; +} ?> diff --git a/libraries/sysinfo.lib.php b/libraries/sysinfo.lib.php index d2b2e982b3..ef33910626 100644 --- a/libraries/sysinfo.lib.php +++ b/libraries/sysinfo.lib.php @@ -176,14 +176,10 @@ class PMA_SysInfoWinnt extends PMA_SysInfo } $arrInstance = array(); foreach ($arrProp as $propItem) { - if ( empty($strValue)) { - eval("\$value = \$objItem->" . $propItem->Name . ";"); - $arrInstance[$propItem->Name] = trim($value); - } else { - if (in_array($propItem->Name, $strValue)) { - eval("\$value = \$objItem->" . $propItem->Name . ";"); - $arrInstance[$propItem->Name] = trim($value); - } + $name = $propItem->Name; + if ( empty($strValue) || in_array($name, $strValue)) { + $value = $objItem->$name; + $arrInstance[$name] = trim($value); } } $arrData[] = $arrInstance; diff --git a/po/vls.po b/po/vls.po index f4fe1c24b0..43f1a201e2 100644 --- a/po/vls.po +++ b/po/vls.po @@ -8,14 +8,16 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.1-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-07-12 16:06+0200\n" -"PO-Revision-Date: 2013-07-12 16:06+0200\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2013-07-25 14:40+0200\n" +"Last-Translator: saurabh chikate