diff --git a/db_create.php b/db_create.php index ec00be636..a69064316 100644 --- a/db_create.php +++ b/db_create.php @@ -23,7 +23,7 @@ $err_url = 'main.php?' . PMA_generate_common_url(); * Builds and executes the db creation sql query */ $sql_query = 'CREATE DATABASE ' . PMA_backquote($db); -if (!empty($db_collation) && PMA_MYSQL_INT_VERSION >= 40101) { +if (!empty($db_collation)) { list($db_charset) = explode('_', $db_collation); if (in_array($db_charset, $mysql_charsets) && in_array($db_collation, $mysql_collations[$db_charset])) { $sql_query .= ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation); diff --git a/db_datadict.php b/db_datadict.php index 742f12141..0e3619a9e 100644 --- a/db_datadict.php +++ b/db_datadict.php @@ -61,9 +61,7 @@ $count = 0; while ($row = PMA_DBI_fetch_assoc($rowset)) { $myfieldname = 'Tables_in_' . htmlspecialchars($db); $table = $row[$myfieldname]; - if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { - $comments = PMA_getComments($db, $table); - } + $comments = PMA_getComments($db, $table); if ($count != 0) { echo '
' . "\n"; @@ -184,9 +182,7 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) { if ($have_rel) { echo ' ' . $strLinksTo . '' . "\n"; } - if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { - echo ' ' . $strComments . '' . "\n"; - } + echo ' ' . $strComments . '' . "\n"; if ($cfgRelation['mimework']) { echo ' MIME' . "\n"; } @@ -274,13 +270,11 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) { } echo '' . "\n"; } - if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { - echo ' '; - if (isset($comments[$field_name])) { - echo htmlspecialchars($comments[$field_name]); - } - echo '' . "\n"; + echo ' '; + if (isset($comments[$field_name])) { + echo htmlspecialchars($comments[$field_name]); } + echo '' . "\n"; if ($cfgRelation['mimework']) { $mime_map = PMA_getMIME($db, $table, true); diff --git a/db_export.php b/db_export.php index 24064a723..bb9b0d353 100644 --- a/db_export.php +++ b/db_export.php @@ -15,7 +15,7 @@ */ require_once './libraries/common.inc.php'; -// $sub_part is also used in db_info.inc.php to see if we are coming from +// $sub_part is also used in db_info.inc.php to see if we are coming from // db_export.php, in which case we don't obey $cfg['MaxTableList'] $sub_part = '_export'; require_once './libraries/db_common.inc.php'; @@ -48,7 +48,7 @@ $multi_values .= "\n"; foreach ($tables as $each_table) { // ok we show also views - //if (PMA_MYSQL_INT_VERSION >= 50000 && is_null($each_table['Engine'])) { + //if (is_null($each_table['Engine'])) { // Don't offer to export views yet. // continue; //} diff --git a/db_operations.php b/db_operations.php index 228a1f2a0..9b9e78ef7 100644 --- a/db_operations.php +++ b/db_operations.php @@ -40,7 +40,7 @@ if (strlen($db) && (isset($create_database_before_copying) && $create_database_before_copying)) { /** * @todo activate this with the correct version of MySQL - * when they fix the problem when the db contains a VIEW + * when they fix the problem when the db contains a VIEW * (problem exists in 5.1.20) * also, in 6.0.0 when the db contains a Falcon table, * renaming it results in a unusable db! @@ -206,14 +206,11 @@ if (empty($is_info)) { echo "\n"; } -if (PMA_MYSQL_INT_VERSION >= 40101) { - $db_collation = PMA_getDbCollation($db); -} -if (PMA_MYSQL_INT_VERSION < 50002 - || (PMA_MYSQL_INT_VERSION >= 50002 && $db != 'information_schema')) { - $is_information_schema = false; -} else { +$db_collation = PMA_getDbCollation($db); +if ($db == 'information_schema') { $is_information_schema = true; +} else { + $is_information_schema = false; } if (!$is_information_schema) { @@ -278,7 +275,7 @@ if (!$is_information_schema) { = 50107) { // echo 'RENAME DATABASE'; @@ -313,11 +310,7 @@ if (!$is_information_schema) { .' alt="" width="16" height="16" />'; } echo $strDBCopy . ':'; - if (PMA_MYSQL_INT_VERSION >= 50000) { - $drop_clause = 'DROP TABLE / DROP VIEW'; - } else { - $drop_clause = 'DROP TABLE'; - } + $drop_clause = 'DROP TABLE / DROP VIEW'; ?>
@@ -370,26 +363,22 @@ if (!$is_information_schema) { /** * Change database charset */ - if (PMA_MYSQL_INT_VERSION >= 40101) { - // MySQL supports setting default charsets / collations for databases since - // version 4.1.1. - echo '
' . "\n" - . PMA_generate_common_hidden_inputs($db, $table) - . '
' . "\n" - . ' '; - if ($cfg['PropertiesIconic']) { - echo ''; - } - echo ' ' . "\n" - . ' ' . "\n" - . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, - 'db_collation', 'select_db_collation', $db_collation, false, 3) - . ' ' . "\n" - . '
' . "\n" - . '
' . "\n"; + echo '
' . "\n" + . PMA_generate_common_hidden_inputs($db, $table) + . '
' . "\n" + . ' '; + if ($cfg['PropertiesIconic']) { + echo ''; } + echo ' ' . "\n" + . ' ' . "\n" + . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, + 'db_collation', 'select_db_collation', $db_collation, false, 3) + . ' ' . "\n" + . '
' . "\n" + . '
' . "\n"; if ($num_tables > 0 && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) { diff --git a/db_search.php b/db_search.php index ba8f8b968..0009c2939 100644 --- a/db_search.php +++ b/db_search.php @@ -129,7 +129,6 @@ if (isset($_REQUEST['submit_search'])) { * * @todo can we make use of fulltextsearch IN BOOLEAN MODE for this? * @uses PMA_DBI_query - * PMA_MYSQL_INT_VERSION * PMA_backquote * PMA_DBI_free_result * PMA_DBI_fetch_assoc @@ -156,11 +155,9 @@ if (isset($_REQUEST['submit_search'])) { $sqlstr_delete = 'DELETE'; // Fields to select - $res = PMA_DBI_query('SHOW ' . (PMA_MYSQL_INT_VERSION >= 40100 ? 'FULL ' : '') . 'FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($GLOBALS['db']) . ';'); + $res = PMA_DBI_query('SHOW FULL FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($GLOBALS['db']) . ';'); while ($current = PMA_DBI_fetch_assoc($res)) { - if (PMA_MYSQL_INT_VERSION >= 40100) { - list($current['Charset']) = explode('_', $current['Collation']); - } + list($current['Charset']) = explode('_', $current['Collation']); $current['Field'] = PMA_backquote($current['Field']); $tblfields[] = $current; } // while @@ -187,8 +184,7 @@ if (isset($_REQUEST['submit_search'])) { $thefieldlikevalue = array(); foreach ($tblfields as $tblfield) { - if (PMA_MYSQL_INT_VERSION >= 40100 - && $tblfield['Charset'] != $charset_connection + if ($tblfield['Charset'] != $charset_connection && $tblfield['Charset'] != 'NULL' && $tblfield['Charset'] != '') { $prefix = 'CONVERT(_utf8 '; diff --git a/db_structure.php b/db_structure.php index 85605d224..4733f008e 100644 --- a/db_structure.php +++ b/db_structure.php @@ -52,10 +52,8 @@ if ($num_tables == 0) { require_once './libraries/bookmark.lib.php'; -if (PMA_MYSQL_INT_VERSION >= 40101) { - require_once './libraries/mysql_charsets.lib.php'; - $db_collation = PMA_getDbCollation($db); -} +require_once './libraries/mysql_charsets.lib.php'; +$db_collation = PMA_getDbCollation($db); // Display function /** @@ -63,7 +61,6 @@ if (PMA_MYSQL_INT_VERSION >= 40101) { * display table header (...) * * @uses PMA_showHint() - * @uses PMA_MYSQL_INT_VERSION * @uses $GLOBALS['cfg']['PropertiesNumColumns'] * @uses $GLOBALS['is_show_stats'] * @uses $GLOBALS['strTable'] @@ -100,10 +97,8 @@ function PMA_TableHeader($db_is_information_schema = false) if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) { echo ' ' . "\n"; $cnt++; - if (PMA_MYSQL_INT_VERSION >= 40100) { - echo ' ' . "\n"; - $cnt++; - } + echo ' ' . "\n"; + $cnt++; } if ($GLOBALS['is_show_stats']) { echo ' ' . "\n" @@ -227,17 +222,10 @@ foreach ($tables as $keyname => $each_table) { if (! empty($each_table['TABLE_ROWS'])) { $empty_table = '' . $titles['Empty'] . ''; } else { $empty_table = $titles['NoEmpty']; @@ -292,14 +280,12 @@ foreach ($tables as $keyname => $each_table) { } } - if (PMA_MYSQL_INT_VERSION >= 40100) { - if (isset($each_table['Collation'])) { - $collation = '' - . $each_table['Collation'] . ''; - } else { - $collation = '---'; - } + if (isset($each_table['Collation'])) { + $collation = '' + . $each_table['Collation'] . ''; + } else { + $collation = '---'; } if ($is_show_stats) { @@ -430,17 +416,14 @@ if (!($cfg['PropertiesNumColumns'] > 1)) { echo ' ' . "\n"; - // Have to account for old MySQL with no collation (bug 1554885) - if (PMA_MYSQL_INT_VERSION >= 40100) { - // we got a case where $db_collation was empty - echo ' '; + // we got a case where $db_collation was empty + echo ' '; } if ($is_show_stats) {
' . $GLOBALS['strType'] . '' . $GLOBALS['strCollation'] . '' . $GLOBALS['strCollation'] . '' . $GLOBALS['strSize'] . '' . "\n" . ' ' .$default_engine . '' . "\n"; - if (! empty($db_collation)) { - echo ' ' . $db_collation - . ''; - } - echo '' . "\n"; + if (! empty($db_collation)) { + echo ' ' . $db_collation + . ''; } + echo '