bug 1228862, creating a table under MySQL 5.x with wrong table type
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2005-06-29 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
|
* tbl_properties_table_info.php: bug #1228862, creating a table under
|
||||||
|
MySQL 5.x with wrong table type
|
||||||
|
|
||||||
2005-06-28 Marc Delisle <lem9@users.sourceforge.net>
|
2005-06-28 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* tbl_properties_operations.php: bug #1225635,
|
* tbl_properties_operations.php: bug #1225635,
|
||||||
cannot change table's collation under MySQL 5.0.4
|
cannot change table's collation under MySQL 5.0.4
|
||||||
|
@@ -28,31 +28,38 @@ PMA_DBI_select_db($db);
|
|||||||
|
|
||||||
// The 'show table' statement works correct since 3.23.03
|
// The 'show table' statement works correct since 3.23.03
|
||||||
$table_info_result = PMA_DBI_query('SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';');
|
$table_info_result = PMA_DBI_query('SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';');
|
||||||
$showtable = PMA_DBI_fetch_assoc($table_info_result);
|
|
||||||
if (!isset($showtable['Type']) && isset($showtable['Engine'])) {
|
|
||||||
$showtable['Type'] =& $showtable['Engine'];
|
|
||||||
}
|
|
||||||
if (PMA_MYSQL_INT_VERSION >= 50000 && !isset($showtable['Type']) && isset($showtable['Comment']) && $showtable['Comment'] == 'view') {
|
|
||||||
$tbl_is_view = TRUE;
|
|
||||||
$tbl_type = $strView;
|
|
||||||
$show_comment = NULL;
|
|
||||||
} else {
|
|
||||||
$tbl_is_view = FALSE;
|
|
||||||
$tbl_type = isset($showtable['Type']) ? strtoupper($showtable['Type']) : '';
|
|
||||||
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
|
|
||||||
}
|
|
||||||
$tbl_collation = empty($showtable['Collation']) ? '' : $showtable['Collation'];
|
|
||||||
$table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
|
|
||||||
$auto_increment = (isset($showtable['Auto_increment']) ? $showtable['Auto_increment'] : '');
|
|
||||||
|
|
||||||
$tmp = isset($showtable['Create_options']) ? explode(' ', $showtable['Create_options']) : array();
|
// need this test because when we are creating a table, we get 0 rows
|
||||||
$tmp_cnt = count($tmp);
|
// from the SHOW TABLE query
|
||||||
for ($i = 0; $i < $tmp_cnt; $i++) {
|
// and we don't want to mess up the $tbl_type coming from the form
|
||||||
$tmp1 = explode('=', $tmp[$i]);
|
|
||||||
if (isset($tmp1[1])) {
|
if ($table_info_result && PMA_DBI_num_rows($table_info_result) > 0) {
|
||||||
$$tmp1[0] = $tmp1[1];
|
$showtable = PMA_DBI_fetch_assoc($table_info_result);
|
||||||
|
if (!isset($showtable['Type']) && isset($showtable['Engine'])) {
|
||||||
|
$showtable['Type'] =& $showtable['Engine'];
|
||||||
}
|
}
|
||||||
} // end for
|
if (PMA_MYSQL_INT_VERSION >= 50000 && !isset($showtable['Type']) && isset($showtable['Comment']) && $showtable['Comment'] == 'view') {
|
||||||
PMA_DBI_free_result($table_info_result);
|
$tbl_is_view = TRUE;
|
||||||
unset($tmp1, $tmp, $table_info_result);
|
$tbl_type = $strView;
|
||||||
|
$show_comment = NULL;
|
||||||
|
} else {
|
||||||
|
$tbl_is_view = FALSE;
|
||||||
|
$tbl_type = isset($showtable['Type']) ? strtoupper($showtable['Type']) : '';
|
||||||
|
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
|
||||||
|
}
|
||||||
|
$tbl_collation = empty($showtable['Collation']) ? '' : $showtable['Collation'];
|
||||||
|
$table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
|
||||||
|
$auto_increment = (isset($showtable['Auto_increment']) ? $showtable['Auto_increment'] : '');
|
||||||
|
|
||||||
|
$tmp = isset($showtable['Create_options']) ? explode(' ', $showtable['Create_options']) : array();
|
||||||
|
$tmp_cnt = count($tmp);
|
||||||
|
for ($i = 0; $i < $tmp_cnt; $i++) {
|
||||||
|
$tmp1 = explode('=', $tmp[$i]);
|
||||||
|
if (isset($tmp1[1])) {
|
||||||
|
$$tmp1[0] = $tmp1[1];
|
||||||
|
}
|
||||||
|
} // end for
|
||||||
|
PMA_DBI_free_result($table_info_result);
|
||||||
|
unset($tmp1, $tmp, $table_info_result);
|
||||||
|
} // end if
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user