mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-16 05:43:19 +02:00
[ticket/16629] Fix ACP get_database_size() for MySql 8
PHPBB3-16629
This commit is contained in:
parent
3521d2e9fa
commit
cd235dfd42
@ -2842,34 +2842,24 @@ function get_database_size()
|
||||
switch ($db->get_sql_layer())
|
||||
{
|
||||
case 'mysqli':
|
||||
$sql = 'SELECT VERSION() AS mysql_version';
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$mysql_engine = ['MyISAM', 'InnoDB', 'Aria'];
|
||||
|
||||
if ($row)
|
||||
$db_name = $db->get_db_name();
|
||||
|
||||
$sql = 'SHOW TABLE STATUS
|
||||
FROM ' . $db_name;
|
||||
$result = $db->sql_query($sql, 7200);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$version = $row['mysql_version'];
|
||||
$mysql_engine = ['MyISAM', 'InnoDB', 'Aria'];
|
||||
$db_name = $db->get_db_name();
|
||||
|
||||
$sql = 'SHOW TABLE STATUS
|
||||
FROM ' . $db_name;
|
||||
$result = $db->sql_query($sql, 7200);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
if (isset($row['Engine']) && in_array($row['Engine'], $mysql_engine))
|
||||
{
|
||||
if (isset($row['Engine'])
|
||||
&& in_array($row['Engine'], $mysql_engine)
|
||||
)
|
||||
{
|
||||
$database_size += $row['Data_length'] + $row['Index_length'];
|
||||
}
|
||||
$database_size += $row['Data_length'] + $row['Index_length'];
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
break;
|
||||
|
||||
case 'sqlite3':
|
||||
|
Loading…
x
Reference in New Issue
Block a user