diff options
author | Madhura Jayaratne <madhura.cj@gmail.com> | 2011-07-03 20:12:04 +0400 |
---|---|---|
committer | Madhura Jayaratne <madhura.cj@gmail.com> | 2011-07-03 20:12:04 +0400 |
commit | 1bc0473fe2b2c5fe24ccb2a1541b70e584009265 (patch) | |
tree | d2e5444f4b5f641f2db71ec5a8acc119e8ad308b /tbl_replace.php | |
parent | b8ddd56d78598c497e4b4b0b1ffa27ed0550ebc8 (diff) | |
parent | 64e4f9fe0ed661e16172cc354e5dfd0b9111342e (diff) |
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin into OpenGIS
Conflicts:
tbl_replace.php
Diffstat (limited to 'tbl_replace.php')
-rw-r--r-- | tbl_replace.php | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/tbl_replace.php b/tbl_replace.php index 584350a776..b2f8d97f2f 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -130,43 +130,30 @@ 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', ); - -$gis_from_text_functions = array( - 'GeomFromText', - 'GeomCollFromText', - 'LineFromText', - 'MLineFromText', - 'PointFromText', - 'MPointFromText', - 'PolyFromText', - 'MPolyFromText', -); - -$gis_from_wkb_functions = array( - 'GeomFromWKB', - 'GeomCollFromWKB', - 'LineFromWKB', - 'MLineFromWKB', - 'PointFromWKB', - 'MPointFromWKB', - 'PolyFromWKB', - 'MPolyFromWKB', +$func_optional_param = array( + 'RAND', + 'UNIX_TIMESTAMP', ); -foreach ($loop_array as $rownumber => $where_clause) { +$gis_from_text_functions = array( 'GeomFromText', 'GeomCollFromText', 'LineFromText', 'MLineFromText', 'PointFromText', 'MPointFromText', 'PolyFromText', 'MPolyFromText',);$gis_from_wkb_functions = array( 'GeomFromWKB', 'GeomCollFromWKB', 'LineFromWKB', 'MLineFromWKB', 'PointFromWKB', 'MPointFromWKB', 'PolyFromWKB', 'MPolyFromWKB',);foreach ($loop_array as $rownumber => $where_clause) { // skip fields to be ignored if (! $using_key && isset($_REQUEST['insert_ignore_' . $where_clause])) { continue; @@ -247,13 +234,14 @@ 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)) { + } 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] . '()'; } elseif ((in_array($me_funcs[$key], $gis_from_text_functions) && substr($val, 0, 3) == "'''") |