From da6c5b71294892dda8da09ce8886ce35abf48a78 Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Tue, 23 Aug 2011 22:19:21 +0200 Subject: [PATCH 1/5] Inline PMA_DBI_get_default_engine(), this one-liner is used only once --- db_structure.php | 2 +- libraries/database_interface.lib.php | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/db_structure.php b/db_structure.php index 9c2e045755..c0c1d33ec8 100644 --- a/db_structure.php +++ b/db_structure.php @@ -444,7 +444,7 @@ if ($is_show_stats) { 1)) { - $default_engine = PMA_DBI_get_default_engine(); + $default_engine = PMA_DBI_fetch_value('SHOW VARIABLES LIKE \'storage_engine\';', 0, 1); echo ' ' . "\n" . ' ' .$default_engine . '' . "\n"; diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 58307fea39..3db1b498a4 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -1174,16 +1174,6 @@ function PMA_DBI_fetch_result($result, $key = null, $value = null, return $resultrows; } -/** - * return default table engine for given database - * - * @return string default table engine - */ -function PMA_DBI_get_default_engine() -{ - return PMA_DBI_fetch_value('SHOW VARIABLES LIKE \'storage_engine\';', 0, 1); -} - /** * Get supported SQL compatibility modes * From e7994a364e811c0fcbbd58fbbd2fa6a088bd0a3c Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Tue, 23 Aug 2011 22:56:35 +0200 Subject: [PATCH 2/5] PMA_DBI_fetch_value() doesn't shouldn't allow to set the $options argument --- libraries/database_interface.lib.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 3db1b498a4..074715d659 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -899,7 +899,7 @@ function PMA_DBI_postConnect($link, $is_controluser = false) define('PMA_MYSQL_STR_VERSION', PMA_cacheGet('PMA_MYSQL_STR_VERSION', true)); } else { $mysql_version = PMA_DBI_fetch_value( - 'SELECT VERSION()', 0, 0, $link, PMA_DBI_QUERY_STORE); + 'SELECT VERSION()', 0, 0, $link); if ($mysql_version) { $match = explode('.', $mysql_version); define('PMA_MYSQL_MAJOR_VERSION', (int)$match[0]); @@ -950,16 +950,15 @@ function PMA_DBI_postConnect($link, $is_controluser = false) * @param integer|string $field field to fetch the value from, * starting at 0, with 0 beeing default * @param resource $link mysql link - * @param mixed $options * @return mixed value of first field in first row from result * or false if not found */ -function PMA_DBI_fetch_value($result, $row_number = 0, $field = 0, $link = null, $options = 0) +function PMA_DBI_fetch_value($result, $row_number = 0, $field = 0, $link = null) { $value = false; if (is_string($result)) { - $result = PMA_DBI_try_query($result, $link, $options | PMA_DBI_QUERY_STORE, false); + $result = PMA_DBI_try_query($result, $link, PMA_DBI_QUERY_STORE, false); } // return false if result is empty or false From 0bf475bce1b909dd654255e1265cc767cde51d07 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 23 Aug 2011 19:08:50 -0400 Subject: [PATCH 3/5] Coding style --- tbl_zoom_select.php | 146 +++++++++++++++++++++++--------------------- 1 file changed, 76 insertions(+), 70 deletions(-) diff --git a/tbl_zoom_select.php b/tbl_zoom_select.php index ad90043308..47d9b84b87 100644 --- a/tbl_zoom_select.php +++ b/tbl_zoom_select.php @@ -248,38 +248,44 @@ for ($i = 0; $i < 4; $i++) { */ //Set default datalabel if not selected - if(isset($zoom_submit) && $inputs[0] != 'pma_null' && $inputs[1] != 'pma_null') { - if ($dataLabel == '') - $dataLabel = PMA_getDisplayField($db,$table); +if (isset($zoom_submit) && $inputs[0] != 'pma_null' && $inputs[1] != 'pma_null') { + if ($dataLabel == '') { + $dataLabel = PMA_getDisplayField($db,$table); } - ?> +} +?> - - - + + + + +
        
- -
@@ -293,10 +299,10 @@ for ($i = 0; $i < 4; $i++) { $row[$inputs[0]], $inputs[1] => $row[$inputs[1]], 'where_clause' => $uniqueCondition[0]); -else if($dataLabel) + } elseif ($dataLabel) { $data[] = array($inputs[0] => $row[$inputs[0]], $inputs[1] => $row[$inputs[1]], $dataLabel => $row[$dataLabel], 'where_clause' => $uniqueCondition[0]); -else + } else { $data[] = array($inputs[0] => $row[$inputs[0]], $inputs[1] => $row[$inputs[1]], $dataLabel => '', 'where_clause' => $uniqueCondition[0]); + } } - -?> - -
- +
-
+
+ } +?>
- - - From 471e10a458940c4c2fa8453ead75a7178e1a01ee Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 23 Aug 2011 19:36:13 -0400 Subject: [PATCH 4/5] Fix some of the XHTML problems --- tbl_zoom_select.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tbl_zoom_select.php b/tbl_zoom_select.php index 47d9b84b87..c261918a02 100644 --- a/tbl_zoom_select.php +++ b/tbl_zoom_select.php @@ -118,7 +118,7 @@ if (isset($inputs) && ($inputs[0] != 'pma_null' || $inputs[1] != 'pma_null')) { - /> +
@@ -137,15 +137,15 @@ for ($i = 0; $i < 4; $i++) { } ?> - + - + - + @@ -162,7 +162,7 @@ for ($i = 0; $i < 4; $i++) { foreach ($GLOBALS['cfg']['EnumOperators'] as $fc) { if (isset($zoomFunc[$i]) && $zoomFunc[$i] == htmlspecialchars($fc)) { echo "\n" . ' ' - . ''; } else { echo "\n" . ' ' @@ -174,7 +174,7 @@ for ($i = 0; $i < 4; $i++) { foreach ($GLOBALS['cfg']['TextOperators'] as $fc) { if (isset($zoomFunc[$i]) && $zoomFunc[$i] == $fc) { echo "\n" . ' ' - . ''; } else { echo "\n" . ' ' @@ -186,7 +186,7 @@ for ($i = 0; $i < 4; $i++) { foreach ($GLOBALS['cfg']['NumOperators'] as $fc) { if (isset($zoomFunc[$i]) && $zoomFunc[$i] == $fc) { echo "\n" . ' ' - . ''; } else { echo "\n" . ' ' @@ -200,7 +200,7 @@ for ($i = 0; $i < 4; $i++) { foreach ($GLOBALS['cfg']['NullOperators'] as $fc) { if (isset($zoomFunc[$i]) && $zoomFunc[$i] == $fc) { echo "\n" . ' ' - . ''; } else { echo "\n" . ' ' @@ -262,11 +262,11 @@ if (isset($zoom_submit) && $inputs[0] != 'pma_null' && $inputs[1] != 'pma_null') for ($j = 0; $j < $fields_cnt; $j++) { if (isset($dataLabel) && $dataLabel == htmlspecialchars($fields_list[$j])) { ?> - + - + Date: Tue, 23 Aug 2011 19:45:17 -0400 Subject: [PATCH 5/5] Other XHTML fixes --- tbl_zoom_select.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tbl_zoom_select.php b/tbl_zoom_select.php index c261918a02..7b1188975f 100644 --- a/tbl_zoom_select.php +++ b/tbl_zoom_select.php @@ -255,7 +255,7 @@ if (isset($zoom_submit) && $inputs[0] != 'pma_null' && $inputs[1] != 'pma_null') } ?> - + - + - - -'; ?>
        
        
-