mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/16629] Fix ACP get_database_size() for MySql 8
PHPBB3-16629
This commit is contained in:
parent
3521d2e9fa
commit
cd235dfd42
1 changed files with 12 additions and 22 deletions
|
@ -2842,15 +2842,8 @@ 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);
|
||||
|
||||
if ($row)
|
||||
{
|
||||
$version = $row['mysql_version'];
|
||||
$mysql_engine = ['MyISAM', 'InnoDB', 'Aria'];
|
||||
|
||||
$db_name = $db->get_db_name();
|
||||
|
||||
$sql = 'SHOW TABLE STATUS
|
||||
|
@ -2859,16 +2852,13 @@ function get_database_size()
|
|||
|
||||
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'];
|
||||
}
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue