diff --git a/Documentation.html b/Documentation.html
index a735bfba1a..ec0e184fb9 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -761,13 +761,17 @@ since this link provides funding for phpMyAdmin.
'signon' authentication mode
($auth_type = 'signon')
as introduced in 2.10.0 allows you to log in from prepared PHP
- session data. This is useful for implementing single signon
- from another application. Sample way how to seed session is in
- signon example: scripts/signon.php. There is also
- alternative example using OpenID -
- scripts/openid.php. You need to
+ session data or using supplied PHP script. This is useful for implementing single signon
+ from another application.
+
+ Sample way how to seed session is in signon example: scripts/signon.php.
+ There is also alternative example using OpenID - scripts/openid.php and
+ example for scripts based solution - scripts/signon-script.php.
+
+ You need to
configure session name and session name or script to be executed and signon
URL to use this authentication method.
@@ -1322,10 +1326,20 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE
$cfg['Servers'][$i]['CountTables'] boolean
Whether to count the number of tables for each database when preparing the list of databases for the navigation frame.
+ $cfg['Servers'][$i]['SignonScript'] string
+ Name of PHP script to be sourced and executed to obtain
+ login credentials. This is alternative approach to session based single
+ signon. The script needs to provide function
+ get_login_credentials which returns list of username and
+ pasword, accepting single parameter of existing username (can be empty).
+ See scripts/signon-script.php for an example.
+
$cfg['Servers'][$i]['SignonSession'] string
Name of session which will be used for signon authentication method.
You should use something different than phpMyAdmin, because
- this is session which phpMyAdmin uses internally.
+ this is session which phpMyAdmin uses internally. Takes effect only if
+ SignonScript
+ is not configured.
$cfg['Servers'][$i]['SignonURL'] string
URL where user will be redirected to log in for signon authentication method. Should be absolute including protocol.
diff --git a/js/codemirror/mode/mysql/mysql.js b/js/codemirror/mode/mysql/mysql.js
index 704825e403..fd53d6cd78 100644
--- a/js/codemirror/mode/mysql/mysql.js
+++ b/js/codemirror/mode/mysql/mysql.js
@@ -127,7 +127,7 @@ CodeMirror.defineMode("mysql", function(config, parserConfig) {
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
return obj;
}
- var cKeywords = "accessible action add after against aggregate algorithm all alter analyse analyze and as asc autocommit auto_increment avg_row_length backup begin between binlog both by cascade case change changed charset check checksum collate collation column columns comment commit committed compressed concurrent constraint contains convert create cross current_timestamp database databases day day_hour day_minute day_second definer delayed delay_key_write delete desc describe deterministic distinct distinctrow div do drop dumpfile duplicate dynamic else enclosed end engine engines escape escaped events execute exists explain extended fast fields file first fixed flush for force foreign from full fulltext function gemini gemini_spin_retries global grant grants group having heap high_priority hosts hour hour_minute hour_second identified if ignore in index indexes infile inner insert insert_id insert_method interval into invoker is isolation join key keys kill last_insert_id leading left like limit linear lines load local lock locks logs low_priority maria master master_connect_retry master_host master_log_file master_log_pos master_password master_port master_user match max_connections_per_hour max_queries_per_hour max_rows max_updates_per_hour max_user_connections medium merge minute minute_second min_rows mode modify month mrg_myisam myisam names natural no not null offset on open optimize option optionally or order outer outfile pack_keys page page_checksum partial partition partitions password primary privileges procedure process processlist purge quick raid0 raid_chunks raid_chunksize raid_type range read read_only read_write references regexp reload rename repair repeatable replace replication reset restore restrict return returns revoke right rlike rollback row rows row_format second security select separator serializable session share show shutdown slave soname sounds sql sql_auto_is_null sql_big_result sql_big_selects sql_big_tables sql_buffer_result sql_cache sql_calc_found_rows sql_log_bin sql_log_off sql_log_update sql_low_priority_updates sql_max_join_size sql_no_cache sql_quote_show_create sql_safe_updates sql_select_limit sql_slave_skip_counter sql_small_result sql_warnings start starting status stop storage straight_join string striped super table tables temporary terminated then to trailing transactional truncate type types uncommitted union unique unlock update usage use using values variables view when where with work write xor year_month";
+ var cKeywords = "accessible add all alter analyze and as asc asensitive before between bigint binary blob both by call cascade case change char character check collate column condition constraint continue convert create cross current_date current_time current_timestamp current_user cursor database databases day_hour day_microsecond day_minute day_second dec decimal declare default delayed delete desc describe deterministic distinct distinctrow div double drop dual each else elseif enclosed escaped exists exit explain false fetch float float4 float8 for force foreign from fulltext grant group having high_priority hour_microsecond hour_minute hour_second if ignore in index infile inner inout insensitive insert int int1 int2 int3 int4 int8 integer interval into is iterate join key keys kill leading leave left like limit linear lines load localtime localtimestamp lock long longblob longtext loop low_priority master_ssl_verify_server_cert match maxvalue mediumblob mediumint mediumtext middleint minute_microsecond minute_second mod modifies natural not no_write_to_binlog null numeric on optimize option optionally or order out outer outfile precision primary procedure purge range read reads read_write real references regexp release rename repeat replace require resignal restrict return revoke right rlike schema schemas second_microsecond select sensitive separator set show signal smallint spatial specific sql sqlexception sqlstate sqlwarning sql_big_result sql_calc_found_rows sql_small_result ssl starting straight_join table terminated then tinyblob tinyint tinytext to trailing trigger true undo union unique unlock unsigned update usage use using utc_date utc_time utc_timestamp values varbinary varchar varcharacter varying when where while with write xor year_month zerofill";
var cFunctions = "abs acos adddate addtime aes_decrypt aes_encrypt area asbinary ascii asin astext atan atan2 avg bdmpolyfromtext bdmpolyfromwkb bdpolyfromtext bdpolyfromwkb benchmark bin bit_and bit_count bit_length bit_or bit_xor boundary buffer cast ceil ceiling centroid char character_length charset char_length coalesce coercibility collation compress concat concat_ws connection_id contains conv convert convert_tz convexhull cos cot count crc32 crosses curdate current_date current_time current_timestamp current_user curtime database date datediff date_add date_diff date_format date_sub day dayname dayofmonth dayofweek dayofyear decode default degrees des_decrypt des_encrypt difference dimension disjoint distance elt encode encrypt endpoint envelope equals exp export_set exteriorring extract extractvalue field find_in_set floor format found_rows from_days from_unixtime geomcollfromtext geomcollfromwkb geometrycollection geometrycollectionfromtext geometrycollectionfromwkb geometryfromtext geometryfromwkb geometryn geometrytype geomfromtext geomfromwkb get_format get_lock glength greatest group_concat group_unique_users hex hour if ifnull inet_aton inet_ntoa insert instr interiorringn intersection intersects interval isclosed isempty isnull isring issimple is_free_lock is_used_lock last_day last_insert_id lcase least left length linefromtext linefromwkb linestring linestringfromtext linestringfromwkb ln load_file localtime localtimestamp locate log log10 log2 lower lpad ltrim makedate maketime make_set master_pos_wait max mbrcontains mbrdisjoint mbrequal mbrintersects mbroverlaps mbrtouches mbrwithin md5 microsecond mid min minute mlinefromtext mlinefromwkb mod month monthname mpointfromtext mpointfromwkb mpolyfromtext mpolyfromwkb multilinestring multilinestringfromtext multilinestringfromwkb multipoint multipointfromtext multipointfromwkb multipolygon multipolygonfromtext multipolygonfromwkb name_const now nullif numgeometries numinteriorrings numpoints oct octet_length old_password ord overlaps password period_add period_diff pi point pointfromtext pointfromwkb pointn pointonsurface polyfromtext polyfromwkb polygon polygonfromtext polygonfromwkb position pow power quarter quote radians rand related release_lock repeat replace reverse right round row_count rpad rtrim schema second sec_to_time session_user sha sha1 sign sin sleep soundex space sqrt srid startpoint std stddev stddev_pop stddev_samp strcmp str_to_date subdate substr substring substring_index subtime sum symdifference sysdate system_user tan time timediff timestamp timestampadd timestampdiff time_format time_to_sec touches to_days trim truncate ucase uncompress uncompressed_length unhex unique_users unix_timestamp updatexml upper user utc_date utc_time utc_timestamp uuid variance var_pop var_samp version week weekday weekofyear within x y year yearweek";
diff --git a/js/navigation.js b/js/navigation.js
index 7f9a013119..20aea18bd4 100644
--- a/js/navigation.js
+++ b/js/navigation.js
@@ -171,13 +171,16 @@ function clear_fast_filter() {
* Reloads the recent tables list.
*/
function PMA_reloadRecentTable() {
- $.get('navigation.php',
- { 'token' : window.parent.token, 'ajax_request' : true, 'recent_table' : true },
- function (data) {
- if (data.success == true) {
- $('#recentTable').html(data.options);
- }
- });
+ $.get('navigation.php', {
+ 'token': window.parent.token,
+ 'server': window.parent.server,
+ 'ajax_request': true,
+ 'recent_table': true},
+ function (data) {
+ if (data.success == true) {
+ $('#recentTable').html(data.options);
+ }
+ });
}
/* Performed on load */
diff --git a/libraries/auth/signon.auth.lib.php b/libraries/auth/signon.auth.lib.php
index 0735020f4a..e095829936 100644
--- a/libraries/auth/signon.auth.lib.php
+++ b/libraries/auth/signon.auth.lib.php
@@ -60,6 +60,9 @@ function PMA_auth_check()
return false;
}
+ /* Script name */
+ $script_name = $GLOBALS['cfg']['Server']['SignonScript'];
+
/* Session name */
$session_name = $GLOBALS['cfg']['Server']['SignonSession'];
@@ -78,8 +81,17 @@ function PMA_auth_check()
/* Are we requested to do logout? */
$do_logout = !empty($_REQUEST['old_usr']);
+ /* Handle script based auth */
+ if (!empty($script_name)) {
+ if (! file_exists($script_name)) {
+ PMA_fatalError(__('Can not find signon authentication script:') . ' ' . $script_name);
+ }
+ require $script_name;
+
+ list ($PHP_AUTH_USER, $PHP_AUTH_PW) = get_login_credentials($cfg['Server']['user']);
+
/* Does session exist? */
- if (isset($_COOKIE[$session_name])) {
+ } elseif (isset($_COOKIE[$session_name])) {
/* End current session */
$old_session = session_name();
$old_id = session_id();
diff --git a/libraries/config.default.php b/libraries/config.default.php
index d6e47c2720..1a478b7874 100644
--- a/libraries/config.default.php
+++ b/libraries/config.default.php
@@ -212,6 +212,13 @@ $cfg['Servers'][$i]['password'] = '';
*/
$cfg['Servers'][$i]['SignonSession'] = '';
+/**
+ * PHP script to use for 'signon' authentication method
+ *
+ * @global string $cfg['Servers'][$i]['SignonScript']
+ */
+$cfg['Servers'][$i]['SignonScript'] = '';
+
/**
* URL where to redirect user to login for 'signon' authentication method
*
diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php
index 966195e28a..7ca66bc9b8 100644
--- a/libraries/database_interface.lib.php
+++ b/libraries/database_interface.lib.php
@@ -75,6 +75,70 @@ function PMA_DBI_query($query, $link = null, $options = 0, $cache_affected_rows
return $res;
}
+/**
+ * runs a query and returns the result
+ *
+ * @param string $query query to run
+ * @param resource $link mysql link resource
+ * @param integer $options
+ * @return mixed
+ */
+function PMA_DBI_try_query($query, $link = null, $options = 0, $cache_affected_rows = true)
+{
+ if (empty($link)) {
+ if (isset($GLOBALS['userlink'])) {
+ $link = $GLOBALS['userlink'];
+ } else {
+ return false;
+ }
+ }
+
+ if ($GLOBALS['cfg']['DBG']['sql']) {
+ $time = microtime(true);
+ }
+
+ $r = PMA_DBI_real_query($query, $link, $options);
+
+ if ($cache_affected_rows) {
+ $GLOBALS['cached_affected_rows'] = PMA_DBI_affected_rows($link, $get_from_cache = false);
+ }
+
+ if ($GLOBALS['cfg']['DBG']['sql']) {
+ $time = microtime(true) - $time;
+
+ $hash = md5($query);
+
+ if (isset($_SESSION['debug']['queries'][$hash])) {
+ $_SESSION['debug']['queries'][$hash]['count']++;
+ } else {
+ $_SESSION['debug']['queries'][$hash] = array();
+ $_SESSION['debug']['queries'][$hash]['count'] = 1;
+ $_SESSION['debug']['queries'][$hash]['query'] = $query;
+ $_SESSION['debug']['queries'][$hash]['time'] = $time;
+ }
+
+ $trace = array();
+ foreach (debug_backtrace() as $trace_step) {
+ $trace[] = PMA_Error::relPath($trace_step['file']) . '#'
+ . $trace_step['line'] . ': '
+ . (isset($trace_step['class']) ? $trace_step['class'] : '')
+ //. (isset($trace_step['object']) ? get_class($trace_step['object']) : '')
+ . (isset($trace_step['type']) ? $trace_step['type'] : '')
+ . (isset($trace_step['function']) ? $trace_step['function'] : '')
+ . '('
+ . (isset($trace_step['params']) ? implode(', ', $trace_step['params']) : '')
+ . ')'
+ ;
+ }
+ $_SESSION['debug']['queries'][$hash]['trace'][] = $trace;
+ }
+ if ($r != false && PMA_Tracker::isActive() == true ) {
+ PMA_Tracker::handleQuery($query);
+ }
+
+ return $r;
+}
+
/**
* converts charset of a mysql message, usually coming from mysql_error(),
* into PMA charset, usally UTF-8
diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php
index 3a23686d9a..5cbb4fa3b7 100644
--- a/libraries/dbi/mysql.dbi.lib.php
+++ b/libraries/dbi/mysql.dbi.lib.php
@@ -154,65 +154,15 @@ function PMA_DBI_select_db($dbname, $link = null)
* @param integer $options
* @return mixed
*/
-function PMA_DBI_try_query($query, $link = null, $options = 0, $cache_affected_rows = true)
+function PMA_DBI_real_query($query, $link, $options)
{
- if (empty($link)) {
- if (isset($GLOBALS['userlink'])) {
- $link = $GLOBALS['userlink'];
- } else {
- return false;
- }
- }
-
- if ($GLOBALS['cfg']['DBG']['sql']) {
- $time = microtime(true);
- }
if ($options == ($options | PMA_DBI_QUERY_STORE)) {
- $r = mysql_query($query, $link);
+ return mysql_query($query, $link);
} elseif ($options == ($options | PMA_DBI_QUERY_UNBUFFERED)) {
- $r = mysql_unbuffered_query($query, $link);
+ return mysql_unbuffered_query($query, $link);
} else {
- $r = mysql_query($query, $link);
+ return mysql_query($query, $link);
}
-
- if ($cache_affected_rows) {
- $GLOBALS['cached_affected_rows'] = PMA_DBI_affected_rows($link, $get_from_cache = false);
- }
-
- if ($GLOBALS['cfg']['DBG']['sql']) {
- $time = microtime(true) - $time;
-
- $hash = md5($query);
-
- if (isset($_SESSION['debug']['queries'][$hash])) {
- $_SESSION['debug']['queries'][$hash]['count']++;
- } else {
- $_SESSION['debug']['queries'][$hash] = array();
- $_SESSION['debug']['queries'][$hash]['count'] = 1;
- $_SESSION['debug']['queries'][$hash]['query'] = $query;
- $_SESSION['debug']['queries'][$hash]['time'] = $time;
- }
-
- $trace = array();
- foreach (debug_backtrace() as $trace_step) {
- $trace[] = PMA_Error::relPath($trace_step['file']) . '#'
- . $trace_step['line'] . ': '
- . (isset($trace_step['class']) ? $trace_step['class'] : '')
- //. (isset($trace_step['object']) ? get_class($trace_step['object']) : '')
- . (isset($trace_step['type']) ? $trace_step['type'] : '')
- . (isset($trace_step['function']) ? $trace_step['function'] : '')
- . '('
- . (isset($trace_step['params']) ? implode(', ', $trace_step['params']) : '')
- . ')'
- ;
- }
- $_SESSION['debug']['queries'][$hash]['trace'][] = $trace;
- }
- if ($r != false && PMA_Tracker::isActive() == true ) {
- PMA_Tracker::handleQuery($query);
- }
-
- return $r;
}
function PMA_DBI_fetch_array($result)
@@ -432,7 +382,7 @@ function PMA_DBI_insert_id($link = null)
* @uses $GLOBALS['userlink']
* @uses mysql_affected_rows()
* @param object mysql $link the mysql object
- * @param boolean $get_from_cache
+ * @param boolean $get_from_cache
* @return string integer
*/
function PMA_DBI_affected_rows($link = null, $get_from_cache = true)
diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php
index 53f7d9525e..bee7430553 100644
--- a/libraries/dbi/mysqli.dbi.lib.php
+++ b/libraries/dbi/mysqli.dbi.lib.php
@@ -164,18 +164,15 @@ function PMA_DBI_select_db($dbname, $link = null)
*
* @uses PMA_DBI_QUERY_STORE
* @uses PMA_DBI_QUERY_UNBUFFERED
- * @uses $GLOBALS['userlink']
* @uses MYSQLI_STORE_RESULT
* @uses MYSQLI_USE_RESULT
* @uses mysqli_query()
- * @uses defined()
* @param string $query query to execute
* @param object mysqli $link mysqli object
* @param integer $options
- * @param boolean $cache_affected_rows
* @return mixed true, false or result object
*/
-function PMA_DBI_try_query($query, $link = null, $options = 0, $cache_affected_rows = true)
+function PMA_DBI_real_query($query, $link, $options)
{
if ($options == ($options | PMA_DBI_QUERY_STORE)) {
$method = MYSQLI_STORE_RESULT;
@@ -185,64 +182,7 @@ function PMA_DBI_try_query($query, $link = null, $options = 0, $cache_affected_r
$method = 0;
}
- if (empty($link)) {
- if (isset($GLOBALS['userlink'])) {
- $link = $GLOBALS['userlink'];
- } else {
- return false;
- }
- }
-
- if ($GLOBALS['cfg']['DBG']['sql']) {
- $time = microtime(true);
- }
- $r = mysqli_query($link, $query, $method);
-
- if ($cache_affected_rows) {
- $GLOBALS['cached_affected_rows'] = PMA_DBI_affected_rows($link, $get_from_cache = false);
- }
-
- if ($GLOBALS['cfg']['DBG']['sql']) {
- $time = microtime(true) - $time;
-
- $hash = md5($query);
-
- if (isset($_SESSION['debug']['queries'][$hash])) {
- $_SESSION['debug']['queries'][$hash]['count']++;
- } else {
- $_SESSION['debug']['queries'][$hash] = array();
- $_SESSION['debug']['queries'][$hash]['count'] = 1;
- $_SESSION['debug']['queries'][$hash]['query'] = $query;
- $_SESSION['debug']['queries'][$hash]['time'] = $time;
- }
-
- $trace = array();
- foreach (debug_backtrace() as $trace_step) {
- $trace[] = PMA_Error::relPath($trace_step['file']) . '#'
- . $trace_step['line'] . ': '
- . (isset($trace_step['class']) ? $trace_step['class'] : '')
- //. (isset($trace_step['object']) ? get_class($trace_step['object']) : '')
- . (isset($trace_step['type']) ? $trace_step['type'] : '')
- . (isset($trace_step['function']) ? $trace_step['function'] : '')
- . '('
- . (isset($trace_step['params']) ? implode(', ', $trace_step['params']) : '')
- . ')'
- ;
- }
- $_SESSION['debug']['queries'][$hash]['trace'][] = $trace;
- }
-
- if ($r != false && PMA_Tracker::isActive() == true ) {
- PMA_Tracker::handleQuery($query);
- }
-
- return $r;
-
- // From the PHP manual:
- // "note: returns true on success or false on failure. For SELECT,
- // SHOW, DESCRIBE or EXPLAIN, mysqli_query() will return a result object"
- // so, do not use the return value to feed mysqli_num_rows() if it's
- // a boolean
+ return mysqli_query($link, $query, $method);
}
/**
@@ -490,9 +430,9 @@ function PMA_DBI_insert_id($link = '')
return false;
}
}
- // When no controluser is defined, using mysqli_insert_id($link)
+ // When no controluser is defined, using mysqli_insert_id($link)
// does not always return the last insert id due to a mixup with
- // the tracking mechanism, but this works:
+ // the tracking mechanism, but this works:
return PMA_DBI_fetch_value('SELECT LAST_INSERT_ID();', 0, 0, $link);
// Curiously, this problem does not happen with the mysql extension but
// there is another problem with BIGINT primary keys so PMA_DBI_insert_id()
@@ -505,7 +445,7 @@ function PMA_DBI_insert_id($link = '')
* @uses $GLOBALS['userlink']
* @uses mysqli_affected_rows()
* @param object mysqli $link the mysqli object
- * @param boolean $get_from_cache
+ * @param boolean $get_from_cache
* @return string integer
*/
function PMA_DBI_affected_rows($link = null, $get_from_cache = true)
diff --git a/libraries/export/sql.php b/libraries/export/sql.php
index 55d330efe0..b1bd4579b1 100644
--- a/libraries/export/sql.php
+++ b/libraries/export/sql.php
@@ -449,7 +449,11 @@ function PMA_exportHeader()
. PMA_exportComment('version ' . PMA_VERSION)
. PMA_exportComment('http://www.phpmyadmin.net')
. PMA_exportComment();
- $head .= empty($cfg['Server']['port']) ? PMA_exportComment(__('Host') . ': ' . $cfg['Server']['host']) : PMA_exportComment(__('Host') . ': ' . $cfg['Server']['host'] . ':' . $cfg['Server']['port']);
+ $host_string = __('Host') . ': ' . $cfg['Server']['host'];
+ if (!empty($cfg['Server']['port'])) {
+ $host_string .= ':' . $cfg['Server']['port'];
+ }
+ $head .= PMA_exportComment($host_string);
$head .= PMA_exportComment(__('Generation Time')
. ': ' . PMA_localisedDate())
. PMA_exportComment(__('Server version') . ': ' . substr(PMA_MYSQL_INT_VERSION, 0, 1) . '.' . (int) substr(PMA_MYSQL_INT_VERSION, 1, 2) . '.' . (int) substr(PMA_MYSQL_INT_VERSION, 3))
@@ -677,8 +681,6 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false, $a
{
global $sql_drop_table;
global $sql_backquotes;
- global $cfgRelation;
- global $sql_constraints;
global $sql_constraints_query; // just the text of the query
global $sql_drop_foreign_keys;
@@ -1040,7 +1042,6 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = false,
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
{
global $sql_backquotes;
- global $rows_cnt;
global $current_row;
$formatted_table_name = (isset($GLOBALS['sql_backquotes']))
@@ -1063,9 +1064,6 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
return true;
}
- // it's not a VIEW
- $buffer = '';
-
// analyze the query to get the true column names, not the aliases
// (this fixes an undefined index, also if Complete inserts
// are used, we did not get the true column name in case of aliases)
diff --git a/libraries/sqlparser.data.php b/libraries/sqlparser.data.php
index 5011ca7f82..d1c4b16a48 100644
--- a/libraries/sqlparser.data.php
+++ b/libraries/sqlparser.data.php
@@ -1222,4 +1222,270 @@ $PMA_SQPdata_column_type = array (
'YEAR'
);
+/**
+ * Documentation links for operators.
+ */
+$PMA_SQPdata_operators_docs = array(
+ '!=' => array('link' => 'comparison-operators','anchor' => 'operator_not-equal'),
+ '<>' => array('link' => 'comparison-operators','anchor' => 'operator_not-equal'),
+ '!' => array('link' => 'logical-operators','anchor' => 'operator_not'),
+ '||' => array('link' => 'logical-operators','anchor' => 'operator_or'),
+ '+' => array('link' => 'arithmetic-functions','anchor' => 'operator_plus'),
+ '>>' => array('link' => 'bit-functions','anchor' => 'operator_right-shift'),
+ '-' => array('link' => 'arithmetic-functions','anchor' => 'operator_minus'),
+ '*' => array('link' => 'arithmetic-functions','anchor' => 'operator_times'),
+ '&&' => array('link' => 'logical-operators','anchor' => 'operator_and'),
+ '&' => array('link' => 'bit-functions','anchor' => 'operator_bitwise-and'),
+ '~' => array('link' => 'bit-functions','anchor' => 'operator_bitwise-invert'),
+ '|' => array('link' => 'bit-functions','anchor' => 'operator_bitwise-or'),
+ '^' => array('link' => 'bit-functions','anchor' => 'operator_bitwise-xor'),
+ '=' => array('link' => 'assignment-operators','anchor' => 'operator_assign-equal'),
+ ':=' => array('link' => 'assignment-operators','anchor' => 'operator_assign-value'),
+ '/' => array('link' => 'arithmetic-functions','anchor' => 'operator_divide'),
+ '<=>' => array('link' => 'comparison-operators','anchor' => 'operator_equal-to'),
+ '=' => array('link' => 'comparison-operators','anchor' => 'operator_equal'),
+ '>=' => array('link' => 'comparison-operators','anchor' => 'operator_greater-than-or-equal'),
+ '>' => array('link' => 'comparison-operators','anchor' => 'operator_greater-than'),
+ '<<' => array('link' => 'bit-functions','anchor' => 'operator_left-shift'),
+ '<=' => array('link' => 'comparison-operators','anchor' => 'operator_less-than-or-equal'),
+ '<' => array('link' => 'comparison-operators','anchor' => 'operator_less-than'),
+ '%' => array('link' => 'arithmetic-functions','anchor' => 'operator_mod')
+);
+
+/**
+ * Documentation links for functions.
+ */
+$PMA_SQPdata_functions_docs = array(
+ 'ABS' => array('link' => 'mathematical-functions','anchor' => 'function_abs'),
+ 'ACOS' => array('link' => 'mathematical-functions','anchor' => 'function_acos'),
+ 'ADDDATE' => array('link' => 'date-and-time-functions','anchor' => 'function_adddate'),
+ 'ADDTIME' => array('link' => 'date-and-time-functions','anchor' => 'function_addtime'),
+ 'AES_DECRYPT' => array('link' => 'encryption-functions','anchor' => 'function_aes_decrypt'),
+ 'AES_ENCRYPT' => array('link' => 'encryption-functions','anchor' => 'function_aes_encrypt'),
+ 'AND' => array('link' => 'logical-operators','anchor' => 'operator_and'),
+ 'ASCII' => array('link' => 'string-functions','anchor' => 'function_ascii'),
+ 'ASIN' => array('link' => 'mathematical-functions','anchor' => 'function_asin'),
+ 'ATAN2' => array('link' => 'mathematical-functions','anchor' => 'function_atan2'),
+ 'ATAN' => array('link' => 'mathematical-functions','anchor' => 'function_atan2'),
+ 'ATAN' => array('link' => 'mathematical-functions','anchor' => 'function_atan'),
+ 'AVG' => array('link' => 'group-by-functions','anchor' => 'function_avg'),
+ 'BENCHMARK' => array('link' => 'information-functions','anchor' => 'function_benchmark'),
+ 'BIN' => array('link' => 'string-functions','anchor' => 'function_bin'),
+ 'BINARY' => array('link' => 'cast-functions','anchor' => 'operator_binary'),
+ 'BIT_AND' => array('link' => 'group-by-functions','anchor' => 'function_bit_and'),
+ 'BIT_COUNT' => array('link' => 'bit-functions','anchor' => 'function_bit_count'),
+ 'BIT_LENGTH' => array('link' => 'string-functions','anchor' => 'function_bit_length'),
+ 'BIT_OR' => array('link' => 'group-by-functions','anchor' => 'function_bit_or'),
+ 'BIT_XOR' => array('link' => 'group-by-functions','anchor' => 'function_bit_xor'),
+ 'CASE' => array('link' => 'control-flow-functions','anchor' => 'operator_case'),
+ 'CAST' => array('link' => 'cast-functions','anchor' => 'function_cast'),
+ 'CEIL' => array('link' => 'mathematical-functions','anchor' => 'function_ceil'),
+ 'CEILING' => array('link' => 'mathematical-functions','anchor' => 'function_ceiling'),
+ 'CHAR_LENGTH' => array('link' => 'string-functions','anchor' => 'function_char_length'),
+ 'CHAR' => array('link' => 'string-functions','anchor' => 'function_char'),
+ 'CHARACTER_LENGTH' => array('link' => 'string-functions','anchor' => 'function_character_length'),
+ 'CHARSET' => array('link' => 'information-functions','anchor' => 'function_charset'),
+ 'COALESCE' => array('link' => 'comparison-operators','anchor' => 'function_coalesce'),
+ 'COERCIBILITY' => array('link' => 'information-functions','anchor' => 'function_coercibility'),
+ 'COLLATION' => array('link' => 'information-functions','anchor' => 'function_collation'),
+ 'COMPRESS' => array('link' => 'encryption-functions','anchor' => 'function_compress'),
+ 'CONCAT_WS' => array('link' => 'string-functions','anchor' => 'function_concat_ws'),
+ 'CONCAT' => array('link' => 'string-functions','anchor' => 'function_concat'),
+ 'CONNECTION_ID' => array('link' => 'information-functions','anchor' => 'function_connection_id'),
+ 'CONV' => array('link' => 'mathematical-functions','anchor' => 'function_conv'),
+ 'CONVERT_TZ' => array('link' => 'date-and-time-functions','anchor' => 'function_convert_tz'),
+ 'Convert' => array('link' => 'cast-functions','anchor' => 'function_convert'),
+ 'COS' => array('link' => 'mathematical-functions','anchor' => 'function_cos'),
+ 'COT' => array('link' => 'mathematical-functions','anchor' => 'function_cot'),
+ 'COUNT' => array('link' => 'group-by-functions','anchor' => 'function_count'),
+ 'CRC32' => array('link' => 'mathematical-functions','anchor' => 'function_crc32'),
+ 'CURDATE' => array('link' => 'date-and-time-functions','anchor' => 'function_curdate'),
+ 'CURRENT_DATE' => array('link' => 'date-and-time-functions','anchor' => 'function_current_date'),
+ 'CURRENT_TIME' => array('link' => 'date-and-time-functions','anchor' => 'function_current_time'),
+ 'CURRENT_TIMESTAMP' => array('link' => 'date-and-time-functions','anchor' => 'function_current_timestamp'),
+ 'CURRENT_USER' => array('link' => 'information-functions','anchor' => 'function_current_user'),
+ 'CURTIME' => array('link' => 'date-and-time-functions','anchor' => 'function_curtime'),
+ 'DATABASE' => array('link' => 'information-functions','anchor' => 'function_database'),
+ 'DATE_ADD' => array('link' => 'date-and-time-functions','anchor' => 'function_date_add'),
+ 'DATE_FORMAT' => array('link' => 'date-and-time-functions','anchor' => 'function_date_format'),
+ 'DATE_SUB' => array('link' => 'date-and-time-functions','anchor' => 'function_date_sub'),
+ 'DATE' => array('link' => 'date-and-time-functions','anchor' => 'function_date'),
+ 'DATEDIFF' => array('link' => 'date-and-time-functions','anchor' => 'function_datediff'),
+ 'DAY' => array('link' => 'date-and-time-functions','anchor' => 'function_day'),
+ 'DAYNAME' => array('link' => 'date-and-time-functions','anchor' => 'function_dayname'),
+ 'DAYOFMONTH' => array('link' => 'date-and-time-functions','anchor' => 'function_dayofmonth'),
+ 'DAYOFWEEK' => array('link' => 'date-and-time-functions','anchor' => 'function_dayofweek'),
+ 'DAYOFYEAR' => array('link' => 'date-and-time-functions','anchor' => 'function_dayofyear'),
+ 'DECODE' => array('link' => 'encryption-functions','anchor' => 'function_decode'),
+ 'DEFAULT' => array('link' => 'miscellaneous-functions','anchor' => 'function_default'),
+ 'DEGREES' => array('link' => 'mathematical-functions','anchor' => 'function_degrees'),
+ 'DES_DECRYPT' => array('link' => 'encryption-functions','anchor' => 'function_des_decrypt'),
+ 'DES_ENCRYPT' => array('link' => 'encryption-functions','anchor' => 'function_des_encrypt'),
+ 'DIV' => array('link' => 'arithmetic-functions','anchor' => 'operator_div'),
+ 'ELT' => array('link' => 'string-functions','anchor' => 'function_elt'),
+ 'ENCODE' => array('link' => 'encryption-functions','anchor' => 'function_encode'),
+ 'ENCRYPT' => array('link' => 'encryption-functions','anchor' => 'function_encrypt'),
+ 'EXP' => array('link' => 'mathematical-functions','anchor' => 'function_exp'),
+ 'EXPORT_SET' => array('link' => 'string-functions','anchor' => 'function_export_set'),
+ 'EXTRACT' => array('link' => 'date-and-time-functions','anchor' => 'function_extract'),
+ 'ExtractValue' => array('link' => 'xml-functions','anchor' => 'function_extractvalue'),
+ 'FIELD' => array('link' => 'string-functions','anchor' => 'function_field'),
+ 'FIND_IN_SET' => array('link' => 'string-functions','anchor' => 'function_find_in_set'),
+ 'FLOOR' => array('link' => 'mathematical-functions','anchor' => 'function_floor'),
+ 'FORMAT' => array('link' => 'string-functions','anchor' => 'function_format'),
+ 'FOUND_ROWS' => array('link' => 'information-functions','anchor' => 'function_found_rows'),
+ 'FROM_DAYS' => array('link' => 'date-and-time-functions','anchor' => 'function_from_days'),
+ 'FROM_UNIXTIME' => array('link' => 'date-and-time-functions','anchor' => 'function_from_unixtime'),
+ 'GET_FORMAT' => array('link' => 'date-and-time-functions','anchor' => 'function_get_format'),
+ 'GET_LOCK' => array('link' => 'miscellaneous-functions','anchor' => 'function_get_lock'),
+ 'GREATEST' => array('link' => 'comparison-operators','anchor' => 'function_greatest'),
+ 'GROUP_CONCAT' => array('link' => 'group-by-functions','anchor' => 'function_group_concat'),
+ 'HEX' => array('link' => 'string-functions','anchor' => 'function_hex'),
+ 'HOUR' => array('link' => 'date-and-time-functions','anchor' => 'function_hour'),
+ 'IF' => array('link' => 'control-flow-functions','anchor' => 'function_if'),
+ 'IFNULL' => array('link' => 'control-flow-functions','anchor' => 'function_ifnull'),
+ 'IN' => array('link' => 'comparison-operators','anchor' => 'function_in'),
+ 'INET_ATON' => array('link' => 'miscellaneous-functions','anchor' => 'function_inet_aton'),
+ 'INET_NTOA' => array('link' => 'miscellaneous-functions','anchor' => 'function_inet_ntoa'),
+ 'INSERT' => array('link' => 'string-functions','anchor' => 'function_insert'),
+ 'INSTR' => array('link' => 'string-functions','anchor' => 'function_instr'),
+ 'INTERVAL' => array('link' => 'comparison-operators','anchor' => 'function_interval'),
+ 'IS_FREE_LOCK' => array('link' => 'miscellaneous-functions','anchor' => 'function_is_free_lock'),
+ 'IS_USED_LOCK' => array('link' => 'miscellaneous-functions','anchor' => 'function_is_used_lock'),
+ 'IS' => array('link' => 'comparison-operators','anchor' => 'operator_is'),
+ 'ISNULL' => array('link' => 'comparison-operators','anchor' => 'function_isnull'),
+ 'LAST_DAY' => array('link' => 'date-and-time-functions','anchor' => 'function_last_day'),
+ 'LAST_INSERT_ID' => array('link' => 'information-functions','anchor' => 'function_last_insert_id'),
+ 'LCASE' => array('link' => 'string-functions','anchor' => 'function_lcase'),
+ 'LEAST' => array('link' => 'comparison-operators','anchor' => 'function_least'),
+ 'LEFT' => array('link' => 'string-functions','anchor' => 'function_left'),
+ 'LENGTH' => array('link' => 'string-functions','anchor' => 'function_length'),
+ 'LIKE' => array('link' => 'string-comparison-functions','anchor' => 'operator_like'),
+ 'LN' => array('link' => 'mathematical-functions','anchor' => 'function_ln'),
+ 'LOAD_FILE' => array('link' => 'string-functions','anchor' => 'function_load_file'),
+ 'LOCALTIME' => array('link' => 'date-and-time-functions','anchor' => 'function_localtime'),
+ 'LOCALTIMESTAMP' => array('link' => 'date-and-time-functions','anchor' => 'function_localtimestamp'),
+ 'LOCATE' => array('link' => 'string-functions','anchor' => 'function_locate'),
+ 'LOG10' => array('link' => 'mathematical-functions','anchor' => 'function_log10'),
+ 'LOG2' => array('link' => 'mathematical-functions','anchor' => 'function_log2'),
+ 'LOG' => array('link' => 'mathematical-functions','anchor' => 'function_log'),
+ 'LOWER' => array('link' => 'string-functions','anchor' => 'function_lower'),
+ 'LPAD' => array('link' => 'string-functions','anchor' => 'function_lpad'),
+ 'LTRIM' => array('link' => 'string-functions','anchor' => 'function_ltrim'),
+ 'MAKE_SET' => array('link' => 'string-functions','anchor' => 'function_make_set'),
+ 'MAKEDATE' => array('link' => 'date-and-time-functions','anchor' => 'function_makedate'),
+ 'MAKETIME' => array('link' => 'date-and-time-functions','anchor' => 'function_maketime'),
+ 'MASTER_POS_WAIT' => array('link' => 'miscellaneous-functions','anchor' => 'function_master_pos_wait'),
+ 'MATCH' => array('link' => 'fulltext-search','anchor' => 'function_match'),
+ 'MAX' => array('link' => 'group-by-functions','anchor' => 'function_max'),
+ 'MD5' => array('link' => 'encryption-functions','anchor' => 'function_md5'),
+ 'MICROSECOND' => array('link' => 'date-and-time-functions','anchor' => 'function_microsecond'),
+ 'MID' => array('link' => 'string-functions','anchor' => 'function_mid'),
+ 'MIN' => array('link' => 'group-by-functions','anchor' => 'function_min'),
+ 'MINUTE' => array('link' => 'date-and-time-functions','anchor' => 'function_minute'),
+ 'MOD' => array('link' => 'mathematical-functions','anchor' => 'function_mod'),
+ 'MONTH' => array('link' => 'date-and-time-functions','anchor' => 'function_month'),
+ 'MONTHNAME' => array('link' => 'date-and-time-functions','anchor' => 'function_monthname'),
+ 'NAME_CONST' => array('link' => 'miscellaneous-functions','anchor' => 'function_name_const'),
+ 'NOT' => array('link' => 'logical-operators','anchor' => 'operator_not'),
+ 'NOW' => array('link' => 'date-and-time-functions','anchor' => 'function_now'),
+ 'NULLIF' => array('link' => 'control-flow-functions','anchor' => 'function_nullif'),
+ 'OCT' => array('link' => 'mathematical-functions','anchor' => 'function_oct'),
+ 'OCTET_LENGTH' => array('link' => 'string-functions','anchor' => 'function_octet_length'),
+ 'OLD_PASSWORD' => array('link' => 'encryption-functions','anchor' => 'function_old_password'),
+ 'OR' => array('link' => 'logical-operators','anchor' => 'operator_or'),
+ 'ORD' => array('link' => 'string-functions','anchor' => 'function_ord'),
+ 'PASSWORD' => array('link' => 'encryption-functions','anchor' => 'function_password'),
+ 'PERIOD_ADD' => array('link' => 'date-and-time-functions','anchor' => 'function_period_add'),
+ 'PERIOD_DIFF' => array('link' => 'date-and-time-functions','anchor' => 'function_period_diff'),
+ 'PI' => array('link' => 'mathematical-functions','anchor' => 'function_pi'),
+ 'POSITION' => array('link' => 'string-functions','anchor' => 'function_position'),
+ 'POW' => array('link' => 'mathematical-functions','anchor' => 'function_pow'),
+ 'POWER' => array('link' => 'mathematical-functions','anchor' => 'function_power'),
+ 'QUARTER' => array('link' => 'date-and-time-functions','anchor' => 'function_quarter'),
+ 'QUOTE' => array('link' => 'string-functions','anchor' => 'function_quote'),
+ 'RADIANS' => array('link' => 'mathematical-functions','anchor' => 'function_radians'),
+ 'RAND' => array('link' => 'mathematical-functions','anchor' => 'function_rand'),
+ 'REGEXP' => array('link' => 'regexp','anchor' => 'operator_regexp'),
+ 'RELEASE_LOCK' => array('link' => 'miscellaneous-functions','anchor' => 'function_release_lock'),
+ 'REPEAT' => array('link' => 'string-functions','anchor' => 'function_repeat'),
+ 'REPLACE' => array('link' => 'string-functions','anchor' => 'function_replace'),
+ 'REVERSE' => array('link' => 'string-functions','anchor' => 'function_reverse'),
+ 'RIGHT' => array('link' => 'string-functions','anchor' => 'function_right'),
+ 'RLIKE' => array('link' => 'regexp','anchor' => 'operator_rlike'),
+ 'ROUND' => array('link' => 'mathematical-functions','anchor' => 'function_round'),
+ 'ROW_COUNT' => array('link' => 'information-functions','anchor' => 'function_row_count'),
+ 'RPAD' => array('link' => 'string-functions','anchor' => 'function_rpad'),
+ 'RTRIM' => array('link' => 'string-functions','anchor' => 'function_rtrim'),
+ 'SCHEMA' => array('link' => 'information-functions','anchor' => 'function_schema'),
+ 'SEC_TO_TIME' => array('link' => 'date-and-time-functions','anchor' => 'function_sec_to_time'),
+ 'SECOND' => array('link' => 'date-and-time-functions','anchor' => 'function_second'),
+ 'SESSION_USER' => array('link' => 'information-functions','anchor' => 'function_session_user'),
+ 'SHA' => array('link' => 'encryption-functions','anchor' => 'function_sha1'),
+ 'SHA1' => array('link' => 'encryption-functions','anchor' => 'function_sha1'),
+ 'SIGN' => array('link' => 'mathematical-functions','anchor' => 'function_sign'),
+ 'SIN' => array('link' => 'mathematical-functions','anchor' => 'function_sin'),
+ 'SLEEP' => array('link' => 'miscellaneous-functions','anchor' => 'function_sleep'),
+ 'SOUNDEX' => array('link' => 'string-functions','anchor' => 'function_soundex'),
+ 'SPACE' => array('link' => 'string-functions','anchor' => 'function_space'),
+ 'SQRT' => array('link' => 'mathematical-functions','anchor' => 'function_sqrt'),
+ 'STD' => array('link' => 'group-by-functions','anchor' => 'function_std'),
+ 'STDDEV_POP' => array('link' => 'group-by-functions','anchor' => 'function_stddev_pop'),
+ 'STDDEV_SAMP' => array('link' => 'group-by-functions','anchor' => 'function_stddev_samp'),
+ 'STDDEV' => array('link' => 'group-by-functions','anchor' => 'function_stddev'),
+ 'STR_TO_DATE' => array('link' => 'date-and-time-functions','anchor' => 'function_str_to_date'),
+ 'STRCMP' => array('link' => 'string-comparison-functions','anchor' => 'function_strcmp'),
+ 'SUBDATE' => array('link' => 'date-and-time-functions','anchor' => 'function_subdate'),
+ 'SUBSTR' => array('link' => 'string-functions','anchor' => 'function_substr'),
+ 'SUBSTRING_INDEX' => array('link' => 'string-functions','anchor' => 'function_substring_index'),
+ 'SUBSTRING' => array('link' => 'string-functions','anchor' => 'function_substring'),
+ 'SUBTIME' => array('link' => 'date-and-time-functions','anchor' => 'function_subtime'),
+ 'SUM' => array('link' => 'group-by-functions','anchor' => 'function_sum'),
+ 'SYSDATE' => array('link' => 'date-and-time-functions','anchor' => 'function_sysdate'),
+ 'SYSTEM_USER' => array('link' => 'information-functions','anchor' => 'function_system_user'),
+ 'TAN' => array('link' => 'mathematical-functions','anchor' => 'function_tan'),
+ 'TIME_FORMAT' => array('link' => 'date-and-time-functions','anchor' => 'function_time_format'),
+ 'TIME_TO_SEC' => array('link' => 'date-and-time-functions','anchor' => 'function_time_to_sec'),
+ 'TIME' => array('link' => 'date-and-time-functions','anchor' => 'function_time'),
+ 'TIMEDIFF' => array('link' => 'date-and-time-functions','anchor' => 'function_timediff'),
+ 'TIMESTAMP' => array('link' => 'date-and-time-functions','anchor' => 'function_timestamp'),
+ 'TIMESTAMPADD' => array('link' => 'date-and-time-functions','anchor' => 'function_timestampadd'),
+ 'TIMESTAMPDIFF' => array('link' => 'date-and-time-functions','anchor' => 'function_timestampdiff'),
+ 'TO_DAYS' => array('link' => 'date-and-time-functions','anchor' => 'function_to_days'),
+ 'TRIM' => array('link' => 'string-functions','anchor' => 'function_trim'),
+ 'TRUNCATE' => array('link' => 'mathematical-functions','anchor' => 'function_truncate'),
+ 'UCASE' => array('link' => 'string-functions','anchor' => 'function_ucase'),
+ 'UNCOMPRESS' => array('link' => 'encryption-functions','anchor' => 'function_uncompress'),
+ 'UNCOMPRESSED_LENGTH' => array('link' => 'encryption-functions','anchor' => 'function_uncompressed_length'),
+ 'UNHEX' => array('link' => 'string-functions','anchor' => 'function_unhex'),
+ 'UNIX_TIMESTAMP' => array('link' => 'date-and-time-functions','anchor' => 'function_unix_timestamp'),
+ 'UpdateXML' => array('link' => 'xml-functions','anchor' => 'function_updatexml'),
+ 'UPPER' => array('link' => 'string-functions','anchor' => 'function_upper'),
+ 'USER' => array('link' => 'information-functions','anchor' => 'function_user'),
+ 'UTC_DATE' => array('link' => 'date-and-time-functions','anchor' => 'function_utc_date'),
+ 'UTC_TIME' => array('link' => 'date-and-time-functions','anchor' => 'function_utc_time'),
+ 'UTC_TIMESTAMP' => array('link' => 'date-and-time-functions','anchor' => 'function_utc_timestamp'),
+ 'UUID_SHORT' => array('link' => 'miscellaneous-functions','anchor' => 'function_uuid_short'),
+ 'UUID' => array('link' => 'miscellaneous-functions','anchor' => 'function_uuid'),
+ 'VALUES' => array('link' => 'miscellaneous-functions','anchor' => 'function_values'),
+ 'VAR_POP' => array('link' => 'group-by-functions','anchor' => 'function_var_pop'),
+ 'VAR_SAMP' => array('link' => 'group-by-functions','anchor' => 'function_var_samp'),
+ 'VARIANCE' => array('link' => 'group-by-functions','anchor' => 'function_variance'),
+ 'VERSION' => array('link' => 'information-functions','anchor' => 'function_version'),
+ 'WEEK' => array('link' => 'date-and-time-functions','anchor' => 'function_week'),
+ 'WEEKDAY' => array('link' => 'date-and-time-functions','anchor' => 'function_weekday'),
+ 'WEEKOFYEAR' => array('link' => 'date-and-time-functions','anchor' => 'function_weekofyear'),
+ 'XOR' => array('link' => 'logical-operators','anchor' => 'operator_xor'),
+ 'YEAR' => array('link' => 'date-and-time-functions','anchor' => 'function_year'),
+ 'YEARWEEK' => array('link' => 'date-and-time-functions','anchor' => 'function_yearweek'),
+ 'SOUNDS_LIKE' => array('link' => 'string-functions','anchor' => 'operator_sounds-like'),
+ 'IS_NOT_NULL' => array('link' => 'comparison-operators','anchor' => 'operator_is-not-null'),
+ 'IS_NOT' => array('link' => 'comparison-operators','anchor' => 'operator_is-not'),
+ 'IS_NULL' => array('link' => 'comparison-operators','anchor' => 'operator_is-null'),
+ 'NOT_LIKE' => array('link' => 'string-comparison-functions','anchor' => 'operator_not-like'),
+ 'NOT_REGEXP' => array('link' => 'regexp','anchor' => 'operator_not-regexp'),
+ 'COUNT_DISTINCT' => array('link' => 'group-by-functions','anchor' => 'function_count-distinct'),
+ 'NOT_IN' => array('link' => 'comparison-operators','anchor' => 'function_not-in')
+);
+
?>
diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php
index e05d0118ee..46ae2b2d5b 100644
--- a/libraries/sqlparser.lib.php
+++ b/libraries/sqlparser.lib.php
@@ -2089,6 +2089,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
function PMA_SQP_formatHtml($arr, $mode='color', $start_token=0,
$number_of_tokens=-1)
{
+ global $PMA_SQPdata_operators_docs, $PMA_SQPdata_functions_docs;
//DEBUG echo 'in Format'; print_r($arr); echo '
';
// then check for an array
if (! is_array($arr)) {
@@ -2180,21 +2181,18 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$keywords_priv_list_cnt = 2;
if ($number_of_tokens == -1) {
- $arraysize = $arr['len'];
- } else {
- $arraysize = $number_of_tokens;
+ $number_of_tokens = $arr['len'];
}
$typearr = array();
- if ($arraysize >= 0) {
+ if ($number_of_tokens >= 0) {
$typearr[0] = '';
$typearr[1] = '';
$typearr[2] = '';
- //$typearr[3] = $arr[0]['type'];
$typearr[3] = $arr[$start_token]['type'];
}
$in_priv_list = false;
- for ($i = $start_token; $i < $arraysize; $i++) {
+ for ($i = $start_token; $i < $number_of_tokens; $i++) {
// DEBUG echo "Loop format " . $arr[$i]['data'] . " " . $arr[$i]['type'] . "
";
$before = '';
$after = '';
@@ -2205,11 +2203,9 @@ if (! defined('PMA_MINIMUM_COMMON')) {
2 current
3 next
*/
- if (($i + 1) < $arraysize) {
- // array_push($typearr, $arr[$i + 1]['type']);
+ if (($i + 1) < $number_of_tokens) {
$typearr[4] = $arr[$i + 1]['type'];
} else {
- //array_push($typearr, null);
$typearr[4] = '';
}
@@ -2285,6 +2281,17 @@ if (! defined('PMA_MINIMUM_COMMON')) {
break;
case 'punct':
$before .= ' ';
+ if ($docu && isset($PMA_SQPdata_operators_docs[$arr[$i]['data']]) &&
+ ($arr[$i]['data'] != '*' || in_array($arr[$i]['type'], array('digit_integer','digit_float','digit_hex')))) {
+ $before .= PMA_showMySQLDocu(
+ 'functions',
+ $PMA_SQPdata_operators_docs[$arr[$i]['data']]['link'],
+ false,
+ $PMA_SQPdata_operators_docs[$arr[$i]['data']]['anchor'],
+ true);
+ $after .= '';
+ }
+
// workaround for
// select * from mytable limit 0,-1
// (a side effect of this workaround is that
@@ -2388,6 +2395,18 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$after .= ' ';
}
break;
+ case 'alpha_functionName':
+ $funcname = strtoupper($arr[$i]['data']);
+ if ($docu && isset($PMA_SQPdata_functions_docs[$funcname])) {
+ $before .= PMA_showMySQLDocu(
+ 'functions',
+ $PMA_SQPdata_functions_docs[$funcname]['link'],
+ false,
+ $PMA_SQPdata_functions_docs[$funcname]['anchor'],
+ true);
+ $after .= '';
+ }
+ break;
case 'alpha_reservedWord':
// do not uppercase the reserved word if we are calling
// this function in query_only mode, because we need
@@ -2544,6 +2563,24 @@ if (! defined('PMA_MINIMUM_COMMON')) {
}
break;
default:
+ if ($close_docu_link && in_array($arr[$i]['data'], array('LIKE', 'NOT', 'IN', 'REGEXP', 'NULL'))){
+ $after .= '';
+ $close_docu_link = false;
+ } else if ($docu && isset($PMA_SQPdata_functions_docs[$arr[$i]['data']])) {
+ /* Handle multi word statements first */
+ if (isset($typearr[4]) && $typearr[4] == 'alpha_reservedWord' && $typearr[3] == 'alpha_reservedWord' && isset($PMA_SQPdata_functions_docs[strtoupper($arr[$i]['data'] . '_' . $arr[$i + 1]['data'] . '_' . $arr[$i + 2]['data'])])) {
+ $tempname = strtoupper($arr[$i]['data'] . '_' . $arr[$i + 1]['data'] . '_' . $arr[$i + 2]['data']);
+ $before .= PMA_showMySQLDocu('functions', $PMA_SQPdata_functions_docs[$tempname]['link'], false, $PMA_SQPdata_functions_docs[$tempname]['anchor'], true);
+ $close_docu_link = true;
+ } else if (isset($typearr[3]) && $typearr[3] == 'alpha_reservedWord' && isset($PMA_SQPdata_functions_docs[strtoupper($arr[$i]['data'] . '_' . $arr[$i + 1]['data'])])) {
+ $tempname = strtoupper($arr[$i]['data'] . '_' . $arr[$i + 1]['data']);
+ $before .= PMA_showMySQLDocu('functions', $PMA_SQPdata_functions_docs[$tempname]['link'], false, $PMA_SQPdata_functions_docs[$tempname]['anchor'], true);
+ $close_docu_link = true;
+ } else {
+ $before .= PMA_showMySQLDocu('functions', $PMA_SQPdata_functions_docs[$arr[$i]['data']]['link'], false, $PMA_SQPdata_functions_docs[$arr[$i]['data']]['anchor'], true);
+ $after .= '';
+ }
+ }
break;
} // end switch ($arr[$i]['data'])
diff --git a/scripts/signon.php b/scripts/signon.php
index e585625db9..d80c1cf9de 100644
--- a/scripts/signon.php
+++ b/scripts/signon.php
@@ -3,9 +3,9 @@
/**
* Single signon for phpMyAdmin
*
- * This is just example how to use single signon with phpMyAdmin, it is
- * not intended to be perfect code and look, only shows how you can
- * integrate this functionality in your application.
+ * This is just example how to use session based single signon with
+ * phpMyAdmin, it is not intended to be perfect code and look, only
+ * shows how you can integrate this functionality in your application.
*
* @package phpMyAdmin
* @subpackage Example