The branch, master has been updated via d5dd8a2d37f0fab931df449d4c6a744821a78afb (commit) via a28d43abf3948f44d036a009462d48cedf597b5b (commit) via 56d4b081a0020d03b988d322a39ac4a05d803384 (commit) via f53f5d76473c7d88ebd8b8a361ffb7a5d1643cb4 (commit) from 9fde1b5b23c00a1c9be499122f5d46d4d9b257f3 (commit)
- Log ----------------------------------------------------------------- commit d5dd8a2d37f0fab931df449d4c6a744821a78afb Author: Piotr Przybylski piotrprz@gmail.com Date: Fri Jul 1 20:35:38 2011 +0200
Fix PMA_DBI_get_columns
commit a28d43abf3948f44d036a009462d48cedf597b5b Author: Piotr Przybylski piotrprz@gmail.com Date: Fri Jul 1 20:31:21 2011 +0200
Updated MySQL function list
commit 56d4b081a0020d03b988d322a39ac4a05d803384 Author: Piotr Przybylski piotrprz@gmail.com Date: Fri Jul 1 20:01:37 2011 +0200
Remove STDDEV_* and VAR_* Standard deviation and variance make no sense when called with one argument
commit f53f5d76473c7d88ebd8b8a361ffb7a5d1643cb4 Author: Piotr Przybylski piotrprz@gmail.com Date: Fri Jul 1 18:33:23 2011 +0200
Changed background color for invalid inputs
-----------------------------------------------------------------------
Summary of changes: libraries/config.default.php | 67 +++++++++++++++++++++++++++---- libraries/database_interface.lib.php | 2 +- tbl_replace.php | 30 +++++++++----- themes/pmahomme/css/theme_right.css.php | 2 +- 4 files changed, 80 insertions(+), 21 deletions(-)
diff --git a/libraries/config.default.php b/libraries/config.default.php index 1a478b7..0e0b9c8 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -2824,14 +2824,19 @@ if ($cfg['ShowFunctionFields']) { 'CHAR', 'CHAR_LENGTH', 'COMPRESS', + 'CONNECTION_ID', 'COS', 'COT', 'CRC32', 'CURDATE', 'CURRENT_USER', 'CURTIME', + 'DATABASE', 'DATE', 'DAYNAME', + 'DAYOFMONTH', + 'DAYOFWEEK', + 'DAYOFYEAR', 'DEGREES', 'DES_DECRYPT', 'DES_ENCRYPT', @@ -2841,35 +2846,53 @@ if ($cfg['ShowFunctionFields']) { 'FROM_DAYS', 'FROM_UNIXTIME', 'HEX', + 'HOUR', 'INET_ATON', 'INET_NTOA', + 'LAST_DAY', 'LENGTH', 'LN', + 'LOAD_FILE', 'LOG', 'LOG10', 'LOG2', 'LOWER', + 'LTRIM', 'MD5', + 'MICROSECOND', + 'MINUTE', + 'MONTH', + 'MONTHNAME', 'NOW', 'OCT', 'OLD_PASSWORD', 'ORD', 'PASSWORD', + 'PI', + 'QUARTER', + 'QUOTE', 'RADIANS', 'RAND', 'REVERSE', 'ROUND', + 'RTRIM', + 'SECOND', 'SEC_TO_TIME', 'SHA1', + 'SIGN', + 'SIN', 'SOUNDEX', 'SPACE', 'SQRT', - 'STDDEV_POP', - 'STDDEV_SAMP', + 'SYSDATE', 'TAN', + 'TIME', 'TIMESTAMP', 'TIME_TO_SEC', + 'TO_DAYS', + 'TRIM', 'UNCOMPRESS', + 'UNCOMPRESSED_LENGTH', 'UNHEX', 'UNIX_TIMESTAMP', 'UPPER', @@ -2878,9 +2901,12 @@ if ($cfg['ShowFunctionFields']) { 'UTC_TIME', 'UTC_TIMESTAMP', 'UUID', - 'VAR_POP', - 'VAR_SAMP', + 'VERSION', + 'WEEK', + 'WEEKDAY', + 'WEEKOFYEAR', 'YEAR', + 'YEARWEEK', );
/** @@ -2945,20 +2971,27 @@ if ($cfg['ShowFunctionFields']) { 'CHAR', 'CURRENT_USER', 'COMPRESS', + 'DATABASE', 'DAYNAME', 'DES_DECRYPT', 'DES_ENCRYPT', 'ENCRYPT', 'HEX', 'INET_NTOA', + 'LOAD_FILE', 'LOWER', + 'LTRIM', 'MD5', + 'MONTHNAME', 'OLD_PASSWORD', 'PASSWORD', + 'QUOTE', 'REVERSE', + 'RTRIM', 'SHA1', 'SOUNDEX', 'SPACE', + 'TRIM', 'UNCOMPRESS', 'UNHEX', 'UPPER', @@ -2972,8 +3005,11 @@ if ($cfg['ShowFunctionFields']) { 'DATE', 'FROM_DAYS', 'FROM_UNIXTIME', + 'LAST_DAY', 'NOW', 'SEC_TO_TIME', + 'SYSDATE', + 'TIME', 'TIMESTAMP', 'UTC_DATE', 'UTC_TIME', @@ -2991,31 +3027,46 @@ if ($cfg['ShowFunctionFields']) { 'BIT_COUNT', 'CEILING', 'CHAR_LENGTH', + 'CONNECTION_ID', 'COS', 'COT', 'CRC32', + 'DAYOFMONTH', + 'DAYOFWEEK', + 'DAYOFYEAR', 'DEGREES', 'EXP', 'FLOOR', + 'HOUR', 'INET_ATON', 'LENGTH', 'LN', 'LOG', 'LOG2', 'LOG10', + 'MICROSECOND', + 'MINUTE', + 'MONTH', 'OCT', 'ORD', + 'PI', + 'QUARTER', 'RADIANS', 'RAND', 'ROUND', + 'SECOND', + 'SIGN', + 'SIN', 'SQRT', - 'STDDEV_POP', - 'STDDEV_SAMP', 'TAN', + 'TO_DAYS', 'TIME_TO_SEC', + 'UNCOMPRESSED_LENGTH', 'UNIX_TIMESTAMP', - 'VAR_POP', - 'VAR_SAMP', + 'WEEK', + 'WEEKDAY', + 'WEEKOFYEAR', + 'YEARWEEK', ),
'FUNC_SPATIAL' => array( diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 50ae58b..bcafbb1 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -836,7 +836,7 @@ function PMA_DBI_get_columns($database, $table, $full = false, $link = null) $fields = PMA_DBI_fetch_result( 'SHOW ' . ($full ? 'FULL' : '') . ' COLUMNS FROM ' . PMA_backquote($database) . '.' . PMA_backquote($table), - 'Field', ($full ? null : 'Field'), $link); + 'Field', null, $link); if (! is_array($fields) || count($fields) < 1) { return false; } diff --git a/tbl_replace.php b/tbl_replace.php index b0c71e6..ab20d29 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -130,18 +130,27 @@ if (isset($_REQUEST['where_clause'])) { $query = array(); $value_sets = array(); $func_no_param = array( - 'NOW', + 'CONNECTION_ID', + 'CURRENT_USER', 'CURDATE', 'CURTIME', + 'DATABASE', + 'LAST_INSERT_ID', + 'NOW', + 'PI', + 'RAND', + 'SYSDATE', + 'UNIX_TIMESTAMP', + 'USER', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP', - 'UNIX_TIMESTAMP', - 'RAND', - 'USER', - 'LAST_INSERT_ID', 'UUID', - 'CURRENT_USER', + 'VERSION', +); +$func_optional_param = array( + 'RAND', + 'UNIX_TIMESTAMP', );
foreach ($loop_array as $rownumber => $where_clause) { @@ -225,16 +234,15 @@ foreach ($loop_array as $rownumber => $where_clause) {
if (empty($me_funcs[$key])) { $cur_value = $val; - } elseif ('UNIX_TIMESTAMP' === $me_funcs[$key] && $val != "''") { - $cur_value = $me_funcs[$key] . '(' . $val . ')'; } elseif ('UUID' === $me_funcs[$key]) { /* This way user will know what UUID new row has */ $uuid = PMA_DBI_fetch_value('SELECT UUID()'); $cur_value = "'" . $uuid . "'"; - } elseif (in_array($me_funcs[$key], $func_no_param)) { - $cur_value = $me_funcs[$key] . '()'; - } else { + } elseif (!in_array($me_funcs[$key], $func_no_param) + || ($val != "''" && in_array($me_funcs[$key], $func_optional_param))) { $cur_value = $me_funcs[$key] . '(' . $val . ')'; + } else { + $cur_value = $me_funcs[$key] . '()'; }
// i n s e r t diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index ba5a926..272c17b 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -1729,7 +1729,7 @@ table#serverconnection_trg_local { */ input[type=text].invalid_value, .invalid_value { - background:#F00; + background:#FFCCCC; }
/**
hooks/post-receive