Permalink
Browse files

Bug #3839 Index comment is supported only starting with MySQL 5.5

  • Loading branch information...
1 parent 8254d3e commit a1344cffe281ab4f7325b2eedc0be14b9b1182ba @lem9 lem9 committed Mar 25, 2013
Showing with 16 additions and 3 deletions.
  1. +5 −2 libraries/Index.class.php
  2. +11 −1 tbl_indexes.php
@@ -566,7 +566,9 @@ static public function getView($table, $schema, $print_mode = false)
$r .= '<th>' . __('Cardinality') . '</th>';
$r .= '<th>' . __('Collation') . '</th>';
$r .= '<th>' . __('Null') . '</th>';
- $r .= '<th>' . __('Comment') . '</th>';
+ if (PMA_MYSQL_INT_VERSION > 50500) {
+ $r .= '<th>' . __('Comment') . '</th>';
+ }
$r .= '</tr>';
$r .= '</thead>';
$r .= '<tbody>';
@@ -658,7 +660,8 @@ static public function getView($table, $schema, $print_mode = false)
. htmlspecialchars($column->getNull(true))
. '</td>';
- if ($column->getSeqInIndex() == 1) {
+ if (PMA_MYSQL_INT_VERSION > 50500
+ && $column->getSeqInIndex() == 1) {
$r .= '<td ' . $row_span . '>'
. htmlspecialchars($index->getComments()) . '</td>';
}
View
@@ -99,7 +99,11 @@
$sql_query .= ' (' . implode(', ', $index_fields) . ')';
}
- $sql_query .= "COMMENT '" . PMA_Util::sqlAddSlashes($index->getComment()) . "'";
+ if (PMA_MYSQL_INT_VERSION > 50500) {
+ $sql_query .= "COMMENT '"
+ . PMA_Util::sqlAddSlashes($index->getComment())
+ . "'";
+ }
$sql_query .= ';';
if (! $error) {
@@ -220,6 +224,9 @@
value="<?php echo htmlspecialchars($index->getName()); ?>"
onfocus="this.select()" />
</div>
+<?php
+if (PMA_MYSQL_INT_VERSION > 50500) {
+?>
<div>
<div class="label">
<strong>
@@ -232,6 +239,9 @@
value="<?php echo htmlspecialchars($index->getComment()); ?>"
onfocus="this.select()" />
</div>
+<?php
+}
+?>
<div>
<div class="label">
<strong>

0 comments on commit a1344cf

Please sign in to comment.