removed MySQL < 5 code
This commit is contained in:
@@ -168,15 +168,6 @@ if (isset($submit_num_fields)) {
|
||||
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
// garvin: Update comment table, if a comment was set.
|
||||
if (isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork'] && PMA_MYSQL_INT_VERSION < 40100) {
|
||||
foreach ($field_comments AS $fieldindex => $fieldcomment) {
|
||||
if (isset($field_name[$fieldindex]) && strlen($field_name[$fieldindex])) {
|
||||
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, '', 'pmadb');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// garvin: Update comment table for mime types [MIME]
|
||||
if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
|
||||
foreach ($field_mimetype AS $fieldindex => $mimetype) {
|
||||
|
@@ -83,16 +83,6 @@ if (isset($do_save_data)) {
|
||||
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
// take care of pmadb internal comments here
|
||||
// garvin: Update comment table, if a comment was set.
|
||||
if (PMA_MYSQL_INT_VERSION < 40100 && isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork']) {
|
||||
foreach ($field_comments AS $fieldindex => $fieldcomment) {
|
||||
if (isset($field_name[$fieldindex]) && strlen($field_name[$fieldindex])) {
|
||||
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, $field_orig[$fieldindex], 'pmadb');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// garvin: Rename relations&display fields, if altered.
|
||||
if (($cfgRelation['displaywork'] || $cfgRelation['relwork']) && isset($field_orig) && is_array($field_orig)) {
|
||||
foreach ($field_orig AS $fieldindex => $fieldcontent) {
|
||||
|
@@ -9,7 +9,6 @@
|
||||
* @uses $strTable
|
||||
* @uses $strHasBeenCreated
|
||||
* @uses PMA_ENGINE_KEYWORD
|
||||
* @uses PMA_MYSQL_INT_VERSION
|
||||
* @uses PMA_Table::generateFieldSpec()
|
||||
* @uses PMA_checkParameters()
|
||||
* @uses PMA_generateCharsetQueryPart()
|
||||
@@ -185,7 +184,7 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
if (!empty($tbl_type) && ($tbl_type != 'Default')) {
|
||||
$sql_query .= ' ' . PMA_ENGINE_KEYWORD . ' = ' . $tbl_type;
|
||||
}
|
||||
if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($tbl_collation)) {
|
||||
if (!empty($tbl_collation)) {
|
||||
$sql_query .= PMA_generateCharsetQueryPart($tbl_collation);
|
||||
}
|
||||
|
||||
@@ -204,16 +203,6 @@ if (isset($_REQUEST['do_save_data'])) {
|
||||
|
||||
$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
// garvin: Update comment table, if a comment was set.
|
||||
if (isset($field_comments) && is_array($field_comments)
|
||||
&& $cfgRelation['commwork'] && PMA_MYSQL_INT_VERSION < 40100) {
|
||||
foreach ($field_comments as $fieldindex => $fieldcomment) {
|
||||
if (isset($field_name[$fieldindex]) && strlen($field_name[$fieldindex])) {
|
||||
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, '', 'pmadb');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// garvin: Update comment table for mime types [MIME]
|
||||
if (isset($field_mimetype) && is_array($field_mimetype)
|
||||
&& $cfgRelation['commwork'] && $cfgRelation['mimework']
|
||||
|
@@ -220,10 +220,7 @@ elseif (!defined('PMA_IDX_INCLUDED')
|
||||
$edited_index_data = $indexes_data[$old_index];
|
||||
|
||||
|
||||
if ((PMA_MYSQL_INT_VERSION < 40002
|
||||
&& $edited_index_info['Comment'] == 'FULLTEXT')
|
||||
|| (PMA_MYSQL_INT_VERSION >= 40002
|
||||
&& $edited_index_info['Index_type'] == 'FULLTEXT')) {
|
||||
if ($edited_index_info['Index_type'] == 'FULLTEXT') {
|
||||
$index_type = 'FULLTEXT';
|
||||
} elseif ($index == 'PRIMARY') {
|
||||
$index_type = 'PRIMARY';
|
||||
|
@@ -170,9 +170,7 @@ foreach ($the_tables as $key => $table) {
|
||||
if ($have_rel) {
|
||||
echo '<th>' . $strLinksTo . '</th>' . "\n";
|
||||
}
|
||||
if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) {
|
||||
echo ' <th>' . $strComments . '</th>' . "\n";
|
||||
}
|
||||
if ($cfgRelation['mimework']) {
|
||||
echo ' <th>MIME</th>' . "\n";
|
||||
}
|
||||
@@ -260,14 +258,12 @@ foreach ($the_tables as $key => $table) {
|
||||
}
|
||||
echo ' </td>' . "\n";
|
||||
}
|
||||
if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) {
|
||||
echo ' <td>';
|
||||
$comments = PMA_getComments($db, $table);
|
||||
if (isset($comments[$field_name])) {
|
||||
echo htmlspecialchars($comments[$field_name]);
|
||||
}
|
||||
echo ' </td>' . "\n";
|
||||
}
|
||||
if ($cfgRelation['mimework']) {
|
||||
$mime_map = PMA_getMIME($db, $table, true);
|
||||
|
||||
@@ -288,8 +284,7 @@ foreach ($the_tables as $key => $table) {
|
||||
|
||||
<?php
|
||||
|
||||
if (! $tbl_is_view
|
||||
&& ($db != 'information_schema' || PMA_MYSQL_INT_VERSION < 50002)) {
|
||||
if (! $tbl_is_view && $db != 'information_schema') {
|
||||
|
||||
/**
|
||||
* Displays indexes
|
||||
|
@@ -171,7 +171,6 @@ if (isset($_REQUEST['destination_innodb'])) {
|
||||
// an option has been changed for ON DELETE or ON UPDATE
|
||||
|
||||
// remove existing key
|
||||
if (PMA_MYSQL_INT_VERSION >= 40013) {
|
||||
$sql_query = 'ALTER TABLE ' . PMA_backquote($table)
|
||||
. ' DROP FOREIGN KEY '
|
||||
. PMA_backquote($existrel_innodb[$master_field]['constraint']) . ';';
|
||||
@@ -179,7 +178,6 @@ if (isset($_REQUEST['destination_innodb'])) {
|
||||
// I tried to send both in one query but it failed
|
||||
$upd_rs = PMA_DBI_query($sql_query);
|
||||
$display_query .= $sql_query . "\n";
|
||||
}
|
||||
|
||||
// add another
|
||||
$sql_query = 'ALTER TABLE ' . PMA_backquote($table)
|
||||
@@ -203,13 +201,11 @@ if (isset($_REQUEST['destination_innodb'])) {
|
||||
|
||||
} // end if... else....
|
||||
} elseif (isset($existrel_innodb[$master_field])) {
|
||||
if (PMA_MYSQL_INT_VERSION >= 40013) {
|
||||
$sql_query = 'ALTER TABLE ' . PMA_backquote($table)
|
||||
. ' DROP FOREIGN KEY '
|
||||
. PMA_backquote($existrel_innodb[$master_field]['constraint']);
|
||||
$sql_query .= ';';
|
||||
$display_query .= $sql_query . "\n";
|
||||
}
|
||||
} // end if... else....
|
||||
|
||||
if (! empty($sql_query)) {
|
||||
@@ -409,9 +405,6 @@ if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
|
||||
}
|
||||
if ($tbl_type == 'INNODB') {
|
||||
echo '<th colspan="2">InnoDB';
|
||||
if (PMA_MYSQL_INT_VERSION < 40013) {
|
||||
echo '(**)';
|
||||
}
|
||||
echo '</th>';
|
||||
}
|
||||
?>
|
||||
@@ -558,12 +551,6 @@ if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
|
||||
<?php
|
||||
} // end if (we have columns in this table)
|
||||
|
||||
if ($tbl_type === 'INNODB' && PMA_MYSQL_INT_VERSION < 40013) {
|
||||
echo '<div class="warning">'
|
||||
.'** ' . sprintf($strUpgrade, 'MySQL', '4.0.13')
|
||||
.'</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
|
@@ -51,7 +51,7 @@ if (!isset($param) || $param[0] == '') {
|
||||
$err_url = $goto . '?' . PMA_generate_common_url($db, $table);
|
||||
|
||||
// Gets the list and number of fields
|
||||
$result = PMA_DBI_query('SHOW' . (PMA_MYSQL_INT_VERSION >= 40100 ? ' FULL' : '') . ' FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
|
||||
$result = PMA_DBI_query('SHOW FULL FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
|
||||
$fields_cnt = PMA_DBI_num_rows($result);
|
||||
// rabue: we'd better ensure, that all arrays are empty.
|
||||
$fields_list = $fields_null = $fields_type = $fields_collation = array();
|
||||
@@ -79,7 +79,7 @@ if (!isset($param) || $param[0] == '') {
|
||||
}
|
||||
$fields_null[] = $row['Null'];
|
||||
$fields_type[] = $type;
|
||||
$fields_collation[] = PMA_MYSQL_INT_VERSION >= 40100 && !empty($row['Collation']) && $row['Collation'] != 'NULL'
|
||||
$fields_collation[] = !empty($row['Collation']) && $row['Collation'] != 'NULL'
|
||||
? $row['Collation']
|
||||
: '';
|
||||
} // end while
|
||||
@@ -186,7 +186,7 @@ while (list($operator) = each($GLOBALS['cfg']['UnaryOperators'])) {
|
||||
<thead>
|
||||
<tr><th><?php echo $strField; ?></th>
|
||||
<th><?php echo $strType; ?></th>
|
||||
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? '<th>' . $strCollation . '</th>' . "\n" : ''; ?>
|
||||
<th><?php echo $strCollation; ?></th>
|
||||
<th><?php echo $strOperator; ?></th>
|
||||
<th><?php echo $strValue; ?></th>
|
||||
</tr>
|
||||
@@ -202,8 +202,7 @@ while (list($operator) = each($GLOBALS['cfg']['UnaryOperators'])) {
|
||||
<tr class="<?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
|
||||
<th><?php echo htmlspecialchars($fields_list[$i]); ?></th>
|
||||
<td><?php echo $fields_type[$i]; ?></td>
|
||||
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? '<td>'
|
||||
. $fields_collation[$i] . '</td>' . "\n" : ''; ?>
|
||||
<td><?php echo $fields_collation[$i]; ?></td>
|
||||
<td><select name="func[]">
|
||||
<?php
|
||||
if (strncasecmp($fields_type[$i], 'enum', 4) == 0) {
|
||||
@@ -288,7 +287,7 @@ while (list($operator) = each($GLOBALS['cfg']['UnaryOperators'])) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
document.write('<a title="<?php echo $strCalendar;?>" href="javascript:openCalendar(\'<?php echo PMA_generate_common_url();?>\', \'insertForm\', \'field_<?php echo ($i); ?>\', \'<?php echo (PMA_MYSQL_INT_VERSION >= 40100 && substr($type, 0, 9) == 'timestamp') ? 'datetime' : substr($type, 0, 9); ?>\')"><img class="calendar" src="<?php echo $pmaThemeImage; ?>b_calendar.png" alt="<?php echo $strCalendar; ?>"/></a>');
|
||||
document.write('<a title="<?php echo $strCalendar;?>" href="javascript:openCalendar(\'<?php echo PMA_generate_common_url();?>\', \'insertForm\', \'field_<?php echo ($i); ?>\', \'<?php echo (substr($type, 0, 9) == 'timestamp') ? 'datetime' : substr($type, 0, 9); ?>\')"><img class="calendar" src="<?php echo $pmaThemeImage; ?>b_calendar.png" alt="<?php echo $strCalendar; ?>"/></a>');
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
@@ -349,9 +348,7 @@ else {
|
||||
$cnt_func = count($func);
|
||||
reset($func);
|
||||
while (list($i, $func_type) = each($func)) {
|
||||
if (PMA_MYSQL_INT_VERSION >= 40100) {
|
||||
list($charsets[$i]) = explode('_', $collations[$i]);
|
||||
}
|
||||
if (@$GLOBALS['cfg']['UnaryOperators'][$func_type] == 1) {
|
||||
$fields[$i] = '';
|
||||
$w[] = PMA_backquote(urldecode($names[$i])) . ' ' . $func_type;
|
||||
@@ -377,13 +374,13 @@ else {
|
||||
$parens_close = '';
|
||||
}
|
||||
$enum_where = '\'' . PMA_sqlAddslashes($fields[$i][0]) . '\'';
|
||||
if (PMA_MYSQL_INT_VERSION >= 40100 && $charsets[$i] != $charset_connection) {
|
||||
if ($charsets[$i] != $charset_connection) {
|
||||
$enum_where = 'CONVERT(_utf8 ' . $enum_where . ' USING ' . $charsets[$i] . ') COLLATE ' . $collations[$i];
|
||||
}
|
||||
for ($e = 1; $e < $enum_selected_count; $e++) {
|
||||
$enum_where .= ', ';
|
||||
$tmp_literal = '\'' . PMA_sqlAddslashes($fields[$i][$e]) . '\'';
|
||||
if (PMA_MYSQL_INT_VERSION >= 40100 && $charsets[$i] != $charset_connection) {
|
||||
if ($charsets[$i] != $charset_connection) {
|
||||
$tmp_literal = 'CONVERT(_utf8 ' . $tmp_literal . ' USING ' . $charsets[$i] . ') COLLATE ' . $collations[$i];
|
||||
}
|
||||
$enum_where .= $tmp_literal;
|
||||
@@ -407,7 +404,7 @@ else {
|
||||
// But if the field's type is VARBINARY, it has no charset
|
||||
// and $charsets[$i] is empty, so we cannot generate a CONVERT
|
||||
|
||||
if (PMA_MYSQL_INT_VERSION >= 40101 && !empty($charsets[$i]) && $charsets[$i] != $charset_connection && preg_match('@char|binary|blob|text|set@i', $types[$i])) {
|
||||
if (!empty($charsets[$i]) && $charsets[$i] != $charset_connection && preg_match('@char|binary|blob|text|set@i', $types[$i])) {
|
||||
$prefix = 'CONVERT(_utf8 ';
|
||||
$suffix = ' USING ' . $charsets[$i] . ') COLLATE ' . $collations[$i];
|
||||
} else {
|
||||
|
@@ -166,7 +166,7 @@ $i = 0;
|
||||
<th id="th<?php echo ++$i; ?>"></th>
|
||||
<th id="th<?php echo ++$i; ?>"><?php echo $strField; ?></th>
|
||||
<th id="th<?php echo ++$i; ?>"><?php echo $strType; ?></th>
|
||||
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <th id="th' . ++$i . '">' . $strCollation . '</th>' . "\n" : ''; ?>
|
||||
<th id="th<?php echo ++$i; ?>"><?php echo $strCollation; ?></th>
|
||||
<th id="th<?php echo ++$i; ?>"><?php echo $strAttr; ?></th>
|
||||
<th id="th<?php echo ++$i; ?>"><?php echo $strNull; ?></th>
|
||||
<th id="th<?php echo ++$i; ?>"><?php echo $strDefault; ?></th>
|
||||
@@ -195,14 +195,12 @@ if ($GLOBALS['cfg']['ShowPropertyComments']) {
|
||||
|
||||
//$cfgRelation = PMA_getRelationsParam();
|
||||
|
||||
if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) {
|
||||
$comments_map = PMA_getComments($db, $table);
|
||||
|
||||
if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
|
||||
$mime_map = PMA_getMIME($db, $table, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$rownum = 0;
|
||||
$aryFields = array();
|
||||
@@ -252,9 +250,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
||||
$zerofill = stristr($row['Type'], 'zerofill');
|
||||
}
|
||||
|
||||
// rabus: Divide charset from the rest of the type definition (MySQL >= 4.1)
|
||||
unset($field_charset);
|
||||
if (PMA_MYSQL_INT_VERSION >= 40100) {
|
||||
if ((substr($type, 0, 4) == 'char'
|
||||
|| substr($type, 0, 7) == 'varchar'
|
||||
|| substr($type, 0, 4) == 'text'
|
||||
@@ -275,7 +271,6 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
||||
} else {
|
||||
$field_charset = '';
|
||||
}
|
||||
}
|
||||
|
||||
// garvin: Display basic mimetype [MIME]
|
||||
if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME'] && isset($mime_map[$row['Field']]['mimetype'])) {
|
||||
@@ -338,7 +333,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
||||
</td>
|
||||
<th nowrap="nowrap"><label for="checkbox_row_<?php echo $rownum; ?>"><?php echo $field_name; ?></label></th>
|
||||
<td<?php echo $type_nowrap; ?>><bdo dir="ltr" xml:lang="en"><?php echo $type; echo $type_mime; ?></bdo></td>
|
||||
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td>' . (empty($field_charset) ? '' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>') . '</td>' . "\n" : '' ?>
|
||||
<td><?php echo (empty($field_charset) ? '' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>'); ?></td>
|
||||
<td nowrap="nowrap" style="font-size: 70%"><?php echo $attribute; ?></td>
|
||||
<td><?php echo (($row['Null'] == 'YES') ? $strYes : $strNo); ?></td>
|
||||
<td nowrap="nowrap"><?php if (isset($row['Default'])) { echo $row['Default']; } ?></td>
|
||||
@@ -690,7 +685,7 @@ if ($cfg['ShowStats']) {
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if (PMA_MYSQL_INT_VERSION >= 40100 && !empty($tbl_collation)) {
|
||||
if (!empty($tbl_collation)) {
|
||||
?>
|
||||
<tr class="<?php echo ($odd_row = !$odd_row) ? 'odd' : 'even'; ?>">
|
||||
<th class="name"><?php echo $strCollation; ?></th>
|
||||
|
Reference in New Issue
Block a user