Emulation for MySQL 4.1.2
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2005-01-18 Alexander M. Turek <me@derrabus.de>
|
||||
* server_engines.php, libraries/storage_engines.lib.php: Emulation for
|
||||
< MySQL 4.1.2.
|
||||
|
||||
2005-01-17 Michael Keck <mkkeck@users.sourceforge.net>
|
||||
* libraries/common.lib.php: modified function for
|
||||
Add a link by MySQL-Error #1062 - Duplicate entry
|
||||
|
@@ -4,17 +4,61 @@
|
||||
|
||||
/**
|
||||
* Library for extracting information about the available storage engines
|
||||
*
|
||||
* Requires at least MySQL 4.1.2
|
||||
* TODO: Emulation for earlier versions.
|
||||
*/
|
||||
|
||||
$GLOBALS['mysql_storage_engines'] = array();
|
||||
$res = PMA_DBI_query('SHOW STORAGE ENGINES');
|
||||
while ($row = PMA_DBI_fetch_assoc($res)) {
|
||||
$GLOBALS['mysql_storage_engines'][strtolower($row['Engine'])] = $row;
|
||||
|
||||
if (PMA_MYSQL_INT_VERSION >= 40102) {
|
||||
/**
|
||||
* For MySQL >= 4.1.2, the job is easy...
|
||||
*/
|
||||
$res = PMA_DBI_query('SHOW STORAGE ENGINES');
|
||||
while ($row = PMA_DBI_fetch_assoc($res)) {
|
||||
$GLOBALS['mysql_storage_engines'][strtolower($row['Engine'])] = $row;
|
||||
}
|
||||
PMA_DBI_free_result($res);
|
||||
unset($res, $row);
|
||||
} else {
|
||||
/**
|
||||
* Emulating SHOW STORAGE ENGINES...
|
||||
*/
|
||||
$GLOBALS['mysql_storage_engines'] = array(
|
||||
'myisam' => array(
|
||||
'Engine' => 'MyISAM',
|
||||
'Support' => 'DEFAULT'
|
||||
),
|
||||
'merge' => array(
|
||||
'Engine' => 'MERGE',
|
||||
'Support' => 'YES'
|
||||
),
|
||||
'heap' => array(
|
||||
'Engine' => 'HEAP',
|
||||
'Support' => 'YES'
|
||||
),
|
||||
'memory' => array(
|
||||
'Engine' => 'MEMORY',
|
||||
'Support' => 'YES'
|
||||
)
|
||||
);
|
||||
$known_engines = array(
|
||||
'archive' => 'ARCHIVE',
|
||||
'bdb' => 'BDB',
|
||||
'csv' => 'CSV',
|
||||
'innodb' => 'InnoDB',
|
||||
'isam' => 'ISAM'
|
||||
);
|
||||
$res = PMA_DBI_query('SHOW VARIABLES LIKE \'have\\_%\';');
|
||||
while ($row = PMA_DBI_fetch_row($res)) {
|
||||
$current = substr($row[0], 5);
|
||||
if (!empty($known_engines[$current])) {
|
||||
$GLOBALS['mysql_storage_engines'][$current] = array(
|
||||
'Engine' => $known_engines[$current],
|
||||
'Support' => $row[1]
|
||||
);
|
||||
}
|
||||
}
|
||||
PMA_DBI_free_result($res);
|
||||
unset($known_engines, $res, $row);
|
||||
}
|
||||
PMA_DBI_free_result($res);
|
||||
unset($res, $row);
|
||||
|
||||
?>
|
||||
|
@@ -127,11 +127,13 @@ if (empty($engine) || empty($mysql_storage_engines[$engine])) {
|
||||
. ' <tr>' . "\n"
|
||||
. ' <th>' . "\n"
|
||||
. ' ' . $strStorageEngine . "\n"
|
||||
. ' </th>' . "\n"
|
||||
. ' <th>' . "\n"
|
||||
. ' ' . $strDescription . "\n"
|
||||
. ' </th>' . "\n"
|
||||
. ' </tr>' . "\n"
|
||||
. ' </th>' . "\n";
|
||||
if (PMA_MYSQL_INT_VERSION >= 40102) {
|
||||
echo ' <th>' . "\n"
|
||||
. ' ' . $strDescription . "\n"
|
||||
. ' </th>' . "\n";
|
||||
}
|
||||
echo ' </tr>' . "\n"
|
||||
. ' </thead>' . "\n"
|
||||
. ' <tbody>' . "\n";
|
||||
|
||||
@@ -147,11 +149,13 @@ if (empty($engine) || empty($mysql_storage_engines[$engine])) {
|
||||
. ' <a href="' . $common_url . $engine . '">' . "\n"
|
||||
. ' ' . htmlspecialchars($details['Engine']) . "\n"
|
||||
. ' </a>' . "\n"
|
||||
. ' </td>' . "\n"
|
||||
. ' <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
|
||||
. ' ' . htmlspecialchars($details['Comment']) . "\n"
|
||||
. ' </td>' . "\n"
|
||||
. ' </tr>' . "\n";
|
||||
. ' </td>' . "\n";
|
||||
if (PMA_MYSQL_INT_VERSION >= 40102) {
|
||||
echo ' <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
|
||||
. ' ' . htmlspecialchars($details['Comment']) . "\n"
|
||||
. ' </td>' . "\n";
|
||||
}
|
||||
echo ' </tr>' . "\n";
|
||||
$useBgcolorOne = !$useBgcolorOne;
|
||||
}
|
||||
unset($useBgcolorOne, $common_url, $engine, $details);
|
||||
|
@@ -53,9 +53,7 @@ if ($cfg['ShowMysqlVars']) {
|
||||
if (PMA_MYSQL_INT_VERSION >= 40100) {
|
||||
echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 's_asci.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strCharsets.'" />' : '') . $strCharsets, 'server_collations.php', $url_query);
|
||||
}
|
||||
if (PMA_MYSQL_INT_VERSION >= 40102) {
|
||||
echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 's_process.png" width="16" height="16" border="0" hspace="2" align="middle" alt="' . $strEngines . '" />' : '') . $strEngines, 'server_engines.php', $url_query);
|
||||
}
|
||||
echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 's_process.png" width="16" height="16" border="0" hspace="2" align="middle" alt="' . $strEngines . '" />' : '') . $strEngines, 'server_engines.php', $url_query);
|
||||
if ($is_superuser) {
|
||||
echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 's_rights.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strPrivileges.'" />' : '') . $strPrivileges, 'server_privileges.php', $url_query);
|
||||
}
|
||||
|
Reference in New Issue
Block a user