removed MySQL < 5 code
This commit is contained in:
@@ -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);
|
||||
|
@@ -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 '<div style="page-break-before: always;">' . "\n";
|
||||
@@ -184,9 +182,7 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
|
||||
if ($have_rel) {
|
||||
echo ' <th>' . $strLinksTo . '</th>' . "\n";
|
||||
}
|
||||
if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) {
|
||||
echo ' <th>' . $strComments . '</th>' . "\n";
|
||||
}
|
||||
echo ' <th>' . $strComments . '</th>' . "\n";
|
||||
if ($cfgRelation['mimework']) {
|
||||
echo ' <th>MIME</th>' . "\n";
|
||||
}
|
||||
@@ -274,13 +270,11 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
|
||||
}
|
||||
echo '</td>' . "\n";
|
||||
}
|
||||
if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) {
|
||||
echo ' <td>';
|
||||
if (isset($comments[$field_name])) {
|
||||
echo htmlspecialchars($comments[$field_name]);
|
||||
}
|
||||
echo '</td>' . "\n";
|
||||
echo ' <td>';
|
||||
if (isset($comments[$field_name])) {
|
||||
echo htmlspecialchars($comments[$field_name]);
|
||||
}
|
||||
echo '</td>' . "\n";
|
||||
if ($cfgRelation['mimework']) {
|
||||
$mime_map = PMA_getMIME($db, $table, true);
|
||||
|
||||
|
@@ -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;
|
||||
//}
|
||||
|
@@ -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) {
|
||||
@@ -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';
|
||||
?>
|
||||
</legend>
|
||||
<input type="text" name="newname" size="30" class="textfield" value="" /><br />
|
||||
@@ -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 '<form method="post" action="./db_operations.php">' . "\n"
|
||||
. PMA_generate_common_hidden_inputs($db, $table)
|
||||
. '<fieldset>' . "\n"
|
||||
. ' <legend>';
|
||||
if ($cfg['PropertiesIconic']) {
|
||||
echo '<img class="icon" src="' . $pmaThemeImage . 's_asci.png"'
|
||||
.' alt="" width="16" height="16" />';
|
||||
}
|
||||
echo ' <label for="select_db_collation">' . $strCollation . ':</label>' . "\n"
|
||||
. ' </legend>' . "\n"
|
||||
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION,
|
||||
'db_collation', 'select_db_collation', $db_collation, false, 3)
|
||||
. ' <input type="submit" name="submitcollation"'
|
||||
. ' value="' . $strGo . '" style="vertical-align: middle" />' . "\n"
|
||||
. '</fieldset>' . "\n"
|
||||
. '</form>' . "\n";
|
||||
echo '<form method="post" action="./db_operations.php">' . "\n"
|
||||
. PMA_generate_common_hidden_inputs($db, $table)
|
||||
. '<fieldset>' . "\n"
|
||||
. ' <legend>';
|
||||
if ($cfg['PropertiesIconic']) {
|
||||
echo '<img class="icon" src="' . $pmaThemeImage . 's_asci.png"'
|
||||
.' alt="" width="16" height="16" />';
|
||||
}
|
||||
echo ' <label for="select_db_collation">' . $strCollation . ':</label>' . "\n"
|
||||
. ' </legend>' . "\n"
|
||||
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION,
|
||||
'db_collation', 'select_db_collation', $db_collation, false, 3)
|
||||
. ' <input type="submit" name="submitcollation"'
|
||||
. ' value="' . $strGo . '" style="vertical-align: middle" />' . "\n"
|
||||
. '</fieldset>' . "\n"
|
||||
. '</form>' . "\n";
|
||||
|
||||
if ($num_tables > 0
|
||||
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
|
||||
|
@@ -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 ';
|
||||
|
@@ -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 (<table><thead>...</thead><tbody>)
|
||||
*
|
||||
* @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 ' <th>' . $GLOBALS['strType'] . '</th>' . "\n";
|
||||
$cnt++;
|
||||
if (PMA_MYSQL_INT_VERSION >= 40100) {
|
||||
echo ' <th>' . $GLOBALS['strCollation'] . '</th>' . "\n";
|
||||
$cnt++;
|
||||
}
|
||||
echo ' <th>' . $GLOBALS['strCollation'] . '</th>' . "\n";
|
||||
$cnt++;
|
||||
}
|
||||
if ($GLOBALS['is_show_stats']) {
|
||||
echo ' <th>' . $GLOBALS['strSize'] . '</th>' . "\n"
|
||||
@@ -227,17 +222,10 @@ foreach ($tables as $keyname => $each_table) {
|
||||
if (! empty($each_table['TABLE_ROWS'])) {
|
||||
$empty_table = '<a href="sql.php?' . $tbl_url_query
|
||||
. '&sql_query=';
|
||||
if (PMA_MYSQL_INT_VERSION >= 40000) {
|
||||
$empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
|
||||
. '&zero_rows='
|
||||
. urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($each_table['TABLE_NAME'])))
|
||||
. '" onclick="return confirmLink(this, \'TRUNCATE ';
|
||||
} else {
|
||||
$empty_table .= urlencode('DELETE FROM ' . PMA_backquote($each_table['TABLE_NAME']))
|
||||
. '&zero_rows='
|
||||
. urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($each_table['TABLE_NAME'])))
|
||||
. '" onclick="return confirmLink(this, \'DELETE FROM ';
|
||||
}
|
||||
$empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
|
||||
. '&zero_rows='
|
||||
. urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($each_table['TABLE_NAME'])))
|
||||
. '" onclick="return confirmLink(this, \'TRUNCATE ';
|
||||
$empty_table .= PMA_jsFormat($each_table['TABLE_NAME']) . '\')">' . $titles['Empty'] . '</a>';
|
||||
} 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 = '<dfn title="'
|
||||
. PMA_getCollationDescr($each_table['Collation']) . '">'
|
||||
. $each_table['Collation'] . '</dfn>';
|
||||
} else {
|
||||
$collation = '---';
|
||||
}
|
||||
if (isset($each_table['Collation'])) {
|
||||
$collation = '<dfn title="'
|
||||
. PMA_getCollationDescr($each_table['Collation']) . '">'
|
||||
. $each_table['Collation'] . '</dfn>';
|
||||
} else {
|
||||
$collation = '---';
|
||||
}
|
||||
|
||||
if ($is_show_stats) {
|
||||
@@ -430,17 +416,14 @@ if (!($cfg['PropertiesNumColumns'] > 1)) {
|
||||
echo ' <th align="center">' . "\n"
|
||||
. ' <dfn title="'
|
||||
. sprintf($strDefaultEngine, $default_engine) . '">' .$default_engine . '</dfn></th>' . "\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 ' <th align="center">' . "\n";
|
||||
if (! empty($db_collation)) {
|
||||
echo ' <dfn title="'
|
||||
. PMA_getCollationDescr($db_collation) . ' (' . $strDefault . ')">' . $db_collation
|
||||
. '</dfn>';
|
||||
}
|
||||
echo '</th>';
|
||||
// we got a case where $db_collation was empty
|
||||
echo ' <th align="center">' . "\n";
|
||||
if (! empty($db_collation)) {
|
||||
echo ' <dfn title="'
|
||||
. PMA_getCollationDescr($db_collation) . ' (' . $strDefault . ')">' . $db_collation
|
||||
. '</dfn>';
|
||||
}
|
||||
echo '</th>';
|
||||
}
|
||||
|
||||
if ($is_show_stats) {
|
||||
|
Reference in New Issue
Block a user